unixODBC-2.3.9/0000775000175000017500000000000013725127522010151 500000000000000unixODBC-2.3.9/depcomp0000755000175000017500000005370013725127167011456 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2015 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixODBC-2.3.9/exe/0000775000175000017500000000000013725127520010730 500000000000000unixODBC-2.3.9/exe/isql.c0000644000175000017500000014672313631435706012003 00000000000000 /************************************************** * isql * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under GPL 18.FEB.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "isql.h" #ifdef HAVE_READLINE #include #include #endif #ifdef HAVE_EDITLINE #include #endif #ifdef HAVE_SETLOCALE #ifdef HAVE_LOCALE_H #include #endif #endif static int OpenDatabase( SQLHENV *phEnv, SQLHDBC *phDbc, char *szDSN, char *szUID, char *szPWD ); static int ExecuteSQL( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ); static int ExecuteHelp( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ); static int ExecuteSlash( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ); static int CloseDatabase( SQLHENV hEnv, SQLHDBC hDbc ); static void WriteHeaderHTMLTable( SQLHSTMT hStmt ); static void WriteHeaderNormal( SQLHSTMT hStmt, SQLCHAR **szSepLine ); static void WriteHeaderDelimited( SQLHSTMT hStmt, char cDelimiter ); static void WriteBodyHTMLTable( SQLHSTMT hStmt ); static SQLLEN WriteBodyNormal( SQLHSTMT hStmt ); static void WriteBodyDelimited( SQLHSTMT hStmt, char cDelimiter ); static void WriteFooterHTMLTable( SQLHSTMT hStmt ); static void WriteFooterNormal( SQLHSTMT hStmt, SQLCHAR *szSepLine, SQLLEN nRows ); static int DumpODBCLog( SQLHENV hEnv, SQLHDBC hDbc, SQLHSTMT hStmt ); static int get_args(char *string, char **args, int maxarg); static void free_args(char **args, int maxarg); static void output_help(void); int bVerbose = 0; int nUserWidth = 0; SQLHENV hEnv = 0; SQLHDBC hDbc = 0; int bQuote = 0; int version3 = 0; int bBatch = 0; int ac_off = 0; int bHTMLTable = 0; int cDelimiter = 0; int bColumnNames = 0; int buseDC = 0; int buseED = 0; int max_col_size = MAX_DATA_WIDTH; SQLUSMALLINT has_moreresults = 1; int main( int argc, char *argv[] ) { int nArg, count; int bNewStyle = 0; char *szDSN; char *szUID; char *szPWD; char *szSQL; char *line_buffer; int buffer_size = 9000; int line_buffer_size = 9000; int bufpos,linen; char prompt[24]; #if defined(HAVE_EDITLINE) || defined(HAVE_READLINE) char *rlhistory; /* readline history path */ rlhistory = strdup(getenv("HOME")); rlhistory = realloc(rlhistory, strlen(rlhistory)+16); strcat(rlhistory, "/.isql_history"); read_history(rlhistory); #endif szDSN = NULL; szUID = NULL; szPWD = NULL; if ( argc < 2 ) { fputs( szSyntax, stderr ); exit( 1 ); } #ifdef HAVE_SETLOCALE /* * Default locale */ setlocale( LC_ALL, "" ); #endif /**************************** * PARSE ARGS ***************************/ for ( nArg = 1, count = 1 ; nArg < argc; nArg++ ) { if ( argv[nArg][0] == '-' ) { /* Options */ switch ( argv[nArg][1] ) { case 'd': cDelimiter = argv[nArg][2]; break; case 'm': nUserWidth = atoi( &(argv[nArg][2]) ); break; case 's': buffer_size = atoi( &(argv[nArg][2]) ); line_buffer_size = buffer_size; break; case 'w': bHTMLTable = 1; break; case 'b': bBatch = 1; break; case 'c': bColumnNames = 1; break; case '3': version3 = 1; break; case 'v': bVerbose = 1; break; case 'q': bQuote = 1; break; case 'n': bNewStyle = 1; break; case 'k': buseDC = 1; break; case 'e': buseED = 1; break; case 'L': max_col_size = atoi( &(argv[nArg][2]) ); break; case '-': printf( "unixODBC " VERSION "\n" ); exit(0); #ifdef HAVE_STRTOL case 'x': cDelimiter = strtol( argv[nArg]+2, NULL, 0 ); break; #endif #ifdef HAVE_SETLOCALE case 'l': if ( !setlocale( LC_ALL, argv[nArg]+2 )) { fprintf( stderr, "isql: can't set locale to '%s'\n", argv[nArg]+2 ); exit ( -1 ); } break; #endif default: fputs( szSyntax, stderr ); exit( 1 ); } continue; } else if ( count == 1 ) szDSN = argv[nArg]; else if ( count == 2 ) szUID = argv[nArg]; else if ( count == 3 ) szPWD = argv[nArg]; count++; } szSQL = calloc( 1, buffer_size + 1 ); line_buffer = calloc( 1, buffer_size + 1 ); /**************************** * CONNECT ***************************/ if ( !OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ) ) exit( 1 ); /**************************** * EXECUTE ***************************/ if ( !bBatch ) { printf( "+---------------------------------------+\n" ); printf( "| Connected! |\n" ); printf( "| |\n" ); if ( bNewStyle ) { printf( "| sql-statement(s)[;] |\n" ); printf( "| go |\n" ); printf( "| \\noac |\n" ); printf( "| \\ac |\n" ); printf( "| \\commit |\n" ); printf( "| \\rollback |\n" ); printf( "| \\tables |\n" ); printf( "| \\columns |\n" ); printf( "| \\quit |\n" ); } else { printf( "| sql-statement |\n" ); printf( "| help [tablename] |\n" ); printf( "| quit |\n" ); } printf( "| |\n" ); printf( "+---------------------------------------+\n" ); } linen = 0; bufpos = 0; do { char *line = NULL; int malloced = 0; int len = 0; int dont_copy, exec_now; szSQL[ bufpos ] = '\0'; if ( bNewStyle ) { if ( ac_off ) { sprintf( prompt, "*%d SQL> ", ++linen ); } else { sprintf( prompt, "%d SQL> ", ++linen ); } } else { sprintf( prompt, "SQL> " ); } if ( !bBatch ) { #if defined(HAVE_EDITLINE) || defined(HAVE_READLINE) line=readline( prompt ); if ( !line ) /* EOF - ctrl D */ { malloced = 1; if ( bNewStyle ) { line = strdup( "\\quit" ); } else { line = strdup( "quit" ); } } else { malloced = 0; } if ( strcmp(line, "quit") && strcmp(line, "\\quit") ) { add_history(line); } #else fputs( prompt, stdout ); line = fgets( line_buffer, line_buffer_size, stdin ); if ( !line ) /* EOF - ctrl D */ { malloced = 1; if ( bNewStyle ) { line = strdup( "\\quit" ); } else { line = strdup( "quit" ); } } else { if ( line[ 0 ] == '\n' ) { malloced = 1; if ( bNewStyle ) { line = strdup( "\\quit" ); } else { line = strdup( "quit" ); } } else { malloced = 0; } } #endif } else { line = fgets( line_buffer, line_buffer_size, stdin ); if ( !line ) /* EOF - ctrl D */ { malloced = 1; if ( bNewStyle ) { line = strdup( "\\quit" ); } else { line = strdup( "quit" ); } } else { if ( line[ 0 ] == '\n' ) { malloced = 1; if ( bNewStyle ) { line = strdup( "\\quit" ); } else { line = strdup( "quit" ); } } else { malloced = 0; } } } /* remove any ctrl chars, and find the length */ len = 0; while ( line[ len ] ) { if ( line[ len ] == '\n' ) { line[ len ] = ' '; } if ( line[ len ] == '\r' ) { line[ len ] = ' '; } len ++; } /* remove trailing spaces */ while( len > 0 ) { if ( line[ len - 1 ] == ' ' ) { len --; } else { break; } } /* * is it a comment? */ if ( bNewStyle ) { if ( len >= 2 && line[ 0 ] == '-' && line[ 1 ] == '-' ) { /* * it can't have been malloc'd */ continue; } } dont_copy = 0; exec_now = 0; if ( bNewStyle ) { if ( len > 0 && line[ len - 1 ] == ';' ) { line[ len - 1 ] = '\0'; exec_now = 1; len --; } else if ( len == 3 && memcmp( line, "go", 2 ) == 0 ) { exec_now = 1; dont_copy = 1; } else if ( len > 1 && line[ 0 ] == '\\' ) { bufpos = 0; linen = 1; exec_now = 1; } } else { exec_now = 1; } if ( !bNewStyle ) { if ( len >= 4 && memcmp( line, "quit", 4 ) == 0 ) { if ( malloced ) { free(line); } break; } } /* * stop on a blank line */ if ( !bNewStyle ) { if ( line[ 0 ] == '\0' ) { break; } } if ( !dont_copy ) { /* * is there space */ if ( len > 0 && bufpos + len + 2 > buffer_size ) { szSQL = realloc( szSQL, bufpos + len + 2 ); buffer_size = bufpos + len + 2; } /* * insert space between the lines * the above length check will make sure there is room for * the extra space */ if ( linen > 1 ) { szSQL[ bufpos ] = ' '; bufpos ++; } memcpy( szSQL + bufpos, line, len ); bufpos += len; szSQL[ bufpos ] = '\0'; } if ( exec_now ) { if ( bNewStyle ) { if ( bufpos >= 1 && szSQL[ 0 ] == '\\' ) { if ( ExecuteSlash( hDbc, szSQL, cDelimiter, bColumnNames, bHTMLTable ) == 0 ) { break; } } else { ExecuteSQL( hDbc, szSQL, cDelimiter, bColumnNames, bHTMLTable ); } } else { if ( bufpos >= 4 && memcmp( szSQL, "help", 4 ) == 0 ) { ExecuteHelp( hDbc, szSQL, cDelimiter, bColumnNames, bHTMLTable ); } else { ExecuteSQL( hDbc, szSQL, cDelimiter, bColumnNames, bHTMLTable ); } } linen = 0; bufpos = 0; } } while ( 1 ); /**************************** * DISCONNECT ***************************/ #if defined(HAVE_EDITLINE) || defined(HAVE_READLINE) write_history(rlhistory); #endif CloseDatabase( hEnv, hDbc ); exit( 0 ); } static void mem_error( int line ) { if ( bVerbose ) DumpODBCLog( hEnv, 0, 0 ); fprintf( stderr, "[ISQL]ERROR: memory allocation fail before line %d\n", line ); exit(-1); } /**************************** * OptimalDisplayWidth ***************************/ static SQLUINTEGER OptimalDisplayWidth( SQLHSTMT hStmt, SQLINTEGER nCol, int nUserWidth ) { SQLUINTEGER nLabelWidth = 10; SQLULEN nDataWidth = 10; SQLUINTEGER nOptimalDisplayWidth = 10; SQLCHAR szColumnName[MAX_DATA_WIDTH+1]; *szColumnName = '\0'; SQLColAttribute( hStmt, nCol, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL, (SQLLEN*)&nDataWidth ); SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, sizeof(szColumnName), NULL, NULL ); nLabelWidth = strlen((char*) szColumnName ); /* * catch sqlserver var(max) types */ if ( nDataWidth == 0 ) { nDataWidth = max_col_size; } nOptimalDisplayWidth = max( nLabelWidth, nDataWidth ); if ( nUserWidth > 0 ) nOptimalDisplayWidth = min( nOptimalDisplayWidth, nUserWidth ); if ( nOptimalDisplayWidth > max_col_size ) nOptimalDisplayWidth = max_col_size; return nOptimalDisplayWidth; } /**************************** * OpenDatabase - do everything we have to do to get a viable connection to szDSN ***************************/ static int OpenDatabase( SQLHENV *phEnv, SQLHDBC *phDbc, char *szDSN, char *szUID, char *szPWD ) { if ( version3 ) { if ( SQLAllocHandle( SQL_HANDLE_ENV, NULL, phEnv ) != SQL_SUCCESS ) { fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocHandle( SQL_HANDLE_ENV )\n" ); return 0; } if ( SQLSetEnvAttr( *phEnv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) 3, 0 ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, 0, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLSetEnvAttr( SQL_HANDLE_DBC )\n" ); SQLFreeHandle( SQL_HANDLE_ENV, *phEnv ); return 0; } if ( SQLAllocHandle( SQL_HANDLE_DBC, *phEnv, phDbc ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, 0, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocHandle( SQL_HANDLE_DBC )\n" ); SQLFreeHandle( SQL_HANDLE_ENV, *phEnv ); return 0; } if ( buseDC ) { if ( !SQL_SUCCEEDED( SQLDriverConnect( *phDbc, NULL, (SQLCHAR*)szDSN, SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT ))) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLDriverConnect\n" ); SQLFreeHandle( SQL_HANDLE_DBC, *phDbc ); SQLFreeHandle( SQL_HANDLE_ENV, *phEnv ); return 0; } } else { if ( !SQL_SUCCEEDED( SQLConnect( *phDbc, (SQLCHAR*)szDSN, SQL_NTS, (SQLCHAR*)szUID, SQL_NTS, (SQLCHAR*)szPWD, SQL_NTS ))) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLConnect\n" ); SQLFreeHandle( SQL_HANDLE_DBC, *phDbc ); SQLFreeHandle( SQL_HANDLE_ENV, *phEnv ); return 0; } } } else { if ( SQLAllocEnv( phEnv ) != SQL_SUCCESS ) { fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocEnv\n" ); return 0; } if ( SQLAllocConnect( *phEnv, phDbc ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, 0, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocConnect\n" ); SQLFreeEnv( *phEnv ); return 0; } if ( buseDC ) { if ( !SQL_SUCCEEDED( SQLDriverConnect( *phDbc, NULL, (SQLCHAR*)szDSN, SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT ))) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLDriverConnect\n" ); SQLFreeConnect( *phDbc ); SQLFreeEnv( *phEnv ); return 0; } } else { if ( !SQL_SUCCEEDED( SQLConnect( *phDbc, (SQLCHAR*)szDSN, SQL_NTS, (SQLCHAR*)szUID, SQL_NTS, (SQLCHAR*)szPWD, SQL_NTS ))) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLConnect\n" ); SQLFreeConnect( *phDbc ); SQLFreeEnv( *phEnv ); return 0; } } } /* * does the driver support SQLMoreResults */ if ( !SQL_SUCCEEDED( SQLGetFunctions( *phDbc, SQL_API_SQLMORERESULTS, &has_moreresults ))) { has_moreresults = 0; } return 1; } static void display_result_set( SQLHDBC hDbc, SQLHSTMT hStmt ) { SQLCHAR *szSepLine; SQLRETURN ret; int mr; SQLSMALLINT cols; SQLLEN nRows = 0; szSepLine = calloc(1, 32001); /* * Loop while SQLMoreResults returns success */ mr = 0; do { if ( mr ) { if ( ret == SQL_SUCCESS_WITH_INFO ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]INFO: SQLMoreResults returned SQL_SUCCESS_WITH_INFO\n" ); } else if ( ret == SQL_ERROR ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: SQLMoreResults returned SQL_ERROR\n" ); } } mr = 1; strcpy ((char*) szSepLine, "" ) ; /* * check to see if it has generated a result set */ if ( SQLNumResultCols( hStmt, &cols ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLNumResultCols\n" ); break; } if ( cols > 0 ) { /**************************** * WRITE HEADER ***************************/ if ( bHTMLTable ) WriteHeaderHTMLTable( hStmt ); else if ( cDelimiter == 0 ) WriteHeaderNormal( hStmt, &szSepLine ); else if ( cDelimiter && bColumnNames ) WriteHeaderDelimited( hStmt, cDelimiter ); /**************************** * WRITE BODY ***************************/ if ( bHTMLTable ) WriteBodyHTMLTable( hStmt ); else if ( cDelimiter == 0 ) nRows = WriteBodyNormal( hStmt ); else WriteBodyDelimited( hStmt, cDelimiter ); } /**************************** * WRITE FOOTER ***************************/ if ( bHTMLTable ) WriteFooterHTMLTable( hStmt ); else if ( cDelimiter == 0 ) WriteFooterNormal( hStmt, szSepLine, nRows ); } while ( has_moreresults && ( ret = SQLMoreResults( hStmt )) != SQL_NO_DATA ); free( szSepLine ); } static int display_tables( SQLHDBC hDbc ) { SQLHSTMT hStmt; SQLRETURN ret; if ( version3 ) { if ( SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocHandle( SQL_HANDLE_STMT )\n" ); return 0; } } else { if ( SQLAllocStmt( hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocStmt\n" ); return 0; } } ret = SQLTables( hStmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0 ); if ( ret == SQL_ERROR ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLTables\n" ); } else { display_result_set( hDbc, hStmt ); } SQLFreeStmt( hStmt, SQL_DROP ); return 1; } static int display_columns( SQLHDBC hDbc, char *sql ) { SQLHSTMT hStmt; SQLRETURN ret; char *args[10]; int n_args; SQLCHAR *table; int len; if ( version3 ) { if ( SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocHandle( SQL_HANDLE_STMT )\n" ); return 0; } } else { if ( SQLAllocStmt( hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocStmt\n" ); return 0; } } n_args = get_args(sql, &args[0], sizeof(args) / sizeof(args[0])); if ( n_args == 0 ) { table = NULL; len = 0; } else { table = (SQLCHAR*)args[ 0 ]; len = SQL_NTS; } ret = SQLColumns( hStmt, NULL, 0, NULL, 0, table, len, NULL, 0 ); if ( ret == SQL_ERROR ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLTables\n" ); } else { display_result_set( hDbc, hStmt ); } SQLFreeStmt( hStmt, SQL_DROP ); free_args(args, sizeof(args) / sizeof(args[0])); return 1; } /**************************** * ExecuteSlash - meta commands ***************************/ static int ExecuteSlash( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ) { SQLRETURN ret; szSQL ++; if ( memcmp( szSQL, "tables", 6 ) == 0 ) { return display_tables( hDbc ); } else if ( memcmp( szSQL, "columns", 7 ) == 0 ) { return display_columns( hDbc, szSQL + 7 ); } else if ( memcmp( szSQL, "ac", 2 ) == 0 ) { if ( version3 ) { ret = SQLSetConnectAttr( hDbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_ON, 0 ); if ( SQL_SUCCEEDED( ret ) ) { ac_off = 0; } } else { ret = SQLSetConnectOption( hDbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_ON ); if ( SQL_SUCCEEDED( ret ) ) { ac_off = 0; } } if ( !bBatch ) { printf( "AUTOCOMMIT ON (return status = %d)\n", ret ); } if ( bVerbose && !SQL_SUCCEEDED( ret )) { DumpODBCLog( hEnv, hDbc, 0 ); } } else if ( memcmp( szSQL, "noac", 4 ) == 0 ) { if ( version3 ) { ret = SQLSetConnectAttr( hDbc, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_OFF, 0 ); if ( SQL_SUCCEEDED( ret ) ) { ac_off = 1; } } else { ret = SQLSetConnectOption( hDbc, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF ); if ( SQL_SUCCEEDED( ret ) ) { ac_off = 1; } } if ( !bBatch ) { printf( "AUTOCOMMIT OFF (return status = %d)\n", ret ); } if ( bVerbose && !SQL_SUCCEEDED( ret )) { DumpODBCLog( hEnv, hDbc, 0 ); } } else if ( memcmp( szSQL, "commit", 6 ) == 0 ) { if ( version3 ) { ret = SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_COMMIT ); } else { ret = SQLTransact( hEnv, hDbc, SQL_COMMIT ); } if ( !bBatch ) { printf( "COMMIT (return status = %d)\n", ret ); } if ( bVerbose && !SQL_SUCCEEDED( ret )) { DumpODBCLog( hEnv, hDbc, 0 ); } } else if ( memcmp( szSQL, "rollback", 8 ) == 0 ) { if ( version3 ) { ret = SQLEndTran( SQL_HANDLE_DBC, hDbc, SQL_ROLLBACK ); } else { ret = SQLTransact( hEnv, hDbc, SQL_ROLLBACK ); } if ( !bBatch ) { printf( "ROLLBACK (return status = %d)\n", ret ); } if ( bVerbose && !SQL_SUCCEEDED( ret )) { DumpODBCLog( hEnv, hDbc, 0 ); } } else if ( memcmp( szSQL, "quit", 4 ) == 0 ) { return 0; } else { printf( "\nUnknown metacommand '%s'\n\n", szSQL ); } return 1; } /**************************** * ExecuteSQL - create a statement, execute the SQL, and get rid of the statement * - show results as per request; bHTMLTable has precedence over other options ***************************/ static int ExecuteSQL( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ) { SQLHSTMT hStmt; SQLSMALLINT cols; SQLLEN nRows = 0; SQLINTEGER ret; SQLCHAR *szSepLine; int mr; szSepLine = calloc(1, 32001); /**************************** * EXECUTE SQL ***************************/ if ( version3 ) { if ( SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocHandle( SQL_HANDLE_STMT )\n" ); free(szSepLine); return 0; } } else { if ( SQLAllocStmt( hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocStmt\n" ); free(szSepLine); return 0; } } if ( buseED ) { ret = SQLExecDirect( hStmt, (SQLCHAR*)szSQL, strlen( szSQL )); if ( ret == SQL_NO_DATA ) { fprintf( stderr, "[ISQL]INFO: SQLExecDirect returned SQL_NO_DATA\n" ); } else if ( ret == SQL_SUCCESS_WITH_INFO ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]INFO: SQLExecDirect returned SQL_SUCCESS_WITH_INFO\n" ); } else if ( ret != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLExecDirect\n" ); SQLFreeStmt( hStmt, SQL_DROP ); free(szSepLine); return 0; } } else { if ( SQLPrepare( hStmt, (SQLCHAR*)szSQL, strlen( szSQL )) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLPrepare\n" ); SQLFreeStmt( hStmt, SQL_DROP ); free(szSepLine); return 0; } ret = SQLExecute( hStmt ); if ( ret == SQL_NO_DATA ) { fprintf( stderr, "[ISQL]INFO: SQLExecute returned SQL_NO_DATA\n" ); } else if ( ret == SQL_SUCCESS_WITH_INFO ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]INFO: SQLExecute returned SQL_SUCCESS_WITH_INFO\n" ); } else if ( ret != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLExecute\n" ); SQLFreeStmt( hStmt, SQL_DROP ); free(szSepLine); return 0; } } /* * Loop while SQLMoreResults returns success */ mr = 0; do { if ( mr ) { if ( ret == SQL_SUCCESS_WITH_INFO ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]INFO: SQLMoreResults returned SQL_SUCCESS_WITH_INFO\n" ); } else if ( ret == SQL_ERROR ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: SQLMoreResults returned SQL_ERROR\n" ); } } mr = 1; strcpy ((char*) szSepLine, "" ) ; /* * check to see if it has generated a result set */ if ( SQLNumResultCols( hStmt, &cols ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLNumResultCols\n" ); SQLFreeStmt( hStmt, SQL_DROP ); free(szSepLine); return 0; } if ( cols > 0 ) { /**************************** * WRITE HEADER ***************************/ if ( bHTMLTable ) WriteHeaderHTMLTable( hStmt ); else if ( cDelimiter == 0 ) WriteHeaderNormal( hStmt, &szSepLine ); else if ( cDelimiter && bColumnNames ) WriteHeaderDelimited( hStmt, cDelimiter ); /**************************** * WRITE BODY ***************************/ if ( bHTMLTable ) WriteBodyHTMLTable( hStmt ); else if ( cDelimiter == 0 ) nRows = WriteBodyNormal( hStmt ); else WriteBodyDelimited( hStmt, cDelimiter ); } /**************************** * WRITE FOOTER ***************************/ if ( bHTMLTable ) WriteFooterHTMLTable( hStmt ); else if ( cDelimiter == 0 ) WriteFooterNormal( hStmt, szSepLine, nRows ); } while ( has_moreresults && ( ret = SQLMoreResults( hStmt )) != SQL_NO_DATA ); /**************************** * CLEANUP ***************************/ SQLFreeStmt( hStmt, SQL_DROP ); free(szSepLine); return 1; } /**************************** * ExecuteHelp - create a statement, execute the SQL, and get rid of the statement * - show results as per request; bHTMLTable has precedence over other options ***************************/ static int ExecuteHelp( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ) { SQLHSTMT hStmt; SQLLEN nRows = 0; SQLRETURN nReturn; SQLCHAR *szSepLine; char *args[10]; int n_args; if (!(szSepLine = calloc(1, 32001))) { fprintf(stderr, "[ISQL]ERROR: Failed to allocate line"); return 0; } /**************************** * EXECUTE SQL ***************************/ if ( version3 ) { if ( SQLAllocHandle( SQL_HANDLE_STMT, hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocHandle( SQL_HANDLE_STMT )\n" ); free(szSepLine); return 0; } } else { if ( SQLAllocStmt( hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocStmt\n" ); free(szSepLine); return 0; } } n_args = get_args(szSQL, &args[0], sizeof(args) / sizeof(args[0])); if (n_args == 2 ) { if (strcmp(args[1], "help") == 0) { output_help(); free(szSepLine); return 0; } /* COLUMNS */ nReturn = SQLColumns( hStmt, NULL, 0, NULL, 0, (SQLCHAR*)args[1], SQL_NTS, NULL, 0 ); if ( (nReturn != SQL_SUCCESS) && (nReturn != SQL_SUCCESS_WITH_INFO) ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLColumns\n" ); SQLFreeStmt( hStmt, SQL_DROP ); free(szSepLine); return 0; } } else { SQLCHAR *catalog = NULL; SQLCHAR *schema = NULL; SQLCHAR *table = NULL; SQLCHAR *type = NULL; if (n_args > 2) { catalog = (SQLCHAR*)args[1]; schema = (SQLCHAR*)args[2]; table = (SQLCHAR*)args[3]; type = (SQLCHAR*)args[4]; } /* TABLES */ nReturn = SQLTables( hStmt, catalog, SQL_NTS, schema, SQL_NTS, table, SQL_NTS, type, SQL_NTS ); if ( (nReturn != SQL_SUCCESS) && (nReturn != SQL_SUCCESS_WITH_INFO) ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLTables\n" ); SQLFreeStmt( hStmt, SQL_DROP ); free(szSepLine); free_args(args, sizeof(args) / sizeof(args[0])); return 0; } } /**************************** * WRITE HEADER ***************************/ if ( bHTMLTable ) WriteHeaderHTMLTable( hStmt ); else if ( cDelimiter == 0 ) WriteHeaderNormal( hStmt, &szSepLine ); else if ( cDelimiter && bColumnNames ) WriteHeaderDelimited( hStmt, cDelimiter ); /**************************** * WRITE BODY ***************************/ if ( bHTMLTable ) WriteBodyHTMLTable( hStmt ); else if ( cDelimiter == 0 ) nRows = WriteBodyNormal( hStmt ); else WriteBodyDelimited( hStmt, cDelimiter ); /**************************** * WRITE FOOTER ***************************/ if ( bHTMLTable ) WriteFooterHTMLTable( hStmt ); else if ( cDelimiter == 0 ) WriteFooterNormal( hStmt, szSepLine, nRows ); /**************************** * CLEANUP ***************************/ SQLFreeStmt( hStmt, SQL_DROP ); free(szSepLine); free_args(args, sizeof(args) / sizeof(args[0])); return 1; } /**************************** * CloseDatabase - cleanup in prep for exiting the program ***************************/ static int CloseDatabase( SQLHENV hEnv, SQLHDBC hDbc ) { SQLDisconnect( hDbc ); if ( version3 ) { SQLFreeHandle( SQL_HANDLE_DBC, hDbc ); SQLFreeHandle( SQL_HANDLE_ENV, hEnv ); } else { SQLFreeConnect( hDbc ); SQLFreeEnv( hEnv ); } return 1; } /**************************** * WRITE HTML ***************************/ static void WriteHeaderHTMLTable( SQLHSTMT hStmt ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLCHAR szColumnName[MAX_DATA_WIDTH+1]; *szColumnName = '\0'; printf( "\n" ); printf( "\n" ); if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; for ( nCol = 1; nCol <= nColumns; nCol++ ) { SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, sizeof(szColumnName), NULL, NULL ); printf( "\n" ); } printf( "\n" ); } static void WriteBodyHTMLTable( SQLHSTMT hStmt ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLLEN nIndicator = 0; SQLCHAR *szColumnValue; SQLRETURN nReturn = 0; SQLRETURN ret; if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; szColumnValue = malloc( max_col_size + 1 ); if ( !szColumnValue ) { mem_error( __LINE__ ); } while ( (ret = SQLFetch( hStmt )) == SQL_SUCCESS ) /* ROWS */ { printf( "\n" ); for ( nCol = 1; nCol <= nColumns; nCol++ ) /* COLS */ { printf( "\n" ); } if (ret != SQL_SUCCESS) break; printf( "\n" ); } free( szColumnValue ); } static void WriteFooterHTMLTable( SQLHSTMT hStmt ) { printf( "
\n" ); printf( "\n" ); printf( "%s\n", szColumnName ); printf( "\n" ); printf( "
\n" ); printf( "\n" ); nReturn = SQLGetData( hStmt, nCol, SQL_C_CHAR, (SQLPOINTER)szColumnValue, max_col_size + 1, &nIndicator ); if ( nReturn == SQL_SUCCESS && nIndicator != SQL_NULL_DATA ) { fputs((char*) szColumnValue, stdout ); } else if ( nReturn == SQL_SUCCESS_WITH_INFO ) { szColumnValue[ max_col_size ] = '\0'; fputs((char*) szColumnValue, stdout ); fputs((char*) "...", stdout ); } else if ( nReturn == SQL_ERROR ) { ret = SQL_ERROR; break; } else printf( "%s\n", "" ); printf( "\n" ); printf( "
\n" ); } /**************************** * WRITE DELIMITED * - this output can be used by the ODBC Text File driver * - last column no longer has a delimit char (it is implicit)... * this is consistent with odbctxt ***************************/ static void WriteHeaderDelimited( SQLHSTMT hStmt, char cDelimiter ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLCHAR szColumnName[MAX_DATA_WIDTH+1]; *szColumnName = '\0'; if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; for ( nCol = 1; nCol <= nColumns; nCol++ ) { SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, sizeof(szColumnName), NULL, NULL ); fputs((char*) szColumnName, stdout ); if ( nCol < nColumns ) putchar( cDelimiter ); } putchar( '\n' ); } static void WriteBodyDelimited( SQLHSTMT hStmt, char cDelimiter ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLLEN nIndicator = 0; SQLCHAR *szColumnValue; SQLRETURN nReturn = 0; SQLRETURN ret; SQLINTEGER *types; szColumnValue = malloc( max_col_size + 1 ); if ( !szColumnValue ) { mem_error( __LINE__ ); } if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; if ( bQuote && nColumns > 0 ) { types = malloc( nColumns * sizeof ( SQLINTEGER )); for ( nCol = 1; nCol <= nColumns && types; nCol++ ) { SQLSMALLINT type = 0; nReturn = SQLDescribeCol( hStmt, nCol, NULL, 0, NULL, &type, NULL, NULL, NULL ); switch ( type ) { case SQL_CHAR: case SQL_VARCHAR: case SQL_WCHAR: case SQL_WVARCHAR: case SQL_LONGVARCHAR: case SQL_WLONGVARCHAR: types[ nCol - 1 ] = 1; break; default: types[ nCol - 1 ] = 0; break; } } } else { types = NULL; } /* ROWS */ while (( ret = SQLFetch( hStmt )) == SQL_SUCCESS ) { /* COLS */ for ( nCol = 1; nCol <= nColumns; nCol++ ) { nReturn = SQLGetData( hStmt, nCol, SQL_C_CHAR, (SQLPOINTER)szColumnValue, max_col_size + 1, &nIndicator ); if ( nReturn == SQL_SUCCESS && nIndicator != SQL_NULL_DATA ) { if ( types && types[ nCol - 1 ] ) { putchar( '"' ); } fputs((char*) szColumnValue, stdout ); if ( types && types[ nCol - 1 ] ) { putchar( '"' ); } if ( nCol < nColumns ) { putchar( cDelimiter ); } } else if ( nReturn == SQL_SUCCESS_WITH_INFO ) { szColumnValue[ max_col_size ] = '\0'; if ( types && types[ nCol - 1 ] ) { putchar( '"' ); } fputs((char*) szColumnValue, stdout ); fputs((char*) "...", stdout ); if ( types && types[ nCol - 1 ] ) { putchar( '"' ); } if ( nCol < nColumns ) { putchar( cDelimiter ); } } else if ( nReturn == SQL_ERROR ) { ret = SQL_ERROR; break; } else { if ( nCol < nColumns ) { putchar( cDelimiter ); } } } if (ret != SQL_SUCCESS) { break; } printf( "\n" ); } if ( ret == SQL_ERROR ) { if ( bVerbose ) DumpODBCLog( 0, 0, hStmt ); } if ( types ) { free( types ); } free( szColumnValue ); } /**************************** * WRITE NORMAL ***************************/ static void WriteHeaderNormal( SQLHSTMT hStmt, SQLCHAR **szSepLine ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLCHAR *szColumn; SQLCHAR *szColumnName; SQLCHAR *szHdrLine; SQLUINTEGER nOptimalDisplayWidth = 10; szColumnName = malloc( max_col_size + 1 ); if ( !szColumnName ) { mem_error( __LINE__ ); } szColumn = malloc( max_col_size + 3 ); if ( !szColumn ) { free( szColumnName ); mem_error( __LINE__ ); } *szColumn = '\0'; *szColumnName = '\0'; if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; if ( nColumns > 0 ) { szHdrLine = calloc(1, 512 + max_col_size * nColumns ); if ( !szHdrLine ) { mem_error( __LINE__ ); } *szSepLine = realloc( *szSepLine, 512 + max_col_size * nColumns ); if ( !*szSepLine ) { mem_error( __LINE__ ); } } else { szHdrLine = calloc(1, 32001); } for ( nCol = 1; nCol <= nColumns; nCol++ ) { int sret; nOptimalDisplayWidth = OptimalDisplayWidth( hStmt, nCol, nUserWidth ); SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, max_col_size, NULL, NULL ); /* SEP */ memset( szColumn, '\0', max_col_size + 2 ); memset( szColumn, '-', nOptimalDisplayWidth + 1 ); strcat((char*) *szSepLine, "+" ); strcat((char*) *szSepLine,(char*) szColumn ); /* HDR */ sret = sprintf( (char*)szColumn, "| %-*.*s", (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, szColumnName ); if (sret < 0) sprintf((char *)szColumn, "| %-*.*s", (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, "**ERROR**"); strcat( (char*)szHdrLine,(char*) szColumn ); } strcat((char*) *szSepLine, "+\n" ); strcat((char*) szHdrLine, "|\n" ); fputs((char*) *szSepLine, stdout ); fputs((char*) szHdrLine, stdout ); fputs((char*) *szSepLine, stdout ); free(szHdrLine); free( szColumnName ); free( szColumn ); } static SQLLEN WriteBodyNormal( SQLHSTMT hStmt ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLLEN nIndicator = 0; SQLCHAR *szColumn; SQLCHAR *szColumnValue; SQLRETURN nReturn = 0; SQLLEN nRows = 0; SQLUINTEGER nOptimalDisplayWidth = 10; szColumnValue = malloc( max_col_size + 1 ); if ( !szColumnValue ) { mem_error( __LINE__ ); } szColumn = malloc( max_col_size + 21 ); if ( !szColumn ) { free( szColumnValue ); mem_error( __LINE__ ); } nReturn = SQLNumResultCols( hStmt, &nColumns ); if ( nReturn != SQL_SUCCESS && nReturn != SQL_SUCCESS_WITH_INFO ) nColumns = -1; /* ROWS */ nReturn = SQLFetch( hStmt ); while ( nReturn == SQL_SUCCESS || nReturn == SQL_SUCCESS_WITH_INFO ) { /* COLS */ for ( nCol = 1; nCol <= nColumns; nCol++ ) { int sret; nOptimalDisplayWidth = OptimalDisplayWidth( hStmt, nCol, nUserWidth ); nReturn = SQLGetData( hStmt, nCol, SQL_C_CHAR, (SQLPOINTER)szColumnValue, max_col_size + 1, &nIndicator ); szColumnValue[max_col_size] = '\0'; if ( nReturn == SQL_SUCCESS && nIndicator != SQL_NULL_DATA ) { sret = sprintf( (char*)szColumn, "| %-*.*s", (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, szColumnValue ); if (sret < 0) sprintf( (char*)szColumn, "| %-*.*s", (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, "**ERROR**" ); } else if ( nReturn == SQL_SUCCESS_WITH_INFO ) { sret = sprintf( (char*)szColumn, "| %-*.*s...", (int)nOptimalDisplayWidth - 3, (int)nOptimalDisplayWidth - 3, szColumnValue ); if (sret < 0) sprintf( (char*)szColumn, "| %-*.*s", (int)nOptimalDisplayWidth, (int)nOptimalDisplayWidth, "**ERROR**" ); } else if ( nReturn == SQL_ERROR ) { break; } else { sprintf( (char*)szColumn, "| %-*s", (int)nOptimalDisplayWidth, "" ); } fputs( (char*)szColumn, stdout ); } /* for columns */ nRows++; printf( "|\n" ); nReturn = SQLFetch( hStmt ); } /* while rows */ if ( nReturn == SQL_ERROR ) { if ( bVerbose ) DumpODBCLog( 0, 0, hStmt ); } free( szColumnValue ); free( szColumn); return nRows; } static void WriteFooterNormal( SQLHSTMT hStmt, SQLCHAR *szSepLine, SQLLEN nRows ) { SQLLEN nRowsAffected = -1; fputs( (char*)szSepLine, stdout ); SQLRowCount( hStmt, &nRowsAffected ); printf( "SQLRowCount returns %ld\n", nRowsAffected ); if ( nRows ) { printf( "%ld rows fetched\n", nRows ); } } static int DumpODBCLog( SQLHENV hEnv, SQLHDBC hDbc, SQLHSTMT hStmt ) { SQLCHAR szError[501]; SQLCHAR szSqlState[10]; SQLINTEGER nNativeError; SQLSMALLINT nErrorMsg; if ( version3 ) { int rec; if ( hStmt ) { rec = 0; while ( SQLGetDiagRec( SQL_HANDLE_STMT, hStmt, ++rec, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "[%s]%s\n", szSqlState, szError ); } } if ( hDbc ) { rec = 0; while ( SQLGetDiagRec( SQL_HANDLE_DBC, hDbc, ++rec, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "[%s]%s\n", szSqlState, szError ); } } if ( hEnv ) { rec = 0; while ( SQLGetDiagRec( SQL_HANDLE_ENV, hEnv, ++rec, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "[%s]%s\n", szSqlState, szError ); } } } else { if ( hStmt ) { while ( SQL_SUCCEEDED( SQLError( hEnv, hDbc, hStmt, szSqlState, &nNativeError, szError, 500, &nErrorMsg ))) { printf( "[%s]%s\n", szSqlState, szError ); } } if ( hDbc ) { while ( SQL_SUCCEEDED( SQLError( hEnv, hDbc, 0, szSqlState, &nNativeError, szError, 500, &nErrorMsg ))) { printf( "[%s]%s\n", szSqlState, szError ); } } if ( hEnv ) { while ( SQL_SUCCEEDED( SQLError( hEnv, 0, 0, szSqlState, &nNativeError, szError, 500, &nErrorMsg ))) { printf( "[%s]%s\n", szSqlState, szError ); } } } return 1; } static int get_args(char *string, char **args, int maxarg) { int nargs = 0; char *copy; char *p; const char *sep = " "; char *arg; unsigned int i; if (!string || !args) return 0; if (!(copy = strdup(string))) return 0; for (i = 0; i < maxarg; i++) { args[i] = NULL; } p = copy; while ((arg = strtok(p, sep))) { p = NULL; if (strcmp(arg, "\"\"") == 0) args[nargs++] = strdup(""); else if (strcmp(arg, "null") == 0) args[nargs++] = NULL; else args[nargs++] = strdup(arg); if (nargs > maxarg) return maxarg; } free(copy); return nargs; } static void free_args(char **args, int maxarg) { unsigned int i; for (i = 0; i < maxarg; i++) { if (args[i]) { free(args[i]); args[i] = NULL; } } } static void output_help(void) { fprintf(stderr, \ "help usage:\n\n" \ "help help - output this help\n" \ "help - call SQLTables and output the result-set\n" \ "help table_name - call SQLColumns for table_name and output the result-set\n" \ "help catalog schema table type - call SQLTables with these arguments\n" \ " where any argument may be specified as \"\" (for the empty string) \n" \ " or null to pass a null pointer argument.\n" \ "\n" \ " e.g.\n" \ " help %% \"\" \"\" \"\" - output list of catalogs\n" \ " help \"\" %% \"\" \"\" - output list of schemas\n" \ " help null null b%% null - output all tables beginning with b\n" \ " help null null null VIEW - output list of views\n" \ "\n"); } unixODBC-2.3.9/exe/COPYING0000755000175000017500000003545212262474471011722 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS unixODBC-2.3.9/exe/dltest.c0000755000175000017500000000651312547233231012317 00000000000000/************************************************** * dltest * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under GPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include #include #include char *szSyntax = "\n" \ "**********************************************\n" \ "* unixODBC - dltest *\n" \ "**********************************************\n" \ "* Syntax *\n" \ "* *\n" \ "* dltest libName Symbol *\n" \ "* *\n" \ "* libName *\n" \ "* *\n" \ "* Full path + file name of share to test*\n" \ "* *\n" \ "* Symbol *\n" \ "* *\n" \ "* ie a function name in the share *\n" \ "* *\n" \ "* Notes *\n" \ "* *\n" \ "* This can be placed into a makefile *\n" \ "* to throw an error if test fails. *\n" \ "* *\n" \ "* If this segfaults you probably have an*\n" \ "* unresolved symbol in the lib. This is *\n" \ "* not caught since dltest started using *\n" \ "* libtool. Linux users can refer to the *\n" \ "* man page for dlopen to create a *\n" \ "* better test. *\n" \ "* *\n" \ "* *\n" \ "* Examples *\n" \ "* *\n" \ "* dltest /usr/lib/libMy.so MyFunc *\n" \ "* *\n" \ "* Please visit; *\n" \ "* *\n" \ "* http://www.unixodbc.org/ *\n" \ "* Peter Harvey *\n" \ "**********************************************\n\n"; int main( int argc, char *argv[] ) { void *hDLL; void (*pFunc)(); const char *pError; if ( argc < 2 ) { puts( szSyntax ); exit( 1 ); } /* * initialize libtool */ if ( lt_dlinit() ) { printf( "ERROR: Failed to lt_dlinit()\n" ); exit( 1 ); } hDLL = lt_dlopen( argv[1] ); if ( !hDLL ) { printf( "[dltest] ERROR dlopen: %s\n", lt_dlerror() ); exit( 1 ); } printf( "SUCCESS: Loaded %s\n", argv[1] ); if ( argc > 2 ) { pFunc = (void (*)()) lt_dlsym( hDLL, argv[2] ); /* PAH - lt_dlerror() is not a good indicator of success */ /* if ( (pError = lt_dlerror()) != NULL ) */ if ( !pFunc ) { if ( (pError = lt_dlerror()) != NULL ) printf( "ERROR: %s\n Could not find %s\n", pError, argv[2] ); else printf( "ERROR: Could not find %s\n", argv[2] ); exit( 1 ); } printf( "SUCCESS: Found %s\n", argv[2] ); } lt_dlclose( hDLL ); return ( 0 ); } unixODBC-2.3.9/exe/README0000755000175000017500000000325012262474471011536 00000000000000*************************************************************** * This code is GPL. * * This software is a unixODBC component and may NOT be * * distributed seperately. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | +-------------------------------------------------------------+ isql/iusql This is a utility which can be used to submit SQL to a data source and to format/output results. It can be used in batch or interactive mode. odbcinst This utility has been created for install script/RPM writers. It is a command line interface to key functionality in the odbcinst lib. It does not copy any files (ie libs) but it will modify the ODBC System Information for the user. dltest This is a utility which can be used to check a share library to see if it can be loaded and if a given symbol exists in it. This can be useful when debugging a problem with a share library or in a makefile situation. dbfio This utility is used to test the functionality of the DBFIO library. +-------------------------------------------------------------+ | Peter Harvey | | pharvey@codebydesign.com | | www.unixodbc.org | 27.JAN.99 | +-------------------------------------------------------------+ unixODBC-2.3.9/exe/slencheck.c0000644000175000017500000000751313364067027012763 00000000000000#include #include #include #include static void show_error( SQLHANDLE henv, SQLHANDLE hdbc, SQLHANDLE hstmt, char *func ) { SQLSMALLINT len; SQLCHAR state[ 7 ]; SQLCHAR msg[ 512 ]; SQLINTEGER native; SQLRETURN ret; SQLSMALLINT rec; fprintf( stderr, "slencheck: error from driver calling %s\n", func ); rec = 0; while( 1 ) { rec ++; if ( hstmt ) { ret = SQLGetDiagRec( SQL_HANDLE_STMT, hstmt, rec, state, &native, msg, sizeof( msg ), &len ); } else if ( hdbc ) { ret = SQLGetDiagRec( SQL_HANDLE_DBC, hdbc, rec, state, &native, msg, sizeof( msg ), &len ); } else { ret = SQLGetDiagRec( SQL_HANDLE_ENV, henv, rec, state, &native, msg, sizeof( msg ), &len ); } if ( SQL_SUCCEEDED( ret )) { fprintf( stderr, "\t[%s]:%d:%s\n", state, (int)native, msg ); } else { break; } } } int main( int argc, char **argv ) { SQLHANDLE henv, hdbc, hstmt; SQLRETURN ret; unsigned char mem[ 8 ]; int size; if ( argc < 2 || argc > 4 ) { fprintf( stderr, "usage: slencheck dsn [uid [pwd]]\n" ); exit( -1 ); } ret = SQLAllocHandle( SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv ); if ( ret != SQL_SUCCESS ) { fprintf( stderr, "slencheck: failed to call SQLAllocHandle(ENV)\n" ); exit( -1 ); } ret = SQLSetEnvAttr( henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_UINTEGER ); if ( ret != SQL_SUCCESS ) { show_error( henv, NULL, NULL, "SQLSetEnvAttr" ); exit( -1 ); } ret = SQLAllocHandle( SQL_HANDLE_DBC, henv, &hdbc ); if ( ret != SQL_SUCCESS ) { show_error( henv, NULL, NULL, "SQLAllocHandle" ); exit( -1 ); } if ( argc == 2 ) { ret = SQLConnect( hdbc, (SQLCHAR*) argv[ 1 ], SQL_NTS, NULL, 0, NULL, 0 ); } else if ( argc == 3 ) { ret = SQLConnect( hdbc, (SQLCHAR*) argv[ 1 ], SQL_NTS, (SQLCHAR*) argv[ 2 ], SQL_NTS, NULL, 0 ); } else { ret = SQLConnect( hdbc, (SQLCHAR*) argv[ 1 ], SQL_NTS, (SQLCHAR*) argv[ 2 ], SQL_NTS, (SQLCHAR*) argv[ 3 ], SQL_NTS ); } if ( !SQL_SUCCEEDED( ret )) { show_error( henv, hdbc, NULL, "SQLConnect" ); exit( -1 ); } ret = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt ); if ( !SQL_SUCCEEDED( ret )) { show_error( henv, hdbc, NULL, "SQLAllocHandle" ); exit( -1 ); } ret = SQLTables( hstmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0 ); if ( !SQL_SUCCEEDED( ret )) { show_error( henv, hdbc, hstmt, "SQLTables" ); exit( -1 ); } mem[ 0 ] = 0xde; mem[ 1 ] = 0xad; mem[ 2 ] = 0xbe; mem[ 3 ] = 0xef; mem[ 4 ] = 0xde; mem[ 5 ] = 0xad; mem[ 6 ] = 0xbe; mem[ 7 ] = 0xef; ret = SQLRowCount( hstmt, (SQLLEN*) mem ); if ( !SQL_SUCCEEDED( ret )) { show_error( henv, hdbc, hstmt, "SQLRowCount" ); exit( -1 ); } if ( mem[ 7 ] != 0xef && mem[ 6 ] != 0xbe ) { size = 8; } else if ( mem[ 7 ] == 0xef && mem[ 6 ] == 0xbe && mem[ 3 ] != 0xef && mem[ 2 ] != 0xbe ) { size = 4; } else { size = 0; } if ( size ) { printf( "slencheck: sizeof(SQLLEN) == %d\n", size ); if ( size == sizeof( SQLLEN )) { printf( "slencheck: driver manager and driver matched\n" ); } else { printf( "slencheck: driver manager and driver differ!!!\n" ); } } else { printf( "slencheck: can't decide on sizeof(SQLLEN)\n" ); } ret = SQLCloseCursor( hstmt ); ret = SQLFreeHandle( SQL_HANDLE_STMT, hstmt ); ret = SQLDisconnect( hdbc ); ret = SQLFreeHandle( SQL_HANDLE_DBC, hdbc ); ret = SQLFreeHandle( SQL_HANDLE_ENV, henv ); return size; } unixODBC-2.3.9/exe/iusql.c0000644000175000017500000006575113542634624012172 00000000000000/************************************************** * isql * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under GPL 18.FEB.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #define UNICODE #include "isql.h" #include "ini.h" #include "sqlucode.h" #ifdef HAVE_READLINE #include #include #endif #ifdef HAVE_EDITLINE #include #endif #ifdef HAVE_SETLOCALE #ifdef HAVE_LOCALE_H #include #endif #endif static int OpenDatabase( SQLHENV *phEnv, SQLHDBC *phDbc, char *szDSN, char *szUID, char *szPWD ); static int CloseDatabase( SQLHENV hEnv, SQLHDBC hDbc ); static int ExecuteSQL( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ); static int ExecuteHelp( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ); static void WriteHeaderHTMLTable( SQLHSTMT hStmt ); static void WriteHeaderDelimited( SQLHSTMT hStmt, char cDelimiter ); static void WriteBodyHTMLTable( SQLHSTMT hStmt ); static SQLLEN WriteBodyNormal( SQLHSTMT hStmt ); static void WriteBodyDelimited( SQLHSTMT hStmt, char cDelimiter ); static void WriteFooterHTMLTable( SQLHSTMT hStmt ); static int DumpODBCLog( SQLHENV hEnv, SQLHDBC hDbc, SQLHSTMT hStmt ); int bVerbose = 0; SQLHENV hEnv = 0; SQLHDBC hDbc = 0; int buseED = 0; void UWriteHeaderNormal( SQLHSTMT hStmt, SQLTCHAR *szSepLine ); void UWriteFooterNormal( SQLHSTMT hStmt, SQLTCHAR *szSepLine, SQLLEN nRows ); static char * uc_to_ascii( SQLWCHAR *uc ) { char *ascii = (char *)uc; int i; for ( i = 0; uc[ i ]; i ++ ) { ascii[ i ] = uc[ i ] & 0x00ff; } ascii[ i ] = 0; return ascii; } static void ansi_to_unicode( char *szSQL, SQLWCHAR *szUcSQL ) { int i; for ( i = 0; szSQL[ i ]; i ++ ) { szUcSQL[ i ] = szSQL[ i ]; } szUcSQL[ i ] = 0; } int main( int argc, char *argv[] ) { int nArg, count; int bHTMLTable = 0; int bBatch = 0; int cDelimiter = 0; int bColumnNames = 0; char *szDSN; char *szUID; char *szPWD; char *szSQL; char *pEscapeChar; int buffer_size = 9000; int len; szDSN = NULL; szUID = NULL; szPWD = NULL; if ( argc < 2 ) { fputs( szSyntax, stderr ); exit( 1 ); } #ifdef HAVE_SETLOCALE /* * Default locale */ setlocale( LC_ALL, "" ); #endif /**************************** * PARSE ARGS ***************************/ for ( nArg = 1, count = 1 ; nArg < argc; nArg++ ) { if ( argv[nArg][0] == '-' ) { /* Options */ switch ( argv[nArg][1] ) { case 'd': cDelimiter = argv[nArg][2]; break; case 's': buffer_size = atoi( &(argv[nArg][2]) ); break; case 'w': bHTMLTable = 1; break; case 'b': bBatch = 1; break; case 'c': bColumnNames = 1; break; case 'v': bVerbose = 1; break; case 'e': buseED = 1; break; case '-': printf( "unixODBC " VERSION "\n" ); exit(0); #ifdef HAVE_STRTOL case 'x': cDelimiter = strtol( argv[nArg]+2, NULL, 0 ); break; #endif #ifdef HAVE_SETLOCALE case 'l': if ( !setlocale( LC_ALL, argv[nArg]+2 )) { fprintf( stderr, "isql: can't set locale to '%s'\n", argv[nArg]+2 ); exit ( -1 ); } break; #endif default: fputs( szSyntax, stderr ); exit( 1 ); } continue; } else if ( count == 1 ) szDSN = argv[nArg]; else if ( count == 2 ) szUID = argv[nArg]; else if ( count == 3 ) szPWD = argv[nArg]; count++; } szSQL = calloc( 1, buffer_size + 1 ); /**************************** * CONNECT ***************************/ if ( !OpenDatabase( &hEnv, &hDbc, szDSN, szUID, szPWD ) ) exit( 1 ); /**************************** * EXECUTE ***************************/ if ( !bBatch ) { printf( "+---------------------------------------+\n" ); printf( "| Connected! |\n" ); printf( "| |\n" ); printf( "| sql-statement |\n" ); printf( "| help [tablename] |\n" ); printf( "| quit |\n" ); printf( "| |\n" ); printf( "+---------------------------------------+\n" ); } do { if ( !bBatch ) #if !defined(HAVE_EDITLINE) && !defined(HAVE_READLINE) printf( "SQL> " ); #else { char *line; int malloced; line=readline("SQL> "); if ( !line ) /* EOF - ctrl D */ { malloced = 1; line = strdup( "quit" ); } else { malloced = 0; } strncpy(szSQL, line, buffer_size ); add_history(line); if ( malloced ) { free(line); } } else #endif { char *line; int malloced; line = fgets( szSQL, buffer_size, stdin ); if ( !line ) /* EOF - ctrl D */ { malloced = 1; line = strdup( "quit" ); } else { malloced = 0; } strncpy(szSQL, line, buffer_size ); if ( malloced ) { free(line); } } /* strip away escape chars */ while ( (pEscapeChar=(char*)strchr(szSQL, '\n')) != NULL || (pEscapeChar=(char*)strchr(szSQL, '\r')) != NULL ) *pEscapeChar = ' '; len = strlen( szSQL ); /* remove trailing spaces */ while( len > 0 ) { len --; if ( szSQL[ len ] == ' ' ) { szSQL[ len ] = '\0'; } else { break; } } if ( szSQL[1] != '\0' ) { if ( strncmp( szSQL, "quit", 4 ) == 0 ) szSQL[1] = '\0'; else if ( strncmp( szSQL, "help", 4 ) == 0 ) ExecuteHelp( hDbc, szSQL, cDelimiter, bColumnNames, bHTMLTable ); else if (memcmp(szSQL, "--", 2) != 0) ExecuteSQL( hDbc, szSQL, cDelimiter, bColumnNames, bHTMLTable ); } } while ( szSQL[1] != '\0' ); /**************************** * DISCONNECT ***************************/ CloseDatabase( hEnv, hDbc ); exit( 0 ); } /**************************** * OpenDatabase - do everything we have to do to get a viable connection to szDSN ***************************/ static int OpenDatabase( SQLHENV *phEnv, SQLHDBC *phDbc, char *szDSN, char *szUID, char *szPWD ) { SQLCHAR dsn[ 1024 ], uid[ 1024 ], pwd[ 1024 ]; SQLTCHAR cstr[ 1024 ]; char zcstr[ 1024 ], tmp[ 1024 ]; int i; size_t zclen; if ( SQLAllocEnv( phEnv ) != SQL_SUCCESS ) { fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocEnv\n" ); return 0; } if ( SQLAllocConnect( *phEnv, phDbc ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, 0, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocConnect\n" ); SQLFreeEnv( *phEnv ); return 0; } if ( szDSN ) { size_t DSNlen=strlen( szDSN ); for ( i = 0; i < DSNlen; i ++ ) { dsn[ i ] = szDSN[ i ]; } dsn[ i ] = '\0'; } else { dsn[ 0 ] = '\0'; } if ( szUID ) { size_t UIDlen=strlen( szUID ); for ( i = 0; i < UIDlen; i ++ ) { uid[ i ] = szUID[ i ]; } uid[ i ] = '\0'; } else { uid[ 0 ] = '\0'; } if ( szPWD ) { size_t PWDlen=strlen( szPWD ); for ( i = 0; i < PWDlen; i ++ ) { pwd[ i ] = szPWD[ i ]; } pwd[ i ] = '\0'; } else { pwd[ 0 ] = '\0'; } sprintf( zcstr, "DSN=%s", dsn ); if ( szUID ) { sprintf( tmp, ";UID=%s", uid ); strcat( zcstr, tmp ); } if ( szPWD ) { sprintf( tmp, ";PWD=%s", pwd ); strcat( zcstr, tmp ); } zclen=strlen( zcstr ); for ( i = 0; i < zclen; i ++ ) { cstr[ i ] = zcstr[ i ]; } cstr[ i ] = 0; if ( !SQL_SUCCEEDED( SQLDriverConnect( *phDbc, NULL, cstr, SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT ))) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLDriverConnect\n" ); SQLFreeConnect( *phDbc ); SQLFreeEnv( *phEnv ); return 0; } if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); return 1; } /**************************** * ExecuteSQL - create a statement, execute the SQL, and get rid of the statement * - show results as per request; bHTMLTable has precedence over other options ***************************/ static int ExecuteSQL( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ) { SQLHSTMT hStmt; SQLTCHAR szSepLine[32001]; SQLTCHAR szUcSQL[32001]; SQLSMALLINT cols; SQLINTEGER ret; SQLLEN nRows = 0; szSepLine[ 0 ] = 0; ansi_to_unicode( szSQL, szUcSQL ); /**************************** * EXECUTE SQL ***************************/ if ( SQLAllocStmt( hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocStmt\n" ); return 0; } if ( buseED ) { ret = SQLExecDirect( hStmt, szUcSQL, SQL_NTS ); if ( ret == SQL_NO_DATA ) { fprintf( stderr, "[ISQL]INFO: SQLExecDirect returned SQL_NO_DATA\n" ); } else if ( ret == SQL_SUCCESS_WITH_INFO ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]INFO: SQLExecDirect returned SQL_SUCCESS_WITH_INFO\n" ); } else if ( ret != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLExecDirect\n" ); SQLFreeStmt( hStmt, SQL_DROP ); return 0; } } else { if ( SQLPrepare( hStmt, szUcSQL, SQL_NTS ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLPrepare\n" ); SQLFreeStmt( hStmt, SQL_DROP ); return 0; } ret = SQLExecute( hStmt ); if ( ret == SQL_NO_DATA ) { fprintf( stderr, "[ISQL]INFO: SQLExecute returned SQL_NO_DATA\n" ); } else if ( ret == SQL_SUCCESS_WITH_INFO ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]INFO: SQLExecute returned SQL_SUCCESS_WITH_INFO\n" ); } else if ( ret != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLExecute\n" ); SQLFreeStmt( hStmt, SQL_DROP ); return 0; } } do { /* * check to see if it has generated a result set */ if ( SQLNumResultCols( hStmt, &cols ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLNumResultCols\n" ); SQLFreeStmt( hStmt, SQL_DROP ); return 0; } if ( cols > 0 ) { /**************************** * WRITE HEADER ***************************/ if ( bHTMLTable ) WriteHeaderHTMLTable( hStmt ); else if ( cDelimiter == 0 ) UWriteHeaderNormal( hStmt, szSepLine ); else if ( cDelimiter && bColumnNames ) WriteHeaderDelimited( hStmt, cDelimiter ); /**************************** * WRITE BODY ***************************/ if ( bHTMLTable ) WriteBodyHTMLTable( hStmt ); else if ( cDelimiter == 0 ) nRows = WriteBodyNormal( hStmt ); else WriteBodyDelimited( hStmt, cDelimiter ); } /**************************** * WRITE FOOTER ***************************/ if ( bHTMLTable ) WriteFooterHTMLTable( hStmt ); else if ( cDelimiter == 0 ) UWriteFooterNormal( hStmt, szSepLine, nRows ); } while ( SQL_SUCCEEDED( SQLMoreResults( hStmt ))); /**************************** * CLEANUP ***************************/ SQLFreeStmt( hStmt, SQL_DROP ); return 1; } /**************************** * ExecuteHelp - create a statement, execute the SQL, and get rid of the statement * - show results as per request; bHTMLTable has precedence over other options ***************************/ static int ExecuteHelp( SQLHDBC hDbc, char *szSQL, char cDelimiter, int bColumnNames, int bHTMLTable ) { char szTable[250] = ""; SQLHSTMT hStmt; SQLTCHAR szSepLine[32001]; SQLLEN nRows = 0; szSepLine[ 0 ] = 0; /**************************** * EXECUTE SQL ***************************/ if ( SQLAllocStmt( hDbc, &hStmt ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, 0 ); fprintf( stderr, "[ISQL]ERROR: Could not SQLAllocStmt\n" ); return 0; } if ( iniElement( szSQL, ' ', '\0', 1, szTable, sizeof(szTable) ) == INI_SUCCESS ) { SQLWCHAR tname[ 1024 ]; ansi_to_unicode( szTable, tname ); /* COLUMNS */ if ( SQLColumns( hStmt, NULL, 0, NULL, 0, tname, SQL_NTS, NULL, 0 ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLColumns\n" ); SQLFreeStmt( hStmt, SQL_DROP ); return 0; } } else { /* TABLES */ if ( SQLTables( hStmt, NULL, 0, NULL, 0, NULL, 0, NULL, 0 ) != SQL_SUCCESS ) { if ( bVerbose ) DumpODBCLog( hEnv, hDbc, hStmt ); fprintf( stderr, "[ISQL]ERROR: Could not SQLTables\n" ); SQLFreeStmt( hStmt, SQL_DROP ); return 0; } } /**************************** * WRITE HEADER ***************************/ if ( bHTMLTable ) WriteHeaderHTMLTable( hStmt ); else if ( cDelimiter == 0 ) UWriteHeaderNormal( hStmt, szSepLine ); else if ( cDelimiter && bColumnNames ) WriteHeaderDelimited( hStmt, cDelimiter ); /**************************** * WRITE BODY ***************************/ if ( bHTMLTable ) WriteBodyHTMLTable( hStmt ); else if ( cDelimiter == 0 ) nRows = WriteBodyNormal( hStmt ); else WriteBodyDelimited( hStmt, cDelimiter ); /**************************** * WRITE FOOTER ***************************/ if ( bHTMLTable ) WriteFooterHTMLTable( hStmt ); else if ( cDelimiter == 0 ) UWriteFooterNormal( hStmt, szSepLine, nRows ); /**************************** * CLEANUP ***************************/ SQLFreeStmt( hStmt, SQL_DROP ); return 1; } /**************************** * CloseDatabase - cleanup in prep for exiting the program ***************************/ int CloseDatabase( SQLHENV hEnv, SQLHDBC hDbc ) { SQLDisconnect( hDbc ); SQLFreeConnect( hDbc ); SQLFreeEnv( hEnv ); return 1; } /**************************** * WRITE HTML ***************************/ static void WriteHeaderHTMLTable( SQLHSTMT hStmt ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLTCHAR szColumnName[MAX_DATA_WIDTH+1]; szColumnName[ 0 ] = 0; printf( "\n" ); printf( "\n" ); if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; for ( nCol = 1; nCol <= nColumns; nCol++ ) { SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, sizeof(szColumnName), NULL, NULL ); printf( "\n" ); } printf( "\n" ); } static void WriteBodyHTMLTable( SQLHSTMT hStmt ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLLEN nIndicator = 0; SQLTCHAR szColumnValue[MAX_DATA_WIDTH+1]; SQLRETURN nReturn = 0; SQLRETURN ret; szColumnValue[ 0 ] = 0; if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; while ( (ret = SQLFetch( hStmt )) == SQL_SUCCESS ) /* ROWS */ { printf( "\n" ); for ( nCol = 1; nCol <= nColumns; nCol++ ) /* COLS */ { printf( "\n" ); } if (ret != SQL_SUCCESS) break; printf( "\n" ); } } static void WriteFooterHTMLTable( SQLHSTMT hStmt ) { printf( "
\n" ); printf( "\n" ); printf( "%s\n", uc_to_ascii( szColumnName )); printf( "\n" ); printf( "
\n" ); printf( "\n" ); nReturn = SQLGetData( hStmt, nCol, SQL_C_WCHAR, (SQLPOINTER)szColumnValue, sizeof(szColumnValue), &nIndicator ); if ( nReturn == SQL_SUCCESS && nIndicator != SQL_NULL_DATA ) { uc_to_ascii( szColumnValue ); fputs((char*) szColumnValue, stdout ); } else if ( nReturn == SQL_ERROR ) { ret = SQL_ERROR; break; } else printf( "%s\n", "" ); printf( "\n" ); printf( "
\n" ); } /**************************** * WRITE DELIMITED * - this output can be used by the ODBC Text File driver * - last column no longer has a delimit char (it is implicit)... * this is consistent with odbctxt ***************************/ static void WriteHeaderDelimited( SQLHSTMT hStmt, char cDelimiter ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLTCHAR szColumnName[MAX_DATA_WIDTH+1]; szColumnName[ 0 ] = 0; if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; for ( nCol = 1; nCol <= nColumns; nCol++ ) { SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, sizeof(szColumnName), NULL, NULL ); fputs((char*) uc_to_ascii( szColumnName ), stdout ); if ( nCol < nColumns ) putchar( cDelimiter ); } putchar( '\n' ); } static void WriteBodyDelimited( SQLHSTMT hStmt, char cDelimiter ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLLEN nIndicator = 0; SQLTCHAR szColumnValue[MAX_DATA_WIDTH+1]; SQLRETURN nReturn = 0; SQLRETURN ret; szColumnValue[ 0 ] = 0; if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; /* ROWS */ while (( ret = SQLFetch( hStmt )) == SQL_SUCCESS ) { /* COLS */ for ( nCol = 1; nCol <= nColumns; nCol++ ) { nReturn = SQLGetData( hStmt, nCol, SQL_C_WCHAR, (SQLPOINTER)szColumnValue, sizeof(szColumnValue), &nIndicator ); if ( nReturn == SQL_SUCCESS && nIndicator != SQL_NULL_DATA ) { uc_to_ascii( szColumnValue ); fputs((char*) szColumnValue, stdout ); if ( nCol < nColumns ) putchar( cDelimiter ); } else if ( nReturn == SQL_ERROR ) { ret = SQL_ERROR; break; } else { if ( nCol < nColumns ) putchar( cDelimiter ); } } if (ret != SQL_SUCCESS) break; printf( "\n" ); } if ( ret == SQL_ERROR ) { if ( bVerbose ) DumpODBCLog( 0, 0, hStmt ); } } /**************************** * WRITE NORMAL ***************************/ void UWriteHeaderNormal( SQLHSTMT hStmt, SQLTCHAR *szSepLine ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLULEN nMaxLength = 10; SQLTCHAR szColumn[MAX_DATA_WIDTH+20]; SQLTCHAR szColumnName[MAX_DATA_WIDTH+1]; SQLTCHAR szHdrLine[32001]; szColumn[ 0 ] = 0; szColumnName[ 0 ] = 0; szHdrLine[ 0 ] = 0; if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; for ( nCol = 1; nCol <= nColumns; nCol++ ) { SQLColAttribute( hStmt, nCol, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL, (SQLLEN*)&nMaxLength ); SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, sizeof(szColumnName), NULL, NULL ); if ( nMaxLength > MAX_DATA_WIDTH ) nMaxLength = MAX_DATA_WIDTH; uc_to_ascii( szColumnName ); /* SEP */ memset( szColumn, '\0', sizeof(szColumn) ); memset( szColumn, '-', max( nMaxLength, strlen((char*)szColumnName) ) + 1 ); strcat((char*) szSepLine, "+" ); strcat((char*) szSepLine,(char*) szColumn ); /* HDR */ sprintf((char*) szColumn, "| %-*s", (int)max( nMaxLength, strlen((char*)szColumnName) ), (char*)szColumnName ); strcat((char*) szHdrLine,(char*) szColumn ); } strcat((char*) szSepLine, "+\n" ); strcat((char*) szHdrLine, "|\n" ); puts((char*) szSepLine ); puts((char*) szHdrLine ); puts((char*) szSepLine ); } static SQLLEN WriteBodyNormal( SQLHSTMT hStmt ) { SQLINTEGER nCol = 0; SQLSMALLINT nColumns = 0; SQLLEN nIndicator = 0; SQLTCHAR szColumn[MAX_DATA_WIDTH+20]; SQLTCHAR szColumnValue[MAX_DATA_WIDTH+1]; SQLTCHAR szColumnName[MAX_DATA_WIDTH+1]; SQLULEN nMaxLength = 10; SQLRETURN nReturn = 0; SQLRETURN ret; SQLLEN nRows = 0; szColumn[ 0 ] = 0; szColumnValue[ 0 ] = 0; szColumnName[ 0 ] = 0; if ( SQLNumResultCols( hStmt, &nColumns ) != SQL_SUCCESS ) nColumns = -1; /* ROWS */ while (( ret = SQLFetch( hStmt )) == SQL_SUCCESS ) { /* COLS */ for ( nCol = 1; nCol <= nColumns; nCol++ ) { SQLColAttribute( hStmt, nCol, SQL_DESC_LABEL, szColumnName, sizeof(szColumnName), NULL, NULL ); SQLColAttribute( hStmt, nCol, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL, (SQLLEN*)&nMaxLength ); uc_to_ascii( szColumnName ); if ( nMaxLength > MAX_DATA_WIDTH ) nMaxLength = MAX_DATA_WIDTH; nReturn = SQLGetData( hStmt, nCol, SQL_C_WCHAR, (SQLPOINTER)szColumnValue, sizeof(szColumnValue), &nIndicator ); szColumnValue[MAX_DATA_WIDTH] = '\0'; uc_to_ascii( szColumnValue ); if ( nReturn == SQL_SUCCESS && nIndicator != SQL_NULL_DATA ) { if ( strlen((char*)szColumnValue) < max( nMaxLength, strlen((char*)szColumnName ))) { int i; size_t maxlen=max( nMaxLength, strlen((char*)szColumnName )); strcpy((char*) szColumn, "| " ); strcat((char*) szColumn, (char*) szColumnValue ); for ( i = strlen((char*) szColumnValue ); i < maxlen; i ++ ) { strcat((char*) szColumn, " " ); } } else { strcpy((char*) szColumn, "| " ); strcat((char*) szColumn, (char*) szColumnValue ); } } else if ( nReturn == SQL_ERROR ) { ret = SQL_ERROR; break; } else { sprintf((char*) szColumn, "| %-*s", (int)max( nMaxLength, strlen((char*) szColumnName) ), "" ); } fputs((char*) szColumn, stdout ); } if (ret != SQL_SUCCESS) break; printf( "|\n" ); nRows++; } if ( ret == SQL_ERROR ) { if ( bVerbose ) DumpODBCLog( 0, 0, hStmt ); } return nRows; } void UWriteFooterNormal( SQLHSTMT hStmt, SQLTCHAR *szSepLine, SQLLEN nRows ) { SQLLEN nRowsAffected = -1; puts( (char*)szSepLine ); SQLRowCount( hStmt, &nRowsAffected ); printf( "SQLRowCount returns %ld\n", nRowsAffected ); if ( nRows ) { printf( "%ld rows fetched\n", nRows ); } } static int DumpODBCLog( SQLHENV hEnv, SQLHDBC hDbc, SQLHSTMT hStmt ) { SQLTCHAR szError[501]; SQLTCHAR szSqlState[10]; SQLINTEGER nNativeError; SQLSMALLINT nErrorMsg; if ( hStmt ) { while ( SQLError( hEnv, hDbc, hStmt, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "%s\n", uc_to_ascii( szError )); } } if ( hDbc ) { while ( SQLError( hEnv, hDbc, 0, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "%s\n", uc_to_ascii( szError )); } } if ( hEnv ) { while ( SQLError( hEnv, 0, 0, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "%s\n", uc_to_ascii( szError )); } } return 1; } unixODBC-2.3.9/exe/isql.h0000644000175000017500000001365513450627026012002 00000000000000/************************************************** * isql * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under GPL 18.FEB.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include #include #include #ifdef HAVE_STRTOL char *szSyntax = "\n" \ "**********************************************\n" \ "* unixODBC - isql and iusql *\n" \ "**********************************************\n" \ "* Syntax *\n" \ "* *\n" \ "* isql DSN [UID [PWD]] [options] *\n" \ "* *\n" \ "* iusql DSN [UID [PWD]] [options] *\n" \ "* *\n" \ "* Options *\n" \ "* *\n" \ "* -b batch.(no prompting etc) *\n" \ "* -dx delimit columns with x *\n" \ "* -x0xXX delimit columns with XX, where *\n" \ "* x is in hex, ie 0x09 is tab *\n" \ "* -w wrap results in an HTML table *\n" \ "* -c column names on first row. *\n" \ "* (only used when -d) *\n" \ "* -mn limit column display width to n *\n" \ "* -v verbose. *\n" \ "* -lx set locale to x *\n" \ "* -q wrap char fields in dquotes *\n" \ "* -3 Use ODBC 3 calls *\n" \ "* -n Use new line processing *\n" \ "* -e Use SQLExecDirect not Prepare *\n" \ "* -k Use SQLDriverConnect *\n" \ "* -L Length of col display (def:300) *\n" \ "* --version version *\n" \ "* *\n" \ "* Commands *\n" \ "* *\n" \ "* help - list tables *\n" \ "* help table - list columns in table *\n" \ "* help help - list all help options *\n" \ "* *\n" \ "* Examples *\n" \ "* *\n" \ "* iusql -v WebDB MyID MyPWD -w < My.sql *\n" \ "* *\n" \ "* Each line in My.sql must contain *\n" \ "* exactly 1 SQL command except for the *\n" \ "* last line which must be blank (unless *\n" \ "* -n option specified). *\n" \ "* *\n" \ "* Datasources, drivers, etc: *\n" \ "* *\n" \ "* See \"man 1 isql\" *\n" \ "* *\n" \ "* Please visit; *\n" \ "* *\n" \ "* http://www.unixodbc.org *\n" \ "* nick@lurcher.org *\n" \ "* pharvey@codebydesign.com *\n" \ "**********************************************\n\n"; #else char *szSyntax = "\n" \ "**********************************************\n" \ "* unixODBC - isql and iusql *\n" \ "**********************************************\n" \ "* Syntax *\n" \ "* *\n" \ "* isql DSN [UID [PWD]] [options] *\n" \ "* *\n" \ "* iusql DSN [UID [PWD]] [options] *\n" \ "* *\n" \ "* Options *\n" \ "* *\n" \ "* -b batch.(no prompting etc) *\n" \ "* -dx delimit columns with x *\n" \ "* -x0xXX delimit columns with XX, where *\n" \ "* x is in hex, ie 0x09 is tab *\n" \ "* -w wrap results in an HTML table *\n" \ "* -c column names on first row. *\n" \ "* (only used when -d) *\n" \ "* -mn limit column display width to n *\n" \ "* -v verbose. *\n" \ "* -q wrap char fields in dquotes *\n" \ "* --version version *\n" \ "* *\n" \ "* Commands *\n" \ "* *\n" \ "* help - list tables *\n" \ "* help table - list columns in table *\n" \ "* help help - list all help options *\n" \ "* *\n" \ "* Examples *\n" \ "* *\n" \ "* iusql -v WebDB MyID MyPWD -w < My.sql *\n" \ "* *\n" \ "* Each line in My.sql must contain *\n" \ "* exactly 1 SQL command except for the *\n" \ "* last line which must be blank. *\n" \ "* *\n" \ "* Datasources, drivers, etc: *\n" \ "* *\n" \ "* See \"man 1 isql\" *\n" \ "* *\n" \ "* Please visit; *\n" \ "* *\n" \ "* http://www.unixodbc.org *\n" \ "* nick@lurcher.org *\n" \ "* pharvey@codebydesign.com *\n" \ "**********************************************\n\n"; #endif #define MAX_DATA_WIDTH 300 #ifndef max #define max( a, b ) (((a) > (b)) ? (a) : (b)) #endif #ifndef min #define min( a, b ) (((a) < (b)) ? (a) : (b)) #endif unixODBC-2.3.9/exe/odbc-config.c0000644000175000017500000001625313611276712013175 00000000000000/********************************************************************* * * Written, as part of unixODBC by Nick Gorham * (nick@lurcher.org). * * copyright (c) 2004 Nick Gorham * * 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 #include #ifdef HAVE_STDLIB_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include static void usage( void ) { fprintf( stderr, "Usage: odbc_config\n\t\t[--prefix]\n\t\t[--exec-prefix]\n\t\t[--include-prefix]\n\t\t[--lib-prefix]\n\t\t[--bin-prefix]\n\t\t[--version]\n\t\t[--libs]\n\t\t[--static-libs]\n\t\t[--libtool-libs]\n\t\t[--cflags]\n\t\t[--odbcversion]\n\t\t[--longodbcversion]\n\t\t[--odbcini]\n\t\t[--odbcinstini]\n\t\t[--header]\n\t\t[--ulen]\n" ); } static void cInc( void ) { #ifdef HAVE_UNISTD_H printf( "#ifndef HAVE_UNISTD_H\n #define HAVE_UNISTD_H\n#endif\n" ); #endif #ifdef HAVE_PWD_H printf( "#ifndef HAVE_PWD_H\n #define HAVE_PWD_H\n#endif\n" ); #endif #ifdef HAVE_SYS_TYPES_H printf( "#ifndef HAVE_SYS_TYPES_H\n #define HAVE_SYS_TYPES_H\n#endif\n" ); #endif #ifdef ODBC_STD printf( "#ifndef ODBC_STD\n #define ODBC_STD\n#endif\n" ); #endif #ifdef UNICODE printf( "#ifndef UNICODE\n #define UNICODE\n#endif\n" ); #endif #ifdef GUID_DEFINED printf( "#ifndef GUID_DEFINED\n #define GUID_DEFINED\n#endif\n" ); #endif #ifdef SQL_WCHART_CONVERT printf( "#ifndef SQL_WCHART_CONVERT\n #define SQL_WCHART_CONVERT\n#endif\n" ); #endif #ifdef HAVE_LONG_LONG printf( "#ifndef HAVE_LONG_LONG\n #define HAVE_LONG_LONG\n#endif\n" ); #endif #ifdef ODBCINT64_TYPE printf( "#ifndef ODBCINT64\n #define ODBCINT64 %s\n#endif\n", ODBCINT64_TYPE ); #endif #ifdef UODBCINT64_TYPE printf( "#ifndef UODBCINT64\n #define UODBCINT64 %s\n#endif\n", UODBCINT64_TYPE ); #endif #ifdef DISABLE_INI_CACHING printf( "#ifndef DISABLE_INI_CACHING\n #define DISABLE_INI_CACHING\n#endif\n" ); #endif #ifdef SIZEOF_LONG_INT printf( "#ifndef SIZEOF_LONG_INT\n #define SIZEOF_LONG_INT %d\n#endif\n", SIZEOF_LONG_INT ); #endif #ifdef ALREADY_HAVE_WINDOWS_TYPE printf( "#ifndef ALREADY_HAVE_WINDOWS_TYPE\n #define ALREADY_HAVE_WINDOWS_TYPE\n#endif\n" ); #endif #ifdef DONT_TD_VOID printf( "#ifndef DONT_TD_VOID\n #define DONT_TD_VOID\n#endif\n" ); #endif #ifdef DO_YOU_KNOW_WHAT_YOU_ARE_DOING printf( "#ifndef DO_YOU_KNOW_WHAT_YOU_ARE_DOING\n #define DO_YOU_KNOW_WHAT_YOU_ARE_DOING\n#endif\n" ); #endif #ifdef BUILD_LEGACY_64_BIT_MODE printf( "#ifndef BUILD_LEGACY_64_BIT_MODE\n #define BUILD_LEGACY_64_BIT_MODE\n#endif\n" ); #endif #ifdef HAVE_ICONV printf( "#ifndef HAVE_ICONV\n #define HAVE_ICONV\n#endif\n" ); #endif #ifdef ASCII_ENCODING printf( "#ifndef ASCII_ENCODING\n #define ASCII_ENCODING \"%s\"\n#endif\n", ASCII_ENCODING ); #endif #ifdef UNICODE_ENCODING printf( "#ifndef UNICODE_ENCODING\n #define UNICODE_ENCODING \"%s\"\n#endif\n", UNICODE_ENCODING ); #endif #ifdef ENABLE_DRIVER_ICONV printf( "#ifndef ENABLE_DRIVER_ICONV\n #define ENABLE_DRIVER_ICONV\n#endif\n" ); #endif } static void cflags( void ) { #ifdef HAVE_UNISTD_H printf( "-DHAVE_UNISTD_H " ); #endif #ifdef HAVE_PWD_H printf( "-DHAVE_PWD_H " ); #endif #ifdef HAVE_SYS_TYPES_H printf( "-DHAVE_SYS_TYPES_H " ); #endif #ifdef ODBC_STD printf( "-DODBC_STD " ); #endif #ifdef UNICODE printf( "-DUNICODE " ); #endif #ifdef GUID_DEFINED printf( "-DGUID_DEFINED " ); #endif #ifdef SQL_WCHART_CONVERT printf( "-DSQL_WCHART_CONVERT " ); #endif #ifdef HAVE_LONG_LONG printf( "-DHAVE_LONG_LONG " ); #endif #ifdef DISABLE_INI_CACHING printf( "-DDISABLE_INI_CACHING " ); #endif #ifdef SIZEOF_LONG_INT printf( "-DSIZEOF_LONG_INT=%d ", SIZEOF_LONG_INT ); #endif #ifdef ALREADY_HAVE_WINDOWS_TYPE printf( "-DALREADY_HAVE_WINDOWS_TYPE " ); #endif #ifdef DONT_TD_VOID printf( "-DDONT_TD_VOID " ); #endif #ifdef DO_YOU_KNOW_WHAT_YOU_ARE_DOING printf( "-DDO_YOU_KNOW_WHAT_YOU_ARE_DOING " ); #endif #ifdef BUILD_LEGACY_64_BIT_MODE printf( "-DBUILD_LEGACY_64_BIT_MODE " ); #endif #ifdef INCLUDE_PREFIX printf( "-I%s ", INCLUDE_PREFIX ); #else printf( "-I%s/include ", PREFIX ); #endif printf( "\n" ); } static void ulen( void ) { printf( "-DSIZEOF_SQLULEN=%d\n", (int)sizeof( SQLULEN )); } int main( int argc, char **argv ) { int i; if ( argc < 2 ) { usage(); exit( -1 ); } for ( i = 1; i < argc; i ++ ) { if ( strcmp( argv[ i ], "--prefix" ) == 0 ) { printf( "%s\n", PREFIX ); } else if ( strcmp( argv[ i ], "--exec-prefix" ) == 0 ) { printf( "%s\n", EXEC_PREFIX ); } else if ( strcmp( argv[ i ], "--bin-prefix" ) == 0 ) { printf( "%s\n", BIN_PREFIX ); } else if ( strcmp( argv[ i ], "--include-prefix" ) == 0 ) { printf( "%s\n", INCLUDE_PREFIX ); } else if ( strcmp( argv[ i ], "--lib-prefix" ) == 0 ) { printf( "%s\n", LIB_PREFIX ); } else if ( strcmp( argv[ i ], "--version" ) == 0 ) { printf( "%s\n", VERSION ); } else if ( strcmp( argv[ i ], "--libs" ) == 0 ) { printf( "-L%s -lodbc\n", LIB_PREFIX ); } else if ( strcmp( argv[ i ], "--static-libs" ) == 0 ) { printf( "%s/libodbc.a\n", LIB_PREFIX ); } else if ( strcmp( argv[ i ], "--libtool-libs" ) == 0 ) { printf( "%s/libodbc.la\n", LIB_PREFIX ); } else if ( strcmp( argv[ i ], "--cflags" ) == 0 ) { cflags(); } else if ( strcmp( argv[ i ], "--header" ) == 0 ) { cInc(); } else if ( strcmp( argv[ i ], "--odbcversion" ) == 0 ) { printf( "3\n" ); } else if ( strcmp( argv[ i ], "--longodbcversion" ) == 0 ) { printf( "3.52\n" ); } else if ( strcmp( argv[ i ], "--odbcini" ) == 0 ) { printf( "%s/odbc.ini\n", SYSTEM_FILE_PATH ); } else if ( strcmp( argv[ i ], "--odbcinstini" ) == 0 ) { printf( "%s/odbcinst.ini\n", SYSTEM_FILE_PATH ); } else if ( strcmp( argv[ i ], "--ulen" ) == 0 ) { ulen(); } else { usage(); exit( -1 ); } } exit(0); } unixODBC-2.3.9/exe/Makefile.in0000664000175000017500000005712513725127175012735 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = isql$(EXEEXT) dltest$(EXEEXT) odbcinst$(EXEEXT) \ iusql$(EXEEXT) odbc_config$(EXEEXT) slencheck$(EXEEXT) subdir = exe ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_dltest_OBJECTS = dltest.$(OBJEXT) dltest_OBJECTS = $(am_dltest_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_isql_OBJECTS = isql.$(OBJEXT) isql_OBJECTS = $(am_isql_OBJECTS) am_iusql_OBJECTS = iusql.$(OBJEXT) iusql_OBJECTS = $(am_iusql_OBJECTS) am_odbc_config_OBJECTS = odbc-config.$(OBJEXT) odbc_config_OBJECTS = $(am_odbc_config_OBJECTS) odbc_config_LDADD = $(LDADD) am_odbcinst_OBJECTS = odbcinst.$(OBJEXT) odbcinst_OBJECTS = $(am_odbcinst_OBJECTS) am_slencheck_OBJECTS = slencheck.$(OBJEXT) slencheck_OBJECTS = $(am_slencheck_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(dltest_SOURCES) $(isql_SOURCES) $(iusql_SOURCES) \ $(odbc_config_SOURCES) $(odbcinst_SOURCES) \ $(slencheck_SOURCES) DIST_SOURCES = $(dltest_SOURCES) $(isql_SOURCES) $(iusql_SOURCES) \ $(odbc_config_SOURCES) $(odbcinst_SOURCES) \ $(slencheck_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs COPYING README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) EXTRA_DIST = \ isql.h \ COPYING odbcinst_LDADD = \ ../odbcinst/libodbcinst.la \ ../ini/libinilc.la \ $(LIBLTDL) odbcinst_DEPENDENCIES = \ ../odbcinst/libodbcinst.la \ ../ini/libinilc.la \ $(LTDLDEPS) odbcinst_SOURCES = odbcinst.c isql_LDADD = \ ../DriverManager/libodbc.la \ ../extras/libodbcextraslc.la \ $(READLINE) isql_DEPENDENCIES = \ ../DriverManager/libodbc.la isql_SOURCES = isql.c iusql_LDADD = \ ../DriverManager/libodbc.la \ ../odbcinst/libodbcinst.la \ ../ini/libinilc.la \ $(READLINE) iusql_DEPENDENCIES = \ ../odbcinst/libodbcinst.la \ ../DriverManager/libodbc.la \ ../ini/libinilc.la \ ../extras/libodbcextraslc.la iusql_SOURCES = iusql.c dltest_SOURCES = dltest.c odbc_config_SOURCES = odbc-config.c slencheck_LDADD = \ ../DriverManager/libodbc.la \ $(READLINE) slencheck_DEPENDENCIES = \ ../DriverManager/libodbc.la slencheck_SOURCES = slencheck.c dltest_DEPENDENCIES = $(LTDLDEPS) dltest_LDADD = $(LIBLTDL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu exe/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu exe/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list dltest$(EXEEXT): $(dltest_OBJECTS) $(dltest_DEPENDENCIES) $(EXTRA_dltest_DEPENDENCIES) @rm -f dltest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dltest_OBJECTS) $(dltest_LDADD) $(LIBS) isql$(EXEEXT): $(isql_OBJECTS) $(isql_DEPENDENCIES) $(EXTRA_isql_DEPENDENCIES) @rm -f isql$(EXEEXT) $(AM_V_CCLD)$(LINK) $(isql_OBJECTS) $(isql_LDADD) $(LIBS) iusql$(EXEEXT): $(iusql_OBJECTS) $(iusql_DEPENDENCIES) $(EXTRA_iusql_DEPENDENCIES) @rm -f iusql$(EXEEXT) $(AM_V_CCLD)$(LINK) $(iusql_OBJECTS) $(iusql_LDADD) $(LIBS) odbc_config$(EXEEXT): $(odbc_config_OBJECTS) $(odbc_config_DEPENDENCIES) $(EXTRA_odbc_config_DEPENDENCIES) @rm -f odbc_config$(EXEEXT) $(AM_V_CCLD)$(LINK) $(odbc_config_OBJECTS) $(odbc_config_LDADD) $(LIBS) odbcinst$(EXEEXT): $(odbcinst_OBJECTS) $(odbcinst_DEPENDENCIES) $(EXTRA_odbcinst_DEPENDENCIES) @rm -f odbcinst$(EXEEXT) $(AM_V_CCLD)$(LINK) $(odbcinst_OBJECTS) $(odbcinst_LDADD) $(LIBS) slencheck$(EXEEXT): $(slencheck_OBJECTS) $(slencheck_DEPENDENCIES) $(EXTRA_slencheck_DEPENDENCIES) @rm -f slencheck$(EXEEXT) $(AM_V_CCLD)$(LINK) $(slencheck_OBJECTS) $(slencheck_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dltest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isql.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iusql.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odbc-config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odbcinst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slencheck.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile all-am: @sed "s![@]ODBC_ULEN[@]!`$(top_builddir)/exe/odbc_config$(EXEEXT) --ulen`!" \ $(top_builddir)/DriverManager/odbc.pc > $(top_builddir)/exe/odbc.pc.tmp @mv -f $(top_builddir)/exe/odbc.pc.tmp $(top_builddir)/DriverManager/odbc.pc @sed "s![@]ODBC_CFLAGS[@]!`$(top_builddir)/exe/odbc_config$(EXEEXT) --cflags | sed 's/ -I.*//'`!" \ $(top_builddir)/DriverManager/odbc.pc > $(top_builddir)/exe/odbc.pc.tmp @mv -f $(top_builddir)/exe/odbc.pc.tmp $(top_builddir)/DriverManager/odbc.pc # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/exe/odbcinst.c0000644000175000017500000005127713256655147012645 00000000000000/******************************************** * odbcinst - command line tool * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under GPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include char *szSyntax = "\n" \ "**********************************************\n" \ "* unixODBC - odbcinst *\n" \ "**********************************************\n" \ "* *\n" \ "* Purpose: *\n" \ "* *\n" \ "* An ODBC Installer and Uninstaller. *\n" \ "* Updates system files, and *\n" \ "* increases/decreases usage counts but *\n" \ "* does not actually copy or remove any *\n" \ "* files. *\n" \ "* *\n" \ "* Syntax: *\n" \ "* *\n" \ "* odbcinst Action Object Options *\n" \ "* *\n" \ "* Action: *\n" \ "* *\n" \ "* -i install *\n" \ "* -u uninstall *\n" \ "* -q query *\n" \ "* -j print config info *\n" \ "* -c call SQLCreateDataSource *\n" \ "* -m call SQLManageDataSources *\n" \ "* --version version *\n" \ "* *\n" \ "* Object: *\n" \ "* *\n" \ "* -d driver *\n" \ "* -s data source *\n" \ "* *\n" \ "* Options: *\n" \ "* *\n" \ "* -f file name of template.ini follows *\n" \ "* this (valid for -i) *\n" \ "* -r get template.ini from stdin, not *\n" \ "* a template file *\n" \ "* -n Driver or Data Source Name follows *\n" \ "* -v turn verbose off (no info, warning *\n" \ "* or error msgs) *\n" \ "* -l system dsn *\n" \ "* -h user dsn *\n" \ "* *\n" \ "* Returns: *\n" \ "* *\n" \ "* 0 Success *\n" \ "* !0 Failed *\n" \ "* *\n" \ "* Please visit; *\n" \ "* *\n" \ "* http://www.unixodbc.org *\n" \ "* pharvey@codebydesign.com *\n" \ "**********************************************\n\n"; char szError[ODBC_FILENAME_MAX+1]; DWORD nError; char cVerbose; int from_stdin = 0; int system_dsn = 0; int user_dsn = 0; /*! * \brief Invoke UI to Create Data Source wizard. * * This exists so we can test calling SQLCreateDataSource from an * app which does not provide the UI used by SQLCreateDataSource. * * At the moment we have "odbcinstQ4" (the Qt4 based UI) requested * explicitly but this could be changed to simply request the default * or to use a ncurses based UI when that becomes available. * * There are at least 3 ways to invoke SQLCreateDataSource; * * \li ODBCCreateDataSourceQ4 at the command-line * \li a custom application * \li "odbcinst -c [-nMyDsn]" at the command-line * * \sa ManageDataSources */ int CreateDataSource( char *pszDataSourceName ) { ODBCINSTWND odbcinstwnd; odbcinstwnd.hWnd = 0; strcpy( odbcinstwnd.szUI, ODBCINSTPLUGIN ); if ( SQLCreateDataSource( (HWND)&(odbcinstwnd), ( (pszDataSourceName && *pszDataSourceName) ? pszDataSourceName : 0 ) ) == FALSE ) return 1; return 0; } /*! * \brief Invoke UI to Manage Data Sources. * * This exists so we can test calling SQLManageDataSources from an * app which does not provide the UI used by SQLManageDataSources. * * At the moment we have "odbcinstQ4" (the Qt4 based UI) requested * explicitly but this could be changed to simply request the default * or to use a ncurses based UI when that becomes available. * * There are at least 3 ways to invoke SQLManageDataSources; * * \li ODBCManageDataSourcesQ4 at the command-line * \li a custom application * \li "odbcinst -m" at the command-line * * \sa CreateDataSource */ int ManageDataSources() { ODBCINSTWND odbcinstwnd; odbcinstwnd.hWnd = 0; strcpy( odbcinstwnd.szUI, ODBCINSTPLUGIN ); if ( SQLManageDataSources( (HWND)&(odbcinstwnd) ) == FALSE ) return 1; return 0; } int DriverInstall( char *pszTemplate ) { HINI hIni; char szObject[INI_MAX_OBJECT_NAME+1]; char szProperty[INI_MAX_PROPERTY_NAME+1]; char szValue[INI_MAX_PROPERTY_VALUE+1]; char szDriver[10000]; char szPathOut[ODBC_FILENAME_MAX+1]; DWORD nUsageCount = 0; char *pChar = NULL; #ifdef __OS2__ if ( iniOpen( &hIni, pszTemplate, "#;", '[', ']', '=', FALSE, 0L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, pszTemplate, "#;", '[', ']', '=', FALSE ) != INI_SUCCESS ) #endif { if ( cVerbose == 0 ) printf( "odbcinst: iniOpen failed on %s.\n", pszTemplate ); return 1; } memset( szDriver, '\0', 10000 ); pChar = szDriver; iniObjectFirst( hIni ); while ( iniObjectEOL( hIni ) == FALSE ) { iniObject( hIni, szObject ); sprintf( pChar, "%s", szObject ); pChar += ( strlen( szObject ) + 1 ); iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) == FALSE ) { iniProperty( hIni, szProperty ); iniValue( hIni, szValue ); sprintf( pChar, "%s=%s", szProperty, szValue ); pChar += ( strlen( szProperty ) + strlen( szValue ) + 2 ); iniPropertyNext( hIni ); } if ( SQLInstallDriverEx( szDriver, NULL, szPathOut, ODBC_FILENAME_MAX, NULL, ODBC_INSTALL_COMPLETE, &nUsageCount ) == FALSE ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLInstallDriverEx failed with %s.\n", szError ); return 1; } if ( cVerbose == 0 ) printf( "odbcinst: Driver installed. Usage count increased to %d. \n Target directory is %s\n", (int)nUsageCount, szPathOut ); memset( szDriver, '\0', 10000 ); pChar = szDriver; iniObjectNext( hIni ); } iniClose( hIni ); return 0; } int DriverUninstall( char *pszDriver ) { DWORD nUsageCount; if ( SQLRemoveDriver( pszDriver, FALSE, &nUsageCount ) == FALSE ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLRemoveDriver failed with %s.\n", szError ); return 1; } if ( nUsageCount == 0 ) { if ( cVerbose == 0 ) printf( "%s has been deleted (if it existed at all) because its usage count became zero\n", pszDriver ); } else { if ( cVerbose == 0 ) printf( "%s usage count has been reduced to %d\n", pszDriver, (int)nUsageCount ); } return 0; } int DriverQuery( char *pszDriver ) { char szResults[4048]; char szValue[501]; char *ptr; if ( pszDriver && (*pszDriver) ) { /* list Driver details */ if ( SQLGetPrivateProfileString( pszDriver, NULL, NULL, szResults, sizeof( szResults ) - 1, "ODBCINST.INI" ) < 1 ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLGetPrivateProfileString failed with %s.\n", szError ); return 1; } printf( "[%s]\n", pszDriver ); ptr = szResults; while ( *ptr ) { printf( "%s=", ptr ); if ( SQLGetPrivateProfileString( pszDriver, ptr, "", szValue, sizeof( szValue ) - 1, "ODBCINST.INI" ) > 0 ) { printf( "%s", szValue ); } printf( "\n" ); ptr += strlen( ptr ) + 1; } } else { /* list Drivers */ if ( SQLGetPrivateProfileString( NULL, NULL, NULL, szResults, sizeof( szResults ) - 1, "ODBCINST.INI" ) < 1 ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLGetPrivateProfileString failed with %s.\n", szError ); return 1; } ptr = szResults; while ( *ptr ) { printf( "[%s]\n", ptr ); ptr += strlen( ptr ) + 1; } } return 0; } int DSNInstall( char *pszTemplate ) { HINI hIni; char szFileName[ODBC_FILENAME_MAX+1]; char szObject[INI_MAX_OBJECT_NAME+1]; char szProperty[INI_MAX_PROPERTY_NAME+1]; char szValue[INI_MAX_PROPERTY_VALUE+1]; #ifdef __OS2__ if ( iniOpen( &hIni, pszTemplate, "#;", '[', ']', '=', FALSE, 0L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, pszTemplate, "#;", '[', ']', '=', FALSE ) != INI_SUCCESS ) #endif { if ( cVerbose == 0 ) printf( "odbcinst: iniOpen failed on %s.\n", pszTemplate ); return 1; } if ( system_dsn ) { SQLSetConfigMode( ODBC_SYSTEM_DSN ); } else if ( user_dsn ) { SQLSetConfigMode( ODBC_USER_DSN ); } strcpy( szFileName, "ODBC.INI" ); iniObjectFirst( hIni ); while ( iniObjectEOL( hIni ) == FALSE ) { iniObject( hIni, szObject ); if ( SQLWritePrivateProfileString( szObject, NULL, NULL, szFileName ) == FALSE ) { int i = 1; int ret; do { ret = SQLInstallerError( i, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLWritePrivateProfileString failed with %s.\n", szError ); i ++; } while ( ret == SQL_SUCCESS ); iniClose( hIni ); SQLSetConfigMode( ODBC_BOTH_DSN ); return 1; } iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) == FALSE ) { iniProperty( hIni, szProperty ); iniValue( hIni, szValue ); if ( SQLWritePrivateProfileString( szObject, szProperty, szValue, szFileName ) == FALSE ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLWritePrivateProfileString failed with %s.\n", szError ); iniClose( hIni ); SQLSetConfigMode( ODBC_BOTH_DSN ); return 1; } iniPropertyNext( hIni ); } iniObjectNext( hIni ); } iniClose( hIni ); if ( cVerbose == 0 && from_stdin ) printf( "odbcinst: Sections and Entries from stdin have been added to %s\n", szFileName ); else if ( cVerbose ) printf( "odbcinst: Sections and Entries from %s have been added to %s\n", pszTemplate, szFileName ); return 0; } int DSNUninstall( char *pszDSN ) { UWORD nConfigMode; char *pMode; if ( system_dsn ) { SQLSetConfigMode( ODBC_SYSTEM_DSN ); } else if ( user_dsn ) { SQLSetConfigMode( ODBC_USER_DSN ); } if ( SQLGetConfigMode( &nConfigMode ) == FALSE ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLGetConfigMode failed with %s.\n", szError ); return 1; } if ( SQLRemoveDSNFromIni( pszDSN ) == FALSE ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLRemoveDSNFromIni failed with %s.\n", szError ); return 1; } switch ( nConfigMode ) { case ODBC_SYSTEM_DSN: pMode = "ODBC_SYSTEM_DSN"; break; case ODBC_USER_DSN: pMode = "ODBC_USER_DSN"; break; case ODBC_BOTH_DSN: pMode = "ODBC_BOTH_DSN"; break; default: pMode = "Unknown mode"; } if ( cVerbose == 0 ) printf( "odbcinst: DSN removed (if it existed at all). %s was used as the search path.\n", pMode ); return 0; } int DSNQuery( char *pszDSN ) { char szResults[9601]; char szValue[501]; char *ptr; szResults[0] = '\0'; if ( system_dsn ) SQLSetConfigMode( ODBC_SYSTEM_DSN ); else if ( user_dsn ) SQLSetConfigMode( ODBC_USER_DSN ); if ( pszDSN && (*pszDSN) ) { /* list DSN details */ if ( SQLGetPrivateProfileString( pszDSN, NULL, NULL, szResults, sizeof( szResults ) - 1, "ODBC.INI" ) < 1 ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLGetPrivateProfileString failed with %s.\n", szError ); SQLSetConfigMode( ODBC_BOTH_DSN ); return 1; } printf( "[%s]\n", pszDSN ); ptr = szResults; while ( *ptr ) { printf( "%s=", ptr ); if ( SQLGetPrivateProfileString( pszDSN, ptr, "", szValue, sizeof( szValue ) - 1, "ODBC.INI" ) > 0 ) { printf( "%s", szValue ); } printf( "\n" ); ptr += strlen( ptr ) + 1; } } else { /* list DSNs */ if ( SQLGetPrivateProfileString( NULL, NULL, NULL, szResults, sizeof( szResults ) - 1, "ODBC.INI" ) < 1 ) { SQLInstallerError( 1, &nError, szError, ODBC_FILENAME_MAX, NULL ); if ( cVerbose == 0 ) printf( "odbcinst: SQLGetPrivateProfileString failed with %s.\n", szError ); SQLSetConfigMode( ODBC_BOTH_DSN ); return 1; } ptr = szResults; while ( *ptr ) { printf( "[%s]\n", ptr ); ptr += strlen( ptr ) + 1; } } SQLSetConfigMode( ODBC_BOTH_DSN ); return 0; } void Syntax() { if ( cVerbose != 0 ) return; puts( szSyntax ); } void PrintConfigInfo() { char szFileName[ODBC_FILENAME_MAX+1]; char b1[ 256 ], b2[ 256 ]; printf( "unixODBC " VERSION "\n" ); *szFileName = '\0'; sprintf( szFileName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); printf( "DRIVERS............: %s\n", szFileName ); *szFileName = '\0'; _odbcinst_SystemINI( szFileName, FALSE ); printf( "SYSTEM DATA SOURCES: %s\n", szFileName ); *szFileName = '\0'; _odbcinst_FileINI( szFileName ); printf( "FILE DATA SOURCES..: %s\n", szFileName ); *szFileName = '\0'; _odbcinst_UserINI( szFileName, FALSE ); printf( "USER DATA SOURCES..: %s\n", szFileName ); printf( "SQLULEN Size.......: %ld\n", (long) sizeof( SQLULEN )); printf( "SQLLEN Size........: %ld\n", (long) sizeof( SQLLEN )); printf( "SQLSETPOSIROW Size.: %ld\n", (long) sizeof( SQLSETPOSIROW )); } int main( int argc, char *argv[] ) { int nArg; char cAction = 0; char cObject = 0; char szTemplateINI[ODBC_FILENAME_MAX+1]; char szObjectName[INI_MAX_OBJECT_NAME+1]; int nReturn = 0; cVerbose = 0; if ( argc < 2 ) { Syntax(); exit ( 1 ); } szTemplateINI[0] = '\0'; szObjectName[0] = '\0'; for ( nArg = 1; nArg < argc; nArg++ ) { if ( argv[nArg][0] == '-' ) { switch ( argv[nArg][1] ) { /* Action */ case 'i': case 'u': case 'q': cAction = argv[nArg][1]; break; case 'j': PrintConfigInfo(); exit(0); case '-': printf( "unixODBC " VERSION "\n" ); exit(0); /* Object */ case 'c': case 'd': case 's': case 'm': cObject = argv[nArg][1]; break; /* Options */ case 'n': if ( nArg < argc-1 ) strncpy( szObjectName, argv[nArg+1], INI_MAX_OBJECT_NAME ); break; case 'f': if ( nArg < argc-1 ) strncpy( szTemplateINI, argv[nArg+1], ODBC_FILENAME_MAX ); break; case 'r': from_stdin = 1; break; case 'v': cVerbose = argv[nArg][1]; break; case 'l': system_dsn = 1; if ( user_dsn ) { if ( cVerbose == 0 ) printf( "odbcinst: cannot install both user and system dsn at the same time"); exit( -2 ); } break; case 'h': user_dsn = 1; if ( system_dsn ) { if ( cVerbose == 0 ) printf( "odbcinst: cannot install both user and system dsn at the same time"); exit( -2 ); } break; default: if ( cVerbose == 0 ) printf( "odbcinst: Unknown option %c\n", argv[nArg][1] ); exit( -1 ); } } } /* DRIVERS */ if ( cObject == 'd' ) { /* install */ if ( cAction == 'i' ) { if ( szTemplateINI[0] != '\0' ) nReturn = DriverInstall( szTemplateINI ); else if ( from_stdin ) nReturn = DriverInstall( STDINFILE ); else { if ( cVerbose == 0 ) printf( "odbcinst: Please supply -f template.ini (The fileformat of template.ini is identical to odbcinst.ini and odbc.ini, respectively)\n" ); Syntax(); exit( 1 ); } } /* uninstall */ else if ( cAction == 'u' ) { if ( szObjectName[0] != '\0' ) nReturn = DriverUninstall( szObjectName ); else { if ( cVerbose == 0 ) printf( "odbcinst: Please supply -n FriendlyDriverName \n" ); Syntax(); exit( 1 ); } } /* query */ else if ( cAction == 'q' ) nReturn = DriverQuery( szObjectName ); else { if ( cVerbose == 0 ) printf( "odbcinst: Invalid Action for Object\n" ); Syntax(); exit( 1 ); } } /* DATA SOURCES */ else if ( cObject == 's' ) { /* install */ if ( cAction == 'i' ) { if ( szTemplateINI[0] != '\0' ) nReturn = DSNInstall( szTemplateINI ); else if ( from_stdin ) nReturn = DSNInstall( STDINFILE ); else { if ( cVerbose == 0 ) printf( "odbcinst: Please supply -f template.ini \n" ); Syntax(); exit( 1 ); } } /* uninstall */ else if ( cAction == 'u' ) { if ( szObjectName[0] != '\0' ) nReturn = DSNUninstall( szObjectName ); else { if ( cVerbose == 0 ) printf( "odbcinst: Please supply -n DataSourceName \n" ); Syntax(); exit( 1 ); } } /* query */ else if ( cAction == 'q' ) nReturn = DSNQuery( szObjectName ); else { if ( cVerbose == 0 ) printf( "odbcinst: Invalid Action for Object\n" ); Syntax(); exit( 1 ); } } else if ( cObject == 'c' ) { nReturn = CreateDataSource( szObjectName ); } else if ( cObject == 'm' ) { nReturn = ManageDataSources(); } else { if ( cVerbose == 0 ) printf( "odbcinst: Invalid Object\n" ); Syntax(); exit( 1 ); } exit( nReturn ); } unixODBC-2.3.9/exe/Makefile.am0000664000175000017500000000305213270565312012704 00000000000000bin_PROGRAMS = isql dltest odbcinst iusql odbc_config slencheck AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) EXTRA_DIST = \ isql.h \ COPYING odbcinst_LDADD = \ ../odbcinst/libodbcinst.la \ ../ini/libinilc.la \ $(LIBLTDL) odbcinst_DEPENDENCIES = \ ../odbcinst/libodbcinst.la \ ../ini/libinilc.la \ $(LTDLDEPS) odbcinst_SOURCES = odbcinst.c isql_LDADD = \ ../DriverManager/libodbc.la \ ../extras/libodbcextraslc.la \ $(READLINE) isql_DEPENDENCIES = \ ../DriverManager/libodbc.la isql_SOURCES = isql.c iusql_LDADD = \ ../DriverManager/libodbc.la \ ../odbcinst/libodbcinst.la \ ../ini/libinilc.la \ $(READLINE) iusql_DEPENDENCIES = \ ../odbcinst/libodbcinst.la \ ../DriverManager/libodbc.la \ ../ini/libinilc.la \ ../extras/libodbcextraslc.la iusql_SOURCES = iusql.c dltest_SOURCES = dltest.c odbc_config_SOURCES = odbc-config.c slencheck_LDADD = \ ../DriverManager/libodbc.la \ $(READLINE) slencheck_DEPENDENCIES = \ ../DriverManager/libodbc.la slencheck_SOURCES = slencheck.c dltest_DEPENDENCIES = $(LTDLDEPS) dltest_LDADD = $(LIBLTDL) all-am: @sed "s![@]ODBC_ULEN[@]!`$(top_builddir)/exe/odbc_config$(EXEEXT) --ulen`!" \ $(top_builddir)/DriverManager/odbc.pc > $(top_builddir)/exe/odbc.pc.tmp @mv -f $(top_builddir)/exe/odbc.pc.tmp $(top_builddir)/DriverManager/odbc.pc @sed "s![@]ODBC_CFLAGS[@]!`$(top_builddir)/exe/odbc_config$(EXEEXT) --cflags | sed 's/ -I.*//'`!" \ $(top_builddir)/DriverManager/odbc.pc > $(top_builddir)/exe/odbc.pc.tmp @mv -f $(top_builddir)/exe/odbc.pc.tmp $(top_builddir)/DriverManager/odbc.pc unixODBC-2.3.9/NEWS0000755000175000017500000000206512262474476010604 00000000000000Release History =============== NOTE: I have moved what was here into ChangeLog, it seemed to make more sense that way (NG). Release 2.2.10 29-Sep-2004 Release 2.2.9 24-Jan-2004 Release 2.2.8 17-Feb-2004 Release 2.2.7 02-Dec-2003 Release 2.2.6 21-July-2003 Release 2.2.5 26-Feb-2003 Release 2.2.4 24-January-2003 Release 2.2.3 23-August-2002 Release 2.2.2 8-July-2002 Release 2.2.1 23-Mar-2002 Release 2.2.0 30-Jan-2002 Release 2.1.1 2001-12-21 Release 2.1.0 2001-11-27 Release 2.0.10 2001-10-14 Release 2.0.9 2001-08-14 Release 2.0.8 2001-06-25 Release 2.0.7 2001-06-06 Release 2.0.6 2001-04-18 Release 2.0.5 2001-03-21 Release 2.0.4 2001-02-02 Release 2.0.3 2001-01-13 Release 2.0.2 2001-01-08 Release 2.0.1 2001-01-06 Release 2.0.0 2001-01-04 Release 1.8.13 2000-11-14 Release 1.8.12 2000-08-18 Release 1.8.11 2000-08-16 Release 1.8.10 2000-06-15 Release 1.8.9 2000-06-13 Release 1.8.8 2000-05-03 Release 1.8.6 2000-02-21 Release 1.8.4 2000-02-12 Release 1.8.3 1999-12-28 Release 1.8.2 1999-12-11 Release 1.8.1 1999-11-17 Release 1.8 1999-11-13 Release 1.7 1999-07-26 unixODBC-2.3.9/Makefile.svn0000644000175000017500000000074313724130415012332 00000000000000svn: @echo "*** Retrieving configure tests needed by configure.in" @libtoolize --copy --ltdl --force @aclocal -I m4 @echo "*** Building Makefile templates (step one)" @automake --add-missing @automake @echo "*** Building config.h" @autoheader @sed -i '/UNIXODBC_SOURCE/d' unixodbc_conf.h.in @echo "*** Building configure" @autoconf @echo "*** Finished" @echo " Don't forget to run ./configure" @echo " If you haven't done so in a while, run ./configure --help" unixODBC-2.3.9/install-sh0000755000175000017500000003452313725127167012107 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixODBC-2.3.9/README.AIX0000755000175000017500000000520012262474476011377 00000000000000Building on AIX =============== Install ======= AIX seems to ship with a install tool /usr/bin/bsdinstall, unfortunatly the version of autoconf that unixODBC uses doesn't seem to like this, so make sure it doesn't find this. It may be best to define INSTALL as a empty string before building, forcing it to use the builtin install-sh. Threads ======= You need to decide to build with or without threads, if you want threads I would do this export CC=xlc_r export CXX=xlC_r ./configure If you don't want threads, do this export CC=xlc export CXX=xlC ./configure --enable-threads=no Shared Libs =========== Because of the way that AIX builds its shared libs there are a couple of points to remember 1. All drivers need changing into .so The drivers will be build as a .a, containing a .so, BUT dlopen only is able to open a .so, so to fix this, for each driver that is needed, do the following (in this case the postgres driver). Go to the target lib directory cd /usr/local/lib extract the .so from the .a ar -x libodbcpsql.a This will create libodbcpsql.so.2 The same will need doing for the seyup libs ar -x libodbcpsqlS.a 2. Shared libs containing C++ are special This is only a issue with the libodbcinstQ.a lib that is opened by ODBCConfig. There are two things, first because libtool decides that shared libs ar lib*.a the code trys to load libodbcinstQ.a, and also we maye have to rebuild the lib using the IBM util makeC++SharedLib (the name gives its away :-) I have tried this with a current AIX, and it seems that all is needed is to extract the .so from the .a by running ar -x libodbcinstQ.a to get the .so If that doesn't help, or on older AIX's the following may need doing. After the make install is done, go into the odbcinstQ dir on thE build tree, and do the following makeC++SharedLib -p 0 -o libodbcinstQ.so.1.0 -L$QTDIR/lib -lqt -L$PREFIX/lib -lodbc -lodbcinst .libs/libodbcinstQ.lax/libodbcextraslc.al/strcasecmp.o *.o ../ini/*.lo where QTDIR is set to the top of the qt tree, so $QTDIR/lib will contain libqt.a and PREFIX is set to the unixODBC install tree, so $PREFIX/lib contains libodbc.a. Ignore any duplicate symbol warnings they are due to the same things being in libodbc.a and libodbcinst.a this will then build a libodbcinstQ.so.1.0, we can copy that to the target lib dir, and delete the existing lib, and link it (again replace $PREFIX with the correct path cp libodbcinstQ.so.1.0 $PREFIX/lib cd $PREFIX/lib rm libodbcinstQ.a ln -s libodbcinstQ.so.1.0 libodbcinstQ.a Then all should be OK with ODBCConfig Nick Gorham unixODBC-2.3.9/COPYING0000755000175000017500000005755712262474476011160 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS unixODBC-2.3.9/include/0000775000175000017500000000000013725127522011574 500000000000000unixODBC-2.3.9/include/sqlspi.h0000755000175000017500000001550712430425713013204 00000000000000/*----------------------------------------------------------------------------- File: sqlspi.h Contents: This is the header for driver writers to support new ODBC features. Application writers should not include this header file Please include and before including this file Based on the sqlspi.h provided by Microsoft -----------------------------------------------------------------------------*/ #ifndef __SQLSPI__ #define __SQLSPI__ #ifdef __cplusplus extern "C" { // Assume C declarations for C++ #endif // End of __cplusplus /* SQL_SPI is just a marker for "Service Provider Interface", otherwise it is the same as API Application should not call functions that are marked as SQL_SPI directly */ #define SQL_SPI SQL_API /*-------------------- ODBC Connection Info Handle -----------------------------*/ /* handle for storing connection information for ODBC driver connection pooling */ #define SQL_HANDLE_DBC_INFO_TOKEN 6 // Handle type, used in SQLAllocHandle typedef SQLHANDLE SQLHDBC_INFO_TOKEN; /*-------------------- ODBC Pool ID for driver-aware pooling -----------------------------*/ typedef SQLULEN POOLID; typedef DWORD* TRANSID; /*-------------------- Driver-aware Connection Pooling --------------------------*/ /* We define a few scores with special meaning */ /* But driver can return any score between 0 and 100 */ typedef DWORD SQLConnPoolRating; #define SQL_CONN_POOL_RATING_BEST 100 /* the best of the rating */ #define SQL_CONN_POOL_RATING_GOOD_ENOUGH 99 /* the rating is good enough and we can stop rating */ #define SQL_CONN_POOL_RATING_USELESS 0 /* the candidate connection must not be reused for the current request */ /* SQLSetConnectAttr */ #define SQL_ATTR_DBC_INFO_TOKEN 118 /* reset the pooled connection in case it is not a perfect match */ /* Set connection attributes into DBC info token */ SQLRETURN SQL_SPI SQLSetConnectAttrForDbcInfoW( SQLHDBC_INFO_TOKEN hDbcInfoToken, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength); /* Set connection information for SQLDriverConnect */ SQLRETURN SQL_SPI SQLSetDriverConnectInfoW( SQLHDBC_INFO_TOKEN hDbcInfoToken, SQLWCHAR *szConnStrIn, SQLSMALLINT cchConnStrIn); /* Set connection information for SQLConnect */ SQLRETURN SQL_SPI SQLSetConnectInfoW ( SQLHDBC_INFO_TOKEN hDbcInfoToken, SQLWCHAR *szDSN, SQLSMALLINT cchDSN, SQLWCHAR *szUID, SQLSMALLINT cchUID, SQLWCHAR *szAuthStr, SQLSMALLINT cchAuthStr ); /* Get the pool ID for the token */ SQLRETURN SQL_SPI SQLGetPoolID( SQLHDBC_INFO_TOKEN hDbcInfoToken, POOLID* pPoolID); /* Return how close hCandidateConnection matches with hRequest */ /* *pRating must be between SQL_CONN_POOL_RATING_USELESS and SQL_CONN_POOL_RATING_BEST (inclusively) */ /* If return value is not SQL_SUCCESS or *pRating > SQL_CONN_POOL_RATING_BEST, the candidate */ /* connection will not be used any more in any other connection request */ /* If fRequiresTransactionEnlistment is TRUE, transId represents the DTC transaction ID that */ /* should be enlisted to (transId == 0 means unenlistment). Otherwise, transId should be ignored */ SQLRETURN SQL_SPI SQLRateConnection( SQLHDBC_INFO_TOKEN hRequest, SQLHDBC hCandidateConnection, BOOL fRequiresTransactionEnlistment, TRANSID transId, SQLConnPoolRating *pRating); /* Create a physical connection */ /* If application is calling SQLDriverConnect, szConnStrOut is non-NULL at input. */ /* Otherwise, it will be set to NULL */ SQLRETURN SQL_SPI SQLPoolConnectW( SQLHDBC hdbc, SQLHDBC_INFO_TOKEN hDbcInfoToken, SQLWCHAR *szConnStrOut, SQLSMALLINT cchConnStrOutMax, SQLSMALLINT *pcchConnStrOut); /* Clean up a pool Id that was timed out */ /*/ poolID [in]: the pool ID (under EnvironmentHandle) to be cleaned */ SQLRETURN SQL_SPI SQLCleanupConnectionPoolID( SQLHENV EnvironmentHandle, POOLID poolID); /*-----------------------------------------------------------------------------*/ /* functions for ANSI drivers */ /* Set connection attributes into DBC info token */ SQLRETURN SQL_SPI SQLSetConnectAttrForDbcInfoA( SQLHDBC_INFO_TOKEN hDbcInfoToken, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength); /* Set connection information for SQLDriverConnect */ SQLRETURN SQL_SPI SQLSetDriverConnectInfoA( SQLHDBC_INFO_TOKEN hDbcInfoToken, SQLCHAR *szConnStrIn, SQLSMALLINT cchConnStrIn); /* Set connection information for SQLConnect */ SQLRETURN SQL_SPI SQLSetConnectInfoA ( SQLHDBC_INFO_TOKEN hDbcInfoToken, SQLCHAR *szDSN, SQLSMALLINT cchDSN, SQLCHAR *szUID, SQLSMALLINT cchUID, SQLCHAR *szAuthStr, SQLSMALLINT cchAuthStr ); /* Create a physical connection */ /* If application is calling SQLDriverConnect, szConnStrOut is non-NULL at input. */ /* Otherwise, it will be set to NULL */ SQLRETURN SQL_SPI SQLPoolConnectA( SQLHDBC hdbc, SQLHDBC_INFO_TOKEN hDbcInfoToken, SQLCHAR *szConnStrOut, SQLSMALLINT cchConnStrOutMax, SQLSMALLINT *pcchConnStrOut); /*-----------------------------------------------------------------------------*/ /* Unicode mapping */ /* Define SQL_NOUNICODEMAP to disable the mapping */ #if (!defined(SQL_NOUNICODEMAP) && defined(UNICODE)) #define SQLSetConnectAttrForDbcInfo SQLSetConnectAttrForDbcInfoW #define SQLSetDriverConnectInfo SQLSetDriverConnectInfoW #define SQLSetConnectInfo SQLSetConnectInfoW #define SQLPoolConnect SQLPoolConnectW #else #define SQLSetConnectAttrForDbcInfo SQLSetConnectAttrForDbcInfoA #define SQLSetDriverConnectInfo SQLSetDriverConnectInfoA #define SQLSetConnectInfo SQLSetConnectInfoA #define SQLPoolConnect SQLPoolConnectA #endif /*------------------------------------------------------------------------------*/ /*-------------------- Async Notification --------------------------*/ #if (ODBCVER >= 0x0380) #define SQL_ATTR_ASYNC_DBC_NOTIFICATION_CALLBACK 120 #define SQL_ATTR_ASYNC_DBC_NOTIFICATION_CONTEXT 121 #define SQL_ATTR_ASYNC_STMT_NOTIFICATION_CALLBACK 30 #define SQL_ATTR_ASYNC_STMT_NOTIFICATION_CONTEXT 31 typedef SQLRETURN (SQL_API *SQL_ASYNC_NOTIFICATION_CALLBACK)(SQLPOINTER pContext, BOOL fLast); #endif /* ODBCVER >= 0x0380 */ #ifdef __cplusplus } // End of extern "C" { #endif #endif unixODBC-2.3.9/include/odbcinstext.h0000644000175000017500000002560613724130672014221 00000000000000/************************************************** * odbcinstext.h * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #ifndef _ODBCINST_H #define _ODBCINST_H #ifdef UNIXODBC_SOURCE #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_PWD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #include #ifndef ODBCVER #define ODBCVER 0x0380 #endif #include #include #include /******************************************************** * CONSTANTS WHICH DO NOT EXIST ELSEWHERE ********************************************************/ #ifndef TRUE #define FALSE 0; #define TRUE 1; #endif #else /* not UNIXODBC_SOURCE */ /******************************************************** * outside the unixODBC source tree only the * * public interface is exposed * ********************************************************/ #include /******************************************************** * these limits are originally defined in ini.h * * but are needed to implement ODBCINSTGetProperties * * for the Driver Setup * ********************************************************/ #define INI_MAX_LINE 1000 #define INI_MAX_OBJECT_NAME INI_MAX_LINE #define INI_MAX_PROPERTY_NAME INI_MAX_LINE #define INI_MAX_PROPERTY_VALUE INI_MAX_LINE #endif /* UNIXODBC_SOURCE */ /******************************************************** * PUBLIC API ********************************************************/ #ifdef __cplusplus extern "C" { #endif BOOL INSTAPI SQLConfigDataSource( HWND hWnd, WORD nRequest, LPCSTR pszDriver, LPCSTR pszAttributes ); BOOL INSTAPI SQLGetConfigMode( UWORD *pnConfigMode ); BOOL INSTAPI SQLGetInstalledDrivers( LPSTR pszBuf, WORD nBufMax, WORD *pnBufOut ); BOOL INSTAPI SQLInstallDriverEx( LPCSTR pszDriver, LPCSTR pszPathIn, LPSTR pszPathOut, WORD nPathOutMax, WORD *nPathOut, WORD nRequest, LPDWORD pnUsageCount ); BOOL INSTAPI SQLInstallDriverManager( LPSTR pszPath, WORD nPathMax, WORD *pnPathOut ); RETCODE INSTAPI SQLInstallerError( WORD nError, DWORD *pnErrorCode, LPSTR pszErrorMsg, WORD nErrorMsgMax, WORD *nErrorMsg ); BOOL INSTAPI SQLManageDataSources( HWND hWnd ); BOOL INSTAPI SQLReadFileDSN( LPCSTR pszFileName, LPCSTR pszAppName, LPCSTR pszKeyName, LPSTR pszString, WORD nString, WORD *pnString ); BOOL INSTAPI SQLRemoveDriver( LPCSTR pszDriver, BOOL nRemoveDSN, LPDWORD pnUsageCount ); BOOL INSTAPI SQLRemoveDriverManager( LPDWORD pnUsageCount ); BOOL INSTAPI SQLRemoveDSNFromIni( LPCSTR pszDSN ); BOOL INSTAPI SQLRemoveTranslator( LPCSTR pszTranslator, LPDWORD pnUsageCount ); BOOL INSTAPI SQLSetConfigMode( UWORD nConfigMode ); BOOL INSTAPI SQLValidDSN( LPCSTR pszDSN ); BOOL INSTAPI SQLWriteDSNToIni( LPCSTR pszDSN, LPCSTR pszDriver ); BOOL INSTAPI SQLWriteFileDSN( LPCSTR pszFileName, LPCSTR pszAppName, LPCSTR pszKeyName, LPCSTR pszString ); BOOL INSTAPI SQLWritePrivateProfileString( LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszString, LPCSTR pszFileName ); #ifdef __cplusplus } #endif #ifdef UNIXODBC_SOURCE /******************************************************** * PRIVATE API ********************************************************/ #if defined(__cplusplus) extern "C" { #endif BOOL _odbcinst_UserINI( char *pszFileName, BOOL bVerify ); BOOL _odbcinst_SystemINI( char *pszFileName, BOOL bVerify ); BOOL _odbcinst_FileINI( char *pszPath ); char * INSTAPI odbcinst_system_file_path( char *buffer ); char * INSTAPI odbcinst_system_file_name( char *buffer ); char * INSTAPI odbcinst_user_file_path( char *buffer ); char * INSTAPI odbcinst_user_file_name( char *buffer ); BOOL _odbcinst_ConfigModeINI( char *pszFileName ); int _odbcinst_GetSections( HINI hIni, LPSTR pRetBuffer, int nRetBuffer, int *pnBufPos ); int _odbcinst_GetEntries( HINI hIni, LPCSTR pszSection, LPSTR pRetBuffer, int nRetBuffer, int *pnBufPos ); int _SQLGetInstalledDrivers( LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPCSTR pRetBuffer, int nRetBuffer ); BOOL _SQLWriteInstalledDrivers( LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszString ); BOOL _SQLDriverConnectPrompt( HWND hwnd, SQLCHAR *dsn, SQLSMALLINT len_dsn ); BOOL _SQLDriverConnectPromptW( HWND hwnd, SQLWCHAR *dsn, SQLSMALLINT len_dsn ); void __set_config_mode( int mode ); int __get_config_mode( void ); int inst_logPushMsg( char *pszModule, char *pszFunctionName, int nLine, int nSeverity, int nCode, char *pszMessage ); int inst_logPeekMsg( long nMsg, HLOGMSG *phMsg ); int inst_logClear(); /* * we should look at caching this info, the calls can become expensive */ #ifndef DISABLE_INI_CACHING struct ini_cache { char *fname; char *section; char *entry; char *value; char *default_value; int buffer_size; int ret_value; int config_mode; long timestamp; struct ini_cache *next; }; #endif #ifdef __cplusplus } #endif #endif /* UNIXODBC_SOURCE */ /********************************* * ODBCINST - PROPERTIES ********************************* * * PURPOSE: * * To provide the caller a mechanism to interact with Data Source properties * containing Driver specific options while avoiding embedding GUI code in * the ODBC infrastructure. * * DETAILS: * * 1. Application calls libodbcinst.ODBCINSTConstructProperties() * - odbcinst will load the driver and call libMyDrvS.ODBCINSTGetProperties() to build a list of all possible properties * 2. Application calls libodbcinst.ODBCINSTSetProperty() * - use, as required, to init values (ie if configuring existing DataSource) * - use libodbcinst.SetConfigMode() & libodbcinst.SQLGetPrivateProfileString() to read existing Data Source info (do not forget to set the mode back) * - do not forget to set mode back to ODBC_BOTH_DSN using SetConfigMode() when done reading * - no call to Driver Setup * 3. Application calls libodbcinst.ODBCINSTValidateProperty() * - use as required (ie on leave widget event) * - an assesment of the entire property list is also done * - this is passed onto the driver setup DLL * 4. Application should refresh widgets in case aPromptData or szValue has changed * - refresh should occur for each property where bRefresh = 1 * 5. Application calls libodbcinst.ODBCINSTValidateProperties() * - call this just before saving new Data Source or updating existing Data Source * - should always call this before saving * - use libodbcinst.SetConfigMode() & libodbcinst.SQLWritePrivateProfileString() to save Data Source info * - do not forget to set mode back to ODBC_BOTH_DSN using SetConfigMode() when done saving * - this is passed onto the driver setup DLL * 6. Application calls ODBCINSTDestructProperties() to free up memory * - unload Driver Setup DLL * - frees memory (Driver Setup allocates most of the memory but we free ALL of it in odbcinst) * * NOTES * * 1. odbcinst implements 5 functions to support this GUI config stuff * 2. Driver Setup DLL implements just 3 functions for its share of the work * *********************************/ #define ODBCINST_SUCCESS 0 #define ODBCINST_WARNING 1 #define ODBCINST_ERROR 2 #define ODBCINST_PROMPTTYPE_LABEL 0 /* readonly */ #define ODBCINST_PROMPTTYPE_TEXTEDIT 1 #define ODBCINST_PROMPTTYPE_LISTBOX 2 #define ODBCINST_PROMPTTYPE_COMBOBOX 3 #define ODBCINST_PROMPTTYPE_FILENAME 4 #define ODBCINST_PROMPTTYPE_HIDDEN 5 #define ODBCINST_PROMPTTYPE_TEXTEDIT_PASSWORD 6 typedef struct tODBCINSTPROPERTY { struct tODBCINSTPROPERTY *pNext; /* pointer to next property, NULL if last property */ char szName[INI_MAX_PROPERTY_NAME+1]; /* property name */ char szValue[INI_MAX_PROPERTY_VALUE+1]; /* property value */ int nPromptType; /* PROMPTTYPE_TEXTEDIT, PROMPTTYPE_LISTBOX, PROMPTTYPE_COMBOBOX, PROMPTTYPE_FILENAME */ char **aPromptData; /* array of pointers terminated with a NULL value in array. */ char *pszHelp; /* help on this property (driver setups should keep it short) */ void *pWidget; /* CALLER CAN STORE A POINTER TO ? HERE */ int bRefresh; /* app should refresh widget ie Driver Setup has changed aPromptData or szValue */ void *hDLL; /* for odbcinst internal use... only first property has valid one */ } ODBCINSTPROPERTY, *HODBCINSTPROPERTY; /* * Plugin name */ #define ODBCINSTPLUGIN "odbcinstQ5" /* * Conversion routines for wide interface */ char* _multi_string_alloc_and_copy( LPCWSTR in ); char* _single_string_alloc_and_copy( LPCWSTR in ); void _single_string_copy_to_wide( SQLWCHAR *out, LPCSTR in, int len ); void _multi_string_copy_to_wide( SQLWCHAR *out, LPCSTR in, int len ); void _single_copy_to_wide( SQLWCHAR *out, LPCSTR in, int len ); SQLWCHAR* _multi_string_alloc_and_expand( LPCSTR in ); SQLWCHAR* _single_string_alloc_and_expand( LPCSTR in ); void _single_copy_from_wide( SQLCHAR *out, LPCWSTR in, int len ); int _multi_string_length( LPCSTR in ); /* * To support finding UI plugin */ char *_getUIPluginName( char *pszName, char *pszUI ); char *_appendUIPluginExtension( char *pszNameAndExtension, char *pszName ); char *_prependUIPluginPath( char *pszPathAndName, char *pszName ); #if defined(__cplusplus) extern "C" { #endif /* ONLY IMPLEMENTED IN ODBCINST (not in Driver Setup) */ int INSTAPI ODBCINSTConstructProperties( char *szDriver, HODBCINSTPROPERTY *hFirstProperty ); int INSTAPI ODBCINSTSetProperty( HODBCINSTPROPERTY hFirstProperty, char *pszProperty, char *pszValue ); int INSTAPI ODBCINSTDestructProperties( HODBCINSTPROPERTY *hFirstProperty ); int INSTAPI ODBCINSTAddProperty( HODBCINSTPROPERTY hFirstProperty, char *pszProperty, char *pszValue ); /* IMPLEMENTED IN ODBCINST AND DRIVER SETUP */ int INSTAPI ODBCINSTValidateProperty( HODBCINSTPROPERTY hFirstProperty, char *pszProperty, char *pszMessage ); int INSTAPI ODBCINSTValidateProperties( HODBCINSTPROPERTY hFirstProperty, HODBCINSTPROPERTY hBadProperty, char *pszMessage ); /* ONLY IMPLEMENTED IN DRIVER SETUP (not in ODBCINST) */ int INSTAPI ODBCINSTGetProperties( HODBCINSTPROPERTY hFirstProperty ); #if defined(__cplusplus) } #endif #endif unixODBC-2.3.9/include/odbctrac.h0000755000175000017500000000646712262474476013474 00000000000000/*! * \file * * \author Peter Harvey www.peterharvey.org * \author \sa AUTHORS file * \version 1 * \date 2007 * \license Copyright unixODBC Project 2007-2008, LGPL */ /*! * \mainpage ODBC Trace PlugIn * * \section intro_sec Introduction * * This library provides a Driver with a cross-platform (including MS Windows) means of producing trace output. * This may also be used by Driver Managers. This is compat. with MS approach but not the same. * * This concept is based upon the MS odbctrac method of producing ODBC trace output. The main principle of this * is that the trace library can be swapped out with a custom trace library allowing the trace output to be * tailored to an organizations needs. It also allows trace code to be shared among Drivers and even the * Driver Manager. * * This library differs from the MS implementation in some significant ways. * * - all TraceSQL* functions return SQLPOINTER for call context... not SQLRETURN (this improves perf.) * - TraceReturn accepts an SQLPOINTER for call context... not SQLRETURN (this improves perf.) * - all functions accept SQLPOINTER as first arg - a trace handle (this can reduce concurrency issues) * * A notable weakness over MS odbctrac is the fact that we work with a HTRACE and that a Driver will want to * maintain this within environment and connection handles. This means that we can not produce trace output * for case when the environment/connection (whichever is relevant for the call) handle is invalid. This weakness * is offset by our ability to reduce conccurency issues and provide more options with regard to the granularity * of the tracing (environment/driver scope or connection/dsn scope for example). The driver can, at the developers * option, make a global HTRACE and thereby allow trace output even when the ODBC handles are invalid - but * this is not recommended. * * If an application is getting back an SQL_INVALID_HANDLE and no trace... then we can pretty much assume that * the application is providing an invalid handle :) * * unixODBC provides a cross-platform (including MS platforms) helper library called 'trace'. This is the * recommended method to use tracing. The text file driver (odbctxt) included with unixODBC demonstrates * how to use the 'trace' helper library. * * Why create a custom trace plugin? Here are a few possible reasons; * * - produce trace output showing a hierarchy (tree view) of calls * - allow config to limit or filter trace output * - allow trace output to be provided to some sort of UI like an IDE via shared mem or other * - allow trace output to be provided to remote machine via RPC or whatever * - produce trace output in XML * - produce trace output in a manner which can allow the calls to be played back (ie to reproduce bug * in a closed source app) */ #ifndef ODBCTRAC_H #define ODBCTRAC_H #include #include #include #endif unixODBC-2.3.9/include/uodbc_stats.h0000755000175000017500000000503612262474476014214 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: uodbc_stats.h,v 1.1.1.1 2001/10/17 16:40:28 lurcher Exp $ * * $Log: uodbc_stats.h,v $ * Revision 1.1.1.1 2001/10/17 16:40:28 lurcher * * First upload to SourceForge * * Revision 1.2 2000/12/19 07:28:45 pharvey * - added first pass at Stats page content * - wrapped public stats functions for C++ * * Revision 1.1 2000/12/18 11:54:22 martin * * handle statistic API. * * **********************************************************************/ #ifndef UODBC__stats_h #define UODBC__stats_h 1 #include #include typedef struct uodbc_stats_retentry { unsigned long type; /* type of statistic */ # define UODBC_STAT_STRING 1 # define UODBC_STAT_LONG 2 union { char s_value[256]; /* string type */ long l_value; /* number type */ } value; char name[32]; /* name of statistic */ } uodbc_stats_retentry; #if defined(__cplusplus) extern "C" { #endif int uodbc_open_stats(void **rh, unsigned int mode); #define UODBC_STATS_READ 0x1 #define UODBC_STATS_WRITE 0x2 int uodbc_close_stats(void *rh); int uodbc_get_stats(void *h, pid_t request_pid, uodbc_stats_retentry *s, int n_stats); char *uodbc_stats_error(char *buf, size_t buflen); #if defined(__cplusplus) } #endif #endif /* UODBC__stats_h */ unixODBC-2.3.9/include/sqltypes.h0000644000175000017500000002607513217426706013563 00000000000000/************************************************************* * sqltypes.h * * This is the lowest level include in unixODBC. It defines * the basic types required by unixODBC and is heavily based * upon the MS include of the same name (it has to be for * binary compatability between drivers developed under different * packages). * * You can include this file directly, but it is almost always * included indirectly, by including, for example sqlext.h * * This include makes no effort to be useful on any platforms other * than Linux (with some exceptions for UNIX in general). * * !!!DO NOT CONTAMINATE THIS FILE WITH NON-Linux CODE!!! * *************************************************************/ #ifndef __SQLTYPES_H #define __SQLTYPES_H /**************************** * default to the 3.80 definitions. should define ODBCVER before here if you want an older set of defines ***************************/ #ifndef ODBCVER #define ODBCVER 0x0380 #endif /* * if this is set, then use a 4 byte unicode definition, instead of the 2 byte definition that MS use */ #ifdef SQL_WCHART_CONVERT /* * Use this if you want to use the C/C++ portable definition of a wide char, wchar_t * Microsoft hardcoded a definition of unsigned short which may not be compatible with * your platform specific wide char definition. */ #include #endif #ifdef __cplusplus extern "C" { #endif /* * this is defined by configure, but will not be on a normal application build * the install creates a unixodbc_conf.h file that contains the current build settings */ #ifndef SIZEOF_LONG_INT #include "unixodbc_conf.h" #endif #ifndef SIZEOF_LONG_INT #error "Needs to know how big a long int is to continue!!!" #endif /**************************** * These make up for having no windows.h ***************************/ #ifndef ALREADY_HAVE_WINDOWS_TYPE #define FAR #define CALLBACK #ifdef __OS2__ #define SQL_API _System #else #define SQL_API #endif #define BOOL int #ifndef _WINDOWS_ typedef void* HWND; #endif typedef char CHAR; #ifdef UNICODE /* * NOTE: The Microsoft unicode define is only for apps that want to use TCHARs and * be able to compile for both unicode and non-unicode with the same source. * This is not recommended for linux applications and is not supported * by the standard linux string header files. */ #ifdef SQL_WCHART_CONVERT typedef wchar_t TCHAR; #else typedef signed short TCHAR; #endif #else typedef char TCHAR; #endif typedef unsigned short WORD; #if (SIZEOF_LONG_INT == 4) typedef unsigned long DWORD; #else typedef unsigned int DWORD; #endif typedef unsigned char BYTE; #ifdef SQL_WCHART_CONVERT typedef wchar_t WCHAR; #else typedef unsigned short WCHAR; #endif typedef WCHAR* LPWSTR; typedef const char* LPCSTR; typedef const WCHAR* LPCWSTR; typedef TCHAR* LPTSTR; typedef char* LPSTR; typedef DWORD* LPDWORD; #ifndef _WINDOWS_ typedef void* HINSTANCE; #endif #endif /**************************** * standard SQL* data types. use these as much as possible when using ODBC calls/vars ***************************/ typedef unsigned char SQLCHAR; #if (ODBCVER >= 0x0300) typedef unsigned char SQLDATE; typedef unsigned char SQLDECIMAL; typedef double SQLDOUBLE; typedef double SQLFLOAT; #endif /* * can't use a long; it fails on 64 platforms */ /* * Hopefully by now it should be safe to assume most drivers know about SQLLEN now * and the default is now sizeof( SQLLEN ) = 8 on 64 bit platforms * */ #if (SIZEOF_LONG_INT == 8) #ifdef BUILD_LEGACY_64_BIT_MODE typedef int SQLINTEGER; typedef unsigned int SQLUINTEGER; #define SQLLEN SQLINTEGER #define SQLULEN SQLUINTEGER #define SQLSETPOSIROW SQLUSMALLINT /* * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril * typedef SQLULEN SQLROWCOUNT; typedef SQLULEN SQLROWSETSIZE; typedef SQLULEN SQLTRANSID; typedef SQLLEN SQLROWOFFSET; */ #else typedef int SQLINTEGER; typedef unsigned int SQLUINTEGER; typedef long SQLLEN; typedef unsigned long SQLULEN; typedef unsigned long SQLSETPOSIROW; /* * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril * typedef SQLULEN SQLTRANSID; typedef SQLULEN SQLROWCOUNT; typedef SQLUINTEGER SQLROWSETSIZE; typedef SQLLEN SQLROWOFFSET; */ #endif #else typedef long SQLINTEGER; typedef unsigned long SQLUINTEGER; /* Handle case of building on mingw-w64 */ #ifdef _WIN64 typedef long long SQLLEN; typedef unsigned long long SQLULEN; typedef unsigned long long SQLSETPOSIROW; #else #define SQLLEN SQLINTEGER #define SQLULEN SQLUINTEGER #define SQLSETPOSIROW SQLUSMALLINT #endif typedef SQLULEN SQLROWCOUNT; typedef SQLULEN SQLROWSETSIZE; typedef SQLULEN SQLTRANSID; typedef SQLLEN SQLROWOFFSET; #endif #if (ODBCVER >= 0x0300) typedef unsigned char SQLNUMERIC; #endif typedef void * SQLPOINTER; #if (ODBCVER >= 0x0300) typedef float SQLREAL; #endif typedef signed short int SQLSMALLINT; typedef unsigned short SQLUSMALLINT; #if (ODBCVER >= 0x0300) typedef unsigned char SQLTIME; typedef unsigned char SQLTIMESTAMP; typedef unsigned char SQLVARCHAR; #endif typedef SQLSMALLINT SQLRETURN; #if (ODBCVER >= 0x0300) typedef void * SQLHANDLE; typedef SQLHANDLE SQLHENV; typedef SQLHANDLE SQLHDBC; typedef SQLHANDLE SQLHSTMT; typedef SQLHANDLE SQLHDESC; #else typedef void * SQLHENV; typedef void * SQLHDBC; typedef void * SQLHSTMT; /* * some things like PHP won't build without this */ typedef void * SQLHANDLE; #endif /**************************** * These are cast into the actual struct that is being passed around. The * DriverManager knows what its structs look like and the Driver knows about its * structs... the app knows nothing about them... just void* * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT ***************************/ #if (ODBCVER >= 0x0300) typedef SQLHANDLE HENV; typedef SQLHANDLE HDBC; typedef SQLHANDLE HSTMT; #else typedef void * HENV; typedef void * HDBC; typedef void * HSTMT; #endif /**************************** * more basic data types to augment what windows.h provides ***************************/ #ifndef ALREADY_HAVE_WINDOWS_TYPE typedef unsigned char UCHAR; typedef signed char SCHAR; typedef SCHAR SQLSCHAR; #if (SIZEOF_LONG_INT == 4) typedef long int SDWORD; typedef unsigned long int UDWORD; #else typedef int SDWORD; typedef unsigned int UDWORD; #endif typedef signed short int SWORD; typedef unsigned short int UWORD; typedef unsigned int UINT; typedef signed long SLONG; typedef signed short SSHORT; typedef unsigned long ULONG; typedef unsigned short USHORT; typedef double SDOUBLE; typedef double LDOUBLE; typedef float SFLOAT; typedef void* PTR; typedef signed short RETCODE; typedef void* SQLHWND; #endif /**************************** * standard structs for working with date/times ***************************/ #ifndef __SQLDATE #define __SQLDATE typedef struct tagDATE_STRUCT { SQLSMALLINT year; SQLUSMALLINT month; SQLUSMALLINT day; } DATE_STRUCT; #if (ODBCVER >= 0x0300) typedef DATE_STRUCT SQL_DATE_STRUCT; #endif typedef struct tagTIME_STRUCT { SQLUSMALLINT hour; SQLUSMALLINT minute; SQLUSMALLINT second; } TIME_STRUCT; #if (ODBCVER >= 0x0300) typedef TIME_STRUCT SQL_TIME_STRUCT; #endif typedef struct tagTIMESTAMP_STRUCT { SQLSMALLINT year; SQLUSMALLINT month; SQLUSMALLINT day; SQLUSMALLINT hour; SQLUSMALLINT minute; SQLUSMALLINT second; SQLUINTEGER fraction; } TIMESTAMP_STRUCT; #if (ODBCVER >= 0x0300) typedef TIMESTAMP_STRUCT SQL_TIMESTAMP_STRUCT; #endif #if (ODBCVER >= 0x0300) typedef enum { SQL_IS_YEAR = 1, SQL_IS_MONTH = 2, SQL_IS_DAY = 3, SQL_IS_HOUR = 4, SQL_IS_MINUTE = 5, SQL_IS_SECOND = 6, SQL_IS_YEAR_TO_MONTH = 7, SQL_IS_DAY_TO_HOUR = 8, SQL_IS_DAY_TO_MINUTE = 9, SQL_IS_DAY_TO_SECOND = 10, SQL_IS_HOUR_TO_MINUTE = 11, SQL_IS_HOUR_TO_SECOND = 12, SQL_IS_MINUTE_TO_SECOND = 13 } SQLINTERVAL; #endif #if (ODBCVER >= 0x0300) typedef struct tagSQL_YEAR_MONTH { SQLUINTEGER year; SQLUINTEGER month; } SQL_YEAR_MONTH_STRUCT; typedef struct tagSQL_DAY_SECOND { SQLUINTEGER day; SQLUINTEGER hour; SQLUINTEGER minute; SQLUINTEGER second; SQLUINTEGER fraction; } SQL_DAY_SECOND_STRUCT; typedef struct tagSQL_INTERVAL_STRUCT { SQLINTERVAL interval_type; SQLSMALLINT interval_sign; union { SQL_YEAR_MONTH_STRUCT year_month; SQL_DAY_SECOND_STRUCT day_second; } intval; } SQL_INTERVAL_STRUCT; #endif #endif /**************************** * ***************************/ #ifndef ODBCINT64 # if (ODBCVER >= 0x0300) # if (SIZEOF_LONG_INT == 8) # define ODBCINT64 long # define UODBCINT64 unsigned long # define ODBCINT64_TYPE "long" # define UODBCINT64_TYPE "unsigned long" # else # ifdef HAVE_LONG_LONG # define ODBCINT64 long long # define UODBCINT64 unsigned long long # define ODBCINT64_TYPE "long long" # define UODBCINT64_TYPE "unsigned long long" # else /* * may fail in some cases, but what else can we do ? */ struct __bigint_struct { int hiword; unsigned int loword; }; struct __bigint_struct_u { unsigned int hiword; unsigned int loword; }; # define ODBCINT64 struct __bigint_struct # define UODBCINT64 struct __bigint_struct_u # define ODBCINT64_TYPE "struct __bigint_struct" # define UODBCINT64_TYPE "struct __bigint_struct_u" # endif # endif #endif #endif #ifdef ODBCINT64 typedef ODBCINT64 SQLBIGINT; #endif #ifdef UODBCINT64 typedef UODBCINT64 SQLUBIGINT; #endif /**************************** * cursor and bookmark ***************************/ #if (ODBCVER >= 0x0300) #define SQL_MAX_NUMERIC_LEN 16 typedef struct tagSQL_NUMERIC_STRUCT { SQLCHAR precision; SQLSCHAR scale; SQLCHAR sign; /* 1=pos 0=neg */ SQLCHAR val[SQL_MAX_NUMERIC_LEN]; } SQL_NUMERIC_STRUCT; #endif #if (ODBCVER >= 0x0350) #ifdef GUID_DEFINED #ifndef ALREADY_HAVE_WINDOWS_TYPE typedef GUID SQLGUID; #else typedef struct tagSQLGUID { DWORD Data1; WORD Data2; WORD Data3; BYTE Data4[ 8 ]; } SQLGUID; #endif #else typedef struct tagSQLGUID { DWORD Data1; WORD Data2; WORD Data3; BYTE Data4[ 8 ]; } SQLGUID; #endif #endif typedef SQLULEN BOOKMARK; typedef WCHAR SQLWCHAR; #ifdef UNICODE typedef SQLWCHAR SQLTCHAR; #else typedef SQLCHAR SQLTCHAR; #endif #ifdef __cplusplus } #endif #endif unixODBC-2.3.9/include/uodbc_extras.h0000755000175000017500000000437512262474476014371 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Further modified and extend by Eric Sharkey * (sharkey@netrics.com). * * Any bugs or problems should be considered the fault of Nick or * Eric and not Peter. * * copyright (c) 2005 Eric Sharkey * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: uodbc_extras.h,v 1.1 2005/03/04 20:08:45 sharkey Exp $ * **********************************************************************/ #ifndef UODBC__extras_h #define UODBC__extras_h 1 #if defined(HAVE_STDARG_H) # include # define HAVE_STDARGS #else # if defined(HAVE_VARARGS_H) # include # ifdef HAVE_STDARGS # undef HAVE_STDARGS # endif # endif #endif #if defined(__cplusplus) extern "C" { #endif extern int uodbc_vsnprintf (char *str, size_t count, const char *fmt, va_list args); #ifdef HAVE_STDARGS int uodbc_snprintf (char *str,size_t count,const char *fmt,...); #else int uodbc_snprintf (va_alist) va_dcl; #endif #ifndef HAVE_SNPRINTF #define snprintf uodbc_snprintf #endif #ifndef HAVE_VSNPRINTF #define vsnprintf uodbc_vsnprintf #endif #ifndef HAVE_STRCASECMP extern int strcasecmp( const char *s1, const char * s2 ); #endif #ifndef HAVE_STRNCASECMP extern int strncasecmp (const char *s1, const char *s2, int n ); #endif #if defined(__cplusplus) } #endif #endif /* UODBC__extras_h */ unixODBC-2.3.9/include/autotest.h0000755000175000017500000001406612262474476013555 00000000000000/*! * \file * * This file contains constants and prototypes required to compile an * Auto Test library/plugin. This is used by the unixODBC-Test and * unixODBC-GUI-Qt projects. * * \note * * The contents of this file must be consistent with MS version so as to * maintain source code portability. This should allow (for example) * Auto Tests to be compiled for all platforms without source changes. * */ #ifndef AUTOTEST_H #define AUTOTEST_H /* standard C stuff... */ #include #include /* platform specific... */ #ifdef _WINDOWS #include #endif /* standard ODBC stuff... */ #include #include #include #ifdef __cplusplus extern "C" { #endif #ifndef WIN32 #ifdef PATH_MAX #define _MAX_PATH PATH_MAX #else #define _MAX_PATH 256 #endif #endif extern HINSTANCE hLoadedInst; /*---------------------------------------------------------------------------------- Defines and Macros ----------------------------------------------------------------------------------*/ #define TEST_ABORTED (-1) #define AUTO_MAX_TEST_NAME 35 #define AUTO_MAX_TESTCASE_NAME 35 #define AUTO_MAX_TESTDESC_NAME 75 #define MAXFLUSH 300 #define MAX_USER_INFO 50 #define MAX_KEYWORD_LEN 149 /* */ #ifdef WIN32 #define EXTFUNCDECL _stdcall #define EXTFUN _stdcall #define MY_EXPORT __declspec(dllexport) #else #define EXTFUNCDECL #define EXTFUN #define MY_EXPORT #endif #define InitTest(lps) \ { lps->cErrors=0; } #define AbortTest(lps) \ { lps->cErrors=TEST_ABORTED; } #define AllocateMemory(cb) (calloc(cb,1)) #define ReleaseMemory(lp) (free(lp)) #define NumItems(s) (sizeof(s) / sizeof(s[0])) /* Following will access bit number pos in a bit array and return */ /* TRUE if it is set, FALSE if it is not */ #define CQBITS (sizeof(unsigned int) * 8) #define getqbit(lpa, pos) \ (lpa[((pos) / CQBITS)] & (1 << ((pos) - (CQBITS * ((pos) / CQBITS))))) #define GETBIT(p1,p2) getqbit(p1,(p2)-1) /* * Message box defines */ #ifndef WIN32 #define MB_OK (0x0000) #define MB_ABORTRETRYIGNORE (0x0001) #define MB_OKCANCEL (0x0002) #define MB_RETRYCANCEL (0x0003) #define MB_YESNO (0x0004) #define MB_YESNOCANCEL (0x0005) #define MB_ICONEXCLAMATION (0x0000) #define MB_ICONWARNING MB_ICONEXCLAMATION #define MB_ICONINFORMATION (0x0010) #define MB_ICONASTERISK MB_ICONINFORMATION #define MB_ICONQUESTION (0x0020) #define MB_ICONSTOP (0x0030) #define MB_ICONERROR MB_ICONSTOP #define MB_ICONHAND MB_ICONSTOP #define MB_DEFBUTTON1 (0x0000) #define MB_DEFBUTTON2 (0x0100) #define MB_DEFBUTTON3 (0x0200) #define MB_DEFBUTTON4 (0x0300) #define MB_APPMODAL (0x0000) #define MB_SYSTEMMODAL (0x1000) #define MB_TASKMODAL (0x2000) #define MB_DEFAULT_DESKTOP_ONLY (0x0000) #define MB_HELP (0x0000) #define MB_RIGHT (0x0000) #define MB_RTLREADING (0x0000) #define MB_SETFOREGROUND (0x0000) #define MB_TOPMOST (0x0000) #define MB_SERVICE_NOTIFICATION (0x0000) #define MB_SERVICE_NOTIFICATION_NT3X (0x0000) #endif /*! This structure contains the information found in the .INI file for a data source. The filled out structure is in turn passed to AutoTestFunc to drive the individual tests. */ typedef struct tagSERVERINFO { HWND hwnd; /* Output edit window */ CHAR szLogFile[_MAX_PATH]; /* Output log file */ HENV henv; /* .EXE's henv */ HDBC hdbc; /* .EXE's hdbc */ HSTMT hstmt; /* .EXE's hstmt */ /* The following items are gathered from the .INI file and may be defined */ /* via the "Manage Test Sources" menu item from ODBC Test */ CHAR szSource[SQL_MAX_DSN_LENGTH+1]; CHAR szValidServer0[SQL_MAX_DSN_LENGTH+1]; CHAR szValidLogin0[MAX_USER_INFO+1]; CHAR szValidPassword0[MAX_USER_INFO+1]; CHAR szKeywords[MAX_KEYWORD_LEN+1]; /* Following are used for run-time */ UINT FAR * rglMask; /* Run test mask */ int failed; /* Track failures on a test case basis */ int cErrors; /* Count of errors */ BOOL fDebug; /* TRUE if debugging is to be enabled */ BOOL fScreen; /* TRUE if test output goes to screen */ BOOL fLog; /* TRUE if test output goes to log */ BOOL fIsolate; /* TRUE to isolate output */ UDWORD vCursorLib; /* Value for SQL_ODBC_CURSOR on SQLSetConnectOption */ HINSTANCE hLoadedInst; /* Instance handle of loaded test */ /* Following are used for buffering output to edit window */ CHAR szBuff[MAXFLUSH]; /* Hold temporary results */ UINT cBuff; /* Number of TCHARs in szBuff */ } SERVERINFO; typedef SERVERINFO FAR * lpSERVERINFO; BOOL EXTFUNCDECL FAR szLogPrintf(lpSERVERINFO lps, BOOL fForce, LPTSTR szFmt, ...); int EXTFUNCDECL FAR szMessageBox(HWND hwnd, UINT style, LPTSTR szTitle, LPTSTR szFmt, ...); LPTSTR EXTFUN GetRCString(HINSTANCE hInst, LPTSTR buf, int cbbuf, UINT ids); #ifdef __cplusplus } #endif #endif unixODBC-2.3.9/include/lst.h0000755000175000017500000002325312262474476012505 00000000000000/********************************************************************************** * lst.h * * lib for creating/managing/deleting doubly-linked lists. * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 04.APR.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #ifndef INCLUDED_LST_H #define INCLUDED_LST_H /*********[ CONSTANTS AND TYPES ]**************************************************/ #include #include #include #include #ifndef true #define true 1 #endif #ifndef false #define false 0 #endif #define LST_NO_DATA 2 #define LST_SUCCESS 1 #define LST_ERROR 0 /******************************************** * tLSTITEM * ********************************************/ typedef struct tLSTITEM { struct tLSTITEM *pNext; struct tLSTITEM *pPrev; int bDelete; /* true if flagged for delete. do delete when refs = 0 */ /* will become invisible for new cursors */ /* ONLY APPLIES TO THE root LIST */ int bHide; /* used in nav funcs if HLST bShowHidden=false (default) */ long nRefs; /* the number of hItems that refer to this item to get pData */ /* if bDelete and refs = 0 then item is really removed */ void *hLst; /* ptr to its list handle. */ void *pData; /* ptr to user data or (if Cursor item) ptr to some base LSTITEM */ } LSTITEM, *HLSTITEM; /******************************************** * tLST * ********************************************/ typedef struct tLST { HLSTITEM hFirst; HLSTITEM hLast; HLSTITEM hCurrent; long nItems; /* number of items in the list (not counting where bDelete or bHide)*/ /* !!! not used anymore !!!! */ long nRefs; /* the number of cursors that are based upon this list */ int bExclusive; /* set this for exclusive access to list ie when navigating with */ /* hCurrent or when doing an insert or delete */ /* do this only for VERY short periods all other access will loop */ /* until this is set back to false */ /* THIS IS FOR INTERNAL USE... IT IS USED WHEN MAINTAINING INTERNAL */ /* LISTS SUCH AS REFERENCE LISTS DO NOT USE IT TO LOCK A ROOT OR */ /* CURSOR LIST */ int bShowHidden; /* true to have nav funcs show bHidden items(default=false) */ int bShowDeleted; /* true to have nav funcs show bDeleted items (default=false) */ void (*pFree)( void *pData ); /* function to use when need to free pData. default is free() */ int (*pFilter)( struct tLST *, void * ); /* this function returns true if we want the data in our result set */ /* default is all items included. no affect if root list */ struct tLST *hLstBase; /* this list was derived from hLstBase. NULL if root list. */ /* we must use this if we are adding a new item in an empty list */ /* and to dec nRefs in our base list */ void *pExtras; /* app can store what ever it wants here. no attempt to interpret it*/ /* or to free it is made by lst */ } LST, *HLST; /******************************************** * tLSTBOOKMARK * ********************************************/ typedef struct tLSTBOOKMARK { HLST hLst; HLSTITEM hCurrent; } LSTBOOKMARK, *HLSTBOOKMARK; #if defined(__cplusplus) extern "C" { #endif /*********[ PRIMARY INTERFACE ]*****************************************************/ /****************************** * lstAppend * * 1. Appends a new item to the end of the list. * 2. Makes the new item the current item. ******************************/ int lstAppend( HLST hLst, void *pData ); /****************************** * lstClose * * 1. free memory previously allocated for HLST * 2. Will call lstDelete with bFreeData for each (if any) * existing items. ******************************/ int lstClose( HLST hLst ); /****************************** * lstDelete * * 1. deletes current item * 2. dec ref count in root item * 3. deletes root item if ref count < 1 OR sets delete flag ******************************/ int lstDelete( HLST hLst ); /****************************** * lstEOL * ******************************/ int lstEOL( HLST hLst ); /****************************** * lstFirst * * 1. makes First item the current item. * 2. returns pData or NULL ******************************/ void *lstFirst( HLST hLst ); /****************************** * lstGet * * 1. Return pData for current item or NULL * 2. Will recurse down to base data if bIsCursor. ******************************/ void *lstGet( HLST hLst ); /****************************** * lstGetBookMark * * !!! BOOKMARKS ONLY SAFE WHEN READONLY !!! ******************************/ int lstGetBookMark( HLST hLst, HLSTBOOKMARK hLstBookMark ); /****************************** * lstGoto * * 1. Return pData for current item or NULL * 2. IF nIndex is out of range THEN * lstEOL = TRUE * returns NULL ******************************/ void *lstGoto( HLST hLst, long nIndex ); /****************************** * lstGotoBookMark * * !!! BOOKMARKS ONLY SAFE WHEN READONLY !!! ******************************/ int lstGotoBookMark( HLSTBOOKMARK hLstBookMark ); /****************************** * lstInsert * * 1. inserts a new item before the current item * 2. becomes current ******************************/ int lstInsert( HLST hLst, void *pData ); /****************************** * lstLast * * 1. makes last item the current item * 2. returns pData or NULL ******************************/ void *lstLast( HLST hLst ); /****************************** * lstNext * * 1. makes next item the current item * 2. returns pData or NULL ******************************/ void *lstNext( HLST hLst ); /****************************** * lstOpen * * 1. Create an empty list. * * *** MUST CALL lstClose WHEN DONE OR LOSE MEMORY *** * ******************************/ HLST lstOpen(); /****************************** * lstOpenCursor * * 1. If you are going to use cursors then just use cursors. Do * not use move funcs, get funcs, etc on base list and use * cursors as well. Garbage collection only accounts for * cursors when deleting items that have been flagged for * deletion... so direct access could result in the list * changing unexpectedly. * * 2. pFilterFunc is optional. If you provide this function * pointer the cursor list will be generated to include * all items where pFilterFunc( lstGet( hBase ) ) = true. * Leaving it NULL just means that all items in hBase will * be included in the cursor list. * * *** MUST CALL lstClose WHEN DONE OR LOSE MEMORY *** * ******************************/ HLST lstOpenCursor( HLST hBase, int (*pFilterFunc)( HLST, void * ), void *pExtras ); /****************************** * lstPrev * * 1. makes prev item the current item * 2. returns pData or NULL ******************************/ void *lstPrev( HLST hLst ); /****************************** * lstSet * * 1. replaces pData pointer * 2. returns pData * 3. Will recurse down to base data. * * *** THIS SHOULD BE CHANGED TO AVOID CHANGING THE pData POINTER AND RESIZE THE BUFFER INSTEAD * ******************************/ void *lstSet( HLST hLst, void *pData ); /****************************** * lstSetFreeFunc * * 1. The given function will be called when ever there is a need to free pData * 2. The default action is to simply free(pData). ******************************/ int lstSetFreeFunc( HLST hLst, void (*pFree)( void *pData ) ); /****************************** * lstSeek * * 1. Tries to set hCurrent to the item where pData is at * 2. simply scans from 1st to last so lsEOL() = true when not found * ******************************/ int lstSeek( HLST hLst, void *pData ); /****************************** * lstSeekItem * * 1. Tries to set hCurrent to the item where hItem is at * 2. simply scans from 1st to last so lsEOL() = true when not found * ******************************/ int lstSeekItem( HLST hLst, HLSTITEM hItem ); /***************[ FOR INTERNAL USE ]***********************/ /*************************** * ENSURE CURRENT IS NOT ON A bDelete ITEM ***************************/ void *_lstAdjustCurrent( HLST hLst ); /*************************** * ***************************/ void _lstDump( HLST hLst ); /****************************** * _lstFreeItem * * 1. Does a real delete. Frees memory used by item. * will delete root item as required. * ******************************/ int _lstFreeItem( HLSTITEM hItem ); /****************************** * _lstNextValidItem * * 1. Starts scanning hLst at hItem until a non-deleted Item found or EOL * ******************************/ HLSTITEM _lstNextValidItem( HLST hLst, HLSTITEM hItem ); /****************************** * _lstPrevValidItem * * 1. Starts scanning hLst at hItem until a non-deleted Item found or EOL * ******************************/ HLSTITEM _lstPrevValidItem( HLST hLst, HLSTITEM hItem ); /****************************** * _lstVisible * * ******************************/ int _lstVisible( HLSTITEM hItem ); /****************************** * _lstAppend * * ******************************/ int _lstAppend( HLST hLst, HLSTITEM hItem ); /****************************** * _lstInsert * * ******************************/ int _lstInsert( HLST hLst, HLSTITEM hItem ); #if defined(__cplusplus) } #endif #endif unixODBC-2.3.9/include/ini.h0000755000175000017500000003316712460420135012446 00000000000000/********************************************************************************** * ini.h * * Include file for libini.a. Coding? Include this and link against libini.a. * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #ifndef INCLUDED_INI_H #define INCLUDED_INI_H /*********[ CONSTANTS AND TYPES ]**************************************************/ #include #include #include #include #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define STDINFILE ((char*)-1) #define INI_NO_DATA 2 #define INI_SUCCESS 1 #define INI_ERROR 0 #define INI_MAX_LINE 1000 #define INI_MAX_OBJECT_NAME INI_MAX_LINE #define INI_MAX_PROPERTY_NAME INI_MAX_LINE #define INI_MAX_PROPERTY_VALUE INI_MAX_LINE #if HAVE_LIMITS_H #include #endif #ifdef PATH_MAX #define ODBC_FILENAME_MAX PATH_MAX #elif MAXPATHLEN #define ODBC_FILENAME_MAX MAXPATHLEN #else #define ODBC_FILENAME_MAX FILENAME_MAX #endif /******************************************** * tINIPROPERTY * * Each property line has Name=Value pair. * They are stored in this structure and linked together to provide a list * of all properties for a given Object. ********************************************/ typedef struct tINIPROPERTY { struct tINIPROPERTY *pNext; struct tINIPROPERTY *pPrev; char szName[INI_MAX_PROPERTY_NAME+1]; char szValue[INI_MAX_PROPERTY_VALUE+1]; } INIPROPERTY, *HINIPROPERTY; /******************************************** * tINIOBJECT * * Each object line has just an object name. This structure * stores the object name and its subordinate information. * The lines that follow are considered to be properties * and are stored in a list of tINIPROPERTY. ********************************************/ typedef struct tINIOBJECT { struct tINIOBJECT *pNext; struct tINIOBJECT *pPrev; char szName[INI_MAX_OBJECT_NAME+1]; HINIPROPERTY hFirstProperty; HINIPROPERTY hLastProperty; int nProperties; } INIOBJECT, *HINIOBJECT; /******************************************** * tINI * * Each INI file contains a list of objects. This * structure stores each object in a list of tINIOBJECT. ********************************************/ typedef struct tINI { #ifdef __OS2__ int iniFileType; /* ini file type 0 = text, 1 = binary (OS/2 only) */ #endif char szFileName[ODBC_FILENAME_MAX+1]; /* FULL INI FILE NAME */ char cComment[ 5 ]; /* COMMENT CHAR MUST BE IN FIRST COLUMN */ char cLeftBracket; /* BRACKETS DELIMIT THE OBJECT NAME, THE LEFT BRACKET MUST BE IN COLUMN ONE */ char cRightBracket; char cEqual; /* SEPERATES THE PROPERTY NAME FROM ITS VALUE */ int bChanged; /* IF true, THEN THE WHOLE FILE IS OVERWRITTEN UPON iniCommit */ int bReadOnly; /* TRUE IF AT LEAST ONE CALL HAS BEEN MADE TO iniAppend() */ HINIOBJECT hFirstObject; HINIOBJECT hLastObject; HINIOBJECT hCurObject; int nObjects; HINIPROPERTY hCurProperty; } INI, *HINI; /******************************************** * tINIBOOKMARK * * Used to store the current Object and Property pointers so * that the caller can quickly return to some point in the * INI data. ********************************************/ typedef struct tINIBOOKMARK { HINI hIni; HINIOBJECT hCurObject; HINIPROPERTY hCurProperty; } INIBOOKMARK, *HINIBOOKMARK; #if defined(__cplusplus) extern "C" { #endif /*********[ PRIMARY INTERFACE ]*****************************************************/ /****************************** * iniOpen * * 1. make sure file exists * 2. allocate memory for HINI * 3. initialize HINI * 4. load entire file into structured memory * 5. set TRUE if you want to create file if non-existing ******************************/ #ifdef __OS2__ int iniOpen( HINI *hIni, char *pszFileName, char *cComment, char cLeftBracket, char cRightBracket, char cEqual, int bCreate, int bFileType ); #else int iniOpen( HINI *hIni, char *pszFileName, char *cComment, char cLeftBracket, char cRightBracket, char cEqual, int bCreate ); #endif /****************************** * iniAppend * * 1. append Sections in pszFileName that do not already exist in hIni * 2. Makes hIni ReadOnly! ******************************/ int iniAppend( HINI hIni, char *pszFileName ); /****************************** * iniDelete * * 1. simple removes all objects (and their properties) from the list using iniObjectDelete() in a loop ******************************/ int iniDelete( HINI hIni ); /****************************** * iniClose * * 1. free memory previously allocated for HINI * 2. DO NOT SAVE ANY CHANGES (see iniCommit) ******************************/ int iniClose( HINI hIni ); /****************************** * iniCommit * * 1. replaces file contents with memory contents (overwrites the file) ******************************/ int iniCommit( HINI hIni ); /****************************** * iniObjectFirst * ******************************/ int iniObjectFirst( HINI hIni ); /****************************** * iniObjectLast * ******************************/ int iniObjectLast( HINI hIni ); /****************************** * iniObjectNext * * 1. iniObjects() if no current object name else * 2. find and store next object name ******************************/ int iniObjectNext( HINI hIni ); /****************************** * iniObjectSeek * * 1. find and store object name ******************************/ int iniObjectSeek( HINI hIni, char *pszObject ); /****************************** * iniObjectSeekSure * * 1. find and store object name * 2. ensure that it exists ******************************/ int iniObjectSeekSure( HINI hIni, char *pszObject ); /****************************** * iniObjectEOL * ******************************/ int iniObjectEOL( HINI hIni ); /****************************** * iniObject * * 1. returns the current object name ******************************/ int iniObject( HINI hIni, char *pszObject ); /****************************** * iniObjectDelete * * 1. deletes current Object ******************************/ int iniObjectDelete( HINI hIni ); /****************************** * iniObjectUpdate * * 1. update current Object ******************************/ int iniObjectUpdate( HINI hIni, char *pszObject ); /****************************** * iniPropertyObject * * 1. inserts a new Object * 2. becomes current ******************************/ int iniObjectInsert( HINI hIni, char *pszObject ); /****************************** * iniPropertyFirst * ******************************/ int iniPropertyFirst( HINI hIni ); /****************************** * iniPropertyLast * ******************************/ int iniPropertyLast( HINI hIni ); /****************************** * iniPropertyNext * * 1. iniProperties() if no current property name else * 2. find and store next property name ******************************/ int iniPropertyNext( HINI hIni ); /****************************** * iniPropertySeek * * 1. set current Object & Property positions where matching parameters * 2. any parms which are empty strings (ie pszObject[0]) are ignored * 3. it is kinda pointless to pass empty strings for all parms... you will get 1st Property in 1st Object ******************************/ int iniPropertySeek( HINI hIni, char *pszObject, char *pszProperty, char *pszValue ); /****************************** * iniPropertySeekSure * * 1. same as iniPropertySeek but * 2. will ensure that both Object and Property exist ******************************/ int iniPropertySeekSure( HINI hIni, char *pszObject, char *pszProperty, char *pszValue ); /****************************** * iniPropertyEOL * ******************************/ int iniPropertyEOL( HINI hIni ); /****************************** * iniProperty * * 1. returns the current property name ******************************/ int iniProperty( HINI hIni, char *pszProperty ); /****************************** * iniPropertyDelete * * 1. deletes current Property ******************************/ int iniPropertyDelete( HINI hIni ); /****************************** * iniPropertyUpdate * * 1. update current Property ******************************/ int iniPropertyUpdate( HINI hIni, char *pszProperty, char *pszValue ); /****************************** * iniPropertyInsert * * 1. inserts a new Property for current Object * 2. becomes current ******************************/ int iniPropertyInsert( HINI hIni, char *pszProperty, char *pszValue ); /****************************** * iniValue * * 1. returns the value for the current object/property ******************************/ int iniValue( HINI hIni, char *pszValue ); /****************************** * iniGetBookmark * * 1. Store the current data positions (Object and Property) * into hIniBookmark. * 2. Does not allocate memory for hIniBookmark so pass a * pointer to a valid bookmark. ******************************/ int iniGetBookmark( HINI hIni, HINIBOOKMARK hIniBookmark ); /****************************** * iniGotoBookmark * * 1. Sets the current Object and Property positions to * those stored in IniBookmark. * 2. Does not account for the bookmark becoming * invalid ie from the Object or Property being deleted. ******************************/ int iniGotoBookmark( INIBOOKMARK IniBookmark ); /****************************** * iniCursor * * 1. Returns a copy of the hIni with a new * set of position cursors (current Object and Property). * 2. Not safe to use when in the possibility of * deleting data in another cursor on same data. * 3. Use when reading data only. * 4. Does not allocate memory so hIniCursor should be valid. * 5. All calls, other than those for movement, are * global and will affect any other view of the data. ******************************/ int iniCursor( HINI hIni, HINI hIniCursor ); /*************************************************************************************/ /*********[ SUPPORT FUNCS ]***********************************************************/ /*************************************************************************************/ /****************************** * iniElement * ******************************/ int iniElement( char *pszData, char cSeperator, char cTerminator, int nElement, char *pszElement, int nMaxElement ); int iniElementMax( char *pData, char cSeperator, int nDataLen, int nElement, char *pszElement, int nMaxElement ); int iniElementToEnd( char *pszData, char cSeperator, char cTerminator, int nElement, char *pszElement, int nMaxElement ); int iniElementEOL( char *pszData, char cSeperator, char cTerminator, int nElement, char *pszElement, int nMaxElement ); /****************************** * iniElementCount * ******************************/ int iniElementCount( char *pszData, char cSeperator, char cTerminator ); /****************************** * iniPropertyValue * * 1. returns the property value for pszProperty in pszValue * 2. pszString example; * "PropertyName1=Value1;PropertyName2=Value2;..." * 3. cEqual is usually '=' * 4. cPropertySep is usually ';' * * This function can be called without calling any other functions in this lib. ******************************/ int iniPropertyValue( char *pszString, char *pszProperty, char *pszValue, char cEqual, char cPropertySep ); /****************************** * iniAllTrim * * 1. trims blanks, tabs and newlines from start and end of pszString * * This function can be called without calling any other functions in this lib. ******************************/ int iniAllTrim( char *pszString ); /****************************** * iniToUpper * * 1. Converts all chars in pszString to upper case. * * This function can be called without calling any other functions in this lib. ******************************/ int iniToUpper( char *pszString ); /****************************** * _iniObjectRead * ******************************/ int _iniObjectRead( HINI hIni, char *szLine, char *pszObjectName ); /****************************** * _iniPropertyRead * ******************************/ int _iniPropertyRead( HINI hIni, char *szLine, char *pszPropertyName, char *pszPropertyValue ); /****************************** * _iniDump * ******************************/ int _iniDump( HINI hIni, FILE *hStream ); /****************************** * _iniScanUntilObject * ******************************/ int _iniScanUntilObject( HINI hIni, FILE *hFile, char *pszLine ); int _iniScanUntilNextObject( HINI hIni, FILE *hFile, char *pszLine ); /* * Some changes to avoid a 255 file handle limit, thanks MQJoe. * Make it conditional as it does have some performance impact esp with LARGE ini files (like what I have :-) */ #if defined( HAVE_VSNPRINTF ) && defined( USE_LL_FIO ) FILE *uo_fopen( const char *filename, const char *mode ); int uo_fclose( FILE *stream ); char *uo_fgets( char *szbuffer, int n, FILE *stream ); int uo_fprintf( FILE *stream, const char *fmt, ...); int uo_vfprintf( FILE *stream, const char *fmt, va_list ap); #else #define uo_fopen fopen #define uo_fclose fclose #define uo_fgets fgets #define uo_fprintf fprintf #define uo_vfprintf vfprintf #endif #if defined(__cplusplus) } #endif #endif unixODBC-2.3.9/include/odbcinst.h0000755000175000017500000004354612262474476013517 00000000000000/************************************************** * odbcinst.h * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #ifndef __ODBCINST_H #define __ODBCINST_H #include #ifndef BOOL #define BOOL int #endif #ifndef __SQL #include "sql.h" #endif /*! * \brief Our generic window handle. * * This is used wherever a HWND is needed. The caller inits this according * to which UI the caller has (or simply desires). This may be a; console, xlib, qt3, qt4, * gtk, mono, carbon, etc. * * SQLCreateDataSource * (maps to ODBCCreateDataSource entry point in UI plugin) * * This function requires a HWND (and it must NOT be NULL as per ODBC spec.). So * the caller should *always* init an ODBCINSTWND and cast it to HWND as it is passed to * SQLCreateDataSource. * * SQLManageDataSources * (maps to ODBCManageDataSources entry point in UI plugin) * * This function requires a HWND (and it must NOT be NULL as per ODBC spec.). So * the caller should *always* init an ODBCINSTWND and cast it to HWND as it is passed to * SQLManageDataSources. However; it may make sense to have a NULL hWnd... this is what * an ODBC Administrator program would typically do. * * Plugin Selection * * 1. Passing a NULL to a function instead of a valid HODBCINSTWND may result in an error * (this is the case with SQLCreateDataSource). In anycase; passing a NULL in this way * negates the use of any UI plugin. * * 2. szUI has a value and it is the file name (no path and no extension) of the UI * plugin. The plugin is loaded and the appropriate function is called with hWnd. The * caller must have init hWnd in a manner which is appropriate for the UI plugin. * * 3. Passing an empty szUI indicates that the UI plugin should be determined by other * means (see 4). In such a case it is dangerous to use hWnd because it may not match * the type expected by the plugin. hWnd will be ignored and a NULL will be passed to the UI * plugin. * * 4. The fallback logic for determining the UI plugin is as follows; * - use the ODBCINSTUI environment variable to get the UI plugin file name * - use the ODBCINSTUI value in odbcinst.ini to get the UI plugin file name * * NOTE: In the future we may want to consider making HWND of this type instead of having * two different types and having to cast HODBCINSTWND into a HWND. */ typedef struct tODBCINSTWND { char szUI[FILENAME_MAX]; /*!< Plugin file name (no path and no extension) ie "odbcinstQ4". */ HWND hWnd; /*!< this is passed to the UI plugin - caller must know what the plugin is expecting */ } ODBCINSTWND, *HODBCINSTWND; #ifdef __cplusplus extern "C" { #endif #ifndef ODBCVER #define ODBCVER 0x0351 #endif #ifndef WINVER #define WINVER 0x0400 #endif /* SQLConfigDataSource request flags */ #define ODBC_ADD_DSN 1 #define ODBC_CONFIG_DSN 2 #define ODBC_REMOVE_DSN 3 #if (ODBCVER >= 0x0250) #define ODBC_ADD_SYS_DSN 4 #define ODBC_CONFIG_SYS_DSN 5 #define ODBC_REMOVE_SYS_DSN 6 #if (ODBCVER >= 0x0300) #define ODBC_REMOVE_DEFAULT_DSN 7 #endif /* ODBCVER >= 0x0300 */ /* install request flags */ #define ODBC_INSTALL_INQUIRY 1 #define ODBC_INSTALL_COMPLETE 2 /* config driver flags */ #define ODBC_INSTALL_DRIVER 1 #define ODBC_REMOVE_DRIVER 2 #define ODBC_CONFIG_DRIVER 3 #define ODBC_CONFIG_DRIVER_MAX 100 #endif /* SQLGetConfigMode and SQLSetConfigMode flags */ #if (ODBCVER >= 0x0300) #define ODBC_BOTH_DSN 0 #define ODBC_USER_DSN 1 #define ODBC_SYSTEM_DSN 2 #endif /* ODBCVER >= 0x0300 */ /* SQLInstallerError code */ #if (ODBCVER >= 0x0300) #define ODBC_ERROR_GENERAL_ERR 1 #define ODBC_ERROR_INVALID_BUFF_LEN 2 #define ODBC_ERROR_INVALID_HWND 3 #define ODBC_ERROR_INVALID_STR 4 #define ODBC_ERROR_INVALID_REQUEST_TYPE 5 #define ODBC_ERROR_COMPONENT_NOT_FOUND 6 #define ODBC_ERROR_INVALID_NAME 7 #define ODBC_ERROR_INVALID_KEYWORD_VALUE 8 #define ODBC_ERROR_INVALID_DSN 9 #define ODBC_ERROR_INVALID_INF 10 #define ODBC_ERROR_REQUEST_FAILED 11 #define ODBC_ERROR_INVALID_PATH 12 #define ODBC_ERROR_LOAD_LIB_FAILED 13 #define ODBC_ERROR_INVALID_PARAM_SEQUENCE 14 #define ODBC_ERROR_INVALID_LOG_FILE 15 #define ODBC_ERROR_USER_CANCELED 16 #define ODBC_ERROR_USAGE_UPDATE_FAILED 17 #define ODBC_ERROR_CREATE_DSN_FAILED 18 #define ODBC_ERROR_WRITING_SYSINFO_FAILED 19 #define ODBC_ERROR_REMOVE_DSN_FAILED 20 #define ODBC_ERROR_OUT_OF_MEM 21 #define ODBC_ERROR_OUTPUT_STRING_TRUNCATED 22 #endif /* ODBCVER >= 0x0300 */ #ifndef EXPORT #define EXPORT #endif #ifdef __OS2__ #define INSTAPI _System #else #define INSTAPI #endif /* HIGH LEVEL CALLS */ BOOL INSTAPI SQLInstallODBC (HWND hwndParent, LPCSTR lpszInfFile, LPCSTR lpszSrcPath, LPCSTR lpszDrivers); BOOL INSTAPI SQLManageDataSources (HWND hwndParent); BOOL INSTAPI SQLCreateDataSource (HWND hwndParent, LPCSTR lpszDSN); BOOL INSTAPI SQLGetTranslator (HWND hwnd, LPSTR lpszName, WORD cbNameMax, WORD *pcbNameOut, LPSTR lpszPath, WORD cbPathMax, WORD *pcbPathOut, DWORD *pvOption); /* LOW LEVEL CALLS */ BOOL INSTAPI SQLInstallDriver (LPCSTR lpszInfFile, LPCSTR lpszDriver, LPSTR lpszPath, WORD cbPathMax, WORD * pcbPathOut); BOOL INSTAPI SQLInstallDriverManager (LPSTR lpszPath, WORD cbPathMax, WORD * pcbPathOut); BOOL INSTAPI SQLGetInstalledDrivers (LPSTR lpszBuf, WORD cbBufMax, WORD * pcbBufOut); BOOL INSTAPI SQLGetAvailableDrivers (LPCSTR lpszInfFile, LPSTR lpszBuf, WORD cbBufMax, WORD * pcbBufOut); BOOL INSTAPI SQLConfigDataSource (HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPCSTR lpszAttributes); BOOL INSTAPI SQLRemoveDefaultDataSource(void); BOOL INSTAPI SQLWriteDSNToIni (LPCSTR lpszDSN, LPCSTR lpszDriver); BOOL INSTAPI SQLRemoveDSNFromIni (LPCSTR lpszDSN); BOOL INSTAPI SQLValidDSN (LPCSTR lpszDSN); BOOL INSTAPI SQLWritePrivateProfileString(LPCSTR lpszSection, LPCSTR lpszEntry, LPCSTR lpszString, LPCSTR lpszFilename); int INSTAPI SQLGetPrivateProfileString( LPCSTR lpszSection, LPCSTR lpszEntry, LPCSTR lpszDefault, LPSTR lpszRetBuffer, int cbRetBuffer, LPCSTR lpszFilename); #if (ODBCVER >= 0x0250) BOOL INSTAPI SQLRemoveDriverManager(LPDWORD lpdwUsageCount); BOOL INSTAPI SQLInstallTranslator(LPCSTR lpszInfFile, LPCSTR lpszTranslator, LPCSTR lpszPathIn, LPSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLRemoveTranslator(LPCSTR lpszTranslator, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLRemoveDriver(LPCSTR lpszDriver, BOOL fRemoveDSN, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLConfigDriver(HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPCSTR lpszArgs, LPSTR lpszMsg, WORD cbMsgMax, WORD *pcbMsgOut); #endif #if (ODBCVER >= 0x0300) SQLRETURN INSTAPI SQLInstallerError(WORD iError, DWORD *pfErrorCode, LPSTR lpszErrorMsg, WORD cbErrorMsgMax, WORD *pcbErrorMsg); SQLRETURN INSTAPI SQLPostInstallerError(DWORD dwErrorCode, LPCSTR lpszErrMsg); BOOL INSTAPI SQLWriteFileDSN(LPCSTR lpszFileName, LPCSTR lpszAppName, LPCSTR lpszKeyName, LPCSTR lpszString); BOOL INSTAPI SQLReadFileDSN(LPCSTR lpszFileName, LPCSTR lpszAppName, LPCSTR lpszKeyName, LPSTR lpszString, WORD cbString, WORD *pcbString); BOOL INSTAPI SQLInstallDriverEx(LPCSTR lpszDriver, LPCSTR lpszPathIn, LPSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLInstallTranslatorEx(LPCSTR lpszTranslator, LPCSTR lpszPathIn, LPSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLGetConfigMode(UWORD *pwConfigMode); BOOL INSTAPI SQLSetConfigMode(UWORD wConfigMode); #endif /* ODBCVER >= 0x0300 */ /* Driver specific Setup APIs called by installer */ BOOL INSTAPI ConfigDSN (HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPCSTR lpszAttributes); BOOL INSTAPI ConfigTranslator ( HWND hwndParent, DWORD *pvOption); #if (ODBCVER >= 0x0250) BOOL INSTAPI ConfigDriver(HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPCSTR lpszArgs, LPSTR lpszMsg, WORD cbMsgMax, WORD *pcbMsgOut); #endif /* * UNICODE APIs */ BOOL INSTAPI SQLInstallODBCW (HWND hwndParent, LPCWSTR lpszInfFile, LPCWSTR lpszSrcPath, LPCWSTR lpszDrivers); BOOL INSTAPI SQLCreateDataSourceW (HWND hwndParent, LPCWSTR lpszDSN); BOOL INSTAPI SQLGetTranslatorW (HWND hwnd, LPWSTR lpszName, WORD cbNameMax, WORD *pcbNameOut, LPWSTR lpszPath, WORD cbPathMax, WORD *pcbPathOut, DWORD *pvOption); BOOL INSTAPI SQLInstallDriverW (LPCWSTR lpszInfFile, LPCWSTR lpszDriver, LPWSTR lpszPath, WORD cbPathMax, WORD * pcbPathOut); BOOL INSTAPI SQLInstallDriverManagerW (LPWSTR lpszPath, WORD cbPathMax, WORD * pcbPathOut); BOOL INSTAPI SQLGetInstalledDriversW (LPWSTR lpszBuf, WORD cbBufMax, WORD * pcbBufOut); BOOL INSTAPI SQLGetAvailableDriversW (LPCWSTR lpszInfFile, LPWSTR lpszBuf, WORD cbBufMax, WORD * pcbBufOut); BOOL INSTAPI SQLConfigDataSourceW (HWND hwndParent, WORD fRequest, LPCWSTR lpszDriver, LPCWSTR lpszAttributes); BOOL INSTAPI SQLWriteDSNToIniW (LPCWSTR lpszDSN, LPCWSTR lpszDriver); BOOL INSTAPI SQLRemoveDSNFromIniW (LPCWSTR lpszDSN); BOOL INSTAPI SQLValidDSNW (LPCWSTR lpszDSN); BOOL INSTAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry, LPCWSTR lpszString, LPCWSTR lpszFilename); int INSTAPI SQLGetPrivateProfileStringW( LPCWSTR lpszSection, LPCWSTR lpszEntry, LPCWSTR lpszDefault, LPWSTR lpszRetBuffer, int cbRetBuffer, LPCWSTR lpszFilename); #if (ODBCVER >= 0x0250) BOOL INSTAPI SQLInstallTranslatorW(LPCWSTR lpszInfFile, LPCWSTR lpszTranslator, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLRemoveTranslatorW(LPCWSTR lpszTranslator, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLRemoveDriverW(LPCWSTR lpszDriver, BOOL fRemoveDSN, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLConfigDriverW(HWND hwndParent, WORD fRequest, LPCWSTR lpszDriver, LPCWSTR lpszArgs, LPWSTR lpszMsg, WORD cbMsgMax, WORD *pcbMsgOut); #endif #if (ODBCVER >= 0x0300) SQLRETURN INSTAPI SQLInstallerErrorW(WORD iError, DWORD *pfErrorCode, LPWSTR lpszErrorMsg, WORD cbErrorMsgMax, WORD *pcbErrorMsg); SQLRETURN INSTAPI SQLPostInstallerErrorW(DWORD dwErrorCode, LPCWSTR lpszErrorMsg); BOOL INSTAPI SQLWriteFileDSNW(LPCWSTR lpszFileName, LPCWSTR lpszAppName, LPCWSTR lpszKeyName, LPCWSTR lpszString); BOOL INSTAPI SQLReadFileDSNW(LPCWSTR lpszFileName, LPCWSTR lpszAppName, LPCWSTR lpszKeyName, LPWSTR lpszString, WORD cbString, WORD *pcbString); BOOL INSTAPI SQLInstallDriverExW(LPCWSTR lpszDriver, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount); BOOL INSTAPI SQLInstallTranslatorExW(LPCWSTR lpszTranslator, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount); #endif /* ODBCVER >= 0x0300 */ /* Driver specific Setup APIs called by installer */ BOOL INSTAPI ConfigDSNW (HWND hwndParent, WORD fRequest, LPCWSTR lpszDriver, LPCWSTR lpszAttributes); #if (ODBCVER >= 0x0250) BOOL INSTAPI ConfigDriverW(HWND hwndParent, WORD fRequest, LPCWSTR lpszDriver, LPCWSTR lpszArgs, LPWSTR lpszMsg, WORD cbMsgMax, WORD *pcbMsgOut); #endif #ifndef SQL_NOUNICODEMAP /* define this to disable the mapping */ #ifdef UNICODE #define SQLInstallODBC SQLInstallODBCW #define SQLCreateDataSource SQLCreateDataSourceW #define SQLGetTranslator SQLGetTranslatorW #define SQLInstallDriver SQLInstallDriverW #define SQLInstallDriverManager SQLInstallDriverManagerW #define SQLGetInstalledDrivers SQLGetInstalledDriversW #define SQLGetAvailableDrivers SQLGetAvailableDriversW #define SQLConfigDataSource SQLConfigDataSourceW #define SQLWriteDSNToIni SQLWriteDSNToIniW #define SQLRemoveDSNFromIni SQLRemoveDSNFromIniW #define SQLValidDSN SQLValidDSNW #define SQLWritePrivateProfileString SQLWritePrivateProfileStringW #define SQLGetPrivateProfileString SQLGetPrivateProfileStringW #define SQLInstallTranslator SQLInstallTranslatorW #define SQLRemoveTranslator SQLRemoveTranslatorW #define SQLRemoveDriver SQLRemoveDriverW #define SQLConfigDriver SQLConfigDriverW #define SQLInstallerError SQLInstallerErrorW #define SQLPostInstallerError SQLPostInstallerErrorW #define SQLReadFileDSN SQLReadFileDSNW #define SQLWriteFileDSN SQLWriteFileDSNW #define SQLInstallDriverEx SQLInstallDriverExW #define SQLInstallTranslatorEx SQLInstallTranslatorExW #endif #endif #ifdef __cplusplus } #endif #endif unixODBC-2.3.9/include/sqlucode.h0000755000175000017500000005224212262474476013522 00000000000000/************************************************** * sqlucode.h * * These should be consistent with the MS version. * **************************************************/ #ifndef __SQLUCODE_H #define __SQLUCODE_H #ifdef __cplusplus extern "C" { #endif #define SQL_WCHAR (-8) #define SQL_WVARCHAR (-9) #define SQL_WLONGVARCHAR (-10) #define SQL_C_WCHAR SQL_WCHAR #ifdef UNICODE #define SQL_C_TCHAR SQL_C_WCHAR #else #define SQL_C_TCHAR SQL_C_CHAR #endif #define SQL_SQLSTATE_SIZEW 10 /* size of SQLSTATE for unicode */ /* UNICODE versions */ SQLRETURN SQL_API SQLColAttributeW( SQLHSTMT hstmt, SQLUSMALLINT iCol, SQLUSMALLINT iField, SQLPOINTER pCharAttr, SQLSMALLINT cbCharAttrMax, SQLSMALLINT *pcbCharAttr, SQLLEN *pNumAttr); SQLRETURN SQL_API SQLColAttributesW( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, SQLLEN *pfDesc); SQLRETURN SQL_API SQLConnectW( SQLHDBC hdbc, SQLWCHAR *szDSN, SQLSMALLINT cbDSN, SQLWCHAR *szUID, SQLSMALLINT cbUID, SQLWCHAR *szAuthStr, SQLSMALLINT cbAuthStr); SQLRETURN SQL_API SQLDescribeColW( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLWCHAR *szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT *pcbColName, SQLSMALLINT *pfSqlType, SQLULEN *pcbColDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable); SQLRETURN SQL_API SQLErrorW( SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt, SQLWCHAR *szSqlState, SQLINTEGER *pfNativeError, SQLWCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT *pcbErrorMsg); SQLRETURN SQL_API SQLExecDirectW( SQLHSTMT hstmt, SQLWCHAR *szSqlStr, SQLINTEGER cbSqlStr); SQLRETURN SQL_API SQLGetConnectAttrW( SQLHDBC hdbc, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValueMax, SQLINTEGER *pcbValue); SQLRETURN SQL_API SQLGetCursorNameW( SQLHSTMT hstmt, SQLWCHAR *szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT *pcbCursor); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLSetDescFieldW(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength); SQLRETURN SQL_API SQLGetDescFieldW( SQLHDESC hdesc, SQLSMALLINT iRecord, SQLSMALLINT iField, SQLPOINTER rgbValue, SQLINTEGER cbValueMax, SQLINTEGER *pcbValue); SQLRETURN SQL_API SQLGetDescRecW( SQLHDESC hdesc, SQLSMALLINT iRecord, SQLWCHAR *szName, SQLSMALLINT cbNameMax, SQLSMALLINT *pcbName, SQLSMALLINT *pfType, SQLSMALLINT *pfSubType, SQLLEN *pLength, SQLSMALLINT *pPrecision, SQLSMALLINT *pScale, SQLSMALLINT *pNullable); SQLRETURN SQL_API SQLGetDiagFieldW( SQLSMALLINT fHandleType, SQLHANDLE handle, SQLSMALLINT iRecord, SQLSMALLINT fDiagField, SQLPOINTER rgbDiagInfo, SQLSMALLINT cbDiagInfoMax, SQLSMALLINT *pcbDiagInfo); SQLRETURN SQL_API SQLGetDiagRecW( SQLSMALLINT fHandleType, SQLHANDLE handle, SQLSMALLINT iRecord, SQLWCHAR *szSqlState, SQLINTEGER *pfNativeError, SQLWCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT *pcbErrorMsg); #endif SQLRETURN SQL_API SQLPrepareW( SQLHSTMT hstmt, SQLWCHAR *szSqlStr, SQLINTEGER cbSqlStr); SQLRETURN SQL_API SQLSetConnectAttrW( SQLHDBC hdbc, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValue); SQLRETURN SQL_API SQLSetCursorNameW( SQLHSTMT hstmt, SQLWCHAR *szCursor, SQLSMALLINT cbCursor); SQLRETURN SQL_API SQLColumnsW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, SQLSMALLINT cbTableName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName); SQLRETURN SQL_API SQLGetConnectOptionW( SQLHDBC hdbc, SQLUSMALLINT fOption, SQLPOINTER pvParam); SQLRETURN SQL_API SQLGetInfoW( SQLHDBC hdbc, SQLUSMALLINT fInfoType, SQLPOINTER rgbInfoValue, SQLSMALLINT cbInfoValueMax, SQLSMALLINT *pcbInfoValue); SQLRETURN SQL_API SQLGetTypeInfoW( SQLHSTMT StatementHandle, SQLSMALLINT DataType); SQLRETURN SQL_API SQLSetConnectOptionW( SQLHDBC hdbc, SQLUSMALLINT fOption, SQLULEN vParam); SQLRETURN SQL_API SQLSpecialColumnsW( SQLHSTMT hstmt, SQLUSMALLINT fColType, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fScope, SQLUSMALLINT fNullable); SQLRETURN SQL_API SQLStatisticsW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fUnique, SQLUSMALLINT fAccuracy); SQLRETURN SQL_API SQLTablesW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, SQLSMALLINT cbTableName, SQLWCHAR *szTableType, SQLSMALLINT cbTableType); SQLRETURN SQL_API SQLDataSourcesW( SQLHENV henv, SQLUSMALLINT fDirection, SQLWCHAR *szDSN, SQLSMALLINT cbDSNMax, SQLSMALLINT *pcbDSN, SQLWCHAR *szDescription, SQLSMALLINT cbDescriptionMax, SQLSMALLINT *pcbDescription); SQLRETURN SQL_API SQLDriverConnectW( SQLHDBC hdbc, SQLHWND hwnd, SQLWCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLWCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut, SQLUSMALLINT fDriverCompletion); SQLRETURN SQL_API SQLBrowseConnectW( SQLHDBC hdbc, SQLWCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLWCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut); SQLRETURN SQL_API SQLColumnPrivilegesW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, SQLSMALLINT cbTableName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName); SQLRETURN SQL_API SQLGetStmtAttrW( SQLHSTMT hstmt, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValueMax, SQLINTEGER *pcbValue); SQLRETURN SQL_API SQLSetStmtAttrW( SQLHSTMT hstmt, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValueMax); SQLRETURN SQL_API SQLForeignKeysW( SQLHSTMT hstmt, SQLWCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, SQLWCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLWCHAR *szPkTableName, SQLSMALLINT cbPkTableName, SQLWCHAR *szFkCatalogName, SQLSMALLINT cbFkCatalogName, SQLWCHAR *szFkSchemaName, SQLSMALLINT cbFkSchemaName, SQLWCHAR *szFkTableName, SQLSMALLINT cbFkTableName); SQLRETURN SQL_API SQLNativeSqlW( SQLHDBC hdbc, SQLWCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr); SQLRETURN SQL_API SQLPrimaryKeysW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, SQLSMALLINT cbTableName); SQLRETURN SQL_API SQLProcedureColumnsW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, SQLSMALLINT cbProcName, SQLWCHAR *szColumnName, SQLSMALLINT cbColumnName); SQLRETURN SQL_API SQLProceduresW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szProcName, SQLSMALLINT cbProcName); SQLRETURN SQL_API SQLTablePrivilegesW( SQLHSTMT hstmt, SQLWCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR *szTableName, SQLSMALLINT cbTableName); SQLRETURN SQL_API SQLDriversW( SQLHENV henv, SQLUSMALLINT fDirection, SQLWCHAR *szDriverDesc, SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, SQLWCHAR *szDriverAttributes, SQLSMALLINT cbDrvrAttrMax, SQLSMALLINT *pcbDrvrAttr); /* ANSI versions */ SQLRETURN SQL_API SQLColAttributeA( SQLHSTMT hstmt, SQLSMALLINT iCol, SQLSMALLINT iField, SQLPOINTER pCharAttr, SQLSMALLINT cbCharAttrMax, SQLSMALLINT *pcbCharAttr, SQLLEN *pNumAttr); SQLRETURN SQL_API SQLColAttributesA( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, SQLLEN *pfDesc); SQLRETURN SQL_API SQLConnectA( SQLHDBC hdbc, SQLCHAR *szDSN, SQLSMALLINT cbDSN, SQLCHAR *szUID, SQLSMALLINT cbUID, SQLCHAR *szAuthStr, SQLSMALLINT cbAuthStr); SQLRETURN SQL_API SQLDescribeColA( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLCHAR *szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT *pcbColName, SQLSMALLINT *pfSqlType, SQLULEN *pcbColDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable); SQLRETURN SQL_API SQLErrorA( SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt, SQLCHAR *szSqlState, SQLINTEGER *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT *pcbErrorMsg); SQLRETURN SQL_API SQLExecDirectA( SQLHSTMT hstmt, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStr); SQLRETURN SQL_API SQLGetConnectAttrA( SQLHDBC hdbc, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValueMax, SQLINTEGER *pcbValue); SQLRETURN SQL_API SQLGetCursorNameA( SQLHSTMT hstmt, SQLCHAR *szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT *pcbCursor); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLGetDescFieldA( SQLHDESC hdesc, SQLSMALLINT iRecord, SQLSMALLINT iField, SQLPOINTER rgbValue, SQLINTEGER cbValueMax, SQLINTEGER *pcbValue); SQLRETURN SQL_API SQLGetDescRecA( SQLHDESC hdesc, SQLSMALLINT iRecord, SQLCHAR *szName, SQLSMALLINT cbNameMax, SQLSMALLINT *pcbName, SQLSMALLINT *pfType, SQLSMALLINT *pfSubType, SQLLEN *pLength, SQLSMALLINT *pPrecision, SQLSMALLINT *pScale, SQLSMALLINT *pNullable); SQLRETURN SQL_API SQLGetDiagFieldA( SQLSMALLINT fHandleType, SQLHANDLE handle, SQLSMALLINT iRecord, SQLSMALLINT fDiagField, SQLPOINTER rgbDiagInfo, SQLSMALLINT cbDiagInfoMax, SQLSMALLINT *pcbDiagInfo); SQLRETURN SQL_API SQLGetDiagRecA( SQLSMALLINT fHandleType, SQLHANDLE handle, SQLSMALLINT iRecord, SQLCHAR *szSqlState, SQLINTEGER *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT *pcbErrorMsg); SQLRETURN SQL_API SQLGetStmtAttrA( SQLHSTMT hstmt, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValueMax, SQLINTEGER *pcbValue); #endif SQLRETURN SQL_API SQLGetTypeInfoA( SQLHSTMT StatementHandle, SQLSMALLINT DataTyoe); SQLRETURN SQL_API SQLPrepareA( SQLHSTMT hstmt, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStr); SQLRETURN SQL_API SQLSetConnectAttrA( SQLHDBC hdbc, SQLINTEGER fAttribute, SQLPOINTER rgbValue, SQLINTEGER cbValue); SQLRETURN SQL_API SQLSetCursorNameA( SQLHSTMT hstmt, SQLCHAR *szCursor, SQLSMALLINT cbCursor); SQLRETURN SQL_API SQLColumnsA( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); SQLRETURN SQL_API SQLGetConnectOptionA( SQLHDBC hdbc, SQLUSMALLINT fOption, SQLPOINTER pvParam); SQLRETURN SQL_API SQLGetInfoA( SQLHDBC hdbc, SQLUSMALLINT fInfoType, SQLPOINTER rgbInfoValue, SQLSMALLINT cbInfoValueMax, SQLSMALLINT* pcbInfoValue); SQLRETURN SQL_API SQLGetStmtOptionA( SQLHSTMT hstmt, SQLUSMALLINT fOption, SQLPOINTER pvParam); SQLRETURN SQL_API SQLSetConnectOptionA( SQLHDBC hdbc, SQLUSMALLINT fOption, SQLULEN vParam); SQLRETURN SQL_API SQLSetStmtOptionA( SQLHSTMT hstmt, SQLUSMALLINT fOption, SQLULEN vParam); SQLRETURN SQL_API SQLSpecialColumnsA( SQLHSTMT hstmt, SQLUSMALLINT fColType, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fScope, SQLUSMALLINT fNullable); SQLRETURN SQL_API SQLStatisticsA( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fUnique, SQLUSMALLINT fAccuracy); SQLRETURN SQL_API SQLTablesA( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLCHAR *szTableType, SQLSMALLINT cbTableType); SQLRETURN SQL_API SQLDataSourcesA( SQLHENV henv, SQLUSMALLINT fDirection, SQLCHAR *szDSN, SQLSMALLINT cbDSNMax, SQLSMALLINT *pcbDSN, SQLCHAR *szDescription, SQLSMALLINT cbDescriptionMax, SQLSMALLINT *pcbDescription); SQLRETURN SQL_API SQLDriverConnectA( SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut, SQLUSMALLINT fDriverCompletion); SQLRETURN SQL_API SQLBrowseConnectA( SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut); SQLRETURN SQL_API SQLColumnPrivilegesA( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); SQLRETURN SQL_API SQLDescribeParamA( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, SQLUINTEGER *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable); SQLRETURN SQL_API SQLForeignKeysA( SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR *szPkTableName, SQLSMALLINT cbPkTableName, SQLCHAR *szFkCatalogName, SQLSMALLINT cbFkCatalogName, SQLCHAR *szFkSchemaName, SQLSMALLINT cbFkSchemaName, SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName); SQLRETURN SQL_API SQLNativeSqlA( SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr); SQLRETURN SQL_API SQLPrimaryKeysA( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName); SQLRETURN SQL_API SQLProcedureColumnsA( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); SQLRETURN SQL_API SQLProceduresA( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, SQLSMALLINT cbProcName); SQLRETURN SQL_API SQLTablePrivilegesA( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName); SQLRETURN SQL_API SQLDriversA( SQLHENV henv, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc, SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, SQLCHAR *szDriverAttributes, SQLSMALLINT cbDrvrAttrMax, SQLSMALLINT *pcbDrvrAttr); /*---------------------------------------------*/ /* Mapping macros for Unicode */ /*---------------------------------------------*/ #ifndef SQL_NOUNICODEMAP /* define this to disable the mapping */ #ifdef UNICODE #define SQLColAttribute SQLColAttributeW #define SQLColAttributes SQLColAttributesW #define SQLConnect SQLConnectW #define SQLDescribeCol SQLDescribeColW #define SQLError SQLErrorW #define SQLExecDirect SQLExecDirectW #define SQLGetConnectAttr SQLGetConnectAttrW #define SQLGetCursorName SQLGetCursorNameW #define SQLGetDescField SQLGetDescFieldW #define SQLGetDescRec SQLGetDescRecW #define SQLGetDiagField SQLGetDiagFieldW #define SQLGetDiagRec SQLGetDiagRecW #define SQLPrepare SQLPrepareW #define SQLSetConnectAttr SQLSetConnectAttrW #define SQLSetCursorName SQLSetCursorNameW #define SQLSetDescField SQLSetDescFieldW #define SQLSetStmtAttr SQLSetStmtAttrW #define SQLGetStmtAttr SQLGetStmtAttrW #define SQLColumns SQLColumnsW #define SQLGetConnectOption SQLGetConnectOptionW #define SQLGetInfo SQLGetInfoW #define SQLGetTypeInfo SQLGetTypeInfoW #define SQLSetConnectOption SQLSetConnectOptionW #define SQLSpecialColumns SQLSpecialColumnsW #define SQLStatistics SQLStatisticsW #define SQLTables SQLTablesW #define SQLDataSources SQLDataSourcesW #define SQLDriverConnect SQLDriverConnectW #define SQLBrowseConnect SQLBrowseConnectW #define SQLColumnPrivileges SQLColumnPrivilegesW #define SQLForeignKeys SQLForeignKeysW #define SQLNativeSql SQLNativeSqlW #define SQLPrimaryKeys SQLPrimaryKeysW #define SQLProcedureColumns SQLProcedureColumnsW #define SQLProcedures SQLProceduresW #define SQLTablePrivileges SQLTablePrivilegesW #define SQLDrivers SQLDriversW #endif /* UNICODE */ #endif /* SQL_NOUNICODEMAP */ #ifdef __cplusplus } #endif #ifndef __SQLEXT_H #include #endif #endif unixODBC-2.3.9/include/odbctrace.h0000755000175000017500000006321112262474476013627 00000000000000/*! * \file * * \author Peter Harvey www.peterharvey.org * \author \sa AUTHORS file * \version 1 * \date 2007 * \license Copyright unixODBC Project 2007-2008, LGPL */ /*! * \mainpage ODBC Trace Manager * * \section intro_sec Introduction * * This library provides an interface to trace code which is cross-platform and supports plugin trace * handlers. Drivers can use this to simplify support for producing trace output. * * odbctrac is an example of a trace plugin which can be used with this trace interface. * * odbctxt is an example of a Driver which uses this trace interface. */ #ifndef TRACE_H #define TRACE_H #include #include typedef SQLHANDLE *HTRACECALL; /*!< internal call handle of trace plugin */ /*! * \brief Trace handle. * * Create an instance of this at the desired scope. The scope could be 1 for driver or * 1 for each driver handle (env, dbc, stmt, desc) or some other scope. * * Use #traceAlloc to allocate the instance or otherwise init the struct. Then use #traceOpen * and #traceClose to open/close the trace plugin. Use #traceFree when your done with the * trace handle. * \code // init SQLHDBC pConnection; HTRACE pTrace = traceAlloc(); { char szTrace[50]; SQLGetPrivateProfileString( "odbctxt", "TraceFile", "/tmp/sql.log", pTrace->szTraceFile, FILENAME_MAX - 2, "odbcinst.ini" ); SQLGetPrivateProfileString( "odbctxt", "TraceLibrary", "libodbctrac.so", pTrace->szFileName, FILENAME_MAX - 2, "odbcinst.ini" ); SQLGetPrivateProfileString( "odbctxt", "Trace", "No", szTrace, sizeof( szTrace ), "odbcinst.ini" ); if ( szTrace[ 0 ] == '1' || toupper( szTrace[ 0 ] ) == 'Y' || ( toupper( szTrace[ 0 ] ) == 'O' && toupper( szTrace[ 1 ] ) == 'N' ) ) traceOpen( pTrace ); } // use (SQLConnect as example) { HTRACECALL hCall = traceConnect( pTrace, pConnection, "DataSource", SQL_NTS, "UID", SQL_NTS, "PWD", SQL_NTS ); // do connect here return traceReturn( pTrace, hCall, nReturn ); } // fini { traceFree( pTrace ); } \endcode */ typedef struct tTRACE { void * hPlugIn; /*!< library handle of trace plugin */ char szFileName[FILENAME_MAX]; /*!< file name of trace plugin */ char szTraceFile[FILENAME_MAX]; /*!< SQL_ATTR_TRACEFILE */ SQLUINTEGER nTrace; /*!< SQL_ATTR_TRACE */ SQLHANDLE hPlugInInternal; /*!< internal handle of trace plugin */ SQLHANDLE (*pTraceAlloc)(); void (*pTraceFree)(); SQLRETURN (*pTraceReturn)(); RETCODE (*pTraceOpenLogFile)(); RETCODE (*pTraceCloseLogFile)(); HTRACECALL (*pTraceSQLAlloConnect)(); HTRACECALL (*pTraceSQLAllocEnv)(); HTRACECALL (*pTraceSQLAllocHandle)(); HTRACECALL (*pTraceSQLAllocHandleStd)(); HTRACECALL (*pTraceSQLAllocStmt)(); HTRACECALL (*pTraceSQLBindCol)(); HTRACECALL (*pTraceSQLBindParam)(); HTRACECALL (*pTraceSQLBindParameter)(); HTRACECALL (*pTraceSQLBrowseConnect)(); HTRACECALL (*pTraceSQLBrowseConnectw)(); HTRACECALL (*pTraceSQLBulkOperations)(); HTRACECALL (*pTraceSQLCancel)(); HTRACECALL (*pTraceSQLCloseCursor)(); HTRACECALL (*pTraceSQLColAttribute)(); HTRACECALL (*pTraceSQLColAttributes)(); HTRACECALL (*pTraceSQLColAttributesW)(); HTRACECALL (*pTraceSQLColAttributeW)(); HTRACECALL (*pTraceSQLColumnPrivileges)(); HTRACECALL (*pTraceSQLColumnPrivilegesW)(); HTRACECALL (*pTraceSQLColumns)(); HTRACECALL (*pTraceSQLColumnsW)(); HTRACECALL (*pTraceSQLConnect)(); HTRACECALL (*pTraceSQLConnectW)(); HTRACECALL (*pTraceSQLCopyDesc)(); HTRACECALL (*pTraceSQLDataSources)(); HTRACECALL (*pTraceSQLDataSourcesW)(); HTRACECALL (*pTraceSQLDescribeCol)(); HTRACECALL (*pTraceSQLDescribeColW)(); HTRACECALL (*pTraceSQLDescribeParam)(); HTRACECALL (*pTraceSQLDisconnect)(); HTRACECALL (*pTraceSQLDriverConnect)(); HTRACECALL (*pTraceSQLDriverConnectW)(); HTRACECALL (*pTraceSQLDrivers)(); HTRACECALL (*pTraceSQLDriversW)(); HTRACECALL (*pTraceSQLEndTran)(); HTRACECALL (*pTraceSQLError)(); HTRACECALL (*pTraceSQLErrorW)(); HTRACECALL (*pTraceSQLExecDirect)(); HTRACECALL (*pTraceSQLExecDirectW)(); HTRACECALL (*pTraceSQLExecute)(); HTRACECALL (*pTraceSQLExtendedFetch)(); HTRACECALL (*pTraceSQLFetch)(); HTRACECALL (*pTraceSQLFetchScroll)(); HTRACECALL (*pTraceSQLForeignKeys)(); HTRACECALL (*pTraceSQLForeignKeysW)(); HTRACECALL (*pTraceSQLFreeConnect)(); HTRACECALL (*pTraceSQLFreeEnv)(); HTRACECALL (*pTraceSQLFreeHandle)(); HTRACECALL (*pTraceSQLFreeStmt)(); HTRACECALL (*pTraceSQLGetConnectAttr)(); HTRACECALL (*pTraceSQLGetConnectAttrW)(); HTRACECALL (*pTraceSQLGetConnectOption)(); HTRACECALL (*pTraceSQLGetConnectOptionW)(); HTRACECALL (*pTraceSQLGetCursorName)(); HTRACECALL (*pTraceSQLGetCursorNameW)(); HTRACECALL (*pTraceSQLGetData)(); HTRACECALL (*pTraceSQLGetDescField)(); HTRACECALL (*pTraceSQLGetDescFieldw)(); HTRACECALL (*pTraceSQLGetDescRec)(); HTRACECALL (*pTraceSQLGetDescRecW)(); HTRACECALL (*pTraceSQLGetDiagField)(); HTRACECALL (*pTraceSQLGetDiagFieldW)(); HTRACECALL (*pTraceSQLGetDiagRec)(); HTRACECALL (*pTraceSQLGetDiagRecW)(); HTRACECALL (*pTraceSQLGetEnvAttr)(); HTRACECALL (*pTraceSQLGetFunctions)(); HTRACECALL (*pTraceSQLGetInfo)(); HTRACECALL (*pTraceSQLGetInfoW)(); HTRACECALL (*pTraceSQLGetStmtAttr)(); HTRACECALL (*pTraceSQLGetStmtAttrW)(); HTRACECALL (*pTraceSQLGetStmtOption)(); HTRACECALL (*pTraceSQLGetTypeInfo)(); HTRACECALL (*pTraceSQLGetTypeInfoW)(); HTRACECALL (*pTraceSQLMoreResults)(); HTRACECALL (*pTraceSQLNativeSql)(); HTRACECALL (*pTraceSQLNativeSqlW)(); HTRACECALL (*pTraceSQLNumParams)(); HTRACECALL (*pTraceSQLNumResultCols)(); HTRACECALL (*pTraceSQLParamData)(); HTRACECALL (*pTraceSQLParamOptions)(); HTRACECALL (*pTraceSQLPrepare)(); HTRACECALL (*pTraceSQLPrepareW)(); HTRACECALL (*pTraceSQLPrimaryKeys)(); HTRACECALL (*pTraceSQLPrimaryKeysw)(); HTRACECALL (*pTraceSQLProcedureColumns)(); HTRACECALL (*pTraceSQLProcedureColumnsw)(); HTRACECALL (*pTraceSQLProcedures)(); HTRACECALL (*pTraceSQLProceduresW)(); HTRACECALL (*pTraceSQLPutData)(); HTRACECALL (*pTraceSQLRowCount)(); HTRACECALL (*pTraceSQLSetConnectAttr)(); HTRACECALL (*pTraceSQLSetConnectAttrW)(); HTRACECALL (*pTraceSQLSetConnectoption)(); HTRACECALL (*pTraceSQLSetConnectoptionW)(); HTRACECALL (*pTraceSQLSetCursorName)(); HTRACECALL (*pTraceSQLSetCursorNameW)(); HTRACECALL (*pTraceSQLSetDescField)(); HTRACECALL (*pTraceSQLSetDescFieldW)(); HTRACECALL (*pTraceSQLSetDescRec)(); HTRACECALL (*pTraceSQLSetDescRecW)(); HTRACECALL (*pTraceSQLSetEnvAttr)(); HTRACECALL (*pTraceSQLSetParam)(); HTRACECALL (*pTraceSQLSetPos)(); HTRACECALL (*pTraceSQLSetScrollOptions)(); HTRACECALL (*pTraceSQLSetStmtAttr)(); HTRACECALL (*pTraceSQLSetStmtAttrW)(); HTRACECALL (*pTraceSQLSetStmtOption)(); HTRACECALL (*pTraceSQLSetStmtOptionW)(); HTRACECALL (*pTraceSQLSpecialColumns)(); HTRACECALL (*pTraceSQLSpecialColumnsW)(); HTRACECALL (*pTraceSQLStatistics)(); HTRACECALL (*pTraceSQLStatisticsW)(); HTRACECALL (*pTraceSQLTablePrivileges)(); HTRACECALL (*pTraceSQLTablePrivilegesW)(); HTRACECALL (*pTraceSQLTables)(); HTRACECALL (*pTraceSQLTablesW)(); HTRACECALL (*pTraceSQLTransact)(); } TRACE, *HTRACE; /*! * \brief Allocates a trace handle. * * Tracing is turned off and no trace plugin is loaded. * * \return HTRACE */ HTRACE traceAlloc(); /*! * \brief Frees trace handle. * * Compliments #traceAlloc. Will call #traceClose as needed. * * This will call #traceClose as needed. * * \param pTrace */ void traceFree( HTRACE pTrace ); /*! * \brief Opens trace plugin. * * This will open/load the trace plugin/library specified in pTrace->szFileName. The * trace output will go to pTrace->szTraceFile. pTrace->nTrace is set to * SQL_OPT_TRACE_ON but can be set to SQL_OPT_TRACE_OFF at any time to 'pause' tracing. * Set it back to SQL_OPT_TRACE_ON to resume tracing. * * \param pTrace * \param pszApplication * * \return int */ int traceOpen( HTRACE pTrace, char *pszApplication ); /*! * \brief Close trace plugin. * * This will close/unload the trace plugin/library. pTrace->nTrace is set to SQL_OPT_TRACE_OFF * but pTrace->szTraceFile and pTrace->szFileName remain unchanged. * * The #traceFree function will silently call #traceClose as needed. * * \param pTrace */ void traceClose( HTRACE pTrace ); /* this is just to shorten the following macros */ #define traceOn ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ) /* these macros are used to call trace plugin functions - they help by calling ONLY if relevant */ #define traceAllocConnect( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLAllocConnect( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceAllocEnv( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLAllocEnv( pTrace->hPlugInInternal, B ) : NULL ); #define traceAllocHandle( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLAllocHandle( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define traceAllocStmt( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLAllocStmt( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceBindCol( pTrace, B, C, D, E, F, G ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLBindCol( pTrace->hPlugInInternal, B, C, D, E, F, G ) : NULL ); #define traceBindParam( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLBindParam( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceBindParameter( pTrace, B, C, D, E, F, G, H, I, J, K ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLBindParameter( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J, K ) : NULL ); #define traceBrowseConnect( pTrace, B, C, D, E, F, G ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLBrowseConnect( pTrace->hPlugInInternal, B, C, D, E, F, G ) : NULL ); #define traceBrowseConnectW( pTrace, B, C, D, E, F, G ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLBrowseConnectW( pTrace->hPlugInInternal, B, C, D, E, F, G ) : NULL ); #define traceBulkOperations( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLBulkOperations( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceCancel( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLCancel( pTrace->hPlugInInternal, B ) : NULL ); #define traceCloseCursor( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLCloseCursor( pTrace->hPlugInInternal, B ) : NULL ); #define traceColAttribute( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLColAttribute( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceColAttributes( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLColAttributes( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceColAttributesW( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLColAttributesW( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceColAttributeW( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLColAttributeW( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceColumnPrivileges( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLColumnPrivileges( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceColumnPrivilegesW( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLColumnPrivilegesW( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceColumns( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLColumns( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceColumnsW( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLColumnsW( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceConnect( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLConnect( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceConnectW( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLConnectW( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceCopyDesc( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLCopyDesc( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceDataSources( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDataSources( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceDataSourcesW( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDataSourcesW( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceDescribeCol( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDescribeCol( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceDescribeColW( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDescribeColW( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceDescribeParam( pTrace, B, C, D, E, F, G ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDescribeParam( pTrace->hPlugInInternal, B, C, D, E, F, G ) : NULL ); #define traceDisconnect( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDisconnect( pTrace->hPlugInInternal, B ) : NULL ); #define traceDriverConnect( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDriverConnect( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceDriverConnectW( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDriverConnectW( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceDrivers( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDrivers( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceDriversW( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLDriversW( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceEndTran( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLEndTran( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define traceError( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLError( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceErrorW( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLErrorW( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceExecDirect( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLExecDirect( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define traceExecDirectW( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLExecDirectW( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define traceExecute( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLExecute( pTrace->hPlugInInternal, B ) : NULL ); #define traceExtendedFetch( pTrace, B, C, D, E, F ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLExtendedFetch( pTrace->hPlugInInternal, B, C, D, E, F ) : NULL ); #define traceFetch( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLFetch( pTrace->hPlugInInternal, B ) : NULL ); #define traceFetchScroll( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLFetchScroll( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define traceForeignKeys( pTrace, B, C, D, E, F, G, H, I, J, K, L, M, N ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLForeignKeys( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J, K, L, M, N ) : NULL ); #define traceForeignKeysW( pTrace, B, C, D, E, F, G, H, I, J, K, L, M, N ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLForeignKeysW( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J, K, L, M, N ) : NULL ); #define traceFreeConnect( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLFreeConnect( pTrace->hPlugInInternal, B ) : NULL ); #define traceFreeEnv( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLFreeEnv( pTrace->hPlugInInternal, B ) : NULL ); #define traceFreeHandle( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLFreeHandle( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceFreeStmt( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLFreeStmt( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceGetConnectAttr( pTrace, B, C, D, E, F ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetConnectAttr( pTrace->hPlugInInternal, B, C, D, E, F ) : NULL ); #define traceGetCursorName( pTrace, B, C, D, E ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetCursorName( pTrace->hPlugInInternal, B, C, D, E ) : NULL ); #define traceGetData( pTrace, B, C, D, E, F, G ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetData( pTrace->hPlugInInternal, B, C, D, E, F, G ) : NULL ); #define traceGetDescField( pTrace, B, C, D, E, F, G ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetDescField( pTrace->hPlugInInternal, B, C, D, E, F, G ) : NULL ); #define traceGetDescRec( pTrace, B, C, D, E, F, G, H, I, J, K, L ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetDescRec( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J, K, L ) : NULL ); #define traceGetDiagField( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetDiagField( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceGetDiagRec( pTrace, B, C, D, E, F, G, H, I ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetDiagRec( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I ) : NULL ); #define traceGetEnvAttr( pTrace, B, C, D, E, F ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetEnvAttr( pTrace->hPlugInInternal, B, C, D, E, F ) : NULL ); #define traceGetFunctions( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetFunctions( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define traceGetInfo( pTrace, B, C, D, E, F ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetInfo( pTrace->hPlugInInternal, B, C, D, E, F ) : NULL ); #define traceGetStmtAttr( pTrace, B, C, D, E, F ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetStmtAttr( pTrace->hPlugInInternal, B, C, D, E, F ) : NULL ); #define traceGetTypeInfo( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLGetTypeInfo( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceMoreResults( pTrace, B ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLMoreResults( pTrace->hPlugInInternal, B ) : NULL ); #define traceNativeSql( pTrace, B, C, D, E, F, G ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLNativeSql( pTrace->hPlugInInternal, B, C, D, E, F, G ) : NULL ); #define traceNumParams( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLNumParams( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceNumResultCols( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLNumResultCols( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceNumParamData( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLParamData( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceParamOptions( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLParamOptions( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define tracePrepare( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLPrepare( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define tracePrimaryKeys( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLPrimaryKeys( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceProcedureColumns( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLProcedureColumns( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceProcedures( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLProcedures( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define tracePutData( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLPutData( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define traceRowCount( pTrace, B, C ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLRowCount( pTrace->hPlugInInternal, B, C ) : NULL ); #define traceSetConnectAttr( pTrace, B, C, D, E ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSetConnectAttr( pTrace->hPlugInInternal, B, C, D, E ) : NULL ); #define traceSetCursorName( pTrace, B, C, D ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSetCursorName( pTrace->hPlugInInternal, B, C, D ) : NULL ); #define traceSetDescField( pTrace, B, C, D, E, F ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSetDescField( pTrace->hPlugInInternal, B, C, D, E, F ) : NULL ); #define traceSetDescRec( pTrace, B, C, D, E, F, G, H, I, J, K ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSetDescRec( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J, K ) : NULL ); #define traceSetEnvAttr( pTrace, B, C, D, E ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSetEnvAttr( pTrace->hPlugInInternal, B, C, D, E ) : NULL ); #define traceSetPos( pTrace, B, C, D, E ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSetPos( pTrace->hPlugInInternal, B, C, D, E ) : NULL ); #define traceSetScrollOptions( pTrace, B, C, D, E ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSetScrollOptions( pTrace->hPlugInInternal, B, C, D, E ) : NULL ); #define traceSetStmtAttr( pTrace, B, C, D, E ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSetStmtAttr( pTrace->hPlugInInternal, B, C, D, E ) : NULL ); #define traceSpecialColumns( pTrace, B, C, D, E, F, G, H, I, J, K ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLSpecialColumns( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J, K ) : NULL ); #define traceStatistics( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLStatistics( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceTablePrivileges( pTrace, B, C, D, E, F, G, H ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLTablePrivileges( pTrace->hPlugInInternal, B, C, D, E, F, G, H ) : NULL ); #define traceTables( pTrace, B, C, D, E, F, G, H, I, J ) ( pTrace->hPlugIn && pTrace->nTrace == SQL_OPT_TRACE_ON ? pTrace->pTraceSQLTables( pTrace->hPlugInInternal, B, C, D, E, F, G, H, I, J ) : NULL ); #define traceReturn( pTrace, pCall, nReturn ) ( pCall ? pTrace->pTraceReturn( pCall, nReturn ) : nReturn ); #endif unixODBC-2.3.9/include/log.h0000755000175000017500000000725412262474476012467 00000000000000/********************************************************************************** * log.h * * Include file for liblog.a. Coding? Include this and link against liblog.a. * * At this time; its a simple list manager but I expect that this will evolve into * a list manager which; * * - allows for messages of different severity and types to be stored * - allows for actions (such as saving to file or poping) to occur on selected message * types and severities * **********************************************************************************/ #ifndef INCLUDED_LOG_H #define INCLUDED_LOG_H #include #include #include #if defined(HAVE_STDARG_H) # include # define HAVE_STDARGS #else # if defined(HAVE_VARARGS_H) # include # ifdef HAVE_STDARGS # undef HAVE_STDARGS # endif # endif #endif #include /***************************************************************************** * FUNCTION RETURN CODES *****************************************************************************/ #define LOG_ERROR 0 #define LOG_SUCCESS 1 #define LOG_NO_DATA 2 /***************************************************************************** * SEVERITY *****************************************************************************/ #define LOG_INFO 0 #define LOG_WARNING 1 #define LOG_CRITICAL 2 /***************************************************************************** * *****************************************************************************/ #define LOG_MSG_MAX 1024 /***************************************************************************** * HANDLES *****************************************************************************/ typedef struct tLOGMSG { char * pszModuleName; /*!< file where message originated */ char * pszFunctionName; /*!< function where message originated. */ int nLine; /*!< File line where message originated. */ int nSeverity; int nCode; char * pszMessage; } LOGMSG, *HLOGMSG; typedef struct tLOG { HLST hMessages; /* list of messages (we may want to switch to vector) */ char *pszProgramName; /* liblog will malloc, copy, and free */ char *pszLogFile; /* NULL, or filename */ long nMaxMsgs; /* OLDEST WILL BE DELETED ONCE MAX */ int bOn; /* turn logging on/off (default=off) */ } LOG, *HLOG; /***************************************************************************** * API *****************************************************************************/ int logOpen( HLOG *phLog, char *pszProgramName, char *pszLogFile, long nMaxMsgs ); int logClose( HLOG hLog ); int logClear( HLOG hLog ); int logPushMsg( HLOG hLog, char *pszModule, char *pszFunctionName, int nLine, int nSeverity, int nCode, char *pszMsg ); int logPushMsgf( HLOG hLog, char *pszModule, char *pszFunctionName, int nLine, int nSeverity, int nCode, char *pszMessageFormat, ... ); int logvPushMsgf( HLOG hLog, char *pszModule, char *pszFunctionName, int nLine, int nSeverity, int nCode, char *pszMessageFormat, va_list args ); int logPeekMsg( HLOG hLog, long nMsg, HLOGMSG *phMsg ); int logPopMsg( HLOG hLog ); int logOn( HLOG hLog, int bOn ); /***************************************************************************** * SUPPORTING FUNCS (do not call directly) *****************************************************************************/ /****************************** * _logFreeMsg * * 1. This is called by lstDelete() ******************************/ void _logFreeMsg( void *pMsg ); #endif unixODBC-2.3.9/include/Makefile.in0000664000175000017500000004331513725127175013573 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ ini.h \ log.h \ lst.h \ odbcinst.h \ odbcinstext.h \ sql.h \ sqlext.h \ sqltypes.h \ sqlucode.h \ sqlspi.h \ sqp.h \ uodbc_stats.h \ uodbc_extras.h \ autotest.h \ odbctrace.h \ odbctrac.h include_HEADERS = \ odbcinst.h \ odbcinstext.h \ sql.h \ sqlext.h \ sqltypes.h \ sqlucode.h \ sqlspi.h \ autotest.h \ uodbc_stats.h \ uodbc_extras.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/include/sqp.h0000755000175000017500000001777612262474476012523 00000000000000#ifndef _SQP_H #define _SQP_H #include /* #define SQPDEBUG */ /***[ PARSED, SUPPORTED, SQL PARTS ]**********************************************/ typedef enum sqpStatementType { sqpcreatetable, sqpdroptable, sqpselect, sqpdelete, sqpinsert, sqpupdate } sqpStatementType; typedef enum sqpOrder { sqpnone, sqpasc, sqpdesc } sqpOrder; typedef struct tSQPTABLE { char *pszOwner; char *pszTable; } SQPTABLE, *HSQPTABLE; typedef struct tSQPCOLUMN { char *pszTable; char *pszColumn; int nColumn; /* index into row data for col value */ } SQPCOLUMN, *HSQPCOLUMN; typedef struct tSQPCOMPARISON { char *pszLValue; /* must be a column name */ char *pszOperator; /* > < >= <= = LIKE NOTLIKE */ char *pszRValue; /* must be a string (quotes removed) */ char cEscape; /* escape char for LIKE operator */ int nLColumn; /* index into row data for col value */ } SQPCOMPARISON, *HSQPCOMPARISON; typedef struct tSQPASSIGNMENT { char *pszColumn; char *pszValue; int nColumn; /* index into row data for col value */ } SQPASSIGNMENT, *HSQPASSIGNMENT; typedef struct tSQPDATATYPE { char *pszType; short nType; int nPrecision; int nScale; } SQPDATATYPE, *HSQPDATATYPE; typedef struct tSQPCOLUMNDEF { char * pszColumn; HSQPDATATYPE hDataType; int bNulls; } SQPCOLUMNDEF, *HSQPCOLUMNDEF; typedef struct tSQPPARAM { char *pszValue; } SQPPARAM, *HSQPPARAM; typedef enum sqpCondType { sqpor, sqpand, sqpnot, sqppar, sqpcomp } sqpCondType; typedef struct tSQPCOND { sqpCondType nType; struct tSQPCOND *hLCond; struct tSQPCOND *hRCond; HSQPCOMPARISON hComp; } SQPCOND, *HSQPCOND; /***[ PARSED, SUPPORTED, SQL STATEMENTS ]**********************************************/ typedef struct tSQPCREATETABLE { char *pszTable; HLST hColumnDefs; /* list of HSQPCOLUMNDEF */ } SQPCREATETABLE, *HSQPCREATETABLE; typedef char SQPDROPTABLE; typedef SQPDROPTABLE * HSQPDROPTABLE; typedef struct tSQPSELECT { HLST hColumns; /* list of HSQPCOLUMN */ char *pszTable; HSQPCOND hWhere; /* tree of HSQPCOND */ HLST hOrderBy; /* list of HSQPCOLUMN */ sqpOrder nOrderDirection; } SQPSELECT, *HSQPSELECT; typedef struct tSQPDELETE { char *pszTable; HSQPCOND hWhere; /* tree of HSQPCOND */ char *pszCursor; } SQPDELETE, *HSQPDELETE; typedef struct tSQPINSERT { HLST hColumns; /* list of HSQPCOLUMN */ char *pszTable; HLST hValues; /* list of strings */ } SQPINSERT, *HSQPINSERT; typedef struct tSQPUPDATE { char *pszTable; HLST hAssignments; /* list of HSQPASSIGNMENT */ HSQPCOND hWhere; /* tree of HSQPCOND */ char *pszCursor; } SQPUPDATE, *HSQPUPDATE; /***[ TOP LEVEL STRUCT ]**********************************************/ typedef struct tSQPPARSEDSQL { sqpStatementType nType; union { HSQPCREATETABLE hCreateTable; HSQPDROPTABLE hDropTable; HSQPSELECT hSelect; HSQPDELETE hDelete; HSQPINSERT hInsert; HSQPUPDATE hUpdate; } h; } SQPPARSEDSQL, *HSQPPARSEDSQL; /*********************** * GLOBALS (yuck... gotta get rid of them): * * TEMPS USED WHEN LEX/YACC DO THEIR THING ***********************/ extern char g_szError[1024]; extern HSQPPARSEDSQL g_hParsedSQL; extern char * g_pszTable; extern char * g_pszType; extern HLST g_hColumns; extern HSQPDATATYPE g_hDataType; extern HLST g_hColumnDefs; extern HLST g_hValues; extern HLST g_hAssignments; extern char * g_pszCursor; extern HLST g_hOrderBy; extern sqpOrder g_nOrderDirection; extern int g_nNulls; extern char * g_pszSQLCursor; /* yyparse position init to start of SQL string before yyparse */ extern char * g_pszSQLLimit; /* ptr to NULL terminator of SQL string (yyparse stops here) */ extern int g_nLineNo; extern HLST g_hParams; extern HSQPCOND g_hConds; /********************************************************************************************* * PUBLIC INTERFACE *********************************************************************************************/ #if defined(__cplusplus) extern "C" { #endif /*********************** * sqpOpen * * Inits parser globals. Must call this before any other functions * and sqpClose MUST be called before next sqpOpen. * * pszFirstChar - pointer to 1st char in sql string * pszLastChar - pointer to last char in sql string (typically a pointer to a '\0' char) * hParams - list of bound parameters * ***********************/ void sqpOpen( char *pszFirstChar, char *pszLastChar, HLST hParams ); /*********************** * sqpParse * * Attempts to parse the sql given in sqpOpen. * Returns true if success else error. Use sqpError to get exact error after call. * Only call this once per sqpOpen. * ***********************/ int sqpParse(); /*********************** * sqpError * * Returns the last error message (i.e. why a parse failed). Will * be an empty string if no error. * ***********************/ char * sqpError(); /*********************** * sqpClose * * Cleans up globals in prep for next call to sqpOpen. * ***********************/ void sqpClose(); /*********************** * sqpAdoptParsedSQL * * Caller adopts the top level pointer to the parsed sql. This means * that the caller must also call sqpFreeParsedSQL when done with it! * ***********************/ HSQPPARSEDSQL sqpAdoptParsedSQL(); /*********************** * sqpFreeParsedSQL * * Frees the parsed sql from memory. * If this is being called as a result if a prior call to * sqpAdoptParsedSQL (which is the only reason it should be called in * this interface) then it can be called even after the sqpClose. * ***********************/ int sqpFreeParsedSQL( HSQPPARSEDSQL hParsedSQL ); /*********************** * sqpFreeParam * * Frees a bound param from memory. * ***********************/ void sqpFreeParam( void *pData ); #if defined(__cplusplus) } #endif /********************************************************************************************* * INTERNAL FUNCS *********************************************************************************************/ int my_yyinput(char *buf, int max_size); void yyerror( char *s ); int yyparse(); int yywrap(); short sqpStringTypeToSQLTYPE (char * pszType); void sqpFreeAssignment( void *pData ); void sqpFreeColumn( void *pData ); void sqpFreeColumnDef( void *pData ); void sqpFreeDataType( void *pData ); void sqpFreeComparison( void *pData ); void sqpFreeCond( void *pData ); void sqpFreeCreateTable( void *pData ); void sqpFreeDropTable( void *pData ); void sqpFreeDelete( void *pData ); void sqpFreeInsert( void *pData ); void sqpFreeSelect( void *pData ); void sqpFreeUpdate( void *pData ); void sqpStoreAssignment( char *pszColumn, char *pszValue ); void sqpStoreColumn( HLST *ph, char *pszColumn, int nColumn ); void sqpStoreColumnDef( char *pszColumn ); void sqpStoreDataType( char *pszType, int nPrecision, int nScale ); HSQPCOMPARISON sqpStoreComparison( char *pszLValue, char *pszOperator, char *pszRValue, char *pszEscape ); HSQPCOND sqpStoreCond( sqpCondType nType, HSQPCOND pLCond, HSQPCOND pRCond, HSQPCOMPARISON pComp ); void sqpStoreCreateTable(); void sqpStoreDropTable(); void sqpStoreDelete(); void sqpStoreInsert(); void sqpStorePositioned( char *pszCursor ); void sqpStoreSelect(); void sqpStoreTable( char *pszTable ); void sqpStoreUpdate(); void sqpStoreValue( char *pszValue ); #endif unixODBC-2.3.9/include/sql.h0000755000175000017500000007717312430141730012471 00000000000000/************************************************** * sql.h * * These should be consistent with the MS version. * **************************************************/ #ifndef __SQL_H #define __SQL_H /**************************** * default to 3.51 declare something else before here and you get a whole new ball of wax ***************************/ #ifndef ODBCVER #define ODBCVER 0x0380 #endif #ifndef __SQLTYPES_H #include "sqltypes.h" #endif #ifdef __cplusplus extern "C" { #endif /**************************** * some ret values ***************************/ #define SQL_NULL_DATA (-1) #define SQL_DATA_AT_EXEC (-2) #define SQL_SUCCESS 0 #define SQL_SUCCESS_WITH_INFO 1 #if (ODBCVER >= 0x0300) #define SQL_NO_DATA 100 #endif #define SQL_ERROR (-1) #define SQL_INVALID_HANDLE (-2) #define SQL_STILL_EXECUTING 2 #define SQL_NEED_DATA 99 #define SQL_SUCCEEDED(rc) (((rc)&(~1))==0) #if (ODBCVER >= 0x0380) #define SQL_PARAM_DATA_AVAILABLE 101 #endif /**************************** * use these to indicate string termination to some function ***************************/ #define SQL_NTS (-3) #define SQL_NTSL (-3L) /* maximum message length */ #define SQL_MAX_MESSAGE_LENGTH 512 /* date/time length constants */ #if (ODBCVER >= 0x0300) #define SQL_DATE_LEN 10 #define SQL_TIME_LEN 8 /* add P+1 if precision is nonzero */ #define SQL_TIMESTAMP_LEN 19 /* add P+1 if precision is nonzero */ #endif /* handle type identifiers */ #if (ODBCVER >= 0x0300) #define SQL_HANDLE_ENV 1 #define SQL_HANDLE_DBC 2 #define SQL_HANDLE_STMT 3 #define SQL_HANDLE_DESC 4 #endif /* environment attribute */ #if (ODBCVER >= 0x0300) #define SQL_ATTR_OUTPUT_NTS 10001 #endif /* connection attributes */ #if (ODBCVER >= 0x0300) #define SQL_ATTR_AUTO_IPD 10001 #define SQL_ATTR_METADATA_ID 10014 #endif /* ODBCVER >= 0x0300 */ /* statement attributes */ #if (ODBCVER >= 0x0300) #define SQL_ATTR_APP_ROW_DESC 10010 #define SQL_ATTR_APP_PARAM_DESC 10011 #define SQL_ATTR_IMP_ROW_DESC 10012 #define SQL_ATTR_IMP_PARAM_DESC 10013 #define SQL_ATTR_CURSOR_SCROLLABLE (-1) #define SQL_ATTR_CURSOR_SENSITIVITY (-2) #endif /* SQL_ATTR_CURSOR_SCROLLABLE values */ #if (ODBCVER >= 0x0300) #define SQL_NONSCROLLABLE 0 #define SQL_SCROLLABLE 1 #endif /* ODBCVER >= 0x0300 */ /* identifiers of fields in the SQL descriptor */ #if (ODBCVER >= 0x0300) #define SQL_DESC_COUNT 1001 #define SQL_DESC_TYPE 1002 #define SQL_DESC_LENGTH 1003 #define SQL_DESC_OCTET_LENGTH_PTR 1004 #define SQL_DESC_PRECISION 1005 #define SQL_DESC_SCALE 1006 #define SQL_DESC_DATETIME_INTERVAL_CODE 1007 #define SQL_DESC_NULLABLE 1008 #define SQL_DESC_INDICATOR_PTR 1009 #define SQL_DESC_DATA_PTR 1010 #define SQL_DESC_NAME 1011 #define SQL_DESC_UNNAMED 1012 #define SQL_DESC_OCTET_LENGTH 1013 #define SQL_DESC_ALLOC_TYPE 1099 #endif /* identifiers of fields in the diagnostics area */ #if (ODBCVER >= 0x0300) #define SQL_DIAG_RETURNCODE 1 #define SQL_DIAG_NUMBER 2 #define SQL_DIAG_ROW_COUNT 3 #define SQL_DIAG_SQLSTATE 4 #define SQL_DIAG_NATIVE 5 #define SQL_DIAG_MESSAGE_TEXT 6 #define SQL_DIAG_DYNAMIC_FUNCTION 7 #define SQL_DIAG_CLASS_ORIGIN 8 #define SQL_DIAG_SUBCLASS_ORIGIN 9 #define SQL_DIAG_CONNECTION_NAME 10 #define SQL_DIAG_SERVER_NAME 11 #define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12 #endif /* dynamic function codes */ #if (ODBCVER >= 0x0300) #define SQL_DIAG_ALTER_DOMAIN 3 #define SQL_DIAG_ALTER_TABLE 4 #define SQL_DIAG_CALL 7 #define SQL_DIAG_CREATE_ASSERTION 6 #define SQL_DIAG_CREATE_CHARACTER_SET 8 #define SQL_DIAG_CREATE_COLLATION 10 #define SQL_DIAG_CREATE_DOMAIN 23 #define SQL_DIAG_CREATE_INDEX (-1) #define SQL_DIAG_CREATE_SCHEMA 64 #define SQL_DIAG_CREATE_TABLE 77 #define SQL_DIAG_CREATE_TRANSLATION 79 #define SQL_DIAG_CREATE_VIEW 84 #define SQL_DIAG_DELETE_WHERE 19 #define SQL_DIAG_DROP_ASSERTION 24 #define SQL_DIAG_DROP_CHARACTER_SET 25 #define SQL_DIAG_DROP_COLLATION 26 #define SQL_DIAG_DROP_DOMAIN 27 #define SQL_DIAG_DROP_INDEX (-2) #define SQL_DIAG_DROP_SCHEMA 31 #define SQL_DIAG_DROP_TABLE 32 #define SQL_DIAG_DROP_TRANSLATION 33 #define SQL_DIAG_DROP_VIEW 36 #define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38 #define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81 #define SQL_DIAG_GRANT 48 #define SQL_DIAG_INSERT 50 #define SQL_DIAG_REVOKE 59 #define SQL_DIAG_SELECT_CURSOR 85 #define SQL_DIAG_UNKNOWN_STATEMENT 0 #define SQL_DIAG_UPDATE_WHERE 82 #endif /* ODBCVER >= 0x0300 */ /* SQL data type codes */ #define SQL_UNKNOWN_TYPE 0 #define SQL_CHAR 1 #define SQL_NUMERIC 2 #define SQL_DECIMAL 3 #define SQL_INTEGER 4 #define SQL_SMALLINT 5 #define SQL_FLOAT 6 #define SQL_REAL 7 #define SQL_DOUBLE 8 #if (ODBCVER >= 0x0300) #define SQL_DATETIME 9 #endif #define SQL_VARCHAR 12 /* One-parameter shortcuts for date/time data types */ #if (ODBCVER >= 0x0300) #define SQL_TYPE_DATE 91 #define SQL_TYPE_TIME 92 #define SQL_TYPE_TIMESTAMP 93 #endif /* Statement attribute values for cursor sensitivity */ #if (ODBCVER >= 0x0300) #define SQL_UNSPECIFIED 0 #define SQL_INSENSITIVE 1 #define SQL_SENSITIVE 2 #endif /* GetTypeInfo() request for all data types */ #define SQL_ALL_TYPES 0 /* Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() */ #if (ODBCVER >= 0x0300) #define SQL_DEFAULT 99 #endif /* SQLGetData() code indicating that the application row descriptor * specifies the data type */ #if (ODBCVER >= 0x0300) #define SQL_ARD_TYPE (-99) #endif /* SQL date/time type subcodes */ #if (ODBCVER >= 0x0300) #define SQL_CODE_DATE 1 #define SQL_CODE_TIME 2 #define SQL_CODE_TIMESTAMP 3 #endif /* CLI option values */ #if (ODBCVER >= 0x0300) #define SQL_FALSE 0 #define SQL_TRUE 1 #endif /* values of NULLABLE field in descriptor */ #define SQL_NO_NULLS 0 #define SQL_NULLABLE 1 /* Value returned by SQLGetTypeInfo() to denote that it is * not known whether or not a data type supports null values. */ #define SQL_NULLABLE_UNKNOWN 2 /* Values returned by SQLGetTypeInfo() to show WHERE clause * supported */ #if (ODBCVER >= 0x0300) #define SQL_PRED_NONE 0 #define SQL_PRED_CHAR 1 #define SQL_PRED_BASIC 2 #endif /* values of UNNAMED field in descriptor */ #if (ODBCVER >= 0x0300) #define SQL_NAMED 0 #define SQL_UNNAMED 1 #endif /* values of ALLOC_TYPE field in descriptor */ #if (ODBCVER >= 0x0300) #define SQL_DESC_ALLOC_AUTO 1 #define SQL_DESC_ALLOC_USER 2 #endif /* FreeStmt() options */ #define SQL_CLOSE 0 #define SQL_DROP 1 #define SQL_UNBIND 2 #define SQL_RESET_PARAMS 3 /* Codes used for FetchOrientation in SQLFetchScroll(), and in SQLDataSources() */ #define SQL_FETCH_NEXT 1 #define SQL_FETCH_FIRST 2 /* Other codes used for FetchOrientation in SQLFetchScroll() */ #define SQL_FETCH_LAST 3 #define SQL_FETCH_PRIOR 4 #define SQL_FETCH_ABSOLUTE 5 #define SQL_FETCH_RELATIVE 6 /* SQLEndTran() options */ #define SQL_COMMIT 0 #define SQL_ROLLBACK 1 /* null handles returned by SQLAllocHandle() */ #define SQL_NULL_HENV 0 #define SQL_NULL_HDBC 0 #define SQL_NULL_HSTMT 0 #if (ODBCVER >= 0x0300) #define SQL_NULL_HDESC 0 #define SQL_NULL_DESC 0 #endif /* null handle used in place of parent handle when allocating HENV */ #if (ODBCVER >= 0x0300) #define SQL_NULL_HANDLE 0L #endif /* Values that may appear in the result set of SQLSpecialColumns() */ #define SQL_SCOPE_CURROW 0 #define SQL_SCOPE_TRANSACTION 1 #define SQL_SCOPE_SESSION 2 #define SQL_PC_UNKNOWN 0 #if (ODBCVER >= 0x0300) #define SQL_PC_NON_PSEUDO 1 #endif #define SQL_PC_PSEUDO 2 /* Reserved value for the IdentifierType argument of SQLSpecialColumns() */ #if (ODBCVER >= 0x0300) #define SQL_ROW_IDENTIFIER 1 #endif /* Reserved values for UNIQUE argument of SQLStatistics() */ #define SQL_INDEX_UNIQUE 0 #define SQL_INDEX_ALL 1 /* Values that may appear in the result set of SQLStatistics() */ #define SQL_INDEX_CLUSTERED 1 #define SQL_INDEX_HASHED 2 #define SQL_INDEX_OTHER 3 /* SQLGetFunctions() values to identify ODBC APIs */ #define SQL_API_SQLALLOCCONNECT 1 #define SQL_API_SQLALLOCENV 2 #if (ODBCVER >= 0x0300) #define SQL_API_SQLALLOCHANDLE 1001 #endif #define SQL_API_SQLALLOCSTMT 3 #define SQL_API_SQLBINDCOL 4 #if (ODBCVER >= 0x0300) #define SQL_API_SQLBINDPARAM 1002 #endif #define SQL_API_SQLCANCEL 5 #if (ODBCVER >= 0x0300) #define SQL_API_SQLCLOSECURSOR 1003 #define SQL_API_SQLCOLATTRIBUTE 6 #endif #define SQL_API_SQLCOLUMNS 40 #define SQL_API_SQLCONNECT 7 #if (ODBCVER >= 0x0300) #define SQL_API_SQLCOPYDESC 1004 #endif #define SQL_API_SQLDATASOURCES 57 #define SQL_API_SQLDESCRIBECOL 8 #define SQL_API_SQLDISCONNECT 9 #if (ODBCVER >= 0x0300) #define SQL_API_SQLENDTRAN 1005 #endif #define SQL_API_SQLERROR 10 #define SQL_API_SQLEXECDIRECT 11 #define SQL_API_SQLEXECUTE 12 #define SQL_API_SQLFETCH 13 #if (ODBCVER >= 0x0300) #define SQL_API_SQLFETCHSCROLL 1021 #endif #define SQL_API_SQLFREECONNECT 14 #define SQL_API_SQLFREEENV 15 #if (ODBCVER >= 0x0300) #define SQL_API_SQLFREEHANDLE 1006 #endif #define SQL_API_SQLFREESTMT 16 #if (ODBCVER >= 0x0300) #define SQL_API_SQLGETCONNECTATTR 1007 #endif #define SQL_API_SQLGETCONNECTOPTION 42 #define SQL_API_SQLGETCURSORNAME 17 #define SQL_API_SQLGETDATA 43 #if (ODBCVER >= 0x0300) #define SQL_API_SQLGETDESCFIELD 1008 #define SQL_API_SQLGETDESCREC 1009 #define SQL_API_SQLGETDIAGFIELD 1010 #define SQL_API_SQLGETDIAGREC 1011 #define SQL_API_SQLGETENVATTR 1012 #endif #define SQL_API_SQLGETFUNCTIONS 44 #define SQL_API_SQLGETINFO 45 #if (ODBCVER >= 0x0300) #define SQL_API_SQLGETSTMTATTR 1014 #endif #define SQL_API_SQLGETSTMTOPTION 46 #define SQL_API_SQLGETTYPEINFO 47 #define SQL_API_SQLNUMRESULTCOLS 18 #define SQL_API_SQLPARAMDATA 48 #define SQL_API_SQLPREPARE 19 #define SQL_API_SQLPUTDATA 49 #define SQL_API_SQLROWCOUNT 20 #if (ODBCVER >= 0x0300) #define SQL_API_SQLSETCONNECTATTR 1016 #endif #define SQL_API_SQLSETCONNECTOPTION 50 #define SQL_API_SQLSETCURSORNAME 21 #if (ODBCVER >= 0x0300) #define SQL_API_SQLSETDESCFIELD 1017 #define SQL_API_SQLSETDESCREC 1018 #define SQL_API_SQLSETENVATTR 1019 #endif #define SQL_API_SQLSETPARAM 22 #if (ODBCVER >= 0x0300) #define SQL_API_SQLSETSTMTATTR 1020 #endif #define SQL_API_SQLSETSTMTOPTION 51 #define SQL_API_SQLSPECIALCOLUMNS 52 #define SQL_API_SQLSTATISTICS 53 #define SQL_API_SQLTABLES 54 #define SQL_API_SQLTRANSACT 23 #if (ODBCVER >= 0x0380) #define SQL_API_SQLCANCELHANDLE 1022 #endif /* Information requested by SQLGetInfo() */ #if (ODBCVER >= 0x0300) #define SQL_MAX_DRIVER_CONNECTIONS 0 #define SQL_MAXIMUM_DRIVER_CONNECTIONS SQL_MAX_DRIVER_CONNECTIONS #define SQL_MAX_CONCURRENT_ACTIVITIES 1 #define SQL_MAXIMUM_CONCURRENT_ACTIVITIES SQL_MAX_CONCURRENT_ACTIVITIES #endif #define SQL_DATA_SOURCE_NAME 2 #define SQL_FETCH_DIRECTION 8 #define SQL_SERVER_NAME 13 #define SQL_SEARCH_PATTERN_ESCAPE 14 #define SQL_DBMS_NAME 17 #define SQL_DBMS_VER 18 #define SQL_ACCESSIBLE_TABLES 19 #define SQL_ACCESSIBLE_PROCEDURES 20 #define SQL_CURSOR_COMMIT_BEHAVIOR 23 #define SQL_DATA_SOURCE_READ_ONLY 25 #define SQL_DEFAULT_TXN_ISOLATION 26 #define SQL_IDENTIFIER_CASE 28 #define SQL_IDENTIFIER_QUOTE_CHAR 29 #define SQL_MAX_COLUMN_NAME_LEN 30 #define SQL_MAXIMUM_COLUMN_NAME_LENGTH SQL_MAX_COLUMN_NAME_LEN #define SQL_MAX_CURSOR_NAME_LEN 31 #define SQL_MAXIMUM_CURSOR_NAME_LENGTH SQL_MAX_CURSOR_NAME_LEN #define SQL_MAX_SCHEMA_NAME_LEN 32 #define SQL_MAXIMUM_SCHEMA_NAME_LENGTH SQL_MAX_SCHEMA_NAME_LEN #define SQL_MAX_CATALOG_NAME_LEN 34 #define SQL_MAXIMUM_CATALOG_NAME_LENGTH SQL_MAX_CATALOG_NAME_LEN #define SQL_MAX_TABLE_NAME_LEN 35 #define SQL_SCROLL_CONCURRENCY 43 #define SQL_TXN_CAPABLE 46 #define SQL_TRANSACTION_CAPABLE SQL_TXN_CAPABLE #define SQL_USER_NAME 47 #define SQL_TXN_ISOLATION_OPTION 72 #define SQL_TRANSACTION_ISOLATION_OPTION SQL_TXN_ISOLATION_OPTION #define SQL_INTEGRITY 73 #define SQL_GETDATA_EXTENSIONS 81 #define SQL_NULL_COLLATION 85 #define SQL_ALTER_TABLE 86 #define SQL_ORDER_BY_COLUMNS_IN_SELECT 90 #define SQL_SPECIAL_CHARACTERS 94 #define SQL_MAX_COLUMNS_IN_GROUP_BY 97 #define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY SQL_MAX_COLUMNS_IN_GROUP_BY #define SQL_MAX_COLUMNS_IN_INDEX 98 #define SQL_MAXIMUM_COLUMNS_IN_INDEX SQL_MAX_COLUMNS_IN_INDEX #define SQL_MAX_COLUMNS_IN_ORDER_BY 99 #define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY SQL_MAX_COLUMNS_IN_ORDER_BY #define SQL_MAX_COLUMNS_IN_SELECT 100 #define SQL_MAXIMUM_COLUMNS_IN_SELECT SQL_MAX_COLUMNS_IN_SELECT #define SQL_MAX_COLUMNS_IN_TABLE 101 #define SQL_MAX_INDEX_SIZE 102 #define SQL_MAXIMUM_INDEX_SIZE SQL_MAX_INDEX_SIZE #define SQL_MAX_ROW_SIZE 104 #define SQL_MAXIMUM_ROW_SIZE SQL_MAX_ROW_SIZE #define SQL_MAX_STATEMENT_LEN 105 #define SQL_MAXIMUM_STATEMENT_LENGTH SQL_MAX_STATEMENT_LEN #define SQL_MAX_TABLES_IN_SELECT 106 #define SQL_MAXIMUM_TABLES_IN_SELECT SQL_MAX_TABLES_IN_SELECT #define SQL_MAX_USER_NAME_LEN 107 #define SQL_MAXIMUM_USER_NAME_LENGTH SQL_MAX_USER_NAME_LEN #if (ODBCVER >= 0x0300) #define SQL_OJ_CAPABILITIES 115 #define SQL_OUTER_JOIN_CAPABILITIES SQL_OJ_CAPABILITIES #endif /* ODBCVER >= 0x0300 */ #if (ODBCVER >= 0x0300) #define SQL_XOPEN_CLI_YEAR 10000 #define SQL_CURSOR_SENSITIVITY 10001 #define SQL_DESCRIBE_PARAMETER 10002 #define SQL_CATALOG_NAME 10003 #define SQL_COLLATION_SEQ 10004 #define SQL_MAX_IDENTIFIER_LEN 10005 #define SQL_MAXIMUM_IDENTIFIER_LENGTH SQL_MAX_IDENTIFIER_LEN #endif /* ODBCVER >= 0x0300 */ /* SQL_ALTER_TABLE bitmasks */ #if (ODBCVER >= 0x0200) #define SQL_AT_ADD_COLUMN 0x00000001L #define SQL_AT_DROP_COLUMN 0x00000002L #endif /* ODBCVER >= 0x0200 */ #if (ODBCVER >= 0x0300) #define SQL_AT_ADD_CONSTRAINT 0x00000008L /* The following bitmasks are ODBC extensions and defined in sqlext.h *#define SQL_AT_COLUMN_SINGLE 0x00000020L *#define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L *#define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L *#define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L *#define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L *#define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L *#define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L *#define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L *#define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L *#define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L *#define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L *#define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L *#define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L *#define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L *#define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L */ #endif /* ODBCVER >= 0x0300 */ /* SQL_ASYNC_MODE values */ #if (ODBCVER >= 0x0300) #define SQL_AM_NONE 0 #define SQL_AM_CONNECTION 1 #define SQL_AM_STATEMENT 2 #endif /* SQL_CURSOR_COMMIT_BEHAVIOR values */ #define SQL_CB_DELETE 0 #define SQL_CB_CLOSE 1 #define SQL_CB_PRESERVE 2 /* SQL_FETCH_DIRECTION bitmasks */ #define SQL_FD_FETCH_NEXT 0x00000001L #define SQL_FD_FETCH_FIRST 0x00000002L #define SQL_FD_FETCH_LAST 0x00000004L #define SQL_FD_FETCH_PRIOR 0x00000008L #define SQL_FD_FETCH_ABSOLUTE 0x00000010L #define SQL_FD_FETCH_RELATIVE 0x00000020L /* SQL_GETDATA_EXTENSIONS bitmasks */ #define SQL_GD_ANY_COLUMN 0x00000001L #define SQL_GD_ANY_ORDER 0x00000002L /* SQL_IDENTIFIER_CASE values */ #define SQL_IC_UPPER 1 #define SQL_IC_LOWER 2 #define SQL_IC_SENSITIVE 3 #define SQL_IC_MIXED 4 /* SQL_OJ_CAPABILITIES bitmasks */ /* NB: this means 'outer join', not what you may be thinking */ #if (ODBCVER >= 0x0201) #define SQL_OJ_LEFT 0x00000001L #define SQL_OJ_RIGHT 0x00000002L #define SQL_OJ_FULL 0x00000004L #define SQL_OJ_NESTED 0x00000008L #define SQL_OJ_NOT_ORDERED 0x00000010L #define SQL_OJ_INNER 0x00000020L #define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L #endif /* SQL_SCROLL_CONCURRENCY bitmasks */ #define SQL_SCCO_READ_ONLY 0x00000001L #define SQL_SCCO_LOCK 0x00000002L #define SQL_SCCO_OPT_ROWVER 0x00000004L #define SQL_SCCO_OPT_VALUES 0x00000008L /* SQL_TXN_CAPABLE values */ #define SQL_TC_NONE 0 #define SQL_TC_DML 1 #define SQL_TC_ALL 2 #define SQL_TC_DDL_COMMIT 3 #define SQL_TC_DDL_IGNORE 4 /* SQL_TXN_ISOLATION_OPTION bitmasks */ #define SQL_TXN_READ_UNCOMMITTED 0x00000001L #define SQL_TRANSACTION_READ_UNCOMMITTED SQL_TXN_READ_UNCOMMITTED #define SQL_TXN_READ_COMMITTED 0x00000002L #define SQL_TRANSACTION_READ_COMMITTED SQL_TXN_READ_COMMITTED #define SQL_TXN_REPEATABLE_READ 0x00000004L #define SQL_TRANSACTION_REPEATABLE_READ SQL_TXN_REPEATABLE_READ #define SQL_TXN_SERIALIZABLE 0x00000008L #define SQL_TRANSACTION_SERIALIZABLE SQL_TXN_SERIALIZABLE /* SQL_NULL_COLLATION values */ #define SQL_NC_HIGH 0 #define SQL_NC_LOW 1 SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle, SQLHDBC *ConnectionHandle); SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); #endif SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle, SQLHSTMT *StatementHandle); SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind); #endif SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle); #if (ODBCVER >= 0x0380) SQLRETURN SQL_API SQLCancelHandle(SQLSMALLINT HandleType, SQLHANDLE InputHandle); #endif #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle); SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLLEN *NumericAttribute ); /* spec says (SQLPOINTER) not (SQLEN*) - PAH */ /* Ms now say SQLLEN* http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp - NG */ #endif SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLCHAR *ColumnName, SQLSMALLINT NameLength4); SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle, SQLCHAR *ServerName, SQLSMALLINT NameLength1, SQLCHAR *UserName, SQLSMALLINT NameLength2, SQLCHAR *Authentication, SQLSMALLINT NameLength3); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, SQLHDESC TargetDescHandle); #endif SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle, SQLUSMALLINT Direction, SQLCHAR *ServerName, SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, SQLCHAR *Description, SQLSMALLINT BufferLength2, SQLSMALLINT *NameLength2); SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, SQLSMALLINT *DataType, SQLULEN *ColumnSize, SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT CompletionType); #endif SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength); SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle); SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, SQLSMALLINT FetchOrientation, SQLLEN FetchOffset); #endif SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle); SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); #endif SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, SQLUSMALLINT Option); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLPOINTER Value); SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT BufferLength, SQLSMALLINT *NameLength); SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle, SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, SQLPOINTER TargetValue, SQLLEN BufferLength, SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength); SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLCHAR *Name, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, SQLSMALLINT *Scale, SQLSMALLINT *Nullable); SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif /* ODBCVER >= 0x0300 */ SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle, SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, SQLUSMALLINT InfoType, SQLPOINTER InfoValue, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif /* ODBCVER >= 0x0300 */ SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLPOINTER Value); SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, SQLSMALLINT DataType); SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, SQLSMALLINT *ColumnCount); SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle, SQLPOINTER *Value); SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle, SQLCHAR *StatementText, SQLINTEGER TextLength); SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle, SQLPOINTER Data, SQLLEN StrLen_or_Ind); SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle, SQLLEN *RowCount); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength); #endif /* ODBCVER >= 0x0300 */ SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle, SQLUSMALLINT Option, SQLULEN Value); SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle, SQLCHAR *CursorName, SQLSMALLINT NameLength); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength); SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, SQLSMALLINT RecNumber, SQLSMALLINT Type, SQLSMALLINT SubType, SQLLEN Length, SQLSMALLINT Precision, SQLSMALLINT Scale, SQLPOINTER Data, SQLLEN *StringLength, SQLLEN *Indicator); SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength); #endif /* ODBCVER >= 0x0300 */ SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN LengthPrecision, SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength); #endif SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle, SQLUSMALLINT Option, SQLULEN Value); SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Scope, SQLUSMALLINT Nullable); SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLUSMALLINT Unique, SQLUSMALLINT Reserved); SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle, SQLCHAR *CatalogName, SQLSMALLINT NameLength1, SQLCHAR *SchemaName, SQLSMALLINT NameLength2, SQLCHAR *TableName, SQLSMALLINT NameLength3, SQLCHAR *TableType, SQLSMALLINT NameLength4); SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle, SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); #ifdef __cplusplus } #endif #endif unixODBC-2.3.9/include/sqlext.h0000755000175000017500000024246612430426701013215 00000000000000/***************************************************** * sqlext.h * * These should be consistent with the MS version. * *****************************************************/ #ifndef __SQLEXT_H #define __SQLEXT_H /* BEGIN - unixODBC ONLY (programs like ODBCConfig and DataManager use these) */ /* COLUMNS IN SQLTables() RESULT SET */ #define SQLTables_TABLE_CATALOG 1 #define SQLTables_TABLE_SCHEM 2 #define SQLTables_TABLE_NAME 3 #define SQLTables_TABLE_TYPE 4 #define SQLTables_REMARKS 5 /* COLUMNS IN SQLColumns() RESULT SET */ #define SQLColumns_TABLE_CAT 1 #define SQLColumns_TABLE_SCHEM 2 #define SQLColumns_TABLE_NAME 3 #define SQLColumns_COLUMN_NAME 4 #define SQLColumns_DATA_TYPE 5 #define SQLColumns_TYPE_NAME 6 #define SQLColumns_COLUMN_SIZE 7 #define SQLColumns_BUFFER_LENGTH 8 #define SQLColumns_DECIMAL_DIGITS 9 #define SQLColumns_NUM_PREC_RADIX 10 #define SQLColumns_NULLABLE 11 #define SQLColumns_REMARKS 12 #define SQLColumns_COLUMN_DEF 13 #define SQLColumns_SQL_DATA_TYPE 14 #define SQLColumns_SQL_DATETIME_SUB 15 #define SQLColumns_CHAR_OCTET_LENGTH 16 #define SQLColumns_ORDINAL_POSITION 17 #define SQLColumns_IS_NULLABLE 18 /* END - unixODBC ONLY */ #ifndef __SQL_H #include "sql.h" #endif #ifdef __cplusplus extern "C" { /* Assume C declarations for C++ */ #endif /* generally useful constants */ #define SQL_SPEC_MAJOR 3 /* Major version of specification */ #define SQL_SPEC_MINOR 52 /* Minor version of specification */ #define SQL_SPEC_STRING "03.52" /* String constant for version */ #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */ #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */ #define SQL_MAX_OPTION_STRING_LENGTH 256 /* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */ #if (ODBCVER < 0x0300) #define SQL_NO_DATA_FOUND 100 #else #define SQL_NO_DATA_FOUND SQL_NO_DATA #endif /* an end handle type */ #if (ODBCVER >= 0x0300) #define SQL_HANDLE_SENV 5 #endif /* ODBCVER >= 0x0300 */ /* env attribute */ #if (ODBCVER >= 0x0300) #define SQL_ATTR_ODBC_VERSION 200 #define SQL_ATTR_CONNECTION_POOLING 201 #define SQL_ATTR_CP_MATCH 202 /* unixODBC additions */ #define SQL_ATTR_UNIXODBC_SYSPATH 65001 #define SQL_ATTR_UNIXODBC_VERSION 65002 #define SQL_ATTR_UNIXODBC_ENVATTR 65003 #endif /* ODBCVER >= 0x0300 */ #if (ODBCVER >= 0x0300) /* values for SQL_ATTR_CONNECTION_POOLING */ #define SQL_CP_OFF 0UL #define SQL_CP_ONE_PER_DRIVER 1UL #define SQL_CP_ONE_PER_HENV 2UL #define SQL_CP_DEFAULT SQL_CP_OFF /* values for SQL_ATTR_CP_MATCH */ #define SQL_CP_STRICT_MATCH 0UL #define SQL_CP_RELAXED_MATCH 1UL #define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH /* values for SQL_ATTR_ODBC_VERSION */ #define SQL_OV_ODBC2 2UL #define SQL_OV_ODBC3 3UL #endif /* ODBCVER >= 0x0300 */ #if (ODBCVER >= 0x0380) /* new values for SQL_ATTR_ODBC_VERSION */ /* From ODBC 3.8 onwards, we should use * 100 + */ #define SQL_OV_ODBC3_80 380UL #endif /* ODBCVER >= 0x0380 */ /* connection attributes */ #define SQL_ACCESS_MODE 101 #define SQL_AUTOCOMMIT 102 #define SQL_LOGIN_TIMEOUT 103 #define SQL_OPT_TRACE 104 #define SQL_OPT_TRACEFILE 105 #define SQL_TRANSLATE_DLL 106 #define SQL_TRANSLATE_OPTION 107 #define SQL_TXN_ISOLATION 108 #define SQL_CURRENT_QUALIFIER 109 #define SQL_ODBC_CURSORS 110 #define SQL_QUIET_MODE 111 #define SQL_PACKET_SIZE 112 /* connection attributes with new names */ #if (ODBCVER >= 0x0300) #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT #define SQL_ATTR_CONNECTION_TIMEOUT 113 #define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER #define SQL_ATTR_DISCONNECT_BEHAVIOR 114 #define SQL_ATTR_ENLIST_IN_DTC 1207 #define SQL_ATTR_ENLIST_IN_XA 1208 #define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT #define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS #define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE #define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE #define SQL_ATTR_TRACE SQL_OPT_TRACE #define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE #define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL #define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION #endif /* ODBCVER >= 0x0300 */ #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */ #define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */ #if (ODBCVER >= 0x0351) /* ODBC Driver Manager sets this connection attribute to a unicode driver (which supports SQLConnectW) when the application is an ANSI application (which calls SQLConnect, SQLDriverConnect, or SQLBrowseConnect). This is SetConnectAttr only and application does not set this attribute This attribute was introduced because some unicode driver's some APIs may need to behave differently on ANSI or Unicode applications. A unicode driver, which has same behavior for both ANSI or Unicode applications, should return SQL_ERROR when the driver manager sets this connection attribute. When a unicode driver returns SQL_SUCCESS on this attribute, the driver manager treates ANSI and Unicode connections differently in connection pooling. */ #define SQL_ATTR_ANSI_APP 115 #endif #if (ODBCVER >= 0x0380) #define SQL_ATTR_RESET_CONNECTION 116 #define SQL_ATTR_ASYNC_DBC_FUNCTIONS_ENABLE 117 #endif /* SQL_CONNECT_OPT_DRVR_START is not meaningful for 3.0 driver */ #if (ODBCVER < 0x0300) #define SQL_CONNECT_OPT_DRVR_START 1000 #endif /* ODBCVER < 0x0300 */ #if (ODBCVER < 0x0300) #define SQL_CONN_OPT_MAX SQL_PACKET_SIZE #define SQL_CONN_OPT_MIN SQL_ACCESS_MODE #endif /* ODBCVER < 0x0300 */ /* SQL_ACCESS_MODE options */ #define SQL_MODE_READ_WRITE 0UL #define SQL_MODE_READ_ONLY 1UL #define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE /* SQL_AUTOCOMMIT options */ #define SQL_AUTOCOMMIT_OFF 0UL #define SQL_AUTOCOMMIT_ON 1UL #define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON /* SQL_LOGIN_TIMEOUT options */ #define SQL_LOGIN_TIMEOUT_DEFAULT 15UL /* SQL_OPT_TRACE options */ #define SQL_OPT_TRACE_OFF 0UL #define SQL_OPT_TRACE_ON 1UL #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF #ifdef _WINDOWS_ #define SQL_OPT_TRACE_FILE_DEFAULT "\\temp\\SQL.LOG" #else #define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/SQL.LOG" #endif /* SQL_ODBC_CURSORS options */ #define SQL_CUR_USE_IF_NEEDED 0UL #define SQL_CUR_USE_ODBC 1UL #define SQL_CUR_USE_DRIVER 2UL #define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER #if (ODBCVER >= 0x0300) /* values for SQL_ATTR_DISCONNECT_BEHAVIOR */ #define SQL_DB_RETURN_TO_POOL 0UL #define SQL_DB_DISCONNECT 1UL #define SQL_DB_DEFAULT SQL_DB_RETURN_TO_POOL /* values for SQL_ATTR_ENLIST_IN_DTC */ #define SQL_DTC_DONE 0L #endif /* ODBCVER >= 0x0300 */ /* values for SQL_ATTR_CONNECTION_DEAD */ #define SQL_CD_TRUE 1L /* Connection is closed/dead */ #define SQL_CD_FALSE 0L /* Connection is open/available */ /* values for SQL_ATTR_ANSI_APP */ #if (ODBCVER >= 0x0351) #define SQL_AA_TRUE 1L /* the application is an ANSI app */ #define SQL_AA_FALSE 0L /* the application is a Unicode app */ #endif /* values for SQL_ATTR_RESET_CONNECTION */ #if (ODBCVER >= 0x0380) #define SQL_RESET_CONNECTION_YES 1UL #endif /* values for SQL_ATTR_ASYNC_DBC_FUNCTIONS_ENABLE */ #if (ODBCVER >= 0x0380) #define SQL_ASYNC_DBC_ENABLE_ON 1UL #define SQL_ASYNC_DBC_ENABLE_OFF 0UL #define SQL_ASYNC_DBC_ENABLE_DEFAULT SQL_ASYNC_DBC_ENABLE_OFF #endif /* statement attributes */ #define SQL_QUERY_TIMEOUT 0 #define SQL_MAX_ROWS 1 #define SQL_NOSCAN 2 #define SQL_MAX_LENGTH 3 #define SQL_ASYNC_ENABLE 4 /* same as SQL_ATTR_ASYNC_ENABLE */ #define SQL_BIND_TYPE 5 #define SQL_CURSOR_TYPE 6 #define SQL_CONCURRENCY 7 #define SQL_KEYSET_SIZE 8 #define SQL_ROWSET_SIZE 9 #define SQL_SIMULATE_CURSOR 10 #define SQL_RETRIEVE_DATA 11 #define SQL_USE_BOOKMARKS 12 #define SQL_GET_BOOKMARK 13 /* GetStmtOption Only */ #define SQL_ROW_NUMBER 14 /* GetStmtOption Only */ /* statement attributes for ODBC 3.0 */ #if (ODBCVER >= 0x0300) #define SQL_ATTR_ASYNC_ENABLE 4 #define SQL_ATTR_CONCURRENCY SQL_CONCURRENCY #define SQL_ATTR_CURSOR_TYPE SQL_CURSOR_TYPE #define SQL_ATTR_ENABLE_AUTO_IPD 15 #define SQL_ATTR_FETCH_BOOKMARK_PTR 16 #define SQL_ATTR_KEYSET_SIZE SQL_KEYSET_SIZE #define SQL_ATTR_MAX_LENGTH SQL_MAX_LENGTH #define SQL_ATTR_MAX_ROWS SQL_MAX_ROWS #define SQL_ATTR_NOSCAN SQL_NOSCAN #define SQL_ATTR_PARAM_BIND_OFFSET_PTR 17 #define SQL_ATTR_PARAM_BIND_TYPE 18 #define SQL_ATTR_PARAM_OPERATION_PTR 19 #define SQL_ATTR_PARAM_STATUS_PTR 20 #define SQL_ATTR_PARAMS_PROCESSED_PTR 21 #define SQL_ATTR_PARAMSET_SIZE 22 #define SQL_ATTR_QUERY_TIMEOUT SQL_QUERY_TIMEOUT #define SQL_ATTR_RETRIEVE_DATA SQL_RETRIEVE_DATA #define SQL_ATTR_ROW_BIND_OFFSET_PTR 23 #define SQL_ATTR_ROW_BIND_TYPE SQL_BIND_TYPE #define SQL_ATTR_ROW_NUMBER SQL_ROW_NUMBER /*GetStmtAttr*/ #define SQL_ATTR_ROW_OPERATION_PTR 24 #define SQL_ATTR_ROW_STATUS_PTR 25 #define SQL_ATTR_ROWS_FETCHED_PTR 26 #define SQL_ATTR_ROW_ARRAY_SIZE 27 #define SQL_ATTR_SIMULATE_CURSOR SQL_SIMULATE_CURSOR #define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS #endif /* ODBCVER >= 0x0300 */ #if (ODBCVER >= 0x0380) #define SQL_ATTR_ASYNC_STMT_EVENT 29 #endif /* ODBCVER >= 0x0380 */ #if (ODBCVER < 0x0300) #define SQL_STMT_OPT_MAX SQL_ROW_NUMBER #define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT #endif /* ODBCVER < 0x0300 */ /* New defines for SEARCHABLE column in SQLGetTypeInfo */ #if (ODBCVER >= 0x0300) #define SQL_COL_PRED_CHAR SQL_LIKE_ONLY #define SQL_COL_PRED_BASIC SQL_ALL_EXCEPT_LIKE #endif /* ODBCVER >= 0x0300 */ /* whether an attribute is a pointer or not */ #if (ODBCVER >= 0x0300) #define SQL_IS_POINTER (-4) #define SQL_IS_UINTEGER (-5) #define SQL_IS_INTEGER (-6) #define SQL_IS_USMALLINT (-7) #define SQL_IS_SMALLINT (-8) #endif /* ODBCVER >= 0x0300 */ /* the value of SQL_ATTR_PARAM_BIND_TYPE */ #if (ODBCVER >= 0x0300) #define SQL_PARAM_BIND_BY_COLUMN 0UL #define SQL_PARAM_BIND_TYPE_DEFAULT SQL_PARAM_BIND_BY_COLUMN #endif /* ODBCVER >= 0x0300 */ /* SQL_QUERY_TIMEOUT options */ #define SQL_QUERY_TIMEOUT_DEFAULT 0UL /* SQL_MAX_ROWS options */ #define SQL_MAX_ROWS_DEFAULT 0UL /* SQL_NOSCAN options */ #define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */ #define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */ #define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF /* SQL_MAX_LENGTH options */ #define SQL_MAX_LENGTH_DEFAULT 0UL /* values for SQL_ATTR_ASYNC_ENABLE */ #define SQL_ASYNC_ENABLE_OFF 0UL #define SQL_ASYNC_ENABLE_ON 1UL #define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF /* SQL_BIND_TYPE options */ #define SQL_BIND_BY_COLUMN 0UL #define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN /* Default value */ /* SQL_CONCURRENCY options */ #define SQL_CONCUR_READ_ONLY 1 #define SQL_CONCUR_LOCK 2 #define SQL_CONCUR_ROWVER 3 #define SQL_CONCUR_VALUES 4 #define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY /* Default value */ /* SQL_CURSOR_TYPE options */ #define SQL_CURSOR_FORWARD_ONLY 0UL #define SQL_CURSOR_KEYSET_DRIVEN 1UL #define SQL_CURSOR_DYNAMIC 2UL #define SQL_CURSOR_STATIC 3UL #define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY /* Default value */ /* SQL_ROWSET_SIZE options */ #define SQL_ROWSET_SIZE_DEFAULT 1UL /* SQL_KEYSET_SIZE options */ #define SQL_KEYSET_SIZE_DEFAULT 0UL /* SQL_SIMULATE_CURSOR options */ #define SQL_SC_NON_UNIQUE 0UL #define SQL_SC_TRY_UNIQUE 1UL #define SQL_SC_UNIQUE 2UL /* SQL_RETRIEVE_DATA options */ #define SQL_RD_OFF 0UL #define SQL_RD_ON 1UL #define SQL_RD_DEFAULT SQL_RD_ON /* SQL_USE_BOOKMARKS options */ #define SQL_UB_OFF 0UL #define SQL_UB_ON 01UL #define SQL_UB_DEFAULT SQL_UB_OFF /* New values for SQL_USE_BOOKMARKS attribute */ #if (ODBCVER >= 0x0300) #define SQL_UB_FIXED SQL_UB_ON #define SQL_UB_VARIABLE 2UL #endif /* ODBCVER >= 0x0300 */ /* extended descriptor field */ #if (ODBCVER >= 0x0300) #define SQL_DESC_ARRAY_SIZE 20 #define SQL_DESC_ARRAY_STATUS_PTR 21 #define SQL_DESC_AUTO_UNIQUE_VALUE SQL_COLUMN_AUTO_INCREMENT #define SQL_DESC_BASE_COLUMN_NAME 22 #define SQL_DESC_BASE_TABLE_NAME 23 #define SQL_DESC_BIND_OFFSET_PTR 24 #define SQL_DESC_BIND_TYPE 25 #define SQL_DESC_CASE_SENSITIVE SQL_COLUMN_CASE_SENSITIVE #define SQL_DESC_CATALOG_NAME SQL_COLUMN_QUALIFIER_NAME #define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE #define SQL_DESC_DATETIME_INTERVAL_PRECISION 26 #define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE #define SQL_DESC_FIXED_PREC_SCALE SQL_COLUMN_MONEY #define SQL_DESC_LABEL SQL_COLUMN_LABEL #define SQL_DESC_LITERAL_PREFIX 27 #define SQL_DESC_LITERAL_SUFFIX 28 #define SQL_DESC_LOCAL_TYPE_NAME 29 #define SQL_DESC_MAXIMUM_SCALE 30 #define SQL_DESC_MINIMUM_SCALE 31 #define SQL_DESC_NUM_PREC_RADIX 32 #define SQL_DESC_PARAMETER_TYPE 33 #define SQL_DESC_ROWS_PROCESSED_PTR 34 #if (ODBCVER >= 0x0350) #define SQL_DESC_ROWVER 35 #endif /* ODBCVER >= 0x0350 */ #define SQL_DESC_SCHEMA_NAME SQL_COLUMN_OWNER_NAME #define SQL_DESC_SEARCHABLE SQL_COLUMN_SEARCHABLE #define SQL_DESC_TYPE_NAME SQL_COLUMN_TYPE_NAME #define SQL_DESC_TABLE_NAME SQL_COLUMN_TABLE_NAME #define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED #define SQL_DESC_UPDATABLE SQL_COLUMN_UPDATABLE #endif /* ODBCVER >= 0x0300 */ /* defines for diagnostics fields */ #if (ODBCVER >= 0x0300) #define SQL_DIAG_CURSOR_ROW_COUNT (-1249) #define SQL_DIAG_ROW_NUMBER (-1248) #define SQL_DIAG_COLUMN_NUMBER (-1247) #endif /* ODBCVER >= 0x0300 */ /* SQL extended datatypes */ #define SQL_DATE 9 #if (ODBCVER >= 0x0300) #define SQL_INTERVAL 10 #endif /* ODBCVER >= 0x0300 */ #define SQL_TIME 10 #define SQL_TIMESTAMP 11 #define SQL_LONGVARCHAR (-1) #define SQL_BINARY (-2) #define SQL_VARBINARY (-3) #define SQL_LONGVARBINARY (-4) #define SQL_BIGINT (-5) #define SQL_TINYINT (-6) #define SQL_BIT (-7) #if (ODBCVER >= 0x0350) #define SQL_GUID (-11) #endif /* ODBCVER >= 0x0350 */ #if (ODBCVER >= 0x0300) /* interval code */ #define SQL_CODE_YEAR 1 #define SQL_CODE_MONTH 2 #define SQL_CODE_DAY 3 #define SQL_CODE_HOUR 4 #define SQL_CODE_MINUTE 5 #define SQL_CODE_SECOND 6 #define SQL_CODE_YEAR_TO_MONTH 7 #define SQL_CODE_DAY_TO_HOUR 8 #define SQL_CODE_DAY_TO_MINUTE 9 #define SQL_CODE_DAY_TO_SECOND 10 #define SQL_CODE_HOUR_TO_MINUTE 11 #define SQL_CODE_HOUR_TO_SECOND 12 #define SQL_CODE_MINUTE_TO_SECOND 13 #define SQL_INTERVAL_YEAR (100 + SQL_CODE_YEAR) #define SQL_INTERVAL_MONTH (100 + SQL_CODE_MONTH) #define SQL_INTERVAL_DAY (100 + SQL_CODE_DAY) #define SQL_INTERVAL_HOUR (100 + SQL_CODE_HOUR) #define SQL_INTERVAL_MINUTE (100 + SQL_CODE_MINUTE) #define SQL_INTERVAL_SECOND (100 + SQL_CODE_SECOND) #define SQL_INTERVAL_YEAR_TO_MONTH (100 + SQL_CODE_YEAR_TO_MONTH) #define SQL_INTERVAL_DAY_TO_HOUR (100 + SQL_CODE_DAY_TO_HOUR) #define SQL_INTERVAL_DAY_TO_MINUTE (100 + SQL_CODE_DAY_TO_MINUTE) #define SQL_INTERVAL_DAY_TO_SECOND (100 + SQL_CODE_DAY_TO_SECOND) #define SQL_INTERVAL_HOUR_TO_MINUTE (100 + SQL_CODE_HOUR_TO_MINUTE) #define SQL_INTERVAL_HOUR_TO_SECOND (100 + SQL_CODE_HOUR_TO_SECOND) #define SQL_INTERVAL_MINUTE_TO_SECOND (100 + SQL_CODE_MINUTE_TO_SECOND) #else #define SQL_INTERVAL_YEAR (-80) #define SQL_INTERVAL_MONTH (-81) #define SQL_INTERVAL_YEAR_TO_MONTH (-82) #define SQL_INTERVAL_DAY (-83) #define SQL_INTERVAL_HOUR (-84) #define SQL_INTERVAL_MINUTE (-85) #define SQL_INTERVAL_SECOND (-86) #define SQL_INTERVAL_DAY_TO_HOUR (-87) #define SQL_INTERVAL_DAY_TO_MINUTE (-88) #define SQL_INTERVAL_DAY_TO_SECOND (-89) #define SQL_INTERVAL_HOUR_TO_MINUTE (-90) #define SQL_INTERVAL_HOUR_TO_SECOND (-91) #define SQL_INTERVAL_MINUTE_TO_SECOND (-92) #endif /* ODBCVER >= 0x0300 */ #if (ODBCVER <= 0x0300) #define SQL_UNICODE (-95) #define SQL_UNICODE_VARCHAR (-96) #define SQL_UNICODE_LONGVARCHAR (-97) #define SQL_UNICODE_CHAR SQL_UNICODE #else /* The previous definitions for SQL_UNICODE_ are historical and obsolete */ #define SQL_UNICODE SQL_WCHAR #define SQL_UNICODE_VARCHAR SQL_WVARCHAR #define SQL_UNICODE_LONGVARCHAR SQL_WLONGVARCHAR #define SQL_UNICODE_CHAR SQL_WCHAR #endif #if (ODBCVER < 0x0300) #define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR #define SQL_TYPE_DRIVER_END SQL_UNICODE_LONGVARCHAR #endif /* ODBCVER < 0x0300 */ /* C datatype to SQL datatype mapping SQL types ------------------- */ #define SQL_C_CHAR SQL_CHAR /* CHAR, VARCHAR, DECIMAL, NUMERIC */ #define SQL_C_LONG SQL_INTEGER /* INTEGER */ #define SQL_C_SHORT SQL_SMALLINT /* SMALLINT */ #define SQL_C_FLOAT SQL_REAL /* REAL */ #define SQL_C_DOUBLE SQL_DOUBLE /* FLOAT, DOUBLE */ #if (ODBCVER >= 0x0300) #define SQL_C_NUMERIC SQL_NUMERIC #endif /* ODBCVER >= 0x0300 */ #define SQL_C_DEFAULT 99 #define SQL_SIGNED_OFFSET (-20) #define SQL_UNSIGNED_OFFSET (-22) /* C datatype to SQL datatype mapping */ #define SQL_C_DATE SQL_DATE #define SQL_C_TIME SQL_TIME #define SQL_C_TIMESTAMP SQL_TIMESTAMP #if (ODBCVER >= 0x0300) #define SQL_C_TYPE_DATE SQL_TYPE_DATE #define SQL_C_TYPE_TIME SQL_TYPE_TIME #define SQL_C_TYPE_TIMESTAMP SQL_TYPE_TIMESTAMP #define SQL_C_INTERVAL_YEAR SQL_INTERVAL_YEAR #define SQL_C_INTERVAL_MONTH SQL_INTERVAL_MONTH #define SQL_C_INTERVAL_DAY SQL_INTERVAL_DAY #define SQL_C_INTERVAL_HOUR SQL_INTERVAL_HOUR #define SQL_C_INTERVAL_MINUTE SQL_INTERVAL_MINUTE #define SQL_C_INTERVAL_SECOND SQL_INTERVAL_SECOND #define SQL_C_INTERVAL_YEAR_TO_MONTH SQL_INTERVAL_YEAR_TO_MONTH #define SQL_C_INTERVAL_DAY_TO_HOUR SQL_INTERVAL_DAY_TO_HOUR #define SQL_C_INTERVAL_DAY_TO_MINUTE SQL_INTERVAL_DAY_TO_MINUTE #define SQL_C_INTERVAL_DAY_TO_SECOND SQL_INTERVAL_DAY_TO_SECOND #define SQL_C_INTERVAL_HOUR_TO_MINUTE SQL_INTERVAL_HOUR_TO_MINUTE #define SQL_C_INTERVAL_HOUR_TO_SECOND SQL_INTERVAL_HOUR_TO_SECOND #define SQL_C_INTERVAL_MINUTE_TO_SECOND SQL_INTERVAL_MINUTE_TO_SECOND #endif /* ODBCVER >= 0x0300 */ #define SQL_C_BINARY SQL_BINARY #define SQL_C_BIT SQL_BIT #if (ODBCVER >= 0x0300) #define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */ #define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */ #endif /* ODBCVER >= 0x0300 */ #define SQL_C_TINYINT SQL_TINYINT #define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET) /* SIGNED INTEGER */ #define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET) /* SIGNED SMALLINT */ #define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET) /* SIGNED TINYINT */ #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/ #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/ #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/ #if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE) #define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */ #else #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */ #endif #if (ODBCVER >= 0x0350) #define SQL_C_GUID SQL_GUID #endif /* ODBCVER >= 0x0350 */ #define SQL_TYPE_NULL 0 #if (ODBCVER < 0x0300) #define SQL_TYPE_MIN SQL_BIT #define SQL_TYPE_MAX SQL_VARCHAR #endif /* base value of driver-specific C-Type (max is 0x7fff) */ /* define driver-specific C-Type, named as SQL_DRIVER_C_TYPE_BASE, */ /* SQL_DRIVER_C_TYPE_BASE+1, SQL_DRIVER_C_TYPE_BASE+2, etc. */ #if (ODBCVER >= 0x380) #define SQL_DRIVER_C_TYPE_BASE 0x4000 #endif /* base value of driver-specific fields/attributes (max are 0x7fff [16-bit] or 0x00007fff [32-bit]) */ /* define driver-specific SQL-Type, named as SQL_DRIVER_SQL_TYPE_BASE, */ /* SQL_DRIVER_SQL_TYPE_BASE+1, SQL_DRIVER_SQL_TYPE_BASE+2, etc. */ /* */ /* Please note that there is no runtime change in this version of DM. */ /* However, we suggest that driver manufacturers adhere to this range */ /* as future versions of the DM may enforce these constraints */ #if (ODBCVER >= 0x380) #define SQL_DRIVER_SQL_TYPE_BASE 0x4000 #define SQL_DRIVER_DESC_FIELD_BASE 0x4000 #define SQL_DRIVER_DIAG_FIELD_BASE 0x4000 #define SQL_DRIVER_INFO_TYPE_BASE 0x4000 #define SQL_DRIVER_CONN_ATTR_BASE 0x00004000 #define SQL_DRIVER_STMT_ATTR_BASE 0x00004000 #endif #if (ODBCVER >= 0x0300) #define SQL_C_VARBOOKMARK SQL_C_BINARY #endif /* ODBCVER >= 0x0300 */ /* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */ #if (ODBCVER >= 0x0300) #define SQL_NO_ROW_NUMBER (-1) #define SQL_NO_COLUMN_NUMBER (-1) #define SQL_ROW_NUMBER_UNKNOWN (-2) #define SQL_COLUMN_NUMBER_UNKNOWN (-2) #endif /* SQLBindParameter extensions */ #define SQL_DEFAULT_PARAM (-5) #define SQL_IGNORE (-6) #if (ODBCVER >= 0x0300) #define SQL_COLUMN_IGNORE SQL_IGNORE #endif /* ODBCVER >= 0x0300 */ #define SQL_LEN_DATA_AT_EXEC_OFFSET (-100) #define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET) /* binary length for driver specific attributes */ #define SQL_LEN_BINARY_ATTR_OFFSET (-100) #define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET) /* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter */ #define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT #define SQL_SETPARAM_VALUE_MAX (-1L) /* SQLColAttributes defines */ #define SQL_COLUMN_COUNT 0 #define SQL_COLUMN_NAME 1 #define SQL_COLUMN_TYPE 2 #define SQL_COLUMN_LENGTH 3 #define SQL_COLUMN_PRECISION 4 #define SQL_COLUMN_SCALE 5 #define SQL_COLUMN_DISPLAY_SIZE 6 #define SQL_COLUMN_NULLABLE 7 #define SQL_COLUMN_UNSIGNED 8 #define SQL_COLUMN_MONEY 9 #define SQL_COLUMN_UPDATABLE 10 #define SQL_COLUMN_AUTO_INCREMENT 11 #define SQL_COLUMN_CASE_SENSITIVE 12 #define SQL_COLUMN_SEARCHABLE 13 #define SQL_COLUMN_TYPE_NAME 14 #define SQL_COLUMN_TABLE_NAME 15 #define SQL_COLUMN_OWNER_NAME 16 #define SQL_COLUMN_QUALIFIER_NAME 17 #define SQL_COLUMN_LABEL 18 #define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL #if (ODBCVER < 0x0300) #define SQL_COLUMN_DRIVER_START 1000 #endif /* ODBCVER < 0x0300 */ #define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT /* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */ #define SQL_ATTR_READONLY 0 #define SQL_ATTR_WRITE 1 #define SQL_ATTR_READWRITE_UNKNOWN 2 /* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */ /* These are also used by SQLGetInfo */ #define SQL_UNSEARCHABLE 0 #define SQL_LIKE_ONLY 1 #define SQL_ALL_EXCEPT_LIKE 2 #define SQL_SEARCHABLE 3 #define SQL_PRED_SEARCHABLE SQL_SEARCHABLE /* Special return values for SQLGetData */ #define SQL_NO_TOTAL (-4) /********************************************/ /* SQLGetFunctions: additional values for */ /* fFunction to represent functions that */ /* are not in the X/Open spec. */ /********************************************/ #if (ODBCVER >= 0x0300) #define SQL_API_SQLALLOCHANDLESTD 73 #define SQL_API_SQLBULKOPERATIONS 24 #endif /* ODBCVER >= 0x0300 */ #define SQL_API_SQLBINDPARAMETER 72 #define SQL_API_SQLBROWSECONNECT 55 #define SQL_API_SQLCOLATTRIBUTES 6 #define SQL_API_SQLCOLUMNPRIVILEGES 56 #define SQL_API_SQLDESCRIBEPARAM 58 #define SQL_API_SQLDRIVERCONNECT 41 #define SQL_API_SQLDRIVERS 71 #define SQL_API_SQLEXTENDEDFETCH 59 #define SQL_API_SQLFOREIGNKEYS 60 #define SQL_API_SQLMORERESULTS 61 #define SQL_API_SQLNATIVESQL 62 #define SQL_API_SQLNUMPARAMS 63 #define SQL_API_SQLPARAMOPTIONS 64 #define SQL_API_SQLPRIMARYKEYS 65 #define SQL_API_SQLPROCEDURECOLUMNS 66 #define SQL_API_SQLPROCEDURES 67 #define SQL_API_SQLSETPOS 68 #define SQL_API_SQLSETSCROLLOPTIONS 69 #define SQL_API_SQLTABLEPRIVILEGES 70 /*-------------------------------------------*/ /* SQL_EXT_API_LAST is not useful with ODBC */ /* version 3.0 because some of the values */ /* from X/Open are in the 10000 range. */ /*-------------------------------------------*/ #if (ODBCVER < 0x0300) #define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER #define SQL_NUM_FUNCTIONS 23 #define SQL_EXT_API_START 40 #define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1) #endif /*--------------------------------------------*/ /* SQL_API_ALL_FUNCTIONS returns an array */ /* of 'booleans' representing whether a */ /* function is implemented by the driver. */ /* */ /* CAUTION: Only functions defined in ODBC */ /* version 2.0 and earlier are returned, the */ /* new high-range function numbers defined by */ /* X/Open break this scheme. See the new */ /* method -- SQL_API_ODBC3_ALL_FUNCTIONS */ /*--------------------------------------------*/ #define SQL_API_ALL_FUNCTIONS 0 /* See CAUTION above */ /*----------------------------------------------*/ /* 2.X drivers export a dummy function with */ /* ordinal number SQL_API_LOADBYORDINAL to speed*/ /* loading under the windows operating system. */ /* */ /* CAUTION: Loading by ordinal is not supported */ /* for 3.0 and above drivers. */ /*----------------------------------------------*/ #define SQL_API_LOADBYORDINAL 199 /* See CAUTION above */ /*----------------------------------------------*/ /* SQL_API_ODBC3_ALL_FUNCTIONS */ /* This returns a bitmap, which allows us to */ /* handle the higher-valued function numbers. */ /* Use SQL_FUNC_EXISTS(bitmap,function_number) */ /* to determine if the function exists. */ /*----------------------------------------------*/ #if (ODBCVER >= 0x0300) #define SQL_API_ODBC3_ALL_FUNCTIONS 999 #define SQL_API_ODBC3_ALL_FUNCTIONS_SIZE 250 /* array of 250 words */ #define SQL_FUNC_EXISTS(pfExists, uwAPI) ((*(((UWORD*) (pfExists)) + ((uwAPI) >> 4)) & (1 << ((uwAPI) & 0x000F)) ) ? SQL_TRUE : SQL_FALSE ) #endif /* ODBCVER >= 0x0300 */ /************************************************/ /* Extended definitions for SQLGetInfo */ /************************************************/ /*---------------------------------*/ /* Values in ODBC 2.0 that are not */ /* in the X/Open spec */ /*---------------------------------*/ #define SQL_INFO_FIRST 0 #define SQL_ACTIVE_CONNECTIONS 0 /* MAX_DRIVER_CONNECTIONS */ #define SQL_ACTIVE_STATEMENTS 1 /* MAX_CONCURRENT_ACTIVITIES */ #define SQL_DRIVER_HDBC 3 #define SQL_DRIVER_HENV 4 #define SQL_DRIVER_HSTMT 5 #define SQL_DRIVER_NAME 6 #define SQL_DRIVER_VER 7 #define SQL_ODBC_API_CONFORMANCE 9 #define SQL_ODBC_VER 10 #define SQL_ROW_UPDATES 11 #define SQL_ODBC_SAG_CLI_CONFORMANCE 12 #define SQL_ODBC_SQL_CONFORMANCE 15 #define SQL_PROCEDURES 21 #define SQL_CONCAT_NULL_BEHAVIOR 22 #define SQL_CURSOR_ROLLBACK_BEHAVIOR 24 #define SQL_EXPRESSIONS_IN_ORDERBY 27 #define SQL_MAX_OWNER_NAME_LEN 32 /* MAX_SCHEMA_NAME_LEN */ #define SQL_MAX_PROCEDURE_NAME_LEN 33 #define SQL_MAX_QUALIFIER_NAME_LEN 34 /* MAX_CATALOG_NAME_LEN */ #define SQL_MULT_RESULT_SETS 36 #define SQL_MULTIPLE_ACTIVE_TXN 37 #define SQL_OUTER_JOINS 38 #define SQL_OWNER_TERM 39 #define SQL_PROCEDURE_TERM 40 #define SQL_QUALIFIER_NAME_SEPARATOR 41 #define SQL_QUALIFIER_TERM 42 #define SQL_SCROLL_OPTIONS 44 #define SQL_TABLE_TERM 45 #define SQL_CONVERT_FUNCTIONS 48 #define SQL_NUMERIC_FUNCTIONS 49 #define SQL_STRING_FUNCTIONS 50 #define SQL_SYSTEM_FUNCTIONS 51 #define SQL_TIMEDATE_FUNCTIONS 52 #define SQL_CONVERT_BIGINT 53 #define SQL_CONVERT_BINARY 54 #define SQL_CONVERT_BIT 55 #define SQL_CONVERT_CHAR 56 #define SQL_CONVERT_DATE 57 #define SQL_CONVERT_DECIMAL 58 #define SQL_CONVERT_DOUBLE 59 #define SQL_CONVERT_FLOAT 60 #define SQL_CONVERT_INTEGER 61 #define SQL_CONVERT_LONGVARCHAR 62 #define SQL_CONVERT_NUMERIC 63 #define SQL_CONVERT_REAL 64 #define SQL_CONVERT_SMALLINT 65 #define SQL_CONVERT_TIME 66 #define SQL_CONVERT_TIMESTAMP 67 #define SQL_CONVERT_TINYINT 68 #define SQL_CONVERT_VARBINARY 69 #define SQL_CONVERT_VARCHAR 70 #define SQL_CONVERT_LONGVARBINARY 71 #define SQL_CONVERT_GUID 173 #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */ #define SQL_CORRELATION_NAME 74 #define SQL_NON_NULLABLE_COLUMNS 75 #define SQL_DRIVER_HLIB 76 #define SQL_DRIVER_ODBC_VER 77 #define SQL_LOCK_TYPES 78 #define SQL_POS_OPERATIONS 79 #define SQL_POSITIONED_STATEMENTS 80 #define SQL_BOOKMARK_PERSISTENCE 82 #define SQL_STATIC_SENSITIVITY 83 #define SQL_FILE_USAGE 84 #define SQL_COLUMN_ALIAS 87 #define SQL_GROUP_BY 88 #define SQL_KEYWORDS 89 #define SQL_OWNER_USAGE 91 #define SQL_QUALIFIER_USAGE 92 #define SQL_QUOTED_IDENTIFIER_CASE 93 #define SQL_SUBQUERIES 95 #define SQL_UNION 96 #define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103 #define SQL_MAX_CHAR_LITERAL_LEN 108 #define SQL_TIMEDATE_ADD_INTERVALS 109 #define SQL_TIMEDATE_DIFF_INTERVALS 110 #define SQL_NEED_LONG_DATA_LEN 111 #define SQL_MAX_BINARY_LITERAL_LEN 112 #define SQL_LIKE_ESCAPE_CLAUSE 113 #define SQL_QUALIFIER_LOCATION 114 #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300) #ifndef SQL_OJ_CAPABILITIES #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ #endif #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */ /*----------------------------------------------*/ /* SQL_INFO_LAST and SQL_INFO_DRIVER_START are */ /* not useful anymore, because X/Open has */ /* values in the 10000 range. You */ /* must contact X/Open directly to get a range */ /* of numbers for driver-specific values. */ /*----------------------------------------------*/ #if (ODBCVER < 0x0300) #define SQL_INFO_LAST SQL_QUALIFIER_LOCATION #define SQL_INFO_DRIVER_START 1000 #endif /* ODBCVER < 0x0300 */ /*-----------------------------------------------*/ /* ODBC 3.0 SQLGetInfo values that are not part */ /* of the X/Open standard at this time. X/Open */ /* standard values are in sql.h. */ /*-----------------------------------------------*/ #if (ODBCVER >= 0x0300) #define SQL_ACTIVE_ENVIRONMENTS 116 #define SQL_ALTER_DOMAIN 117 #define SQL_SQL_CONFORMANCE 118 #define SQL_DATETIME_LITERALS 119 #define SQL_ASYNC_MODE 10021 /* new X/Open spec */ #define SQL_BATCH_ROW_COUNT 120 #define SQL_BATCH_SUPPORT 121 #define SQL_CATALOG_LOCATION SQL_QUALIFIER_LOCATION #define SQL_CATALOG_NAME_SEPARATOR SQL_QUALIFIER_NAME_SEPARATOR #define SQL_CATALOG_TERM SQL_QUALIFIER_TERM #define SQL_CATALOG_USAGE SQL_QUALIFIER_USAGE #define SQL_CONVERT_WCHAR 122 #define SQL_CONVERT_INTERVAL_DAY_TIME 123 #define SQL_CONVERT_INTERVAL_YEAR_MONTH 124 #define SQL_CONVERT_WLONGVARCHAR 125 #define SQL_CONVERT_WVARCHAR 126 #define SQL_CREATE_ASSERTION 127 #define SQL_CREATE_CHARACTER_SET 128 #define SQL_CREATE_COLLATION 129 #define SQL_CREATE_DOMAIN 130 #define SQL_CREATE_SCHEMA 131 #define SQL_CREATE_TABLE 132 #define SQL_CREATE_TRANSLATION 133 #define SQL_CREATE_VIEW 134 #define SQL_DRIVER_HDESC 135 #define SQL_DROP_ASSERTION 136 #define SQL_DROP_CHARACTER_SET 137 #define SQL_DROP_COLLATION 138 #define SQL_DROP_DOMAIN 139 #define SQL_DROP_SCHEMA 140 #define SQL_DROP_TABLE 141 #define SQL_DROP_TRANSLATION 142 #define SQL_DROP_VIEW 143 #define SQL_DYNAMIC_CURSOR_ATTRIBUTES1 144 #define SQL_DYNAMIC_CURSOR_ATTRIBUTES2 145 #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146 #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 147 #define SQL_INDEX_KEYWORDS 148 #define SQL_INFO_SCHEMA_VIEWS 149 #define SQL_KEYSET_CURSOR_ATTRIBUTES1 150 #define SQL_KEYSET_CURSOR_ATTRIBUTES2 151 #define SQL_MAX_ASYNC_CONCURRENT_STATEMENTS 10022 /* new X/Open spec */ #define SQL_ODBC_INTERFACE_CONFORMANCE 152 #define SQL_PARAM_ARRAY_ROW_COUNTS 153 #define SQL_PARAM_ARRAY_SELECTS 154 #define SQL_SCHEMA_TERM SQL_OWNER_TERM #define SQL_SCHEMA_USAGE SQL_OWNER_USAGE #define SQL_SQL92_DATETIME_FUNCTIONS 155 #define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156 #define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157 #define SQL_SQL92_GRANT 158 #define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 159 #define SQL_SQL92_PREDICATES 160 #define SQL_SQL92_RELATIONAL_JOIN_OPERATORS 161 #define SQL_SQL92_REVOKE 162 #define SQL_SQL92_ROW_VALUE_CONSTRUCTOR 163 #define SQL_SQL92_STRING_FUNCTIONS 164 #define SQL_SQL92_VALUE_EXPRESSIONS 165 #define SQL_STANDARD_CLI_CONFORMANCE 166 #define SQL_STATIC_CURSOR_ATTRIBUTES1 167 #define SQL_STATIC_CURSOR_ATTRIBUTES2 168 #define SQL_AGGREGATE_FUNCTIONS 169 #define SQL_DDL_INDEX 170 #define SQL_DM_VER 171 #define SQL_INSERT_STATEMENT 172 #define SQL_UNION_STATEMENT SQL_UNION #endif /* ODBCVER >= 0x0300 */ #if (ODBCVER >= 0x0380) /* Info Types */ #define SQL_ASYNC_DBC_FUNCTIONS 10023 #endif #define SQL_DRIVER_AWARE_POOLING_SUPPORTED 10024 #if (ODBCVER >= 0x0380) #define SQL_ASYNC_NOTIFICATION 10025 /* Possible values for SQL_ASYNC_NOTIFICATION */ #define SQL_ASYNC_NOTIFICATION_NOT_CAPABLE 0x00000000L #define SQL_ASYNC_NOTIFICATION_CAPABLE 0x00000001L #endif /* ODBCVER >= 0x0380 */ #define SQL_DTC_TRANSITION_COST 1750 /* SQL_ALTER_TABLE bitmasks */ #if (ODBCVER >= 0x0300) /* the following 5 bitmasks are defined in sql.h *#define SQL_AT_ADD_COLUMN 0x00000001L *#define SQL_AT_DROP_COLUMN 0x00000002L *#define SQL_AT_ADD_CONSTRAINT 0x00000008L */ #define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L #define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L #define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L #define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L #define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L #define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L #endif /* ODBCVER >= 0x0300 */ /* SQL_CONVERT_* return value bitmasks */ #define SQL_CVT_CHAR 0x00000001L #define SQL_CVT_NUMERIC 0x00000002L #define SQL_CVT_DECIMAL 0x00000004L #define SQL_CVT_INTEGER 0x00000008L #define SQL_CVT_SMALLINT 0x00000010L #define SQL_CVT_FLOAT 0x00000020L #define SQL_CVT_REAL 0x00000040L #define SQL_CVT_DOUBLE 0x00000080L #define SQL_CVT_VARCHAR 0x00000100L #define SQL_CVT_LONGVARCHAR 0x00000200L #define SQL_CVT_BINARY 0x00000400L #define SQL_CVT_VARBINARY 0x00000800L #define SQL_CVT_BIT 0x00001000L #define SQL_CVT_TINYINT 0x00002000L #define SQL_CVT_BIGINT 0x00004000L #define SQL_CVT_DATE 0x00008000L #define SQL_CVT_TIME 0x00010000L #define SQL_CVT_TIMESTAMP 0x00020000L #define SQL_CVT_LONGVARBINARY 0x00040000L #if (ODBCVER >= 0x0300) #define SQL_CVT_INTERVAL_YEAR_MONTH 0x00080000L #define SQL_CVT_INTERVAL_DAY_TIME 0x00100000L #define SQL_CVT_WCHAR 0x00200000L #define SQL_CVT_WLONGVARCHAR 0x00400000L #define SQL_CVT_WVARCHAR 0x00800000L #define SQL_CVT_GUID 0x01000000L #endif /* ODBCVER >= 0x0300 */ /* SQL_CONVERT_FUNCTIONS functions */ #define SQL_FN_CVT_CONVERT 0x00000001L #if (ODBCVER >= 0x0300) #define SQL_FN_CVT_CAST 0x00000002L #endif /* ODBCVER >= 0x0300 */ /* SQL_STRING_FUNCTIONS functions */ #define SQL_FN_STR_CONCAT 0x00000001L #define SQL_FN_STR_INSERT 0x00000002L #define SQL_FN_STR_LEFT 0x00000004L #define SQL_FN_STR_LTRIM 0x00000008L #define SQL_FN_STR_LENGTH 0x00000010L #define SQL_FN_STR_LOCATE 0x00000020L #define SQL_FN_STR_LCASE 0x00000040L #define SQL_FN_STR_REPEAT 0x00000080L #define SQL_FN_STR_REPLACE 0x00000100L #define SQL_FN_STR_RIGHT 0x00000200L #define SQL_FN_STR_RTRIM 0x00000400L #define SQL_FN_STR_SUBSTRING 0x00000800L #define SQL_FN_STR_UCASE 0x00001000L #define SQL_FN_STR_ASCII 0x00002000L #define SQL_FN_STR_CHAR 0x00004000L #define SQL_FN_STR_DIFFERENCE 0x00008000L #define SQL_FN_STR_LOCATE_2 0x00010000L #define SQL_FN_STR_SOUNDEX 0x00020000L #define SQL_FN_STR_SPACE 0x00040000L #if (ODBCVER >= 0x0300) #define SQL_FN_STR_BIT_LENGTH 0x00080000L #define SQL_FN_STR_CHAR_LENGTH 0x00100000L #define SQL_FN_STR_CHARACTER_LENGTH 0x00200000L #define SQL_FN_STR_OCTET_LENGTH 0x00400000L #define SQL_FN_STR_POSITION 0x00800000L #endif /* ODBCVER >= 0x0300 */ /* SQL_SQL92_STRING_FUNCTIONS */ #if (ODBCVER >= 0x0300) #define SQL_SSF_CONVERT 0x00000001L #define SQL_SSF_LOWER 0x00000002L #define SQL_SSF_UPPER 0x00000004L #define SQL_SSF_SUBSTRING 0x00000008L #define SQL_SSF_TRANSLATE 0x00000010L #define SQL_SSF_TRIM_BOTH 0x00000020L #define SQL_SSF_TRIM_LEADING 0x00000040L #define SQL_SSF_TRIM_TRAILING 0x00000080L #endif /* ODBCVER >= 0x0300 */ /* SQL_NUMERIC_FUNCTIONS functions */ #define SQL_FN_NUM_ABS 0x00000001L #define SQL_FN_NUM_ACOS 0x00000002L #define SQL_FN_NUM_ASIN 0x00000004L #define SQL_FN_NUM_ATAN 0x00000008L #define SQL_FN_NUM_ATAN2 0x00000010L #define SQL_FN_NUM_CEILING 0x00000020L #define SQL_FN_NUM_COS 0x00000040L #define SQL_FN_NUM_COT 0x00000080L #define SQL_FN_NUM_EXP 0x00000100L #define SQL_FN_NUM_FLOOR 0x00000200L #define SQL_FN_NUM_LOG 0x00000400L #define SQL_FN_NUM_MOD 0x00000800L #define SQL_FN_NUM_SIGN 0x00001000L #define SQL_FN_NUM_SIN 0x00002000L #define SQL_FN_NUM_SQRT 0x00004000L #define SQL_FN_NUM_TAN 0x00008000L #define SQL_FN_NUM_PI 0x00010000L #define SQL_FN_NUM_RAND 0x00020000L #define SQL_FN_NUM_DEGREES 0x00040000L #define SQL_FN_NUM_LOG10 0x00080000L #define SQL_FN_NUM_POWER 0x00100000L #define SQL_FN_NUM_RADIANS 0x00200000L #define SQL_FN_NUM_ROUND 0x00400000L #define SQL_FN_NUM_TRUNCATE 0x00800000L /* SQL_SQL92_NUMERIC_VALUE_FUNCTIONS */ #if (ODBCVER >= 0x0300) #define SQL_SNVF_BIT_LENGTH 0x00000001L #define SQL_SNVF_CHAR_LENGTH 0x00000002L #define SQL_SNVF_CHARACTER_LENGTH 0x00000004L #define SQL_SNVF_EXTRACT 0x00000008L #define SQL_SNVF_OCTET_LENGTH 0x00000010L #define SQL_SNVF_POSITION 0x00000020L #endif /* ODBCVER >= 0x0300 */ /* SQL_TIMEDATE_FUNCTIONS functions */ #define SQL_FN_TD_NOW 0x00000001L #define SQL_FN_TD_CURDATE 0x00000002L #define SQL_FN_TD_DAYOFMONTH 0x00000004L #define SQL_FN_TD_DAYOFWEEK 0x00000008L #define SQL_FN_TD_DAYOFYEAR 0x00000010L #define SQL_FN_TD_MONTH 0x00000020L #define SQL_FN_TD_QUARTER 0x00000040L #define SQL_FN_TD_WEEK 0x00000080L #define SQL_FN_TD_YEAR 0x00000100L #define SQL_FN_TD_CURTIME 0x00000200L #define SQL_FN_TD_HOUR 0x00000400L #define SQL_FN_TD_MINUTE 0x00000800L #define SQL_FN_TD_SECOND 0x00001000L #define SQL_FN_TD_TIMESTAMPADD 0x00002000L #define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L #define SQL_FN_TD_DAYNAME 0x00008000L #define SQL_FN_TD_MONTHNAME 0x00010000L #if (ODBCVER >= 0x0300) #define SQL_FN_TD_CURRENT_DATE 0x00020000L #define SQL_FN_TD_CURRENT_TIME 0x00040000L #define SQL_FN_TD_CURRENT_TIMESTAMP 0x00080000L #define SQL_FN_TD_EXTRACT 0x00100000L #endif /* ODBCVER >= 0x0300 */ /* SQL_SQL92_DATETIME_FUNCTIONS */ #if (ODBCVER >= 0x0300) #define SQL_SDF_CURRENT_DATE 0x00000001L #define SQL_SDF_CURRENT_TIME 0x00000002L #define SQL_SDF_CURRENT_TIMESTAMP 0x00000004L #endif /* ODBCVER >= 0x0300 */ /* SQL_SYSTEM_FUNCTIONS functions */ #define SQL_FN_SYS_USERNAME 0x00000001L #define SQL_FN_SYS_DBNAME 0x00000002L #define SQL_FN_SYS_IFNULL 0x00000004L /* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */ #define SQL_FN_TSI_FRAC_SECOND 0x00000001L #define SQL_FN_TSI_SECOND 0x00000002L #define SQL_FN_TSI_MINUTE 0x00000004L #define SQL_FN_TSI_HOUR 0x00000008L #define SQL_FN_TSI_DAY 0x00000010L #define SQL_FN_TSI_WEEK 0x00000020L #define SQL_FN_TSI_MONTH 0x00000040L #define SQL_FN_TSI_QUARTER 0x00000080L #define SQL_FN_TSI_YEAR 0x00000100L /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES1, * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1, * SQL_KEYSET_CURSOR_ATTRIBUTES1, and SQL_STATIC_CURSOR_ATTRIBUTES1 */ #if (ODBCVER >= 0x0300) /* supported SQLFetchScroll FetchOrientation's */ #define SQL_CA1_NEXT 0x00000001L #define SQL_CA1_ABSOLUTE 0x00000002L #define SQL_CA1_RELATIVE 0x00000004L #define SQL_CA1_BOOKMARK 0x00000008L /* supported SQLSetPos LockType's */ #define SQL_CA1_LOCK_NO_CHANGE 0x00000040L #define SQL_CA1_LOCK_EXCLUSIVE 0x00000080L #define SQL_CA1_LOCK_UNLOCK 0x00000100L /* supported SQLSetPos Operations */ #define SQL_CA1_POS_POSITION 0x00000200L #define SQL_CA1_POS_UPDATE 0x00000400L #define SQL_CA1_POS_DELETE 0x00000800L #define SQL_CA1_POS_REFRESH 0x00001000L /* positioned updates and deletes */ #define SQL_CA1_POSITIONED_UPDATE 0x00002000L #define SQL_CA1_POSITIONED_DELETE 0x00004000L #define SQL_CA1_SELECT_FOR_UPDATE 0x00008000L /* supported SQLBulkOperations operations */ #define SQL_CA1_BULK_ADD 0x00010000L #define SQL_CA1_BULK_UPDATE_BY_BOOKMARK 0x00020000L #define SQL_CA1_BULK_DELETE_BY_BOOKMARK 0x00040000L #define SQL_CA1_BULK_FETCH_BY_BOOKMARK 0x00080000L #endif /* ODBCVER >= 0x0300 */ /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES2, * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2, * SQL_KEYSET_CURSOR_ATTRIBUTES2, and SQL_STATIC_CURSOR_ATTRIBUTES2 */ #if (ODBCVER >= 0x0300) /* supported values for SQL_ATTR_SCROLL_CONCURRENCY */ #define SQL_CA2_READ_ONLY_CONCURRENCY 0x00000001L #define SQL_CA2_LOCK_CONCURRENCY 0x00000002L #define SQL_CA2_OPT_ROWVER_CONCURRENCY 0x00000004L #define SQL_CA2_OPT_VALUES_CONCURRENCY 0x00000008L /* sensitivity of the cursor to its own inserts, deletes, and updates */ #define SQL_CA2_SENSITIVITY_ADDITIONS 0x00000010L #define SQL_CA2_SENSITIVITY_DELETIONS 0x00000020L #define SQL_CA2_SENSITIVITY_UPDATES 0x00000040L /* semantics of SQL_ATTR_MAX_ROWS */ #define SQL_CA2_MAX_ROWS_SELECT 0x00000080L #define SQL_CA2_MAX_ROWS_INSERT 0x00000100L #define SQL_CA2_MAX_ROWS_DELETE 0x00000200L #define SQL_CA2_MAX_ROWS_UPDATE 0x00000400L #define SQL_CA2_MAX_ROWS_CATALOG 0x00000800L #define SQL_CA2_MAX_ROWS_AFFECTS_ALL (SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE | SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG) /* semantics of SQL_DIAG_CURSOR_ROW_COUNT */ #define SQL_CA2_CRC_EXACT 0x00001000L #define SQL_CA2_CRC_APPROXIMATE 0x00002000L /* the kinds of positioned statements that can be simulated */ #define SQL_CA2_SIMULATE_NON_UNIQUE 0x00004000L #define SQL_CA2_SIMULATE_TRY_UNIQUE 0x00008000L #define SQL_CA2_SIMULATE_UNIQUE 0x00010000L #endif /* ODBCVER >= 0x0300 */ /* SQL_ODBC_API_CONFORMANCE values */ #define SQL_OAC_NONE 0x0000 #define SQL_OAC_LEVEL1 0x0001 #define SQL_OAC_LEVEL2 0x0002 /* SQL_ODBC_SAG_CLI_CONFORMANCE values */ #define SQL_OSCC_NOT_COMPLIANT 0x0000 #define SQL_OSCC_COMPLIANT 0x0001 /* SQL_ODBC_SQL_CONFORMANCE values */ #define SQL_OSC_MINIMUM 0x0000 #define SQL_OSC_CORE 0x0001 #define SQL_OSC_EXTENDED 0x0002 /* SQL_CONCAT_NULL_BEHAVIOR values */ #define SQL_CB_NULL 0x0000 #define SQL_CB_NON_NULL 0x0001 /* SQL_SCROLL_OPTIONS masks */ #define SQL_SO_FORWARD_ONLY 0x00000001L #define SQL_SO_KEYSET_DRIVEN 0x00000002L #define SQL_SO_DYNAMIC 0x00000004L #define SQL_SO_MIXED 0x00000008L #define SQL_SO_STATIC 0x00000010L /* SQL_FETCH_DIRECTION masks */ /* SQL_FETCH_RESUME is no longer supported #define SQL_FD_FETCH_RESUME 0x00000040L */ #define SQL_FD_FETCH_BOOKMARK 0x00000080L /* SQL_TXN_ISOLATION_OPTION masks */ /* SQL_TXN_VERSIONING is no longer supported #define SQL_TXN_VERSIONING 0x00000010L */ /* SQL_CORRELATION_NAME values */ #define SQL_CN_NONE 0x0000 #define SQL_CN_DIFFERENT 0x0001 #define SQL_CN_ANY 0x0002 /* SQL_NON_NULLABLE_COLUMNS values */ #define SQL_NNC_NULL 0x0000 #define SQL_NNC_NON_NULL 0x0001 /* SQL_NULL_COLLATION values */ #define SQL_NC_START 0x0002 #define SQL_NC_END 0x0004 /* SQL_FILE_USAGE values */ #define SQL_FILE_NOT_SUPPORTED 0x0000 #define SQL_FILE_TABLE 0x0001 #define SQL_FILE_QUALIFIER 0x0002 #define SQL_FILE_CATALOG SQL_FILE_QUALIFIER /* ODBC 3.0 */ /* SQL_GETDATA_EXTENSIONS values */ #define SQL_GD_BLOCK 0x00000004L #define SQL_GD_BOUND 0x00000008L #if (ODBCVER >= 0x0380) #define SQL_GD_OUTPUT_PARAMS 0x00000010L #endif /* SQL_POSITIONED_STATEMENTS masks */ #define SQL_PS_POSITIONED_DELETE 0x00000001L #define SQL_PS_POSITIONED_UPDATE 0x00000002L #define SQL_PS_SELECT_FOR_UPDATE 0x00000004L /* SQL_GROUP_BY values */ #define SQL_GB_NOT_SUPPORTED 0x0000 #define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001 #define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002 #define SQL_GB_NO_RELATION 0x0003 #if (ODBCVER >= 0x0300) #define SQL_GB_COLLATE 0x0004 #endif /* ODBCVER >= 0x0300 */ /* SQL_OWNER_USAGE masks */ #define SQL_OU_DML_STATEMENTS 0x00000001L #define SQL_OU_PROCEDURE_INVOCATION 0x00000002L #define SQL_OU_TABLE_DEFINITION 0x00000004L #define SQL_OU_INDEX_DEFINITION 0x00000008L #define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L /* SQL_SCHEMA_USAGE masks */ #if (ODBCVER >= 0x0300) #define SQL_SU_DML_STATEMENTS SQL_OU_DML_STATEMENTS #define SQL_SU_PROCEDURE_INVOCATION SQL_OU_PROCEDURE_INVOCATION #define SQL_SU_TABLE_DEFINITION SQL_OU_TABLE_DEFINITION #define SQL_SU_INDEX_DEFINITION SQL_OU_INDEX_DEFINITION #define SQL_SU_PRIVILEGE_DEFINITION SQL_OU_PRIVILEGE_DEFINITION #endif /* ODBCVER >= 0x0300 */ /* SQL_QUALIFIER_USAGE masks */ #define SQL_QU_DML_STATEMENTS 0x00000001L #define SQL_QU_PROCEDURE_INVOCATION 0x00000002L #define SQL_QU_TABLE_DEFINITION 0x00000004L #define SQL_QU_INDEX_DEFINITION 0x00000008L #define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L #if (ODBCVER >= 0x0300) /* SQL_CATALOG_USAGE masks */ #define SQL_CU_DML_STATEMENTS SQL_QU_DML_STATEMENTS #define SQL_CU_PROCEDURE_INVOCATION SQL_QU_PROCEDURE_INVOCATION #define SQL_CU_TABLE_DEFINITION SQL_QU_TABLE_DEFINITION #define SQL_CU_INDEX_DEFINITION SQL_QU_INDEX_DEFINITION #define SQL_CU_PRIVILEGE_DEFINITION SQL_QU_PRIVILEGE_DEFINITION #endif /* ODBCVER >= 0x0300 */ /* SQL_SUBQUERIES masks */ #define SQL_SQ_COMPARISON 0x00000001L #define SQL_SQ_EXISTS 0x00000002L #define SQL_SQ_IN 0x00000004L #define SQL_SQ_QUANTIFIED 0x00000008L #define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L /* SQL_UNION masks */ #define SQL_U_UNION 0x00000001L #define SQL_U_UNION_ALL 0x00000002L /* SQL_BOOKMARK_PERSISTENCE values */ #define SQL_BP_CLOSE 0x00000001L #define SQL_BP_DELETE 0x00000002L #define SQL_BP_DROP 0x00000004L #define SQL_BP_TRANSACTION 0x00000008L #define SQL_BP_UPDATE 0x00000010L #define SQL_BP_OTHER_HSTMT 0x00000020L #define SQL_BP_SCROLL 0x00000040L /* SQL_STATIC_SENSITIVITY values */ #define SQL_SS_ADDITIONS 0x00000001L #define SQL_SS_DELETIONS 0x00000002L #define SQL_SS_UPDATES 0x00000004L /* SQL_VIEW values */ #define SQL_CV_CREATE_VIEW 0x00000001L #define SQL_CV_CHECK_OPTION 0x00000002L #define SQL_CV_CASCADED 0x00000004L #define SQL_CV_LOCAL 0x00000008L /* SQL_LOCK_TYPES masks */ #define SQL_LCK_NO_CHANGE 0x00000001L #define SQL_LCK_EXCLUSIVE 0x00000002L #define SQL_LCK_UNLOCK 0x00000004L /* SQL_POS_OPERATIONS masks */ #define SQL_POS_POSITION 0x00000001L #define SQL_POS_REFRESH 0x00000002L #define SQL_POS_UPDATE 0x00000004L #define SQL_POS_DELETE 0x00000008L #define SQL_POS_ADD 0x00000010L /* SQL_QUALIFIER_LOCATION values */ #define SQL_QL_START 0x0001 #define SQL_QL_END 0x0002 /* Here start return values for ODBC 3.0 SQLGetInfo */ #if (ODBCVER >= 0x0300) /* SQL_AGGREGATE_FUNCTIONS bitmasks */ #define SQL_AF_AVG 0x00000001L #define SQL_AF_COUNT 0x00000002L #define SQL_AF_MAX 0x00000004L #define SQL_AF_MIN 0x00000008L #define SQL_AF_SUM 0x00000010L #define SQL_AF_DISTINCT 0x00000020L #define SQL_AF_ALL 0x00000040L /* SQL_SQL_CONFORMANCE bit masks */ #define SQL_SC_SQL92_ENTRY 0x00000001L #define SQL_SC_FIPS127_2_TRANSITIONAL 0x00000002L #define SQL_SC_SQL92_INTERMEDIATE 0x00000004L #define SQL_SC_SQL92_FULL 0x00000008L /* SQL_DATETIME_LITERALS masks */ #define SQL_DL_SQL92_DATE 0x00000001L #define SQL_DL_SQL92_TIME 0x00000002L #define SQL_DL_SQL92_TIMESTAMP 0x00000004L #define SQL_DL_SQL92_INTERVAL_YEAR 0x00000008L #define SQL_DL_SQL92_INTERVAL_MONTH 0x00000010L #define SQL_DL_SQL92_INTERVAL_DAY 0x00000020L #define SQL_DL_SQL92_INTERVAL_HOUR 0x00000040L #define SQL_DL_SQL92_INTERVAL_MINUTE 0x00000080L #define SQL_DL_SQL92_INTERVAL_SECOND 0x00000100L #define SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH 0x00000200L #define SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR 0x00000400L #define SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE 0x00000800L #define SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND 0x00001000L #define SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE 0x00002000L #define SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND 0x00004000L #define SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND 0x00008000L /* SQL_CATALOG_LOCATION values */ #define SQL_CL_START SQL_QL_START #define SQL_CL_END SQL_QL_END /* values for SQL_BATCH_ROW_COUNT */ #define SQL_BRC_PROCEDURES 0x0000001 #define SQL_BRC_EXPLICIT 0x0000002 #define SQL_BRC_ROLLED_UP 0x0000004 /* bitmasks for SQL_BATCH_SUPPORT */ #define SQL_BS_SELECT_EXPLICIT 0x00000001L #define SQL_BS_ROW_COUNT_EXPLICIT 0x00000002L #define SQL_BS_SELECT_PROC 0x00000004L #define SQL_BS_ROW_COUNT_PROC 0x00000008L /* Values for SQL_PARAM_ARRAY_ROW_COUNTS getinfo */ #define SQL_PARC_BATCH 1 #define SQL_PARC_NO_BATCH 2 /* values for SQL_PARAM_ARRAY_SELECTS */ #define SQL_PAS_BATCH 1 #define SQL_PAS_NO_BATCH 2 #define SQL_PAS_NO_SELECT 3 /* Bitmasks for SQL_INDEX_KEYWORDS */ #define SQL_IK_NONE 0x00000000L #define SQL_IK_ASC 0x00000001L #define SQL_IK_DESC 0x00000002L #define SQL_IK_ALL (SQL_IK_ASC | SQL_IK_DESC) /* Bitmasks for SQL_INFO_SCHEMA_VIEWS */ #define SQL_ISV_ASSERTIONS 0x00000001L #define SQL_ISV_CHARACTER_SETS 0x00000002L #define SQL_ISV_CHECK_CONSTRAINTS 0x00000004L #define SQL_ISV_COLLATIONS 0x00000008L #define SQL_ISV_COLUMN_DOMAIN_USAGE 0x00000010L #define SQL_ISV_COLUMN_PRIVILEGES 0x00000020L #define SQL_ISV_COLUMNS 0x00000040L #define SQL_ISV_CONSTRAINT_COLUMN_USAGE 0x00000080L #define SQL_ISV_CONSTRAINT_TABLE_USAGE 0x00000100L #define SQL_ISV_DOMAIN_CONSTRAINTS 0x00000200L #define SQL_ISV_DOMAINS 0x00000400L #define SQL_ISV_KEY_COLUMN_USAGE 0x00000800L #define SQL_ISV_REFERENTIAL_CONSTRAINTS 0x00001000L #define SQL_ISV_SCHEMATA 0x00002000L #define SQL_ISV_SQL_LANGUAGES 0x00004000L #define SQL_ISV_TABLE_CONSTRAINTS 0x00008000L #define SQL_ISV_TABLE_PRIVILEGES 0x00010000L #define SQL_ISV_TABLES 0x00020000L #define SQL_ISV_TRANSLATIONS 0x00040000L #define SQL_ISV_USAGE_PRIVILEGES 0x00080000L #define SQL_ISV_VIEW_COLUMN_USAGE 0x00100000L #define SQL_ISV_VIEW_TABLE_USAGE 0x00200000L #define SQL_ISV_VIEWS 0x00400000L /* Bitmasks for SQL_ASYNC_MODE */ #define SQL_AM_NONE 0 #define SQL_AM_CONNECTION 1 #define SQL_AM_STATEMENT 2 /* Bitmasks for SQL_ALTER_DOMAIN */ #define SQL_AD_CONSTRAINT_NAME_DEFINITION 0x00000001L #define SQL_AD_ADD_DOMAIN_CONSTRAINT 0x00000002L #define SQL_AD_DROP_DOMAIN_CONSTRAINT 0x00000004L #define SQL_AD_ADD_DOMAIN_DEFAULT 0x00000008L #define SQL_AD_DROP_DOMAIN_DEFAULT 0x00000010L #define SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L #define SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L #define SQL_AD_ADD_CONSTRAINT_DEFERRABLE 0x00000080L #define SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE 0x00000100L /* SQL_CREATE_SCHEMA bitmasks */ #define SQL_CS_CREATE_SCHEMA 0x00000001L #define SQL_CS_AUTHORIZATION 0x00000002L #define SQL_CS_DEFAULT_CHARACTER_SET 0x00000004L /* SQL_CREATE_TRANSLATION bitmasks */ #define SQL_CTR_CREATE_TRANSLATION 0x00000001L /* SQL_CREATE_ASSERTION bitmasks */ #define SQL_CA_CREATE_ASSERTION 0x00000001L #define SQL_CA_CONSTRAINT_INITIALLY_DEFERRED 0x00000010L #define SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000020L #define SQL_CA_CONSTRAINT_DEFERRABLE 0x00000040L #define SQL_CA_CONSTRAINT_NON_DEFERRABLE 0x00000080L /* SQL_CREATE_CHARACTER_SET bitmasks */ #define SQL_CCS_CREATE_CHARACTER_SET 0x00000001L #define SQL_CCS_COLLATE_CLAUSE 0x00000002L #define SQL_CCS_LIMITED_COLLATION 0x00000004L /* SQL_CREATE_COLLATION bitmasks */ #define SQL_CCOL_CREATE_COLLATION 0x00000001L /* SQL_CREATE_DOMAIN bitmasks */ #define SQL_CDO_CREATE_DOMAIN 0x00000001L #define SQL_CDO_DEFAULT 0x00000002L #define SQL_CDO_CONSTRAINT 0x00000004L #define SQL_CDO_COLLATION 0x00000008L #define SQL_CDO_CONSTRAINT_NAME_DEFINITION 0x00000010L #define SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L #define SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L #define SQL_CDO_CONSTRAINT_DEFERRABLE 0x00000080L #define SQL_CDO_CONSTRAINT_NON_DEFERRABLE 0x00000100L /* SQL_CREATE_TABLE bitmasks */ #define SQL_CT_CREATE_TABLE 0x00000001L #define SQL_CT_COMMIT_PRESERVE 0x00000002L #define SQL_CT_COMMIT_DELETE 0x00000004L #define SQL_CT_GLOBAL_TEMPORARY 0x00000008L #define SQL_CT_LOCAL_TEMPORARY 0x00000010L #define SQL_CT_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L #define SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L #define SQL_CT_CONSTRAINT_DEFERRABLE 0x00000080L #define SQL_CT_CONSTRAINT_NON_DEFERRABLE 0x00000100L #define SQL_CT_COLUMN_CONSTRAINT 0x00000200L #define SQL_CT_COLUMN_DEFAULT 0x00000400L #define SQL_CT_COLUMN_COLLATION 0x00000800L #define SQL_CT_TABLE_CONSTRAINT 0x00001000L #define SQL_CT_CONSTRAINT_NAME_DEFINITION 0x00002000L /* SQL_DDL_INDEX bitmasks */ #define SQL_DI_CREATE_INDEX 0x00000001L #define SQL_DI_DROP_INDEX 0x00000002L /* SQL_DROP_COLLATION bitmasks */ #define SQL_DC_DROP_COLLATION 0x00000001L /* SQL_DROP_DOMAIN bitmasks */ #define SQL_DD_DROP_DOMAIN 0x00000001L #define SQL_DD_RESTRICT 0x00000002L #define SQL_DD_CASCADE 0x00000004L /* SQL_DROP_SCHEMA bitmasks */ #define SQL_DS_DROP_SCHEMA 0x00000001L #define SQL_DS_RESTRICT 0x00000002L #define SQL_DS_CASCADE 0x00000004L /* SQL_DROP_CHARACTER_SET bitmasks */ #define SQL_DCS_DROP_CHARACTER_SET 0x00000001L /* SQL_DROP_ASSERTION bitmasks */ #define SQL_DA_DROP_ASSERTION 0x00000001L /* SQL_DROP_TABLE bitmasks */ #define SQL_DT_DROP_TABLE 0x00000001L #define SQL_DT_RESTRICT 0x00000002L #define SQL_DT_CASCADE 0x00000004L /* SQL_DROP_TRANSLATION bitmasks */ #define SQL_DTR_DROP_TRANSLATION 0x00000001L /* SQL_DROP_VIEW bitmasks */ #define SQL_DV_DROP_VIEW 0x00000001L #define SQL_DV_RESTRICT 0x00000002L #define SQL_DV_CASCADE 0x00000004L /* SQL_INSERT_STATEMENT bitmasks */ #define SQL_IS_INSERT_LITERALS 0x00000001L #define SQL_IS_INSERT_SEARCHED 0x00000002L #define SQL_IS_SELECT_INTO 0x00000004L /* SQL_ODBC_INTERFACE_CONFORMANCE values */ #define SQL_OIC_CORE 1UL #define SQL_OIC_LEVEL1 2UL #define SQL_OIC_LEVEL2 3UL /* SQL_SQL92_FOREIGN_KEY_DELETE_RULE bitmasks */ #define SQL_SFKD_CASCADE 0x00000001L #define SQL_SFKD_NO_ACTION 0x00000002L #define SQL_SFKD_SET_DEFAULT 0x00000004L #define SQL_SFKD_SET_NULL 0x00000008L /* SQL_SQL92_FOREIGN_KEY_UPDATE_RULE bitmasks */ #define SQL_SFKU_CASCADE 0x00000001L #define SQL_SFKU_NO_ACTION 0x00000002L #define SQL_SFKU_SET_DEFAULT 0x00000004L #define SQL_SFKU_SET_NULL 0x00000008L /* SQL_SQL92_GRANT bitmasks */ #define SQL_SG_USAGE_ON_DOMAIN 0x00000001L #define SQL_SG_USAGE_ON_CHARACTER_SET 0x00000002L #define SQL_SG_USAGE_ON_COLLATION 0x00000004L #define SQL_SG_USAGE_ON_TRANSLATION 0x00000008L #define SQL_SG_WITH_GRANT_OPTION 0x00000010L #define SQL_SG_DELETE_TABLE 0x00000020L #define SQL_SG_INSERT_TABLE 0x00000040L #define SQL_SG_INSERT_COLUMN 0x00000080L #define SQL_SG_REFERENCES_TABLE 0x00000100L #define SQL_SG_REFERENCES_COLUMN 0x00000200L #define SQL_SG_SELECT_TABLE 0x00000400L #define SQL_SG_UPDATE_TABLE 0x00000800L #define SQL_SG_UPDATE_COLUMN 0x00001000L /* SQL_SQL92_PREDICATES bitmasks */ #define SQL_SP_EXISTS 0x00000001L #define SQL_SP_ISNOTNULL 0x00000002L #define SQL_SP_ISNULL 0x00000004L #define SQL_SP_MATCH_FULL 0x00000008L #define SQL_SP_MATCH_PARTIAL 0x00000010L #define SQL_SP_MATCH_UNIQUE_FULL 0x00000020L #define SQL_SP_MATCH_UNIQUE_PARTIAL 0x00000040L #define SQL_SP_OVERLAPS 0x00000080L #define SQL_SP_UNIQUE 0x00000100L #define SQL_SP_LIKE 0x00000200L #define SQL_SP_IN 0x00000400L #define SQL_SP_BETWEEN 0x00000800L #define SQL_SP_COMPARISON 0x00001000L #define SQL_SP_QUANTIFIED_COMPARISON 0x00002000L /* SQL_SQL92_RELATIONAL_JOIN_OPERATORS bitmasks */ #define SQL_SRJO_CORRESPONDING_CLAUSE 0x00000001L #define SQL_SRJO_CROSS_JOIN 0x00000002L #define SQL_SRJO_EXCEPT_JOIN 0x00000004L #define SQL_SRJO_FULL_OUTER_JOIN 0x00000008L #define SQL_SRJO_INNER_JOIN 0x00000010L #define SQL_SRJO_INTERSECT_JOIN 0x00000020L #define SQL_SRJO_LEFT_OUTER_JOIN 0x00000040L #define SQL_SRJO_NATURAL_JOIN 0x00000080L #define SQL_SRJO_RIGHT_OUTER_JOIN 0x00000100L #define SQL_SRJO_UNION_JOIN 0x00000200L /* SQL_SQL92_REVOKE bitmasks */ #define SQL_SR_USAGE_ON_DOMAIN 0x00000001L #define SQL_SR_USAGE_ON_CHARACTER_SET 0x00000002L #define SQL_SR_USAGE_ON_COLLATION 0x00000004L #define SQL_SR_USAGE_ON_TRANSLATION 0x00000008L #define SQL_SR_GRANT_OPTION_FOR 0x00000010L #define SQL_SR_CASCADE 0x00000020L #define SQL_SR_RESTRICT 0x00000040L #define SQL_SR_DELETE_TABLE 0x00000080L #define SQL_SR_INSERT_TABLE 0x00000100L #define SQL_SR_INSERT_COLUMN 0x00000200L #define SQL_SR_REFERENCES_TABLE 0x00000400L #define SQL_SR_REFERENCES_COLUMN 0x00000800L #define SQL_SR_SELECT_TABLE 0x00001000L #define SQL_SR_UPDATE_TABLE 0x00002000L #define SQL_SR_UPDATE_COLUMN 0x00004000L /* SQL_SQL92_ROW_VALUE_CONSTRUCTOR bitmasks */ #define SQL_SRVC_VALUE_EXPRESSION 0x00000001L #define SQL_SRVC_NULL 0x00000002L #define SQL_SRVC_DEFAULT 0x00000004L #define SQL_SRVC_ROW_SUBQUERY 0x00000008L /* SQL_SQL92_VALUE_EXPRESSIONS bitmasks */ #define SQL_SVE_CASE 0x00000001L #define SQL_SVE_CAST 0x00000002L #define SQL_SVE_COALESCE 0x00000004L #define SQL_SVE_NULLIF 0x00000008L /* SQL_STANDARD_CLI_CONFORMANCE bitmasks */ #define SQL_SCC_XOPEN_CLI_VERSION1 0x00000001L #define SQL_SCC_ISO92_CLI 0x00000002L /* SQL_UNION_STATEMENT bitmasks */ #define SQL_US_UNION SQL_U_UNION #define SQL_US_UNION_ALL SQL_U_UNION_ALL /* values for SQL_DRIVER_AWARE_POOLING_SUPPORTED */ #define SQL_DRIVER_AWARE_POOLING_NOT_CAPABLE 0x00000000L #define SQL_DRIVER_AWARE_POOLING_CAPABLE 0x00000001L #endif /* ODBCVER >= 0x0300 */ /* SQL_DTC_TRANSITION_COST bitmasks */ #define SQL_DTC_ENLIST_EXPENSIVE 0x00000001L #define SQL_DTC_UNENLIST_EXPENSIVE 0x00000002L #if (ODBCVER >= 0x0380) /* possible values for SQL_ASYNC_DBC_FUNCTIONS */ #define SQL_ASYNC_DBC_NOT_CAPABLE 0x00000000L #define SQL_ASYNC_DBC_CAPABLE 0x00000001L #endif /* additional SQLDataSources fetch directions */ #if (ODBCVER >= 0x0300) #define SQL_FETCH_FIRST_USER 31 #define SQL_FETCH_FIRST_SYSTEM 32 #endif /* ODBCVER >= 0x0300 */ /* Defines for SQLSetPos */ #define SQL_ENTIRE_ROWSET 0 /* Operations in SQLSetPos */ #define SQL_POSITION 0 /* 1.0 FALSE */ #define SQL_REFRESH 1 /* 1.0 TRUE */ #define SQL_UPDATE 2 #define SQL_DELETE 3 /* Operations in SQLBulkOperations */ #define SQL_ADD 4 #define SQL_SETPOS_MAX_OPTION_VALUE SQL_ADD #if (ODBCVER >= 0x0300) #define SQL_UPDATE_BY_BOOKMARK 5 #define SQL_DELETE_BY_BOOKMARK 6 #define SQL_FETCH_BY_BOOKMARK 7 #endif /* ODBCVER >= 0x0300 */ /* Lock options in SQLSetPos */ #define SQL_LOCK_NO_CHANGE 0 /* 1.0 FALSE */ #define SQL_LOCK_EXCLUSIVE 1 /* 1.0 TRUE */ #define SQL_LOCK_UNLOCK 2 #define SQL_SETPOS_MAX_LOCK_VALUE SQL_LOCK_UNLOCK /* Macros for SQLSetPos */ #define SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE) #define SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock) #define SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock) #define SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE) #define SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE) #define SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE) /* Column types and scopes in SQLSpecialColumns. */ #define SQL_BEST_ROWID 1 #define SQL_ROWVER 2 /* Defines for SQLSpecialColumns (returned in the result set) SQL_PC_UNKNOWN and SQL_PC_PSEUDO are defined in sql.h */ #define SQL_PC_NOT_PSEUDO 1 /* Defines for SQLStatistics */ #define SQL_QUICK 0 #define SQL_ENSURE 1 /* Defines for SQLStatistics (returned in the result set) SQL_INDEX_CLUSTERED, SQL_INDEX_HASHED, and SQL_INDEX_OTHER are defined in sql.h */ #define SQL_TABLE_STAT 0 /* Defines for SQLTables */ #if (ODBCVER >= 0x0300) #define SQL_ALL_CATALOGS "%" #define SQL_ALL_SCHEMAS "%" #define SQL_ALL_TABLE_TYPES "%" #endif /* ODBCVER >= 0x0300 */ /* Options for SQLDriverConnect */ #define SQL_DRIVER_NOPROMPT 0 #define SQL_DRIVER_COMPLETE 1 #define SQL_DRIVER_PROMPT 2 #define SQL_DRIVER_COMPLETE_REQUIRED 3 SQLRETURN SQL_API SQLDriverConnect( SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut, SQLUSMALLINT fDriverCompletion); /* Level 2 Functions */ /* SQLExtendedFetch "fFetchType" values */ #define SQL_FETCH_BOOKMARK 8 /* SQLExtendedFetch "rgfRowStatus" element values */ #define SQL_ROW_SUCCESS 0 #define SQL_ROW_DELETED 1 #define SQL_ROW_UPDATED 2 #define SQL_ROW_NOROW 3 #define SQL_ROW_ADDED 4 #define SQL_ROW_ERROR 5 #if (ODBCVER >= 0x0300) #define SQL_ROW_SUCCESS_WITH_INFO 6 #define SQL_ROW_PROCEED 0 #define SQL_ROW_IGNORE 1 #endif /* value for SQL_DESC_ARRAY_STATUS_PTR */ #if (ODBCVER >= 0x0300) #define SQL_PARAM_SUCCESS 0 #define SQL_PARAM_SUCCESS_WITH_INFO 6 #define SQL_PARAM_ERROR 5 #define SQL_PARAM_UNUSED 7 #define SQL_PARAM_DIAG_UNAVAILABLE 1 #define SQL_PARAM_PROCEED 0 #define SQL_PARAM_IGNORE 1 #endif /* ODBCVER >= 0x0300 */ /* Defines for SQLForeignKeys (UPDATE_RULE and DELETE_RULE) */ #define SQL_CASCADE 0 #define SQL_RESTRICT 1 #define SQL_SET_NULL 2 #if (ODBCVER >= 0x0250) #define SQL_NO_ACTION 3 #define SQL_SET_DEFAULT 4 #endif /* ODBCVER >= 0x0250 */ #if (ODBCVER >= 0x0300) /* Note that the following are in a different column of SQLForeignKeys than */ /* the previous #defines. These are for DEFERRABILITY. */ #define SQL_INITIALLY_DEFERRED 5 #define SQL_INITIALLY_IMMEDIATE 6 #define SQL_NOT_DEFERRABLE 7 #endif /* ODBCVER >= 0x0300 */ /* Defines for SQLBindParameter and SQLProcedureColumns (returned in the result set) */ #define SQL_PARAM_TYPE_UNKNOWN 0 #define SQL_PARAM_INPUT 1 #define SQL_PARAM_INPUT_OUTPUT 2 #define SQL_RESULT_COL 3 #define SQL_PARAM_OUTPUT 4 #define SQL_RETURN_VALUE 5 #if (ODBCVER >= 0x0380) #define SQL_PARAM_INPUT_OUTPUT_STREAM 8 #define SQL_PARAM_OUTPUT_STREAM 16 #endif /* Defines for SQLProcedures (returned in the result set) */ #define SQL_PT_UNKNOWN 0 #define SQL_PT_PROCEDURE 1 #define SQL_PT_FUNCTION 2 /* This define is too large for RC */ #define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ "COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\ "CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\ "CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\ "DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\ "DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\ "DISTINCT,DOMAIN,DOUBLE,DROP,"\ "ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\ "EXISTS,EXTERNAL,EXTRACT,"\ "FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\ "GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\ "IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\ "INPUT,INSENSITIVE,INSERT,INT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\ "JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\ "MATCH,MAX,MIN,MINUTE,MODULE,MONTH,"\ "NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\ "OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\ "PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\ "PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\ "READ,REAL,REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS"\ "SCHEMA,SCROLL,SECOND,SECTION,SELECT,SESSION,SESSION_USER,SET,SIZE,"\ "SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\ "SUBSTRING,SUM,SYSTEM_USER,"\ "TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\ "TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\ "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\ "YEAR,ZONE" SQLRETURN SQL_API SQLBrowseConnect( SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut); #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLBulkOperations( SQLHSTMT StatementHandle, SQLSMALLINT Operation); #endif /* ODBCVER >= 0x0300 */ SQLRETURN SQL_API SQLColAttributes( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, SQLLEN *pfDesc); SQLRETURN SQL_API SQLColumnPrivileges( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); SQLRETURN SQL_API SQLDescribeParam( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable); SQLRETURN SQL_API SQLExtendedFetch( SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow, SQLUSMALLINT *rgfRowStatus); SQLRETURN SQL_API SQLForeignKeys( SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, SQLCHAR *szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR *szPkTableName, SQLSMALLINT cbPkTableName, SQLCHAR *szFkCatalogName, SQLSMALLINT cbFkCatalogName, SQLCHAR *szFkSchemaName, SQLSMALLINT cbFkSchemaName, SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName); SQLRETURN SQL_API SQLMoreResults( SQLHSTMT hstmt); SQLRETURN SQL_API SQLNativeSql( SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr); SQLRETURN SQL_API SQLNumParams( SQLHSTMT hstmt, SQLSMALLINT *pcpar); SQLRETURN SQL_API SQLParamOptions( SQLHSTMT hstmt, SQLULEN crow, SQLULEN *pirow); SQLRETURN SQL_API SQLPrimaryKeys( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName); SQLRETURN SQL_API SQLProcedureColumns( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, SQLSMALLINT cbProcName, SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); SQLRETURN SQL_API SQLProcedures( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szProcName, SQLSMALLINT cbProcName); SQLRETURN SQL_API SQLSetPos( SQLHSTMT hstmt, SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock); SQLRETURN SQL_API SQLTablePrivileges( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR *szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR *szTableName, SQLSMALLINT cbTableName); SQLRETURN SQL_API SQLDrivers( SQLHENV henv, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc, SQLSMALLINT cbDriverDescMax, SQLSMALLINT *pcbDriverDesc, SQLCHAR *szDriverAttributes, SQLSMALLINT cbDrvrAttrMax, SQLSMALLINT *pcbDrvrAttr); SQLRETURN SQL_API SQLBindParameter( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue); /*---------------------------------------------------------*/ /* SQLAllocHandleStd is implemented to make SQLAllocHandle */ /* compatible with X/Open standard. an application should */ /* not call SQLAllocHandleStd directly */ /*---------------------------------------------------------*/ #ifdef ODBC_STD #define SQLAllocHandle SQLAllocHandleStd #define SQLAllocEnv(phenv) SQLAllocHandleStd(SQL_HANDLE_ENV, SQL_NULL_HANDLE, phenv) /* Internal type subcodes */ #define SQL_YEAR SQL_CODE_YEAR #define SQL_MONTH SQL_CODE_MONTH #define SQL_DAY SQL_CODE_DAY #define SQL_HOUR SQL_CODE_HOUR #define SQL_MINUTE SQL_CODE_MINUTE #define SQL_SECOND SQL_CODE_SECOND #define SQL_YEAR_TO_MONTH SQL_CODE_YEAR_TO_MONTH #define SQL_DAY_TO_HOUR SQL_CODE_DAY_TO_HOUR #define SQL_DAY_TO_MINUTE SQL_CODE_DAY_TO_MINUTE #define SQL_DAY_TO_SECOND SQL_CODE_DAY_TO_SECOND #define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE #define SQL_HOUR_TO_SECOND SQL_CODE_HOUR_TO_SECOND #define SQL_MINUTE_TO_SECOND SQL_CODE_MINUTE_TO_SECOND #endif /* ODBC_STD */ #if (ODBCVER >= 0x0300) SQLRETURN SQL_API SQLAllocHandleStd( SQLSMALLINT fHandleType, SQLHANDLE hInput, SQLHANDLE *phOutput); #endif /* Deprecated defines from prior versions of ODBC */ #define SQL_DATABASE_NAME 16 /* Use SQLGetConnectOption/SQL_CURRENT_QUALIFIER */ #define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR #define SQL_FETCH_PREV SQL_FETCH_PRIOR #define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER #define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER #define SQL_CC_DELETE SQL_CB_DELETE #define SQL_CR_DELETE SQL_CB_DELETE #define SQL_CC_CLOSE SQL_CB_CLOSE #define SQL_CR_CLOSE SQL_CB_CLOSE #define SQL_CC_PRESERVE SQL_CB_PRESERVE #define SQL_CR_PRESERVE SQL_CB_PRESERVE /* SQL_FETCH_RESUME is not supported by 2.0+ drivers #define SQL_FETCH_RESUME 7 */ #define SQL_SCROLL_FORWARD_ONLY 0L /*-SQL_CURSOR_FORWARD_ONLY */ #define SQL_SCROLL_KEYSET_DRIVEN (-1L) /*-SQL_CURSOR_KEYSET_DRIVEN */ #define SQL_SCROLL_DYNAMIC (-2L) /*-SQL_CURSOR_DYNAMIC */ #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */ /* Deprecated functions from prior versions of ODBC */ SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */ SQLHSTMT hstmt, SQLUSMALLINT fConcurrency, SQLLEN crowKeyset, SQLUSMALLINT crowRowset); /*! * \defgroup Tracing. * * unixODBC implements a slight variation of the tracing mechanism used * on MS platforms. The unixODBC method loses the ability to produce trace * output for invalid handles but gains the following; * * - better concurrency * - allows tracing to be turned on/off and configured at finer granularity * - hopefully; better performance * * unixODBC provides a cross-platform helper library called 'trace' and an * example/default trace plugin called 'odbctrac'. Those writing an ODBC * driver can use the 'trace' helper library (a static library). Those wanting * to create custom trace output can implement a different version of the * 'odbctrac' plugin. * * The text file driver (odbctxt) included with unixODBC is an example of a * driver using the 'trace' helper library. * * The 'trace' library and the example plugin 'odbctrac' are designed to be * portable on all platforms where unixODBC is available and on MS platforms. * This will allow drivers using 'trace' and 'odbctrac' plugin to equilly * portable. On MS platforms - this compliments traditional tracing (mostly * just used by the Driver Manager). * * \sa trace * odbctxt * odbctrac */ /*@{*/ #define TRACE_VERSION 1000 /*!< Version of trace API */ #ifdef UNICODE RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); /*!< open a trace log file */ #else RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); /*!< open a trace log file */ #endif RETCODE TraceCloseLogFile(SQLPOINTER); /*!< Request to close a trace log */ SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN); /*!< Call to produce trace output upon function return. */ DWORD TraceVersion(void); /*!< Returns trace API version */ /* Functions for Visual Studio Analyzer*/ /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */ #define TRACE_ON 0x00000001L #define TRACE_VS_EVENT_ON 0x00000002L RETCODE TraceVSControl(DWORD); /* the flags in ODBC_VS_ARGS */ #define ODBC_VS_FLAG_UNICODE_ARG 0x00000001L /* the argument is unicode */ #define ODBC_VS_FLAG_UNICODE_COR 0x00000002L /* the correlation is unicode */ #define ODBC_VS_FLAG_RETCODE 0x00000004L /* RetCode field is set */ #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */ typedef struct tagODBC_VS_ARGS { #ifdef GUID_DEFINED const GUID *pguidEvent; /* the GUID for event */ #else const void *pguidEvent; /* the GUID for event */ #endif DWORD dwFlags; /* flags for the call */ union { WCHAR *wszArg; CHAR *szArg; }u1; union { WCHAR *wszCorrelation; CHAR *szCorrelation; }u2; RETCODE RetCode; } ODBC_VS_ARGS, *PODBC_VS_ARGS; void FireVSDebugEvent(PODBC_VS_ARGS); /*@}*/ #ifdef __cplusplus } #endif /* * connection pooling retry times */ BOOL ODBCSetTryWaitValue ( DWORD dwValue ); #ifdef __cplusplus DWORD ODBCGetTryWaitValue ( ); #else DWORD ODBCGetTryWaitValue ( void ); #endif #ifndef __SQLUCODE_H #include "sqlucode.h" #endif #endif unixODBC-2.3.9/include/Makefile.am0000755000175000017500000000057412430423210013540 00000000000000EXTRA_DIST = \ ini.h \ log.h \ lst.h \ odbcinst.h \ odbcinstext.h \ sql.h \ sqlext.h \ sqltypes.h \ sqlucode.h \ sqlspi.h \ sqp.h \ uodbc_stats.h \ uodbc_extras.h \ autotest.h \ odbctrace.h \ odbctrac.h include_HEADERS = \ odbcinst.h \ odbcinstext.h \ sql.h \ sqlext.h \ sqltypes.h \ sqlucode.h \ sqlspi.h \ autotest.h \ uodbc_stats.h \ uodbc_extras.h unixODBC-2.3.9/README.OSX0000755000175000017500000001025512364220226011416 00000000000000+-------------------------------------------------------------+ | unixODBC | | Mac OSX | +-------------------------------------------------------------+ README --------------------------------------------------------------- It seems at least with 10.5 of OSX, that we can just configure as normal (--enable-gui=no) and build, no special instructions are needed. --------------------------------------------------------------- Building With GNU Auto Tools (by Nick): It looks as if Darwin (Mac OSX) doesn't support the normal dlopen type process that unixODBC requires. However help is at hand in the form of dlcompat-20010831.tar.gz. This file contains wrappers to emulate the calls. I have put this in ftp://ftp.unixodbc.org/pub/beta/unixODBC/dlcompat-20010831.tar.gz It should be downloaded, unpacked then run make install This should be done before configuring unixODBC This file was created by Christoph Pfisterer and the original copy can be found at http://fink.sourceforge.net If you get a "ld: multiple definitions of symbol " error, then you should edit the file libtool in the unixODBC base directory and find the line whole_archive_flag_spec="-all_load \$convenience" and replace it with whole_archive_flag_spec= As at the time of writing, Qt is not available on OSX, its best to disable the search for X libs that may fail, by configuring with ./configure --enable-gui=no Problems: There is a problem it seems with libtool on OSX that incorrectly sets the SHLIBEXT. The Driver Manager code will now report this if its used in this condition. There are two solutions. Either after running configure check config.h, and search for the string SHLIBEXT. It should look like this: #define SHLIBEXT ".dylib" But may look like this: #define SHLIBEXT "test .$module = .yes && echo .so || echo .dylib" If it does, then change it to the first definition. The other fix is to change the configure script to find the correct value, search for the line: shrext_cmds='test .$module = .yes && echo .so || echo .dylib' And change to shrext_cmds=`test .$module = .yes && echo .so || echo .dylib` Then rerun configure Building With Qt qmake (by Peter): Qt is now availible for OSX but unixODBC may not detect your Qt libs... worse yet you may not be able sort out the GNU auto-tools required to build on OSX. If you want to build using qmake then read README.qmake. Creating Install Packages: unixODBC contains a number of directories and files to help create OSX Packages. The process of doing so is not nearly as automated as creating RPM files using the GNU auto tools. Look for the mac-install and mac-package directories. Cursor LIB The cursor lilb needs a manual stage build to create it as a OSX bundle it needs to be like that so the DM can load it at run time. To do this, after the "make" and "make install" have finished, go to the cur directory in the build tree. Then there issue these commands cc -bundle -flat_namespace -undefined suppress -o libodbccr.1.0.0.so *.lo cp libodbccr.1.0.0.so /usr/local/lib/libodbccr.1 Replace /usr/local/lib/ in the above with whatever your actual unixODBC lib path is. You may also have to do the same with any driver you build. You can check this by testing the type of the lib, for example. file /usr/local/lib/libodbcpsql.2.0.0.so /usr/local/lib/libodbcpsql.2.0.0.so: Mach-O dynamically linked shared library ppc This is not the correct type. So to get it as you need :- cd Drivers/Postgre7.1 cc -bundle -flat_namespace -undefined suppress -o libodbcpsql.2.0.0.so *.lo cp libodbcpsql.2.0.0.so /usr/local/lib/libodbcpsql.2.0.0.so Now to check file /usr/local/lib/libodbcpsql.2.0.0.so /usr/local/lib/libodbcpsql.2.0.0.so: Mach-O bundle ppc Thats how it should be to work under the driver manager +-------------------------------------------------------------+ | Peter Harvey | | Added to by Nick Gorham | +-------------------------------------------------------------+ unixODBC-2.3.9/doc/0000775000175000017500000000000013725127522010716 500000000000000unixODBC-2.3.9/doc/unixODBC.gif0000755000175000017500000000023412262474475012747 00000000000000GIF89a ÂÀÀÀøøÐløÿÿÿÿÿÿÿÿÿ!ÿ NETSCAPE2.0!þMade with GIMP!ù , ¬ºÜþ†Ig¼ŠŽÍ·ÅÍÔŠ$Y}R¦±¶/LÜwµ€[«¸ Œ×óýJBËøCÅ’¹]óCF‹5ÖÎunixODBC-2.3.9/doc/UserManual/0000775000175000017500000000000013725127522012772 500000000000000unixODBC-2.3.9/doc/UserManual/unixODBC.gif0000755000175000017500000000153212262474475015025 00000000000000GIF89a ÂÀÀÀøøÐløÿÿÿÿÿÿÿÿÿ!ÿ NETSCAPE2.0!þMade with GIMP!ù , ¬ºÜþ†Ig¼ŠŽÍ·ÅÍÔŠ$Y}R¦±¶/LÜwµ€[«¸ Œ×óýJBËøCÅ’¹]óCF‹5ÖÎÕÀO.Ï«"îªÐ1Ê3{„…cÁJyゼ>ov[ñ{z}!vJ{ƒ[‡ˆ|fDbŽr+Œ;•‰…W”›‰žZ=¡ˆ’p`¦¨Ÿ„¬‰†u«±aŠnµ›1& gº¢¸¾ÃäÇ !ù , ­ºÌñ0´IÝ8ÆZ/ÎÐ J\ã}™¨Ždy¢B°®À¨<«u‡ç;šï÷yy”tM”˘®ÙR@‘¦ÓAì²Áê5'–Ëq‘3µÔöñ-}Ñ/˜÷‰þ.«&siX€_f‚Vc`BiP^••Y€”7–—2…š” ¦¦I§«¨{i¬°ž…V±¬®&µ­v_¹¡»‰¹š¿‰¥§Ã’oÈÌ !ù , ­ºÜÑ0JÞ¼² Q+ÆÝ&nÝGUD0®¤°ÊÎÞÀé¬s®ƒ§²ÝªFùÅ‚BQ€2“â(Cêz·iÇÚY²ÚïBsU€Ë±×<ÚÖç_šoÏÇÛ-‡iÏä€%q8[‰‚\m…ˆŠ€ƒ)‘‹lv5˜.„…’—ž’xv¥˜œ¡)©‘ F¤®D‡²´¥¶–[®£¾»À¹£w&y%&ËÌ !ù , µÈI«½xºïYöDiš^X‘ä颛*µo]Æagï~é¼â ò†3 ±†—'20 ¹F×€€µª>Qœ‘` Ò ÎèOoå»ËN´¼êœjÝoóüÜœáÿ1T{}ux ‚s„~†8‰Š"†dzƒ‘’Ž{|p…—D™^p’[] š£¤¥Ÿ§^ªy¦ ©ªMƒw´¶Š¯„§¸‹¿™Á‡‹IŗȬ¡Æœ2#mdÐ2l#Ö;unixODBC-2.3.9/doc/UserManual/Figure1.gif0000755000175000017500000001735712262474475014730 00000000000000GIF87aú}÷ÿÿÿ2b„666LLL–mÿ™™™¨¨¨ÃÃÃÆÆÆåååÿÓÿÿÿgò€uÿrüe`ô1óÿ.ÿg‹i)‚f¯'®*?*^xZ´[¶*~øà[Rò ÿøRÔØó´­ÿ¶û*À™øª™R™ÀàªòÿÀÿªôÿÿÿ؈ÿ´ôÿ¶ÿÿ*W±*Øô´ÿ¶*0” Yôóÿÿ\c±*Ø ¨´ôX¶ÿ* 0õôYÿÿ)c±®**¨øØXY´¶*0 0YôYÿ\8óØØz´´®¶¶¯***0ø4YRóÿDø*õRÿ®*z ø®ôR¯ÿ¨™@X™ó™ÿ0(*Yôÿ®*\øRØT`´ôa„Ô@õô[à) ¥®*­,nZ €T|ôó ‹ö‚ÿ¯*غ@´[ð¶**øôRóÿø öRÿ TØöô´ÿÿ¶*ÿ@ÿðÿ2ÌÄ*´œIõJ¬ÿί**ÌÀÚªŒ¤@ôóðÿÿ*M×Ðôÿ}Àª¿Øª´¶ *OverœwJrÎi*tpeõ ÿÿex†i—sÄt*i¤Ðnôgÿ f²i\l e ô 'õ/ÿhodÐmôeÿ/pÀhªarvÿeÿyuÀnªixOnÐD—ôBÿC/,ú}þH° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç ,`@²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ¦, ’‚£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊKv)Ñ‘e§X˶­Û·pãÊK·®Ý»xóêÝË·¯ß¿€ L˜®Ñ´eÏFü´Ç#KžL¹²å˘3kÞ̹³çÏ C‹Mº´éÓ¨//fV1ëÆ©cËžM»¶íÛ¸së6½úµW×N$ ñîãÈ“+_μ¹s½}s¾Àƒسoý¼»÷ïàÃþ‹Ÿ=«ƒóèÓ;€êÀ@Óöf‹2}p=»ýíQ ¸Oº?©ãñ(à€&WVíé§à‚ìé·T‚ñ¡¥}gŸvRßQ*õ_d„ˆ"ŽY‰!JVâd(b–âf-"÷¢Š&^6#–Ýèb­È¢ˆ”ù˜™™ÙWm¨”’NAˆ”“Ê—”u g¡}ž§ “G}øØ‹3‚Yc˜cš¨£˜6ò˜æ‰jÞFä—m¢¦ãšž¡I"œ80çxé§eHZÅåQƒ2å$”QJˆ…ôáwåpªgÀPJiHyy£zšYfŸ•‘ §˜¤Æ)j§v¦¨êˆB¾yâ—þlvª'ª´ÊºjŸ>®xk®@¢ê©¬AªÉ)ŸœíùçŸH¢7U¡…ª¢‰öÆ(~G]¸ÔØf;i¥ÜbÚå± ì©Æ‚z븿ŠK"h¶‹â¯ÃâÊê¼óÊkë®õ¢;*¯öÞÛkžàîùo°àª{¬‘É*àm“ +Ь³6EÝQÓ*Eq ,µ ‚ØNê±Yë+o«q†kp¼¯k¯»é†;§»x¦Z/Ì£Û¦Ì1+pËÄÒÈ®°å<^²7è,U 6œ©”‹Vé¨P @mSo ²É"grÁ¥¶c¨ç†ïÉ_³©+¼é⛳Ù.ÿÜ+Î:—¼5¨X§L·ÐZþ³J?ølÑÑNXñQD-u~®€¦?›ë5Ï=‹ÝïËŸÂ|oÝånúv¾4£­²Öi‡nwæ‡ÌöèAã žÞH7üpR‡*Þ%Ó„O+µáPOÍà { ºã&Ç‹³¾›GÎùÌç¹æ«¿vç+“‹¶ç=Ç wéÖß\²êCÕžzèõýdÑÐήhíâ5q_ùîëºÌ×ìjÙ@Ê<¶ÙdŠšüûûV¯öõÊë_öTf?ì½kdŸâߎ\Å=±nY³ÚSÊW¾‰!…8PßáÀâ¾zðƒ ᑤð÷ôŽvSÒ î¦#ºð…| ¥bA‹]Ì80Ì¡w Î*þ5$ayHÄ"ñ6>ü¡S‚(¡8ñ‰PŒ¢§HÅ*Zq'Jœ ³ÈÅ.zñ‹` £ÇHƨ0±ŒhL£×ÈÆ6º1»âßHÇ:ÚñŽxä Ó’>Nd…y ¤ IÈ4‡…bqäÈH•(¥‘6y$$O"ÉI>±’–L‰o¹€D6|ô£(3‚ŸPŽr#¥<åCR©ÊV„•®„ ÅÂIO.Q$¶Ä Q€È:î²—aüe's%^Ó³Ô£„€IÌ¥³™4\ä3Ý(Ì1Vš³3æwɘZbÓ|ߌ¦6})Mk–ó›×D&k¼ $Å[A‘RJ„xÖó*gþ §ÏIÇt‚ÑŸÍ(¹ G)1Ó)öT@B±’P{6ô(!z'>qùzRe¡V‘ç;EtO‰VE å(S0ÚM~"T¤ EèV@º’Bt†.½å8£²Ð˜¶ó£ÉlŸA§Ù”‡B´¡}iMçùÒ–¦´¨8å©G‘JÓx.Õ§Aeª8JÔŽz‘¥V=jLmºÏ™ªÔ¥\KX‹IÕ‘UªÅé:w*¨Õ¡?5êS‡ W«äS¥r=kPEŠRw“¤C=«DëJ¬ V«)ý«UûªÕ±’U©K­ç^'ûWÇ.Í«==lD‹TÆFU¡ŸE)hÛÕ²õ¡¡*\E«Èµ.²U}þkl9[©ªV¶v¥èIg‹[ÚVv´ ìh›Õ©ÂV³qE,n»\µ˜´§­+g-»¸çæUº¾ílr³«×·R·º˜5kg§ÛQ骵¤¯më\%ËWñw¹~èq%»XÛjW¹Á­ípñ›ÛðFV¹æ.aûkÚ–¸·º´.oï{à£Õ¼hmmëËàòZ¸°9ý [›Z\Ú¾¹‚Íîw«;_zø¶ m/€;,ÞÕø¸Ñ­¯C- Ô‰ú¯3Þ+}Õ:᣸»@ÕqsªbÒJ¸Äí®’!ì\צÇL%ï’Ý«äæ~Ö¹0~*i¥lâWÕ­B}qE¿,ã÷æ—Çó3þ“#,Ó ÇX»„p^)Œá³xÊðe³Ä2Üv¶S´©m°kÊØÿF3ËeF0ž=嬞ø»†õi•C|á÷¦†0£<æ.ï—ÒyÆ3~!­àÿþÖÁÌ5²LÑûäò®'½2¡w\èM'™È&µ­åÿøÓM†²E‡ËQ¿žºÎnžm|}ß8z£ªnsšÉülú»«¬>аß5â.Â:£‰4,Å=CrÒÜ\$hZü ÍoÏ“Ûz¾#V¹}å¢{¤ïês©3šï`î{ÐÃ^«“µíêsë6­ž¼·¿wmïRá 8Ã~p}2â_ÄxA'npާ›ÏZLo8þÝmñÇÚQãëvø«Uîm¯tÃè¬xÉýÃrsz|“5$Êq.q(¯|$™Ì$Ѓ>“¡$F?zP’®t“Tä茥ԧNõª[ýêX¿ÈÓ“8ó®{ýë`/÷ÃNö²›ýì:=Ú×Îö¶»Ý™\»ÜçNwƒ/³îxÏ»Þu>ö½ûýï€ÿgßOøÂ>1ƒ?¼âÏx «½ñ¼äá>ùÊ[žñAlºæ7ÏùÎ{>“˜üöâË¢÷Ï8(Ûïþ™Ã)ùÇwô÷x¼d}ˆaøq x^ýWrÿ§m¯Gzõg€ÒÁ~|·€uÖ€h}â×uä7æWûwü§áô€¼„[5g!Õ‚w¦S«qk]±‚ÑöI3p†fc&¨O(ˆDV,XRø‚×m†~#Øh¬ÑmK3ƒ;¨a=èƒi±lÖ–…"X„LaÄ5^.bõföEdHh†a¦X”¥W·5†KbÍv_)vO 5}S~U€egÛ•\<ç‚]HtXi¿µYr8;þPèiüµdÓ%eÆhd‡\öˆñq‡ßôƒ{HgÜõ‡#{‚¨hž6‰Q’ˆ„X†½¦i&U‘øf¨¶f—e‰Ð„‰d‘dLæ„Yñè…‰æcŠFƒ«øeÃök©¸ˆµ8Ц&‡X¨Q$e‡°HH²(¬¸‰¯‹FHŠË†Š–Fs¤8dŠHaØXŒÚxŒU–ŒC^ÍHLÏo&dõ¶q€è‰0er¶ˆ‡õ‹šŠ”HŒ¥ŽŽFg –æxŽx}V(VÊÆ†ú8Ôˆñbsx`9ÈZ€dÞ¸_†ˆ†“V]ZýRÆŒ™Gé蘋Ÿ¸V@ˆiz´’Ø6’‰Tþ’*ØoY´ðx„8ç’xÕ’%“ƒ$“%g“’Ô%¥“™Õoȉ>ù“yÁw’Õ(‚F9II•KYH@iqBh| Ô|ñ•Èç}W™FY©O[ €Öw1lÙ–nù–p—r9—tY—vy—x™—rY–LI–Ë• YP˜†y˜ˆ™˜Š¹˜ŒÙ˜Žù˜™’9™”Y™–y™˜™™š¹™œÙ™žY˜(¨—¢9𤙗\x“Ÿ™šª¹š¬Ùš®ùš°›²I™(øvåG˜³™›º¹›¼Ù›¾ù›³Y›nw›ÀYœÆyœÈ™œÊ©šÂÙvĹœÐÒ9Ô™›ÍÉvÏYÚþ¹ÜÙÞi˜×¹vÙùäYžæyž±ùƒÚ·‚‰šèùžðŸò™g9rí9”¸9Ÿú¹ŸüYžõs§‰Ÿý9 Z ËùŸØ”–Úf}Ú ú ²‰ ívŸ\¹z¡š¡™)¡E¡ji¡¢":¢ˆÉ¡Ä¤ ¢$º¢,ú &šK(Z|-:£4ÚŸ/jK1Ê 5º£µX‹™/ºUmXYÉ‘²åµR(ªˆšµf«™[{”©6§ÄV^uš`N»­g;·*´w]©8¨vƒMF¶ÓJ·€+™ië^ó¨·¾¥´­{–¸Œ»˜ƒ‹·‹F§‡¨oq»°¸S«ˆ…ë]œ;Ž”ë·8{¹¢{˜I[‘Yz¸ùhØ(N [´£+º<[µLZ¹¯ûº&Jo¶ˆ¦îX©£Z»°k·Y¤VÙºO뻘 ¼ãwµÆ{¶±;nÊ»¼YÛ¼e³ÐK·ßþ ®cI»Õ ¸¡¹®Þû½u©½Û;·Kv;¾G[¾øª–‹¾:«¾Oɾî˼;œ ;¿f ¿Òw¿ø‹µú›¼òÛ¿Qû¿&Àœ¾õëœü{ÀFKÀ3w¾ ̲” Áï›ÀØYÁ<³¬•¼Á-ÛÁhùÁ |²"lŸ\Â!ŒÁâIÂ* ²'s)üÂ&à êÂ4L±6<¡3œÃ»ÃÚÃ>¬Ã,¯8<Ä Ä'zÄH °J £LÜÄúúÄ8ÅRL¯TœpV|ÅîšÅá¶Å\\®^LqBÆS\Ä÷ ÆfÌ­cüsF¸Æ ÛÆv÷Æp\°r,H\ÇäzÇ|WÆz,ÆþhܯjüÇÆÊÇy”Ç„\­†\«ƒœÈ¹ºÈÃêÇŽ¬È<°<ɱ ÉÊ*ɘ|¬šLNœÜÉÀúÉÙÊ¢üÈ•l¾—|Ê—Jʻʬ¼¨®L²¦Ë¥:Ë*[˶œ©¸ ³°¼Ë³šÊëKÇÀìÉ¿Ä\Ì£|Ìû«Ëʬ¨½ì±ÎüÌ{Í=;ÍÔì¦ÖŒLØœÍÁÊÌœÌÞ|Ëà\Àâ<μ\ÎüËè|¤Ûì¼ÝÜÎȪÎÏòìÎôìÁö|ÏEúÎÓËÎü¼£þâǹáH‰á(.¸%îË,Þâ©âÊtâ2þ›4žv6~ã½™ãã<Θ>®o@äŠ9ä!·ãF®ÜnÄE¾ä¤ûâÒ¬äPžžR~ÍT^寉ä/÷äZÎåJèåUæv*æPNæ fæKŽæò•åZŽ´WÎÍnþæ«Éæ¹¥æFnçI5çþtžšzîx|ÞçžùçXè‚Ι„~h†~èhçð¼èŒ®µŽþÏx䉾O•Îã—®H™~ã›þI.ãŸ~K¡Þ⣾gì ±ª¾ê¬Þê8Ñäiüª®>ë´^ë´ë‚̾ػë¼Þë¾þëÀþx—yÁ^ìÆ~ìÈžì1ì‰Ç—Îþì^ݱÐ>íÔλÕ~íØ^ãÙ¾íÜÞåÒÞíàÞŒ¥gëä^îæ~îåN´Ê¾îìÞîîþîð¾êîôNíÏ7ïõžï|yï­[Ýúþï#ÉïÖ®mþðo‰ïªÄWðßð˜ðŠ ïðy?|]8ñ*… µ“‰$¼Y±iS1b ºþe?TòUë„(pX˜„˜¶òYqñÔ—ñ0ÅñWaƒo5Ï0ïTMÈóÐhóU!òM4ñľóã’’ mV:‡No`J?ebË^@õÆf†3ÖŠ%¶MŸX€µcPïôž¥¥Ùeíèl§‹\Õ–XòV`{ÕÆWm¸‘UŠ‘`ÿnµ(dŒè2ô$¤f ©›ëeZß¹àxŠnÛ‹}hø™ø„okƒÚ¶½%ø„_ø©†„e ¶&/ùz?økëòò¨ø &Š|HôUÑ÷õ§ñWØ¢Ök¬¿ùj®ofû©®(ú{[i,h¸û¨¹{¦„›·²ûiOf²ÏUŸÊ-jlË÷FþŸúH¸&òh¸g_ü¹?ýCü–¯ºÍÿ¶YoµÏ^/W ¶‰z‹ø¢Oƒ‘«ý›ÏýF§nÏŽÂ/ý\ú¹¨ú™xgg6ú¯gA $hp`Â… >D¸áA‰)Z¬ÈPãÅ‹ '>Ôè¤G‘#–ir¤À]BÌØ’£È•1QÂÄ)³!Ë‘8ož<¹Ñ¥Nž@{É ÀÈ0HºéTª5m’|¹Ó J¬!‡^…ÀµkP/gzä(ölY¯XÉ~5 ö­Ð”tÝvÔ×íͼaõŽÕ‘çTÁ`iþüÛ²kÕžJ™:… Ò1cÊTÃú•(sÛ­ý²þ<ø9¥fÍ‹/ïÜ 1õiÄž]ã= ڳ⹃vÆÍ:¤nÛmÅúÜZoÆÙ†ƒ÷mzõf̺Î65ê¢%WCŸ^¹áä‡MŸFÕ^üxòåÍŸ·Š^ýzöÐÛ¿‡ôv|úæ¹7ôùáýúýýÿ'O1|o>¤Ì@ˆ¿òo &¤°B /İB7d7?¬JA9qÄÿTBɤR C 8€g”ñ€ MÄ1Gwä±GÉCQÅýXtqB”1I d²I'Ÿ„2Êò‚„,Â]D2K%-”²K/¿3L©ünÅ…°LRK€ËûóðMäº<þ+¼Ú´+qNËð< ¾<ÇÑÀùòü=2õÛŽÈ ÓdTK65”3¾BÍÌᬋ@Bù䬽I9eoSµ2CE•MU!Í«8¾Ž³mÐå>j.¹Þ¸,ÎÎ&ª54YI£.ØÌPËT(Њ%eËŒ6Œ–óŠ5]™…5XjcEÎÙÜz­èÒjoU×Þ¬;.Wn± w=RÍ”ðÂSÕLRÕU),VÜ>k -¸Bû _}éòWº|×:ÌÙ´»ŠXÀÎÍ¢¹lØ®˜ê|¸5Šw¬ÕƒoÍ5b‚Ç-K¦O§ZwÈ3ÝEI.cÓFz}²×·WïMøã…µÕ8Ó;u.–¸á*þÝëæši&:ä¡srá¢n5_„ãyß§Ÿ»íâNd¿*Ù½²Bx×¼ ‚GYe:à™ežz`ëâ¤MÚf«v¸à˜+-j›c¾´mæ”^¸¯¤Ef»ßiÙ­¸½ Ûb¸Æ"öqTIÞ ÁX¡T!o‡xÌ£¹HF6’*qœã‹Å&;"Ò‘—Äd&ùÉA†1Iv 59JR–ÒIœœ\)YIæ™Ò•¯„åˆP‰?”ýÏkBd"c¹K^ö2>³l¢»`þÔ¿åÉ—ÇDf2kÈ% 2• @ÅbºH™×Äf6 ’@~ñ™’æ@Í\ŠR›çDg)y¡p @œ;ŒÑØ–”NzÖS“ë„æàNwFórñ €<ÍiO‚Tø„¦4ù¹ÏhŽ1j¨@'dPŠV”‹µB÷¹Q44í¨D-:R’~ £&G7ÚP´Œ%…iL™tR 5T¥uéKeºSžÊ’™eº_0‹„SÞ¨§GE*€™T¦65JKujT¥ÚÅŸ"j›SÅjV?U­vÕ«ýáêWÅ:VCUÕJdEkZ—ù 2Q­o…+RÂWºÂu®uÅ+YïšïW¾vu¯}¬TÿXÂ&u°…EìN›XÆ’t±…¬AYÊÒs²•Ål69ÉÎvÖ³ŸmhE;ZÒ–Ö´§EmjU»ZÖ¶Öµ¯…mle;[ÚÖÖ¶·Å­kͺ¢ôÖ·¿np…;\â׸ÇEnr•»\æ6׹υnt¥;]êV׺×Ånv¡ËV«fÖ»IíæwÅ»ÓðŽ×¼$-ïyÕkÐô®×½ôlï{å›ÍøÎ׾Ȭï}õ»Kïh׿ÿp€<`ØÀFp‚¥+/7ØÁ†p„%ÿ ¿@´¬ô\õ6ÿ@¿Ìÿ!ö 7ÿ|¸H`5>{6`‘ @øD/| þ@|øA`/„8lö7 ÿaÀƒ…ôÿBj@ø66/‘@\D„ø l/ @ ,Aööÿÿ¿¿é@Œ…7@@¸À57ôÿ¿@¬t6õjÿ¿\ø/„„ƒll @@@ÌøHö/>ÿ¿ØøDü/¸\5>@˜B6­÷ÿ¿!øf@/œ\ÌGöô ÿÿ¿¿6…q@|<÷7_ÿÜÐõ#ÿ@¿ƒ±à„Üölôÿ ÿ¿@¿ø=ü/e@xøÐ÷/\|\(÷>úÿÿ¿¿ÜÐ÷#ÿ@¿0c |f‚øÐ/#(úÿ¿(øL/÷ÿ¿nø¤öÿ¿…ÿ¿@#Ø(6ú|,”öõÿÿ¿¿'ˆ@„4„9ölÿ ¿@ '0ˆ @@„ø”l/õH>Dvæa~*iä‘Tõfh¢9^qPVÈ@…TâGà~)¢–X:‰ä—`"¨äk³•›—ÇM%ŽWe雎\ùãŽ&†içÐy¥rhG^Tj妜?¸åœ>։碌¢Æ" ”( VîY¨¡‰Yèˆ6êé§™¹Gv –jê©u5ÀYg‘*Šê«þ°Æz•¨o'뭸ު盹öê«©»þ*ì°ŸKì±È~)ÀªÉ6ëlŠÕ¡4@SÔVkíµØf«í¶E1À™kSMûì¸äâ&*¸R‰[îºìf¦¤k®©Ûî¼ôm¼QÉ[ï¾üêõ®P¥o¿ÜÖ¹RÅ‹®Á 7<Ö»ø¼°ÃWœÕ¿‡;±ÅwmÂénÜñÈCœn¾"3,ϵ߆-“,³mg²W}êçrg0Ïì3Íß‚Œ2ÎV…xeZNÝ¡‡G³lž«?GM×½'KL4c-ëˆVÒ›f³–^K-ö] œò›­sÌeq½öÚjký¶Úc×]׿Q)|µþoY¿ÌÖs‡-·ÜÚm8[&ç;´sE‡­–Ûƒ;N7‘9nùW5›½7Ïp¿†4ç† îyà_n:Yç}3ã€ÃY9X~ëì¦ë£Ïýúé¸[unÄ£v{îÀ»•¹ÆÎ}XŸý¯ü‚A«¾øj¿//}Y‰üüôØãù±Í×gïý—x; ÷÷ä#¹{Õ½—¯~‚Ûk¾þû ¦î>üô¯'?ñõç?’õïÿÿ  HÀð€©ÈÀ:ðŒ È? Xð‚Ì 7ÈÁzðƒ ¡GHšð„(L¡ WȺð…0Œ¡ %PÁÚð†8Ì¡wÈÃúð‡þ@|a ƒHÄ"ñˆHL¢—øC2ñ‰PŒ¢§HÅ*ªPTÀ d@Ø(>fŠ]¼`]8F ”1‡ŽÉà5žñ„iL!pTøÆÖÑŠ-Ä¢Û(Â;1Œ~ a éÈG ²„qŒ#ïxÆ5r±„Œ¤!!‰HJÂðx<áÍhÉb²‡eüäEYÉ=^R9>d$$»ØFR²Ð•j\e'9ËÂ2“ ÜäY9F^Rr¾äc( ùÅIšiôe,{éÈI2““ƒ¦3 Mb¶2‘×䤋©Lcns›ÔÔæ(eiƆsŽà§7?(Íg‚ó—ÔDæ;£yMkBs™òþä&9§ùÍ~öМɢ?Ó)Nlú™ÂÌf?å©NmòÒ¡ -è>M©Nƒz’œÒ”(AúЊÖÓ›uç:c¹GRf¤ (;:ÍÚÓ£0(jјÔ¥(¥h(Ó†vt¤ í$M1JTˆúT¡ëlä>EÙN¡.Õ’uêQ§:S’´¤Ÿ<©UµºR‘FÔ¨AåêJ©Ò Ž3§ßku Õ¢†UŸg•è›êÌ‘³˜ ­&\ûøT}¢s—}ý"]ßÏYÖ¯Tê^íZ˸2vª.Ul8«šÖÀÖ”¢Ý¢Zq¨˜¸¨u+Zg*Ò­"Õ´yµjjA{QÕS•”}þ­hÁ*[Ô:V‹«íYµÊTE¶¶fõc K[޳´½åêZ‹þö²XÕéPY*[êÆÔ¸î4)uq:Úä"5™O­+3ËêÝrb’·ÛÝ,e#šÝ—¶÷±M/Y7jØÂšõž>äiK+ûR”vT¸m-ìwázNÄV«ýåë0ëHÀb¼T½gfåê[7“ƒèÔ«,ša ÕÂ>ifé‰_ª ÖººÝo:•›B=ŽŒe1.g<ÊÊØŠ7Fccg¨ßÖ.¹)¦±a³þš×Ìæ6'1Ín޳œçLç.@Ë®­³ž÷ æ*s¹Ç¬å³ -d?oY̆&´¢­ÃDC9Ëž'xçŠJ>iø®“Öl¥7MéNkÚÓ'u¦CýéR“úÔ£N5¦W]OS«ºÕ¨fõ¥aýêYÛÚҸ洓ç é|™ÑÀv]dDYØÈN6‰=d8ZÙÐŽv ™-䑸ZÚØÎ¶¶Whm€mûÛà7Åiq›ûÜÙ&÷µÑÍîv[ÝÞv·¼ç½gx–ÞøÎ·šíýk_yÆêÕ7»©Mc~_õ‘=¢r.ðsàxNxŠ­c2¼áâ~8.ñg癟Õå/>þñ™ÒÃó´ÇxSŽGŽ—ûã¿*Bý›Tëzµ­5¯«ÄUnn–ã¸ã¹yy‰ûÓâ èäå¹Ã)Îf—¯{çyFzh)ícIýâJ×¶Ï«èôxÃ\µ({hŸ v©–7ëíÞ:•žU÷Ê·²¾¯Mmž^¦£}Ûj#Û™ÞL¼J]Å€yà! õ»g;ïRìú½ ÏøÆÑàŽ¼äsùÉ[þò-¬<æ7Ïùj¾ó }?xÑ›¾ßt&½ÝOÏúi¯þ̪o½ì‘üz3w{ñAŸ½îO©èØïþ÷6,=}üâÛ±öe&¾ñ—/ÉA+ŸùÐ/%¡Ÿýê#|ú{·¾öiþÙ{ oÿûéö>øÇ¯lÅ“ÿüÒþ<ú׿hõ³ÿý|¦þñ‘ßdúÃ_áö³üßeáß_úΗ}7äü÷8–_¶¤%`öHFL`•M –OŠ•{¨D¸D h[3WxõvQeTìõQs‡€XqØ÷r¸ZèÅ}º‚0(Uw‚‰g‚]¶†bXwXEƒFxÀåq4xD¨D8Èd-x}1çƒ>wN(„CøG6ÈeGhb)õuÒ‚¸…´„ØU„QˆzsV…VR?xl}Wa"È…vuÖtZaˆS¸eîÇ{qx‡<4-*|sˆ‡~¸A·×h}ø‡„hAuXˆþˆ(E‡˜ˆŒ¨øbntc»ÆWñ%‡ÿ†‡`ˆDUxK’X_”Xur؈™xD›X{Èd.ˆŠ?6ˆÛ7ŠFTŠ%&xCw^fr,5Y€õL¶hHÅe`P…®XD¥Hw@µ`P[×MJ%sWx]MøU¿8„ÁHD°ø„ ÈpÈØZIøXjÅ„e5›Ž÷ˆ‰õaih[ Ø\Twv-å…#æfa(Ž?TAx[Øè‰¨µ,8[Þ‰ˆH>dÆuÐHv95^øµŒY8vâņÈ%“'‘9f'¹“ä(C6”ŒV””w”*©”K)”3”9QÈ”P9€R‰Kd8süYÙt[™I)v=…•aɇݷ‡òèð……iÙfhiCeib—r9–xÔ•ÍØ ux)–kùt` „„¾˜‚™‚„Ù|Šé“<©„Ù“‘ “™“•y™“™™š©˜@Ù™á6—?é” )o¢)CŸYšx§—V”šªyx¬YE®ùšÒvš14›´ m¶ C¸™›É¶›/Ô›¾)lÀéBÂ9œÀVœ™GšÈ nÊÉBœÙœ:Òi“ÔY0yØþÙˆÚ¹‰ØÞYˆzؘá–(tåY›±IEÇ™žtöœ+Ôžî)gð©B—k¢&køéjú©k±Fký™Ÿ: ·æŸµ¶ŸÿY ª üI z   Ê ‰)gãéu+8ŸŠVŸ)tžp©¡ºžSä¡ ¢‚Æ¡(ž&:„*º¢'Ø¢.j€0£÷7£4ú~6z£-qÆ‘éz"jB“ˆDX7Aúqñ‰º€ßvŸáU艔HmIF¤U:C€©–Q—tFÖ¥mÉhNŠpø¡Ž”Z*FQ´X/ù¥¶O?j¦Ÿˆ¢8¦/8¦dÚ£¸X‹$÷‘‰‘ÏæwH‚%é‘þM5‚‰Ô‹—xt­]¼XtÇ¥†jX§|:‹nʤÉVy5[ozvÐÈ7—¡Üet÷ƒÄrPúŒö‚PšŽ ©…¢:q†zYnhZ:ˆslšz39«$f™oi—楀Ƀ󥪬¥«=h§ÿux*©ÄšŽÝ(vÃ¥R˜ÆŽï–«\è¨Qú¨ïˆ^븩ÌX¬fW[ͺ­n¨äJªCz–¶*®vª¨[j… †Ž –ch­t ×®½ºsÚ•d4vã ­þ8`;’¨®Ãª¯2õ¬ H­"V©ô*gtŠVYÚ[q·¯ï•sòÈ`n7ª·¸…o'aOj˜?U•yHIù­[ަúþUÓe—옔rºœ*ˆ§¬tik³¹axr—‹=˨#é‘mh–" ¯×J°´Øo>Š­jª“z´eȧû´—:“—Gl3D[;d9:oSv¥Ø&¶Œw¡¸ÇyU–®°™¨g¶:ª“$ú¶,ùµr ~t[·Û'Ÿx«}n›­{û¢Ìù·8xö š †ë ª¸ š¸ ¡»¸{¸;¡Ž{¹’‹¹‘»¹–›¹žË¹ˆë„Ë–]+¸Ú6ºYº¦‹m¨‹¡»ºà׺g »a(»´Kˆ¶{»~˜»º{‡¼Û»µ‹µÀ{¿ûºFƶRH¦ÃeÅ{«‘X¢4™`Ë[fÍ«µ¿þ”¦Ð5½cV½™…ÙûNhú_‚ªb„jŽ5w¨n¨ºîɽ©x²í:TkXª²CKŒªš¥Ú{Dìë‚Á®õÛ°÷h¬¯š¬Æ›¿8´¿×׿bú¿„%ÀNèW"UIjÀF„À(½Å°lÀû„ÎKÁ>dÁ]e•¥ ¿ä¬ã4.ä8Ç)ã(þâJmIÞäÈfâP¾hR>å„VåV.hXžå{¶å\^g^þåsö»]ƒ’ED.h\ÒTvÂô—¯!>Åh9Ô!,áuÙâGb[ZþïHKöõk †M~rwÐÜ«‘®êÛ"}]êhÌ@Fç~ÑMŒ²ëú¿26­“J\î Þ.ç;vʨ*Ú¨$ÝV§¯’5ÖÎÔöºèÙì´×Íè ë¿›ÞÞq^¸l.Ýۊα•Ü®Â;w:·ád®áªª¤]þêTW9r„-µÂ>Ñb¾äíàæÔÞfÖ^Ž£~í™”ížTcÜÞíÕ¬êîhúîUï´þêFïö.Ëã~à kBÕïðn¯š~—OðRäé=,Ì ¯ðþ>íæjêhÈïÿÒ¶¾î) ªñúûï6  …Ùñ_"DÞ¾ïlTòLtòÚ*A,¿€eþò:ó4K6óx;unixODBC-2.3.9/doc/UserManual/index.html0000755000175000017500000004455312262474475014732 00000000000000

unixODBC


USER MANUAL



Welcome to the unixODBC User Manual.  This manual is targeted toward people who will be using unixODBC to access data sources from tools and applications which have been developed by others. This manual compliments the Administrator Manual and the Programmer Manual, each of which is geared for a more technical audience.

Getting Started

At this point unixODBC has been installed by your System Administrator. Your System Administrator should have installed and registered at least one ODBC Driver (we will assume that the ODBC Text File Driver has been installed). Your System Administrator accomplished this by following the directions laid out in the Administrator Manual.

You will need an account on the UNIX/Linux machine; this is also provided by your System Administrator. In fact, if you run into problems at any point in this manual then you should refer to your System Administrator to ensure that all required software is installed, accounts given and privileges granted. You may also want to talk to your Database Administrator (DBA) to ensure that you have access to your database and to resolve any questions about which driver to use and what options to set.

UNIX users can be given a wide variety of methods to access their account resources and these access methods usually fall into one of two categories.

1. shell account (telnet and terminal sessions)
2. graphical desktop

If you are limited to a shell account then you will not be able to use the ODBCConfig and the DataManager tools.

We are now ready to start using the unixODBC tools. The first thing you should do is verify that you have a working System DSN. If you do not; then you should create a User DSN. These tasks can be accomplished using the ODBCConfig tool.

Using ODBCConfig

The ODBCConfig tool is designed to allow you to easily setup a Data Source (DSN). DSN's act as an access point for getting to your data. In many cases; creating a DSN is as simple as picking a Driver to use, selecting a Server, and entering a Name for the DSN. In fact; DSN stands for Data Source Name.

You should find using the ODBCConfig tool to be quite intuitive because of the simple Graphical User Interface (see Figure 1) but you must understand a few terms before getting started.
 


Figure 1

User DSN

These are your personal Data Sources. You are able to; Add new ones, Remove existing ones, and Configure existing ones. User DSN information is stored in a secret location where only you can access them. Keeping your User DSN's separate from other User DSN's allows you a great deal of flexibility and control over creating and working with Data Sources which are only important to you.

System DSN

These are created by the System Administrator. They act very much like the User DSN's but with three important differences.

1. ONLY the System Administrator can; Add, Remove and Configure System DSN's.
2. System DSN's will be used only if the DSN does not exist as a User DSN. In other words; your User DSN has precedence over the System DSN.
3. Everyone, logged into the ODBC enabled computer, shares the same list of System DSN's.

Drivers

Drivers contain the special code required to talk to the specific type of database you will work with. The Drivers often come from the vendor of the database but may also be found in the unixODBC package. Your System Administrator is the only user who can install and register a Driver. You will select a Driver to use when adding a new DSN.

Add a DSN

You will want to ensure that you have at least one working DSN. Here is a quick step-by-step guide to creating your first User DSN. We will not actually use it yet because that will involve using other tools and we have not talked about them yet.

1. Execute ODBCConfig

This can be done in a variety of ways. If you know that you have an icon or menu item for ODBCConfig on your desktop then execute it using one of these methods. If you do not; then start a shell and enter the command ODBCConfig. You should see a window popup (see Figure 1).

2. Add

Click on the User DSN tab to ensure that you are working with User DSNs. Click on the Add button. Select a Driver from the list. If the list is empty then contact your System Administrator; only the System Administrator can add Drivers. For this example we will try to use the Text File Driver. Select the Text File Driver if you have it available.

3. Edit Options

You should be presented with a list of DSN options which you can edit.  Figure 2 shows the options for the Text File Driver but you may have a different set of options if you selected a different driver. Common options are; Name (a unique name must be entered). Description, Trace and TraceFile.
 
 


Figure 2

Enter a unique name, enter a comment, turn Trace off and click Ok to save it. You may click on Configure, at the main window, to come back to these options at any time in the future. Notice that the Database in Figure-2 is /home/pharvey/test.db. You should ensure that this points to something like; /home/YourLoginID/test.db where you replace YourLoginID with your ID. The test.db file should not already exist (for the purposes of this excercise); it will be created for you. This is how to create a new database using the ODBC Text File Driver.

4. Your Done

Notice that you now have your new DSN listed in the main form. This means that you can try to use it in any tool or application which uses ODBC DSNs for data access. This includes many applications such as Word Processors and Spread Sheets. You may want to test your DSN using the DataManager.

Summary

ODBCConfig is a useful tool for PowerUsers but it is simple enough for almost any user to use. ODBCConfig exposes the most important reason for using ODBC to access your data; the ability for you or your System Administrator to change the Data Source for your tools and applications. Please take some time to get familiar with ODBCConfig and your Driver options, perhaps sit with someone who is a bit more technical and talk about it for one or two minutes. You will be rewarded.

Using DataManager

The DataManager is a great, graphical, tool for exploring your Data Sources. It allows you to explore you Data Sources in a similar manner to exploring your file system. The DataManager ( see Figure 6 ) is split into two views. On the left hand side you have a Tree View'. The Tree View is where you can drill down to the information that interests you. On the right hand side you have a Detail View. The Detail View shows any details that may be available for the selected item in the Tree View.

Just like ODBCConfig, you can execute the DataManager in a variety of ways. One way is to go to a shell and enter the command DataManager. This should bring up a window that looks similar to Figure 6.
 


Figure 6

Next; expand the nodes to drill down to the information that interests you. You will be asked to login if you try to drill past a Data Source. If this happens, enter the login ID and Password provided by your Database Administrator or System Administrator. You will know that you are logged in when the little computer screen changes from Red to Green.

One of the interesting Detail Views occurs when you select a Data Source item in the Tree View when you are logged into it (the little computer screen is Green). The Detail View is an SQL editor. This is only useful if you know the SQL command language but for those that do... it can be very handy.

Summary

The DataManager tool is a good way to test a DSN and then to see what resources are available inside the Data Source. It is also very easy to use.
 

Using isql

This is a command line tool. This means that you can use it even if you are not working on a Graphical Desktop (for example; in a telnet session). This tool is designed for more advanced uses of unixODBC. You can use isql to test a connection but it is designed to be used by those experienced with the Structured Query Language (SQL). You probably will not want to use this tool if you are unfamiliar with SQL.

isql allows you to;

1. connect to your Data Source (using a DSN)
2. send SQL commands to the Data Source
3. receive results from the Data Source

This tool can act in batch mode or interactive mode. Figure 3 shows a simple, interactive, session.
 
 


Figure 3

Figure 4 shows an example of isql being used in batch mode. Notice that it is being told to run a similar query as above but this time it is coming from a file ( My.sql ).
 
 


Figure 4

The example, in Figure 4, is also formatting the results into an HTML table and is sending them to a new file ( My.html ). Figure 5 shows the resulting html table.
 

vcCompanyName

vcCompanyStreet

vcCompanyCity

vcCompanyProvince

vcCompanyPostalCode

XYZ Company

XYZ Street




Another Company





CodeByDesign





Figure 5

Summary

isql is a powerful tool for working SQL to access your Data Source but it is more for the advanced user.

StarOffice 5

StarOffice is an application similar in goals to MS Office. A free version, for non-commercial use, can be downloaded from StarDivisions web site. Figure 7 shows a PostgreSQL table being browsed in StarOffice. StarOffice can use ODBC data but it can be tricky to get going. Here are some things to note about using StarOffice with unixODBC. Make sure that unixODBC is installed on your machine before trying to use StarOffice ODBC on UNIX.
 


Figure 7

Q. StarOffice disappears when I try to load a list of ODBC DSNs and I get an error in my terminal window about some library file missing?

A. If you have StarOffice 5.0 you may want to try adding this to your soffice start script export LD_PRELOAD=/usr/lib/libodbc.so  Your soffice start script can be found in Office50/bin/sofficeand can be edited with any text editor. If you are not sure of where libodbc.so is or where soffice is then you may want to use the UNIX find command.

However with the release of StarOffice 5.1 and beyond all you need to do is to add the path to the libodbc.so to either /etc/ld.so.conf or to your LD_LIBRARY_PATH environment variable.

Q. Do all ODBC drivers work with StarOffice?

A. No. StarOffice is very demanding upon an ODBC driver. StarOffice needs many ODBC features in order to accept a driver. Two drivers which are known to work are; 1. PostgreSQL and 2. MySQL. People are actively working on other drivers.

Summary

StarOffice is a rising 'star' in the UNIX world. You can combine StarOffice with unixODBC to get at your data. With StarOffice and unixODBC you can pull your data into a Spreadsheet, Word Processor or even create Web forms based upon your data.

Conclusion

unixODBC comes with a variety of useful and powerful tools to allow you to configure you ODBC access and to work with your ODBC data. Familiarity with these tools is a great start to using your ODBC in applications such as word processors, spreadsheets and even applications developed at your company of employ. I hope you enjoy them! Please email comments and/or suggestions to me, Peter Harvey.



 
 

unixODBC-2.3.9/doc/UserManual/Figure2.gif0000755000175000017500000001015612262474475014717 00000000000000GIF87a Ü÷€2b„666LLL™™™¨¨¨ÃÃÃåååÿÿÿu@a©l/Fiàgò€uÿrüe`ô2óÿ.ÿg‹i)‚f¯'®*?*^XZ´[¶*~øà[Rò ÿøRÔØó´­ÿ¶û*À™øª™R™ÀàªòÿÀÿªôÿÿÿ؈ÿ´ôÿ¶ÿÿ*ÿWÿ±ÿ*Üôÿ0”Yôÿ\óÿØ œ´ôó* õôÿÿ)(có±®ÿ**¨ø¨XYóÿ0 )Yôÿ®*\Ø´¶*ØØ´´W¶¶±***0ø4YRóDø*õRÿ®*z ø®ôR¯ÿ*¨™@X™ó™ÿ0(*Yô\øRØT`´ôa¶ÿ„Ô õô[ÿÿà) ¥®*­,nZ €T|ôóÿÿ ‹ö‚ÿ¯*Øš0´[Ò¶**øôRóÿø öRÿ TØöô´ÿÿ¶*ÿ0ÿÒÿ2ÌÄ*´œIõJ¬ÿί**ÌÀÚªŒ¤0ôóÒÿÿM×ÐôÜÀª¿Øª´¶ *OverœwJrÎi*tpeõ ÿÿex†i—sÄt*i¤Ðnôgÿ f²i\l e ô 'õ/ÿhodÐmôeÿ/pÀhªarvÿeÿyuÀnªixO¤ÐDôBÿC/, ÜþH° Áƒ*\Ȱ¡Ã‡#JœH±¢E‡ ØÈ±£Ç CŠI²¤É“(Sª\ɲ¥Ë—%dD` ¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“ú”©Q©P£JJµªÕ«X³jÝʵ«×¯`ÃÒtê”騤¨]˶­Û·pãÊK·®Ý»xóêÕ{–,R³e÷ L¸°áÈãöõk°Ò´‰#KžL¹òÜÅŒ‰:Fk¹³çÏ íb6@ ti£ ìLsóßаc˦Œ¹t‚Û§‰¦Vswë™×*>|nq»Ä‡N®|òñæz¡¿-þ\pë—sÚ®¹]wîš¾þ7}̶º\ép•£¯¬»s÷„×·…Þ\¾ÚÑ·¹H€:wxñ˜Ý&à€¶Vž{Õ%ˆ]rÓ!¸ qj™Gu F¡[íM(@…Z(!s>˜!|^×^ˆ(Vˆ¢\£Ùdýí÷€9Á¸o7Afáu+š×#‰–˜âƒ!‚8äŽó9È܇6¹#ˆ>Id’< ¡UÂÕ"iûÙ#Ž:¹žid’i`–ôM)dƒSv8¡šHJ·d‘q:yäJ)%håŠY¾Õâ‹Jí&äõé!–F¦ç¦º¨œ$žxç›WÂÇä…tb¨d¦zJ*j[ƒîW¨m3â$fck>Z'’þ­B*+ ižWiž—Ú蟞ii•®®)(Où!Þª—è«?î «¢Q‚ú*–Ò꧆¼âÙ,µ°Fë*®ZÞx¨w`"kÓªEéXd}ÁJ{ §*b«)¼œ +)‡ºâK¥‚&òÉ²Ë¢¸^e®£«Ùl ãeŸgßõð–ÅÅšNç¨,g wlŸËÈ÷eöׯ¯y¬rƒGLWÄ[š¼ÊG©»òÍ8‡³Ì<)<L@-ôÐD-ÏéÒŒôÒL7íôÓPåsÔTWmõÕX#šõÖ\wí5cŽ-vK|möÙ`+»3ÚC•ÍöÛpK­¶M PwÜRã­÷þÞçÎ]Mv?ÅwOnn8ÚaÓýà‡‡Ùøã^'þ÷â‚{ ÀNdž¹ãw޵äθå—㤹§«êùêUƒ.zå] ûM©£¾yެçþ´ë”Té;É.¼NÀç$<ð·Û”|M¾ëî¼É¼Þ¼O³÷t|ñ`Óõ5-o»êχŸYô£5<õÇÛ¤ýöÜ£N»÷Ó‹/c~‡ÞûïÕÿÄýúì·¯¼÷°›Ÿ“6ž³¼.~ÙÞùðw9þõϵÃÝ'ضúxÕ[ P˜?ž\/}” G8³*Nzä =˜@ ¦°ƒ¶ ÀNHÂ>Å‚÷3žÿ6¨¾ôyP…þB¡¡ GH¾öÐ…æ{ K§ÁžkˆPì› '‡BÂ0‰V¼¢ÿ'CÎEqˆED Ÿ†Ä~Ša|[[sF0â°Šh[#øÚHÂ4®Nˆt Ÿ=‡Ç<:tTa]ý˜;Љo„¼£²ÂÂÈF:2‘œZÜIÉJZò’˜Ì¤X˜§4¾É䃠 ¥(GIÊRšò”¨L¥*WÉÊTŽG’p“IfIËZÚò–¸Ì¥.wÉË^úò—À ¦0‡I̼²“{“e1—ÉÌf:ó™ÐŒæ,9žÆ)SšØÌ¦6·ÉÍ[Rsmo»f7ÇIÎrš3—ß´‰p²ÎX€– f<ÏIÏzÚcþÙÌpnÒÎp¾s–óôe@ïIЂ’35Yg?ºÏ„ ý|hC—¦Lât8µÄh,jÐŽzTš}¨H:Ò‘îó¤$-)Ï®9Ï€¶ 0ý¨LgZÌB4¥ê$éMKQ™±4¦ªPiJԢⓓÕ\(O‰£S&‡i?ÝhràéR£Zõª´´iNwjÒ¦ªªÿ ªXqùR¬š•¨ZU'WwÊÖœR4¬ekYzÖº4­n•¨B»ºÔžú®-ÕèE©j×Â4¤‡§a‹UÄN±Œ,Zó‰L½AV²˜õ¨cwÙÌzöž›õdX?KZÐR¶š‰½ˆjWËÚÖºöµ 9þ-8Ù6¶ÚÚö¶¸ Rg ÉÞš –¾ nä*‹7M÷¸ÈM®r§"[È}²•Юt§KÝêZWv¡MæhKË]sfײÛí®x¹ùÝâ†w¼èis×Ùôº—™6}*cüêVúîŸK¢«.õû^ôâõ«H³ïOËß]¸¿Ýýo_ùQ¦:t¯"m(SªÔ‰ÞЖtåè@§Š`÷*x­^UªDâ”B”«Î(u¦ —ÛV»úÕ°Þ­pg=IâÒúÖWËë^ûú×W‘5{aMìbh¶&oqÍÇUsvÙÌv®³= íh+;Ù‰­¶µ;ídj{ÛÔÆ6·Á=¿À)ú,qÖ ¥¡fn½Ù'ë&7ÕÌ­O~3ñΫ¼#gv>øÌj­ðJñ-g®º{ß_£÷ÆzzâËØÂã#¸ž¯Œð®)<©þƲƓ<ð*O\Èú®xÖþ.ŽîŒ‹ÏéÎwº$.dyÊ"o]¿í­ñ‡ædi·¾ýjæ˜|æYn0ÍqìS–cYè*÷yÑ“î,ǸÎ5zžUªÐ¤+lݶ췯Îoq?›ë#¹´Á>ös—ìÙöz¸Ñžv³›ím×5âìºÛýî—Ìú½Í÷¾û$j‡»àå.xŸþ·xO¼âŸ½×úº¼ä'OùPŠq›µd²H[»Só 6‰cŸð̃~±‹SçS/ÚÓ—–õÉBh~Í{Ë »þ¬°×˜c­žëðÚÇ·ÿhj¤·œÁ †ø_k?V—:øš]Ûèi–|2[ç9÷}óyþ }™Žgö“Ð=Îó›Oûrå~÷£p OÑão¹ÁåÏû ¢?¨qþúˉZ—‡ŸúCÇqæ·R÷÷gê·‡µ~õ~ €×‡fÈ|„µ}˜€¶z ¸s(5uÇVødMV¦u—w6í%‚F5|ÿ§‚Ÿ‡‚vÅ‚ è\¦ç‚3ƒ(ƒ4XWÀ7È^3˜ƒåJŽK©V„Fx„HˆCø6ׄNxlWxhGzR¸oThqŒ—…Z˜wháyþTy`†by,x_e8j?„öÔ*ˆ‡yH¼%|~N±$7æhþ~Xƒ€X‡âVùŠö‹ùX=Y”À¾…´Ç”äu¥ÈtÆèqê¶;Ûe€ÙT`ú'M\)Pû5T×ȈۘŽX™–o…amM^IOaÙKæee‰”õ€–—ƉÌpr³e¶a=–~TÅfø·f‚¹f(UUÅ}ö{•a\˜å”ÍÈtӏнøp©x€9W]F™ùš,š¥©~Ù˜„™š,Æ–Nöš_9•G‰˜9t×ç™ùqÕx€£¹š¨ ‚ØeÀI¬ÙšÆÉeĉœõ´ŒŸH 'òEah6dwæÇ8œ„é›rþÅaªÙ›ŒÙbaÉÇ™šöšmYœm¹œTÉ`—y–¹ ŽrÄx_ØÙ›¦©_Ýù›Ç‰ÊÉŸúIVC…ž±¹‹ë)gçX›A×™†Šxm& Æ9š‚9žÿégÀ žúée5XéIOúqΙTÆ8aDF¢UÇŽ ç—ïø  8˜Ù©a*æ¢Í‡QqyžÏ§š° ™„å|é÷|kX Í)”9rKYLúLG dzŒ•甤Ì¥že™Ó¤µVORJLYšYTz IÙR)›t×Bz‡aªŒ©JVJ„Ù¦nj„1 ‘h#’tZ§€w2C™’à&“z:k|Ú§Áõ§€Ú[`‚:¨‰T¨†êGˆš¨t´¨ŒzFŽú¨Q©’êFyZ©¾E©˜ZGrº©Â¥©žIª„:ª¤z¨¦zªŠšªªÚ¨¬Úªúª°:©²:«–ú’¸š«ºŠw7Ù«¾ú«À¬²;unixODBC-2.3.9/doc/UserManual/Figure6.gif0000755000175000017500000002724412262474475014731 00000000000000GIF87a˜ü÷€ø€üüø@@PX`ppppt€€€€€€€lø    ´È¨°À¸¸¼¸ÀÀÀÀÀÈÌàøøøø¨Xø¼¸øÐøÜ¨øüøüÀøüø@@Ìøøö//ÿ¿xøHö/>´\ô\>6@̘!ö­7ÿ¿|H`>{ø6`/‘ @Döÿ¿| þ@|øA`/„8lö7 ÿ@¿aÀƒ…ôÿ@@¿Bj@ø66/‘@\D„ø l/ @ ,Aööÿÿ¿¿é@Œ…7@@¸À57ôÿ¿@¬t6õjÿ¿\ø/„„ƒll @@@ÌøHØøDü/¸\5>@˜B6­÷ÿ¿!øf@/œ\ÌGöô ÿÿ¿¿6…q@|<÷7_ÿÜ0õ%ÿ@¿ƒ±à„Üölôÿ ÿ¿@¿ø=ü/exøÐ÷/\|\(÷>úÿÿ¿¿Ü0÷%ÿ@¿øc/|Hf‚>°08%„(lú ÿ@¿Ê(“úÿRL÷ÿ¿)n49H>ÿ¿#8(öúÿÿ¿¿|0Ô @@*„ Œ9ö7ÿ¿ H>„ lö`µDa'øƒˆ/,˜üþ+H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ€Ž CŠI²¤É“(SŠ<𱄗0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H²˜´©Ó§P£JJµªÕ«/—ºÄʵ«×¯`ÊKS+Ù³hÓª]˫ٚ4ÈÕ ­Ý»xóêµúVfܹrÞK¸°áÃd= ¨©xf_˜ÓmÐ`°MÁ˜qZ†[7æf¯˜;ûÍ<34âÓ¨¿*^,sµã–~%Ï¥LY4MËŸKÛÖ=,îÝ¿{CȺ¸q§®a&—ù‚äÁhS¾¹ù·õΦ_’~]{ÝêÛ¡þc'-ž³pâw_Ï~hòåÌa§ YzåË¢Ës÷Î?÷üú‰÷Ý€ü 蟀èÜmêµçàƒ;­_|LÍG×gÒ5ØŸémØáæ pîÜvÂ× z¶èâL«±VÓc`£»eˆß‡¡—yß w i ö8$ˆúñÆ ‡L¾èä“1ÞÔÜ6z¦£yúx䑙ȥ'’¸$–"jøä™Jˆ€Œ¯U•8†&uZb¸e©§‰`Þ昞•ø'š„BøÞš3Êœ7FW(vYgyyâ¤ޏàhÙu—ev…†Š|f¥è¢Œâ8Ýq,Šêê«þ8•ZjsÚ¥º*j›Âªë®45Ö+›¦ºY•f*¯È&ë­¥)ëì³®2 í´Ô*mµØfûàµÚvëíiÜ~+î¸wõÕã¹è¦«îºì¶ëî»ðÆ+ï¼ò`ï½øæëALöÆäÁ¿,ðÀlðÁ'¬ð 7ìðÃ|LæFlñÅg¬ñÆ p@ ‡,²ÈûR\òK§¬òÊ,·Ìp¿Án5œË4×lóÍx“tñ’<±ñøu*üðOå>sê‹ÿ»õ¼CïYñY÷½o÷ÉóTlçÚ%½áÏ¿ùõÎûUþö<÷œ/¾¢ƒÏ<\· âûæ[Ž´Ý»«Þú°³8ÏðO;›ßüêç˜ðídEêKß{r¾ÌO¼Þ'¨3„}ì{ ¼ƒÂ“AòM°,þÃÚá X @ì Á¾Bæ8P'dßþN¸“ Úî2þ<ßåFCÉ…ð‡ësŸƒØ?Š ‰ùcbã†8£o~7l\ (A)Úć@1!eXEÑ™LlâÛ¢ ½ØÃ>‘O!# ͘•©Á1,T ÷ÈÇ>úñ€ ¤ IÈBÎOŽŽ±âãö@tÝ‘(ç3¤$'IÉJZò’D$sYG4>Ò+>,˜ÐpFÊRšr`šä'ƒfÇOv%”å)gIKš¥’b«š']é7p†@-‡ILƒÝ2+¹l%/¯Kå1¬Œ*¦4‡yÌãÑ‘•»\fUš)0YŒ2©æ4ÇYÊjq‘€Ó&3}Y8åé±`´ñ@8Q‰™€õÈž¡þX>É9Ns&3›ê” 7½)1xÆS˜ÑØÝþµÐ…æL¡ö„¨DùYL^S—ÊÁ¤F7ÊÑŽzTNüeÀ„vO‚þË>£ÒD%êЇº”¡0¥(E- 4Œ"ó£8Í©Nw:ȶ³› Œ×&Á)¦}iLz·–ÊTš4àf9.šùu# êÝæwÒxLœNmª>µ*T¤>ušQEçTgé¿n¹ŒX-(RMê¢ 0+]êX•*Ö³ö“Šs¬©2_IWi²E„C«î€:W¢Ú`x5«^“ÊTÉú•š€MäEË{=µ­gA¬P;½¬:Ó±”ñ€T+™¤"µ²fmþ¨k/kÊ´v’‘_9î@;ѦHJW]ìH߉ÚÈF.ô,+Y™ºO…Ö“¶³´-6q JÞžE·‰âtBZ§F̸²®x!&]›f±³Ö% v{«Ýß夻;îxçÛ°òr¶—mY¯X|k$î·´ô ð)í Ð’è3bÄ¥nvè.R0½`íx*5£ÿzWÀ¶ef7¹Ù?ÏzúûÉz5'óD¿añ­wJôE ¯¬°Æ0©«ÄopY¼%ñv?ä^‰»VMà&|b« ÆknŒÉ9ãtb)‰7~p—¸DsñÊï ²WDèÈ9eHv®`(@æç.ªVeþ‡i (Þ%™ naC\åk¹+NNà{d…5´Ìe>3šãWFÁzX€|óñ Ø:ð$ËMB¡ZTé²|™ca ™)NS@©‚¦e“Ï eɽvž²‰•ˆ½ôuÅÖn«lx9áblIVè¦?M0×Ì{ 5ÇF}?[Ä9¾`«« éUK:-”®4­ÿ÷ӌѕ®Þõ®=ðiÙæUØ,#6ÞŽ"ÎZ•ª^£‡ <-íùÎ\‰6/}1’2Ÿš&3·=à_çU¬JëëKÍð ‚ÛžiÆåš\ÝüÂ+ò.r­\ïœ)פÙÖ¶Pyím–öÕÛ ÿøÁþšpd.œÔëtø¤?Jo‹‘4Ÿ\Íø®7þÚ½‚œ¥8·,¸Å X‹ÅçÕõhË#öò…b¼G›Þw¿;>Ù|ŸÌ9É X©”O´6¨±­í}ºæ”hÁ-V©úŠÞ¥ÿüÊúžzÕ»a¡:Ü–o‹·þõc=îwϰØOüö+=¾ÏûŒéÞaÊõó…;lã7Õ»÷D~ê›_KßS;®¤/þSþ__â¼ñÔO~îŸOOçJߘ޿™õ±fíË”ûd3ùmßÐç*Y«É ¸þéÓz†ßÿû÷}7€ß×\Bu€ÏWV÷WJë÷vÙ÷0öuî—{™wN·åD–7€ ¸H€ˆJ V€çbp(~ˆ€b–8€%˜~)Ó€£§1Â~§7Hušµy˜‚æ·‚'H€*¸0È‚.8ø>„¶×xAø„&ˆ32Xm˜†|º–t8¨1ð‡ô‡‚#h‚Qx0JØ/X~Oˆo$økæW†ghJSˆ}4ˆ|Ú†…Yˆ1[ˆ⇂C(€Dˆ„dh„fȆBøädžJè†þ‰G…õÆxè—oÈs1ÑgL}†«WÿÄyIx„L¨‡dØ1~Xˆ€è„ù4†õW"…£xJohkwZù'ss'p!H‰“w¹F{³å2[h€ö—€§u È‡P·Š–§‡Ëå„ò·†«¸€¤ÔŠçr['w7‡ ˜‹OÇ…•G‹ÿ惿}Syz•€h(f˜xrHS‡‘nЃÀdf\òx.t(„z7Y!§ vøømöètyM÷qçȃ¦¢ŽÊwpí˜}%¥/9CP6"‹û¦Œis9Ç Vv!È|xwd—‘)U,c‰¶qr‘Y‰þ‘|rö×tÝO‡’¨—s;Iv¾x‡&éz*©u-ÅuÄâx€[Å‘)rÁ6Pù”7•`·‹§ƒf锼7”³woö4‡ž–”JÙ ’MéZ{Çte¹–T•M5’jµ•\‰{^¹ˆ ”dì¢o˸‹ÊU„g ~yx€'8vÃWŽ$yjhŽX©fZY’ui—‰‡Zg‹áèŒO™@™Rw—qhLb9‹DÈ™Wy?8]=HšŸç™•y™ìâgª©Pry›žÇš_i›5³™ºyf¸ùн©a©péŽÁI[¿)ÒG}Ç©O³‰šµÙœ¡–œD‡|p×iœšþùœæE—Ò雓銟I„؉™ÒÉ›ßI_Ô 15˜3åé߉žé9^ë¹0¸&†ïÉɇ‹äež:§—:9`ÜI59Ÿ1VŸ sm® Ùlü V¡ûøŸ¢6 ña K†  StBÅu›Ö ÿyw÷ƒ\øP”ç €Ù„ ~bg–*Z¢ÿ(†ª‰š’áÕ©¢ñ( Z–ýÉ“NY‹y(¤h¤=I{3šš5`êA\ÈUé’ ªŸ'Ê“ ™™L¹¢¹wI¤y’KMªž7ª°ht-)‘°€#*€ÑŽjY“8i‹^ú–ÇŠD8¦ÞY¦ôy¦øRþFI% ºŸ~’\ú–z§yZ•ðY‹Iæ§ ¨*zЍœ`y…sxÀWüȨØ=É– z‘Ø¢¨J|òi©õ¤sŸ‚y.žz¿&Œ% }÷ç…Ù‘Àö«c·˜0 ²9œ&Wœ®:_°j|¡YfhZ—­š¬ã´¬vجœö¬\­Ò*MÔ*‰í¨Úº­ÄÔ­âš2áZ®´D®}æªçŠ®¬(¨Ò„dØê~íê® ¯Å$¯ÃüÚ¯ü ­”:¯öÚ2êÚ~–é –ú™­;°2U°Uh™ 00À¯+lõê°6±x)¥µ 0±Hg±‚i…ë8S «±äıšjþZøä¦"k   K²q:š'ËO«².òÕY”ï0›33K³»°ºäø¢*ú‹e¬šG’˳ã³ìù¢&EfC þz´¦ªwNù¨¥ŠV)KµÅdµÁ×…òƒ/²;‡úù¯’*¶[*“Okš™È¤f[}øÊVX{0Vz. ¦¨ú¥vZ§wKDyK¦{›®}{Jöæ²Aš5K¸t›¥7YQeÛ¸Ž‹©”IJ Z0q˵¤·H{ª—[¸aK¶P{šÝY©œû®ž+ž¥$«ûÚi¸ëi¸KyÀú‘½º´mHL;»Uû¸µfk0"”ÃK¼ƒ¶-  ê²­»¸þê¼Rh¼´ÔžÁÙ¼Ø1Л£–ê½ßû0á{µìº¹å»±Úë·۽껾4s¾iû¾þê¯[½è»òÛ³í ¹b0 ·S+häÛ¿ C¿£¯ÿ’¼ãµ «¿ÈŠÀ5£Àʈ0å¶]ÁI ›9+©µ¿¬2 ¥°è\[+³Fk³ |釨š+ÁR;Âóû¿7¹r%À °µE[³§ pK»9yŒ.:ĤЄZ(Â4¼1%«+0ZË"Ûµ,Ì‚p9¤pFú‘„K^J¼ÄÓÄïséLÀr+ªª›¥«»ª6™ƒx»¿ Æ#Æ¢ôÄ¢›.ƒ —ɸÆk Œþm£’øÅtl1vw@+º”[±XüÆ~ü¨iYpWšÄ2<—ü[ÈÏkÃ6º3ºžÌµH«Æ©[ª´(GŒ¥vHȘl¾š\3¶+À¹Ë׊¤)zÄû¬(šw¸JÉq<Á«\¼³‹£îk0L0ËKJs¬2üËpÈN,†¯‰3_›¸…6ÃÌÆ­Œ3Ü+¼ÄŠY•L›×{ͬÌÉ,¾àªÊâœ0Î LéûÍÐÎéÜ{Ù|Ã|žèϳÎwl¿÷+·Ì{ÏøL0úw;ÀÚvº¹Ì¿<Ð'<¡Å¢,œÐÐÃÐkë±¥Á#ûÔ%y“¸d ½ÊÍÉ(,Å9£Â>ìþ»§ Â1Ò˜<ÒÓ¸¯;lÒÐܤI¡-=Ñ]ÇóÜ2E—ÃÅSܯ7m˜’ÕÅ;íί[Î` Ó É¶ÿrÆ Ê0šÓ]èÔÊÔªÕ4 Õ¸z,¢¥l·;ÇÓ=ÝÌ?Í28]ØÇ‹Ç<Ö¢¼á$ª¶¤ºàŠ+Ç"~0îMټȡQ)ÞØß6Í€ýáMãùáãIãˆ]ºF>ß ~àJ©ÑÅÞñlÝyyâ‹­»¼K˜‰yß4©ªþâ¾ äNâùŠ0ÀýÀùýÝNžÎÄ}’ ýÏû͸^þ/iÞÎ>ÞÕo>0q>¾g.Îw~ÎþmÏ@¾ç\Ú›àMÁ€ž™¿=æY8è\è³eл†ÐÁç×ÌèõÜÛ]‡Š^ÝBnm×­4ÙíxíŸ8[æ©Üç!ãâMã‚QÞ+\à:íÁô•éòûß´3-²òíêjÙ²eß§¸”|Øã\>Úuç›>{Ï•µNÓ¾Ë@ºTmœ8Ýä¦NêØ‹×É^ÆTýèV­‚£ÈêÍs.ØÅnì`>ÌžÇè²ÇÎÇ?:§{Híã®Ùå.Þé>¹p}ã´¼ïÓÞ‘Â+é̜ꬭ×GÊ}=ŠV<¶î^׿ÐÇÞ±e|»S¾»‡¹†¼¾”õ=yÖîœÕ^î#.{ ¸–mœA þÒ /Ò?äÒ›.SòK=ïüý放›.c'ÿÒ)ßš|ón.ó9Ÿ›­}ówýóÀ9ªðÛñ¯ÖçnؽÝÀ¿¿<ïç¨NôÑû”޾iŽéB¯ÚToÎM±—žè[ÿÚKoJ‡íé¾ÑN½ñ¥õ§.âoÛ%³æ Ýæ*`²¾¾3>ððëu?ßzʧWÎöƒŒôÿßOÔ9ÓìÌø¥ï®Ôg•÷åKëJã±ÛŽõÝîIÊâ%ùß‹ør´(þî‘—àx?öÃÝõ/Ólãš_·ýnæ†_ïªoŸ}â{mð?ŠàÿêÛ‡úË]öµ{Ý ,˱¼–~uÿû³_ì3þßÀ#ÿÁÝÜÀÞµ¿Àj¾.Ò?ýãåù×~ý ³Í-__/?ìÓôJòf/ÛÍ_ç3oxðÿòÕOèà¿ú— Šó¿ÿü/õ¿èáÂ@T¨@€† >„Qâć&XèÁFŽbRäH’%MžD™RåÉ „Y°¥@‚c¤˜SçNž=}þTèP†h4ˆP!Q¦/fdÈ€ÂTª,\™UëV®]ÌÔä»´ùšÛP¹ýžë¬Ã¼®@Oœí@Ý,ÛŽA¼ÌÛL¶Ïôªjª«’{±Aà2¼°Á}üðà û¯ QD2I¶TOÀË|ƒêÁ³®"Iªú:´ÈóÓ1Hý†DjD#KT²L3ƒb2A'!ƒ²!)óª‘*ä´ÌþPC:³„¯N/Óµ°ÊšìLAÍ)ÍÝ´{ÐÁÎòàÆFÅC ñã1K;÷L­Oêþ<’PO?õÀP‘3ࢀ‚TWUUÕøê›ëJù¸Ü2OLÿÒTL@sµWAEUPÐ…ôšHU.oEV°\‹ÜU1_ŸUØ5 ô°$û’ÅW—#’S2¡·@ivÇlÏÝjYoÍ ·ÝÇ]y…ܶ5?aûÖ]}kƒÚD÷Eë«z[Û_vF²~Ÿý7á¡~‰`];u¸â%ÿ\1Xƒ*×]ˆ¹ “YŠ-&¹©…}mø.¿:x‘äí-غƒK¦y¨“{M¢øb¹ãg_þ–Xä|k&º§›-ÕT•¡ê€¾cuÔ9ê$žnâ¡‹Æš¢£ý7å{þHê‹ÄF‘jÿÖ 4kµµÆ¸I”ó4oé¦ß»ìùÂn*¨ë¶Íl…žymÁÚúL3ú–;hši¾Ãvò%<#ŸÕò»[ƒÓ¼óPÛVóí»K]YqÆš€lñ,¯rº/g+óÑæÕóÎ 7³ME;›`&@¡Ô]'~V½%—µåÚd¿WfÎm_÷2u[g€÷`ø æ^ì¬ãé~½øSûVwóÚ¡ôC?íú¢R?òEå·œõð)Ÿ6æc&1pô±–ž’’–™»0ŽqÛóËþTf®÷hÈu{SžþÊç¼óý€ê•ËLg@Øýl‚ý{ž‰À}aätDÛŸÕü'Bš‘`tÙÇ´B’Ì…5$— ›%¶ƒÃZÎ^¨Ã‘õÐb7˜KHÄ«1aHÜ—õ•BÀ…ЉOüaÝ%E1‘†WÜõÅE~ŠŠ´s+&F p'z‹•ø–³@Š”&'g4_ÕˆE¸„Žhí»£ðìÓºùéÄg‡ô¢÷è.62,Õ[ö¢æ#¾aÇ”ÜYþ¼×:þ ¬jU¬à"õÕÈ·A-g ™›$…g¿É=2?øk¥&Ç÷:Ë%2”¢l)q7ÒÑÇ€Áþhþy¥ïÙ|›¤ßm©G\22‹E#OËfºέiÁ¦1gÉJBÊï~Ç\&›™Ëgþñ‘‰3 ã¸Êù3"î”eOõ=¿„S‹ãL’.AHÓ, ×ìÞ+¿¹Ma6°xd==y¶<ŠŸÐÒ'ûÜxøó€–|‰Y¹LÊQu̱çCÉÙÇõA³'Y6õ÷Æm†T¤àЍèNzO¢”Kž Ø'ÑèЗ‚*¦»K ‰G 2³§>-gÖÈ.¢‚ð–G%ÔO÷‰B—B©$Í IkÖÔ*Òªg’*û¨ºÐ¿í”¦_ÍNX=µTpqu‡gE«mÔJ(¶ÞÍSn-b\Í4þ×éM4íæ;S-ŒTU¯`M*ÍøÉáUR|³¤ 2ñÚÄÃ"‰¯<ç_ë4LZòZÉ4¨iE¼Z’UsEåie-›Ø’E3Ju\§ ÙIKóm%<%gXÕæ“µ$s-^zù‘_>›Æ ¨m•KÏäJ–·½EÑe“äZ7°iê\§J‘+5Ýn÷]ßd¿]IIäùMgþ[•~ӻݽm6Iû‘ç’W\¿µØbícÑ_¶—¶îoýâ `YâdÍsªQí{_¬±µ~µýÛ£ÇAPyRî19ä\Óή¡p]p[Ì;½™¦Ääë0‚»úÔogĘõ s˜bþþ­XÁ-v1~;Öœ2µ'Æ1Z^<]¸Æo 2ƒ'ã6µÕÕƒ4V¡W“Ì/·¶È0‹2‹§l *÷ÊA3ë–¹3äó~Y§sŽ ä©þdo3îqYÑœæ´va”"Ûi7C2Å{õ¥³ÂìœÄˆ(1#Í[mOZSpB”7ôcÈL à.Dˆ‡žä†éYÆWêY£œ5}æHSyÍZÕÑ)c«Êì±’›CE^¬—Ë\QÇù´ Nm©o3è(Žv¸+îCŽ`±½·›Ú,& uM—IˆzÓT'vÞÀ>ØÈïµr¤ìe_ìÔæt:ÓÉ^yêÖ›×è€ñÆínþ«¥Ù *ô;+º^ÿ 8ÝËÅm¾å;Ov·[ȼ#„ûiÀ kZÛŸ¤§?«îöÛßLywÈˆÒ C†¦â•òÃÿým¥º™ÍBuåI®q¡DœÒä’±ÈG=g’‹àw6³qýñ–7ÄäΊ“¹ƒq-×Üf/'4Pt¾žCÚç?çxsÞ«¢çúè%z¯…Îô‘?}'7‡÷ÔAÕtšûë-ê ž'ž,ºÏn®ºÕ õ1†=Þ@$ ãðĦ@áºÚ7¾d?vœ'èíD †Ìì‡/;'½—Élc;ízïÛ·èvS žð˜{æ5Ÿùð¾:–ž¯µ‘³ltÈóþä눢|}†;øÂo^€ýÜ©½oæ&{å?.=QNŸ2Rww¼æ²Ó}ö.`Azû™çé|/)¸wøêJDøÃ/~âi_ítçÝùh’|»zÿöŸóÚG¾¾ jïÿ'»çMïîçcøn’-,ómìt÷Oþ¶q²¡ÓŽöë?Ó ¿p @ªÓ?$+@£9@pIÀ­{¼þû¿Úˆ@3š@÷«ÀñX: \À¼j@ÿ{ÀÑ: ü@Ê AˆØÀÙ¸À»ÊÀï[Á'é@´5ýÔ‰d“tÁ/´¹t¤¿›¿†°€#´€™z³Çz£t>|Œñƒˆ†±€ Pþ8B»ƒ,?sÂ܃BÇ¿¹ B`ˆ+DÂ3DBÈbaCNÊ.,½/lŒ0”&‰°2ô€+ÔÃ=ÔC5Ô7<™5ˆCƠî;,C>TØ‹€+4—Dƒ¥ÚzC̸A,Dº8Äꃈ;ÜÃáKB,ÜÂkC.ðÄA|ˆLl‹0L/ˆøDPÌÃ$<7RܾSDÅ L:­š>òó‰EY|,xzµð±Å[üœ\”>;̬IÔ°W10,{4þÃD!”©ºPÀT14ÆT´F ú ÌŽb¼EUd‹$rDEs\ t„3ћƮ«9vT w8„áNV#ÀßøôÜÁbbòÂáeÜPr‰˜…âM혶LæÍ/¸M”x]zP: 9&ÜV!æÆÖáµáÙ¤ßþ Þ;m MC¸g<^O•¹!îVQýRÕE¿d_èmPé…Ðñ(´Ëì¥âµb LѰ¬Ú>ØÎeÚa’±Ôu/4ÆM5®˜•mcp_˜…ß’}ÆR¬ß.†®/þKòl%ÿ-(K>6T¶ÐMæ@ØíÙ»@`tSÓîfUe‡)É@­£AQ޲0h¤Æ[f&fDbyÛâÆÈæ>Ýf$á7’âÕ´åÞrâb¾WhÍd§ç,ç¿}çrŒç(þìf gK½g0ÌgÇ4ÖäuÜÃíç9üg˜=ç)¶ã¦´çfN¼½¿l%búHgÕZç¤W-ö`Ë­çu,hC »ÎâråkgŒeSå­b‡†9bæcP†X8Þè³3;”þÔÆãQ¾€¤#Ùu3jì´j©KÜ'¾ˆcLîsZ¼^hôè½n;Ò% žàsó̬%j8rëúh?K•™æâ¼ÖQÄž<ïLhFkþvëU$: m…ísä1jIê×¥aíÖþÁ×Θ‰VÙ±J€Þöíßöm\]é÷ó?ô@·—3—ÉîVó‹âÏ” -ò‚­ãGÅQA—ôI§ôJ·ôK—tBßÇ«8NåhÓ¢Ž:ÇôQ'õR7õS/ MoHÂeÆO·µPß)T—õY§õZ¿sUGóÒ^âàþu[ö`vKÇu™4î õ_öegöf·ób÷ÉæŽ˜dWvg·ökvh‡Ji§ jul÷pŸumÿÊæÞj¯vqW÷uŸtr?è'{nÁî†þb÷z·w@w÷yžÜÄn_§oÔº÷€ø[gòµêîm*7¹^BpV¨~?îoøˆø|ïkvŽD3·Q´¸†Ïr€—øø,š—‘'ytñ zù”g÷*ó–wù—‡ù˜—y ôRù›w–¿ðçùž÷ùŸú ú¡/’>·yœGzk§‰¯‰ùfY$ú¨—ú©Gn†púš¤×zfïvÍÇnŒf°§ú²7ûžwˆë>°þó!•;unixODBC-2.3.9/doc/UserManual/StarOfficeDataGrid.gif0000755000175000017500000001271012262474475017037 00000000000000GIF87a¦©÷€øx4 4x<(PP\\8d ||x H4 8X\8hphhHpppx|x€€€€ˆˆpˆˆ”€˜˜€    ¤¨°À°ˆ°(ˆÀÀÀÈÌàð,Øøüøü8øüø´\ôl>6@̘,ö­7ÿ¿|H`>{ø6`/¡ @‰öÿ¿| @|ø†`/„@|ö7 ÿ@¿aÀ“•ôÿ@@¿Bj@ø66/¡@\‰„ø |/ @ ,†ööÿÿ¿¿éHœ•7@@¸À57ôÿ¿@¬t6õjÿ¿\ø/„„ƒ|| À@@ÌøHö/>ÿ¿Øø‰ /¸\5>@˜‡6­÷ÿ¿!øf@/œ\ÌGöô ÿÿ¿¿6•q@|<÷7_ÿÜõ!ÿ@¿ޱà„Üö|ôÿ ÿ¿@¿ø= /exøÐ÷/\|\(÷>úÿÿ¿¿Ü÷!ÿ@¿„c|| „|øFDa'ø“˜/,¦©þGH° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(3~Xɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´(ÎF“*]Ê´©Ó§P£J )Õ«X³jÝʵ«×£-ˆýJ¶¬Ù³hÓbµºR¬—,¨K·®Ý»_Ù~pÛÒ‚„¸x L¸°M½|WZ8q⯄›*¸”L€eË,1ç¼ Àå啜;ó ý’3ÌТ¥jn‰ÚsgͰSEMº´ì«uÖ–™ÛuÔØ›o÷þ‰xì‡ÅŒ8¶Yáå‘+§Ž“:îé·Gg-zøêáM½þoçîÛinð™…¯iýôzôIÛ³WO´ø[äŒKˆ¡fsç‘9']z×Åfç½ö™ib'oÝe÷‚Rè`„×¥'_†¾!h!‡¦eßL ²ö™ˆ¸^y žâ‹ jx¡Œ61#w¶ˆ"Šö(š}4–ß œ @. ÉXœÐd“ÏAHŸŽ¤•È!•Ê·Wr©"y´™¥‡XÚÖ!™eòØåMVb#šðYgо9¦˜ä­i"Ž;î¸ …*ºxãœGc0À€d ß.u é¤L:ii”$æx&v{^YayqN)žbF(Û§k¢i"©}¢J¨nþ§nGè«®qš'—j (®º—go³ŽIç®|²däÇ€xpBv‘E™¤LV[œ¬Þªã¯7Ê*¨ª—m±®šªª—Ün¬¶8‚×f e¶Æâ­ ¦/u» "ºé¶ø'ž}Ú«†+ÙG‚¢ ˜°¬¢Ïú×´ÑeÊkºïb 0¿k/¿Û6èÇiv:1¾ o8ŸÈåÓ‰ž‚¬nÉÿ뱯i®0z,XhXb… À Š €ðÌE ¦fRŒêÄôÞÙª¨N?˜q·)Wî¦nÖ¼âʱŽL&­I“¬´°OkÍnvâù¯ÌfgŸ‘ ðEO6_Î~Ykþ×ýî»ïª¶þ1Œ€Óøò‡{šcƒý'²Î¬2^ãß2çíÚ, Îâ×½r®v¬>nß²n!œÀ ¦úê>Èúë`±ä–X È ûî¼'Ýûï‡ñ,€œ>  |À7ÏzÎÎG_°ð`@ XïÀºKïý÷à ¦Wøä—o>^㟯þúìo•~ûðÇ/¿QV‰`ÿýøç¯ÿþü÷ïÿÿ  HÀð€L ÈÀ:ð `ý"HÁ Zð‚Ì 7ÈÁzü GHšð„(L!C@ÜÏ…„¡dØ@ªp†1  I¸Ãúð‡þd!þ8óÂ""04û“¡u8D#R6ìa{¸DJ±†MìßÈÅ.ÞOˆNLb·ˆCý‘1‹ö;ãÕhÆ#ŠÑ€l< ·G/Úñ„`Lcõ˜FË01‰—1"[ˆF%ú‘ù«c‡hÃC"2StbqèÈ>VÒ‘Tüã#/YÄJÞñ“x\ ÿvXÅIþ/“ ã) ™ÊEš2’Y,¥ 8ÉZ°–³t¥*ý7ÇVºò–  ¦ ó8CHêò˜-4&2_¹ÊE–—Ï„#)KD2Ñ…Ød¥/™KnZ‰Ë”¤0Ç)Bb’Rƒ$äÃùÇ^Ó˜ÙÌ&-§)O>2ŠÔþt';£9Ëxâð'9ºAs®Ó›šÔ&2aéÎLúsža¬'?w©Å|*š µhB*Pgô£4h"séÑŠî“åe#}¹Ð„NÔ›+ÕdLÙ‰Rg2³™öìèMAÊÓŠô¢žT©2ýhÊ jq¦Êl©ÍØÈ†•—ª„fmŠTˆnRŸéì©VHÌ­zõ«.«Xƒ(ÊD¢fg… mIK(fp­I-!\a9Öº °«vÍ«^÷ÊW¼òõ¯€ ,Aý*ØÂö°*$,bËØÆ^Ð*ˆ¬d'KÙÊZö²˜Í¬f7ËÙÎzö³  ­hGKÚÒšö´¨M­jWËY«(éµ°þ­lgKÛÚÚö¶¸Í­nwËÛÞúö·À ®p‡KÜâW±ŽM®r—K@ä2÷¹Ð…®s£×êZ÷ºØÍ®v·ËÝîz÷»à ¯xÇK^¸ž@°ÓÕ!k×ËÞöº÷½ð¯|EpÞÀ¦×~C%ŒËßþú÷¿°€{ËÄúö¾ô½ c̸ß;øÁް„%LßÚbÀ…¶£eˆàgqfÁ/lð„GLâ›øÄJ¢//¬â;b ÂCz1-ñZÙûyœi±e’“äÖÇCry`!ÃÖÈFrlwœ +Ù¸OÖm”};eß¶Ø,ÎpX (c¾ø”µ_—§x®Š8?2¾qþVÐ`# ¹Ê¯E²œ‰ à*ÃÙ¿oVp÷<äÛ¢&ÈQöqhv«ä;ÏVЦ-œ¯Ü¿,Ñ­ø‹¬—é»aŒ™—(sYõ·ßˆÀÓ þ2g.=Ã6/·sæó³Š¬h ¿YÕ«î3¡Ok>»YÊq¦2kMkÙ2šŽŽb }?É®˜Ò—s 3<’:Öâ~ýê&W[Ö»®5¢•Äd3¹Û7ε·o n=¯zÇ×6÷µ‰\hk#úÛ€vr·Ÿ|k[s»Çåž÷íá=ƒ›Ý÷¶6¾¿ î»ÕÒö°³ŠåJ7Ì™µ´–Él8»¶L–ôM-k'÷¹ÞØæ5¼þÞä’ÇzÝnö¸ÉU~òtÓ™å o÷®c®jy«Öë>ùÇÅò—³\ÛwùËóse#ü×¼ €Ò—>l/'ûášóÄ_Xñ\ԟκ§£]‡xæ;Ïv¶S=t‘—]ç`ï¸Úƒ^ó²÷\ìo'ùÚÙŽíœÃîfO{ÜÉ>wU3:©Án!Ó™ÎÆˆ☕ú(p_\ë/‡=Íâ§½åæ†5¯óŽv¹W{ÐuŸ{žG¾ïë›ì2ç|çÝMïËÝÖüÎ7ÍÃÎyÔßÜôD×ò/øÁ7=€‰ŸºÄ£¾_-*éê‘Ï:×+ÿõÚ‹]ó|}½…Þú¶»öÞyöCþpÕÿ|ó<·þØŸý³w>îž}îWœp*Ýè ¯,ˆ÷·_â †ùQúã±ÎÿÉÝòÎ'}!}Ô§~¯·yBw~x×wˆsxy?÷yxv¨·röF˜€×†tœÖ~îihYóGç|Å7Jùgq›i'À·|Äq¨oØ} 8{ÚFƒñ†ƒ &hâ6p6Ho™ç}ñ&p¸hÐÇoFn¢—g;8€JnN(… vÅæ:DlbÖ`Çfiòf˜F)¸É'y–Ay1\ è`©Ç†6ˆboèj?Ø_aiX¸eÄ…À·…’Å_ÆKc¸‚ÅÖ‚eøi~Ôuþi‡xaÿ¦ˆŽ¨yV‡W(‰d…œ†_1F‰—±tdè‚.È|9öˆ¢8ФXŠ)ÖYwØEf‰ûƒ|žy Xj¦8‹´X‹®¦]”xC°u@÷Y3]À(X¬Væ´]úc‹È˜ŒÊXbè%ˆÁøŒÐèXÔX[5Ö˜Ú(L%_ÞøàŽâ8ŽäXŽæ(YµŒê¸ŽìØŽî[é([϶ôX\Àfú¸?„7u‚[%üXýƒ–†_ÊæUÙS iùE+¡‡‘– 9ŒÁô ‘þx‰ý³tä{ð@€e9Fð—@^7ˆÙ’öƒi¶þô·t¹?#i?JA%ùpoõBZhl"¨eiIZ˜?5æ’v… 9™“ä”ä<¹AO•‡}øS—o4YøóZHYWi”Àv“"5i“dÉ@³#•œv×E] Ô‡$˜Dqf•0&iGù•b“ i‘ú#’•i©@l9—ÆwdpÉ@aÖ–€hy8‚Åç•zIŒ9‚Êöl`–Ŧ™˜Qi’§T—Y˜RN燤¦‘ï&heÉt6f"è…+9™^¥”bù—ƒ •%´“‡×BAÖV ·• öš,H—ܶš¬I‚\Y ›²ÙS´Y‘>ô–SšÏ¢A›ecB™•)þg›scW‚CÙœõœÅö‘ 4˜>IFö?á9DÉ1F [ɘf¤fÕ‰“8‰ž^i‘ ž')žv–ÐÉ?ƒypÙ–q–…¶bÃèdtag9 åi…¨)šN‰›ƒ˜œ”ªUþ(”ÿ3’7yOþ#¢>YL¼ÙcÀ× qõMuäš”ˆšÛé{»é[h™:X•y^<*¡Z jä”ÌÇfÉT•FÙ ïi@,F¤V)i¬žé4x­ÉŸõ%œ9ÊSþø‡2ù£ii¤÷’ïô›õyŸ :E-Z¤^z¤ŠW¦©ŸÐÆ•ó‡£WJN©¥jV¤i”LŠp z¦ôyACz§|Øžþ,’”_Å&¨sêEYš%H])¹xx A„Ê@ä§ûƒ¨ìùŸqY©‹Ê¨;ªb/ÆbŠúIžš‘œÚ@rú© Ô¨•Wª.–ª^tª¬š\u*C°ªa²ªŠ»Z«†•¥4”«³Ú«@D«¾ÊXþhCÂz¬Ìj«¡º{Í­ÙHžbV^Öz­Øš­Úº­ÜÚ­Þú­àŠ­ÔʧçX®æz®èš®êº®ÍªôÇfüuaï8¯hfhôz¯(¯Çç®h¬ÀçcÍ*¯ÒJN±¨‚0Ÿ-¡Äú® ‘KE™WKž£ ¯ô°±{± ±yZXªÿh±”Ú±»@[² kX)Ëþ;Ä— K²„±'TT‡ID„M·tI˜„©D³€e³†ÄM9û±v²‹£ë¯ì·²XÄRç4U­$U)´Eµ%U-K°/+²ýê´W¶(KRÖµ$µS$dµ|%KÓ´MF[WH«‡1ɧb‹pu«@õDJXÅH8›N[—&+Xy;R„kS%Xq«´t˱w Ÿ;EµQ[¸U¸5¸m»P%X‰+| ˸Ñ)¹:¥MX{Bj{µ [U—X› l2ë@¥ËCL¥³M•µ<;»“Û¸ ¤·CkM5uX‰›Y­ ¸¸K¯[;P›[«²K¹Ú˜¦zµºïÊ´ì鼟þZ¼[¬]›´=ª§íÅfì¾ò¾â[¾æ ŽÛ+·} ¡áÚ¾îû¾ð¿ò;¿ôk­K·Æ¥¯øêŽ0¶¿þkŠýËz…Ô‹eöú¿¤À¼Àp¨À0[¥Á«˜ÌÀލÀ|ÁæÀüZžË«Ry8z@¨f6wdCeÀUÂ&c±‡ÂsˆÁ.l[̽H×ÁG½úújvw€®wb>˜s)¼v>ìƒýöÂD\[1¬¾1[©iÕhw÷v9gð6oS8ÄC<ÂçÖzÑ÷Ãå~B ~EüŹ·¯2,–4¼xKÜìÖÅÓgrÚ‡Ã÷ÆÛ'Ä=¼oßz¨ÅöénP¬g Æ |Äþ«ZÆ€d vˆoçvƒ5Ø}j,r|<…‹ĉÜÀ@ÜÆ:ìÇ~ Èàya~$ȱ©Õšk }?øÈhv¤áî]™ý½àžá÷úà †áþáíÈá‰áÄ â&¾Ž"¾q~â,^‹)b+Þâ2NŠ/.Ôä=ã8^Š5þÔ7žã>îˆ;ßkôãD‡ANâcZäJ>bGãKþä;unixODBC-2.3.9/doc/UserManual/Makefile.in0000664000175000017500000003237313725127175014773 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/UserManual ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ Figure1.gif \ Figure2.gif \ Figure3.gif \ Figure4.gif \ Figure6.gif \ My.sql \ StarOfficeDataGrid.gif \ index.html \ unixODBC.gif all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/UserManual/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/UserManual/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/doc/UserManual/My.sql0000755000175000017500000000003112262474475014022 00000000000000select * from tbSysInfo unixODBC-2.3.9/doc/UserManual/Makefile.am0000755000175000017500000000023212262474475014753 00000000000000EXTRA_DIST = \ Figure1.gif \ Figure2.gif \ Figure3.gif \ Figure4.gif \ Figure6.gif \ My.sql \ StarOfficeDataGrid.gif \ index.html \ unixODBC.gif unixODBC-2.3.9/doc/UserManual/Figure4.gif0000755000175000017500000000645112262474475014724 00000000000000GIF87a¹[÷PX`ppp€€€   ¨°ÀÀÀÀÀüøÈÌàøüØøüø¿H>…@üð686»X„Põôÿÿ@¿¿|dþôÿ@¿|„'`lˆ @@Ìøøö//ÿ¿xøHö/>´\ô\>6@̘!ö­7ÿ¿|H`>{ø6`/‘ @1öÿ¿| þ@|ø.`/„8lö7 ÿ@¿aÀƒ…ôÿ@@¿Bj@ø66/‘@\1„ø l/ @ ,.ööÿÿ¿¿é@Œ…7@@¸À57ôÿ¿@¬t6õjÿ¿\ø/„„ƒll @@@ÌøHØø1ü/¸\5>@˜/6­÷ÿ¿!ø4@/œ\ÌGöô ÿÿ¿¿6…q@|<÷7_ÿÜÐõÿ@¿ƒ±à„Üölôÿ ÿ¿@¿ø=ü/exøÐ÷/\|\(÷>úÿÿ¿¿ÜÐ÷ÿøc/|H4‚>„Ð8„(lú ÿ@¿Ê(“úÿRL÷ÿ¿)n9H>ÿ¿#8(öúÿÿ¿¿|0Ô @@þ8„ Ô9ö8ÿ¿ H>„ lö`µDa'øƒˆ/,¹[þH° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœISb›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³J¨µ«×¯`ÊK¶¬Ù³hÓªÅÊu­Û·pãÊK·®Ý»xs¶Í  ¯ß¿ò L¸°áÈÞ{€Ç#¬¸²å˘3kÞœ—qÇB‹=™³éÓ¨S«^ͺ€gЀû*( T€·}ÆîË”÷Pß­ƒ N¼xÙ×8pàïlÊ?(È]À¶Pà_±ßν»÷ï=‘þ+ý<¨ôé¶§_‡þÙoãÀîãûæMúß÷àóëßÏß´øÝåé¤À€ @€HÝOÀÍ_løµ'¡|NÈ^f¨á†nýGm9 âˆ"h₺ÙGY}+¶ˆ_}â#‡4ÖhãT!'™dVgÛ`àëÉX…:ha„Gj‡ã“PF)åM¯feh=î4$(öÔà…_2ù`’c.9å™h¦ÙŸgííæ$O?âd]PašIæ‹eÎ8£š|öégkl0ÀRsÊY¤‘JЉçm¶™åŸF*ial*7饘fªiPú榠†*j”l¶⨨¦ª*†¥Æ¸ê«þ°Æ*\«²Öj뭜ъ뮼öÚ¾+ì°rµ…P5%«ì²Ì6ëì³ÐF+-LTò„,±Øf«íVÀºfm·Û†+î¸@‹¸×’«îºã‹îMé²+ï¼Áš€NñÒ«ï¾±š[-¼àò+ðÀ¡º‹Ó½äKð Cj/¾7,ñÄSúë-Àg¬1ŽËñoG~ÖØU÷18òÆ(§üÔÃ9)l²nV±÷èÉ*×l3R£ñË:­ˆèS=úì |?ŒÝ§7'=pÇ |O>‹LóRA3yrÔRÏwµÒ\3ÌòÁ;§èÞÖR—MõNXG6ÍXwí¶À9ƒMT–j—ÜÚl“m_þÞ®¾í7»L#ì2Ìxg-UÕe«Í÷Þ|ýíøº_;M'Ôd›}¶ŒFê½8æ†?îy¸qKÝl#”Ý"‡©"ã‰Ïüùë¼.z^®Ãn;ÜÝ‹°ÜëAˆ•›ôÝ.¼Ä¡'ö]µ¯¼º²¿üóÐs[íî³GoýõC?8öÜw¯Wîï:ïýøä»–{Ó-_þúÊ[œ>ûðGï>ïñ×/|[ä¯ÿþü÷ïÿÿ  HÀð€L ÈÀ:ðŒ 'HÁ Zð‚Ì 7(Aüqðƒ ¡GHšð„(L¡ WÈ â/0Œ¡ gHÃÚð†8Ì¡wÈÃúð‡þ@ ¢‡HÄ"ñˆHL¢—ÈÄ&:ñ‰PŒ¢‘øÂ)ZñŠXÌ¢·ÈÅ.zñ‹` £ÇØÄ*’ñŒhL£×ÈÆ6ºñpŒ£ãHÇ:ÚñŽxÌ£÷ÈGÎ0:ì ÿ²FAÆÐHDdE¿Ì4@ÉH(:²‡•Äa&xI!Ɔˆ›µÄËEu˜ Í^>×0–›Þ4pÅzÐA›4Óqmp¬ÍšäœîÃÂþ4³Ý¼× ר¢¿´iy±gŸBÙÈ6é+)}k;o›ÛϾvEšívë™Ù×Ý,…ßE‰/üáO4ø·ÁØì/üãiì¸.þ)^O¿7 6ù‡ñ}EŸåúö¸ÊgþE‚—“äV´8ÂqNLoÓ|ÛgtùχNôë¼èHOºÒá(ô¥;=Á}ºÔ§Nu9*t©§<º}>FŒ÷›åÈ$ê†õËͪ›ýìhÿ¢ŸÍ]s܉^ϯ‹Ù™a±³¹ìiÏ»Þ÷Îĵ7™ãäÍ/Üok›Oâu]3ÞùÎøÆ;~‡k/,Zí.XXï5å·«ÝEŒõãò[ÆÏFíŒ=z4£»Þ¥^d ÿøÖ»Þñ‘Ÿõi‡}eS+¿†Fq%UíöQó™÷½6®R] j3û>æ‡dýë—Ï|³ÇÞËQî½{Û¼ßn[ß¿Å'u•Sþ?á:CŸÚÁ ¼²q©üæ›ÿüH>ˆ‡=ã÷V ¶D‡~ˆ‚8ˆˆ„xˆˆ˜ˆ|gˆŠØˆŽøˆéÇ…8‰”X‰4;unixODBC-2.3.9/doc/AdministratorManual/0000775000175000017500000000000013725127522014674 500000000000000unixODBC-2.3.9/doc/AdministratorManual/unixODBC.gif0000755000175000017500000000153212262474475016727 00000000000000GIF89a ÂÀÀÀøøÐløÿÿÿÿÿÿÿÿÿ!ÿ NETSCAPE2.0!þMade with GIMP!ù , ¬ºÜþ†Ig¼ŠŽÍ·ÅÍÔŠ$Y}R¦±¶/LÜwµ€[«¸ Œ×óýJBËøCÅ’¹]óCF‹5ÖÎÕÀO.Ï«"îªÐ1Ê3{„…cÁJyゼ>ov[ñ{z}!vJ{ƒ[‡ˆ|fDbŽr+Œ;•‰…W”›‰žZ=¡ˆ’p`¦¨Ÿ„¬‰†u«±aŠnµ›1& gº¢¸¾ÃäÇ !ù , ­ºÌñ0´IÝ8ÆZ/ÎÐ J\ã}™¨Ždy¢B°®À¨<«u‡ç;šï÷yy”tM”˘®ÙR@‘¦ÓAì²Áê5'–Ëq‘3µÔöñ-}Ñ/˜÷‰þ.«&siX€_f‚Vc`BiP^••Y€”7–—2…š” ¦¦I§«¨{i¬°ž…V±¬®&µ­v_¹¡»‰¹š¿‰¥§Ã’oÈÌ !ù , ­ºÜÑ0JÞ¼² Q+ÆÝ&nÝGUD0®¤°ÊÎÞÀé¬s®ƒ§²ÝªFùÅ‚BQ€2“â(Cêz·iÇÚY²ÚïBsU€Ë±×<ÚÖç_šoÏÇÛ-‡iÏä€%q8[‰‚\m…ˆŠ€ƒ)‘‹lv5˜.„…’—ž’xv¥˜œ¡)©‘ F¤®D‡²´¥¶–[®£¾»À¹£w&y%&ËÌ !ù , µÈI«½xºïYöDiš^X‘ä颛*µo]Æagï~é¼â ò†3 ±†—'20 ¹F×€€µª>Qœ‘` Ò ÎèOoå»ËN´¼êœjÝoóüÜœáÿ1T{}ux ‚s„~†8‰Š"†dzƒ‘’Ž{|p…—D™^p’[] š£¤¥Ÿ§^ªy¦ ©ªMƒw´¶Š¯„§¸‹¿™Á‡‹IŗȬ¡Æœ2#mdÐ2l#Ö;unixODBC-2.3.9/doc/AdministratorManual/odbcinst.html0000755000175000017500000002267112460436034017314 00000000000000 unixODBC without the GUI

unixODBC without the GUI

Or
everything you wanted to know about odbcinst but were afraid to ask

Purpose

A lot of people are using unixODBC but for a number of reasons are not building the GUI configuration and testing tools (ODBCConfig and DataManager). This document is aimed at these people and hopes to explain what you need to do and when to do it.

What's a ini file ?

ODBC first appeared within Windows 3.0. At this time Windows used .ini files to contain configuration information. These are text files containing the following layout
[section1]
entry1 = value
entry2 = value

[section2]
entry1 = value
entry2 = value
...
With the advent of Windows NT these ini files have been replaced by the registry, but the API to access them in ODBC has remained the same. Windows has two function in odbcinst.dll that allow applications and drivers to query and modify these files, SQLGetPrivateProfileString and SQLPutPrivateProfileString.

As part of unixODBC's aim of reproducing the ODBC environment on non Windows platform's the ini files and libodbcinst provide the same format and functionality.

System versus User

ODBC distingushes between two types of ini files. System ini files are designed to be accessable but not modifable by any user, and user files are provate to a particular user, and may be modified by that user.

The system files are odbcinst.ini and odbc.ini (note no leading dot), and the user file is ~/.odbc.ini in each user's home directory (note leading dot).

The system file odbcinst.ini contains information about ODBC drivers available to all users, and the odbc.ini file contains information about DSN's available to all users. These "System DSN's" are useful for application such as web servers that may not be running as a real user and so will not have a home directory to contain a .odbc.ini file.

A good example of this is Apache and PHP with ODBC support. When the http server is first started it calls SQLAllocEnv as root. it then at a later time changes to the specified user (in my case nobody) and calls SQLConnect. If the DSN's was not a system DSN then this fails.

FILEDSN's

ODBC 3 also has a third sort of DSN, a file DSN. These store the connection information in a file that may be accessable to anyone. unixODBC does not at this time support FILEDSN's but it will when I get around to it. They are useful things but of less use to UNIX's than NT. Because of the MS view that everyone should have Windows on there desk, each workstation will have it's own registry with it's own set of system and user DSN's that can not be used by other workstations. File DSN's are a fix to allow the information to be stored in a central server that is accessable to all the workstations.

Why not vi ?

All the configuration files needed by unixODBC are plain text files, so there is no reason that you can not use your favorite text editor to setup the files.

However since beta 1.6 the location of the system files odbcinst.ini and odbc.ini are determined by the configure script. The default location is /usr/local/etc, and if a prefix is specified the location is {prefix}/etc. The location of the etc path can be broken out of the normal prefix tree by specifing --sysconfdir=DIR, so the following will expect the system files to be in the same location as pre 1.6 builds.

./configure --sysconfdir=/etc
The upshot of all this is that if you use odbcinst to configure the files you can be sure that the same path to the files will be used as are used by the driver manager, so the modifications will take effect.

What goes into them ?

Ok now we know a bit of the history of ini files and ODBC so now we need to get to the bit that is actually of use. What you put in them.

odbcinst.ini

This contains a section heading that provides a name for the driver, so for the example below PostgreSQL to indicate a Postgres driver. The following lines contain a description and then the important bits. The Driver and Setup paths point to the ODBC driver and setup libs. The setup lib is used when you click on Add in ODBCConfig to add a new DSN, but as this document is about not using the GUI tools, this is not that important for us. Far more important is the Driver entry (vital in fact) This is the library that the driver manager will dynamicaly load when SQLConnect or SQLDriverConnect is called for that DSN. If this points to the wrong place the DSN will not work. If the dlopen() fails the DSN will not work. The fileusage entry is added by the odbcinst program, so if you are using a text editor, you will need to add it yourself.
[PostgreSQL]
Description     = PostgreSQL driver for Linux & Win32
Driver          = /usr/local/lib/libodbcpsql.so
Setup           = /usr/local/lib/libodbcpsqlS.so
FileUsage       = 1

templates

odbcinst expects to be supplied with a template file. If you are adding a driver for the above entry the template file would contain the following
[PostgreSQL]
Description     = PostgreSQL driver for Linux & Win32
Driver          = /usr/local/lib/libodbcpsql.so
Setup           = /usr/local/lib/libodbcpsqlS.so
and you would invoke odbcinst with the following arguments, assuming that you have created a file template_file with the above entries in.
odbcinst -i -d -f template_file
The args to odbcinst are as follows

-i install
-d driver
-f name of template file

Threads

Since 1.6 if the driver manager was built with thread support you may add another entry to each driver entry. For example
[PostgreSQL]
Description     = PostgreSQL driver for Linux & Win32
Driver          = /usr/local/lib/libodbcpsql.so
Setup           = /usr/local/lib/libodbcpsqlS.so
Threading       = 2
This entry alters the default thread serialization level. More details can be found in the file DriverManager/__handles.c in the source tree.

[.]odbc.ini

The contents of the odbc.ini files are a bit more complicated, but they follow just the same format as the odbcinst.ini entries. These are complicated by each driver requiring different entries. The entries for all the drivers supplied with the distribution are included bellow for reference. The entries may be added in the same way using odbcinst, or a text editor. A sample entry to match the above driver could be
[PostgreSQL]
Description         = Test to Postgres
Driver              = PostgreSQL
Trace               = Yes
TraceFile           = sql.log
Database            = nick
Servername          = localhost
UserName            =
Password            =
Port                = 5432
Protocol            = 6.4
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =
And this may be written to a template file, and inserted in the ini file for the current user by
odbcinst -i -s -f template_file
The individual entries of course may vary.

The Driver line is used to match the [section] entry in the odbcinst.ini file and the Driver line in the odbcinst file is used to find the path for the driver library, and this loaded and the connection is then established. It's possible to replace the driver entry with a path to the driver itself. This can be used, for example if the user can't get root access to setup anything in /etc (less important now because of the movable etc path). For example

[PostgreSQL]
Description         = Test to Postgres
Driver              = /usr/local/lib/libodbcpsql.so
Trace               = Yes
TraceFile           = sql.log
Database            = nick
Servername          = localhost
UserName            =
Password            =
Port                = 5432
Protocol            = 6.4
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =

Templates

The templates for the included drivers are...

Postgress

[PostgreSQL]
Description         = Test to Postgres
Driver              = PostgreSQL
Trace               = Yes
TraceFile           = sql.log
Database            = nick
Servername          = localhost
UserName            =
Password            =
Port                = 5432
Protocol            = 6.4
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =

Mini SQL

[Mini SQL]
Description     = MiniSQL
Driver          = MiniSQL
Trace           = No
TraceFile       =
Host            = localhost
Database        =
ConfigFile      =

MySQL

[MySQL]
Description     = MySQL
Driver          = MySQL
Trace           = No
TraceFile       =
Host            = localhost
Port            =
Socket          =
Database        =

NNTP driver

[nntp Data Source]
Description     = nntp Driver
Driver          = nntp Driver
Trace           = No
TraceFile       =
Host            = localhost
Database        =
Port            =

Sybase SQL Anywhere 5.0

Thanks Greg.
[Sybase SQL Anywhere 5.0]
Driver=Sybase SQL Anywhere 5.0
Description=Sybase SQL Anywhere 5.0 ODBC Driver
Userid=dba
Password=sql
DatabaseFile=sademo.db
Hopefully this will be of some use to someone... Nick Gorham unixODBC-2.3.9/doc/AdministratorManual/unixODBCsetup.html0000755000175000017500000003113312262474475020207 00000000000000

A neophyte's guide
to getting unixODBC and Mysql/MyODBC working


Introduction

UnixODBC is an idea whose time has come. It holds many promises for those of us who use databases in our daily work and would like to do more of that work on Linux or one of the UNIX variants. Those coming from a windows background will rapidly discover that it can be much more involved setting up a working Unix based database than they are used to. They will also discover a world of great advantages too; stability, scalability and freely available source code are values not easily dismissed.

This document is designed to help people set up and use unixODBC. My database of choice is MySQL, which I have used with great success for several years, and it is the database I will discuss setting up

ODBC is an interface by which programs and programmers can communicate with any database which has an ODBC driver. While most databases have one or more APIs in various programming languages, ODBC allows the same programming code to talk with numerous types of databases. (ODBC is not the only interface to do this, but it is very widely used and supported)

Getting Started

UnixODBC is available in source code only. This means that you download a tar file from http://www.unixODBC.org , extract it, compile it, and install it. Before you do so though you need some other things.

Prerequisets:

  1. The Qt toolkit version 2.x sources from http://www.troll.no . Make sure it is version 2 or higher !

    1. Download the Qt v2 sources.

    2. Extract the sources to somewhere, usually this is done by placing the tar file in a directory like /usr/local or /opt and using the command.
      tar zxvf qt-2.0.1.tar.gz
      to extract the files. This will create a subdirectory qt-2.0.1 . Remember that only root can normally write to /usr/local or /opt. This is an exaple, use the name of the file you have.

    3. Compile the sources. Assuming you have a relatively recent version of Linux with all the appropriate stuff (libg++, gcc or egcs etc) You issue 3 commands from the qt-2.0.1 directory.
      ./configure
      make
      make install

    4. This last command is scary since it will install the new libqt into places where any old v1.4x libqt may exist. Rest assured that the full name of the library is different and it will not overwrite your existing libqt. It should choke on rewriting the symlink to libqt.so and thus not mess up your existing Qt / KDE apps. If it does rewrite this link, you will need to set it back to its original link.

    5. For more information, see http://www.troll.no . Please don't bother the unixODBC people for instructions on setting up Qt.

  1. A Database - in this case MySQL from http://www.mysql.com

    1. Again, I strongly suggest you get the sources and compile them yourself. The process is similar if not identical to that for Qt described above. By default MySQL installs it's executable files in /usr/local/bin, it's include files (source headers) in /usr/local/include/mysql and it's libraries in /usr/local/lib/mysql. The actual database files are in /usr/local/var.

    2. Before you can use MySQL, you need to run
      /usr/local/bin/mysql_install_db
      as root to set up the system tables. To actually start the database, run
      /usr/local/bin/safe_mysqld &

    3. MySQL comes with very extensive documentation. Refer to it for questions on compiling, installing and using MySQL. This is expecially true for permissions. If the permissions aren't correct, no interface will work.

Installing unixODBC

  1. As mentioned before, get the source tar file from http://www.unixodbc.org . As root, move the tar file to /op or /usr/local or where ever you want the source to reside. Untar the file and run the following commands from the command line in the unixODBC source directories:
    ./configure
    ./make
    ./make install

  2. Assuming that you have all the libraries and tools that it needs, you should be breezing through this compile. Certainly after all that practice with Qt and MySQL this should be old hat. UnixODBC takes quite a while to compile, actually all of these packages do. Relax and enjoy it.

Installing a Driver

UnixODBC by itself isn't a whole lot of good without a driver. MySQL has an ODBC driver named MyODBC but it isn't included with the current edition of unixODBC, so you have to get it and compile it yourself. I'll be referring to version 2.50.24, the latest as of this writing. The installation is much the same as the other packages, but you need to give configure some options. It will prompt you for the path to the MySQL sources if you don't specify the path, but you also have to supply the --with-unixODBC=<your unixODBC directory here> flag. The following is from the MyODBC INSTALL file:

To make configure look for unixODBC instead of iODBC, use

--with-unixODBC=DIR

Where DIR is where unixODBC is installed.

And (as usual), if the unixODBC headers and libraries aren't located

in DIR/include and DIR/lib, use

--with-unixODBC-libs=LIBDIR --with-unixODBC-includes=INCDIR

You might want to specify a prefix other than /usr/local for installation,
I, for example keep my ODBC drivers in /usr/local/odbc/lib, so I add

--prefix=/usr/local/odbc

So here is my configure line:

./configure --with-unixodbc=/usr/local --with-mysql-sources=/usr/local/mysql

Running make and then make install puts the resulting library: libmyodbc-2.50.23.so into /usr/local/lib. WAIT A MINUTE ! Didn't I say it was version 2.50.24 ? Yes, I did. However, unless you want to go in and change the version info in the source code, it will create the library with that name. I don't consider this a big deal and so I didn't mess with it.

If you omit the --with-mysql-sources flag, configure will fail. If you omit the --with-unixodbc flag, configure will complete and MyODBC will compile. However, it will not work correctly when using it with unixODBC. The problems described below occurred when I omitted this flag:

1) If the DSN (Data Source Name) you create is also the name of a database, the driver points to that database no matter what you specify the database to be.
2) If the DSN is not the name of an existing database, it will fail, not allowing you to login to the database. The trace log file will tell you that it couldn't find a database with the name of the DSN. This is confusing if you specified a valid database name in the .odbc.ini file .

When using the --with-unixodbc flag, These problems dissappear and it works the way it should.

A note: MyODBC does not support ODBC version 3 as of version 2.50.24 . When writing programs that utilize this driver, I have had success with specifying V_OD_ODBC2 when calling SQLSetEnvAttr(...) .

Setting up unixODBC

At long last we come to actually setting up unixODBC and using it. While most of this information exists on the unixODBC web pages and user's guide, I found it difficult to find and follow, so I repeat it here in hopes that it will be made clearer.

UnixODBC consists of a lot of libraries, installed in /usr/local/lib, and a few executable files (binaries) installed into /usr/local/bin. These executable files are ODBCConfig, DataManager, and odbcinst.

In order to get unixODBC running, do these things in this order:

Do this as root...

In an xterm, type ODBCConfig . This is a GUI program and must be run in an X session. At the very least you need to set up a driver to use. The drivers will be specific to one database application, like MyODBC is specific to MySQL. In addition to this, you need to specify a setup file to use for this drive. The setup files are the /usr/local/lib/libodbc*S.so libraries where * signifies the database application, so /usr/local/lib/libodbcmyS.so is the "setup file" for MyODBC. The driver (not the setup file) is /usr/local/lib/libmyodbc-2.50.23.so.

To set up the driver, run ODBCConfig as root, go to the drivers tab and click on "New". The following are the settings I use...

Name: myodbc
Description: MySQL driver.
Driver: /usr/local/lib/libmyodbc-2.50.23.so
Setup: /usr/local/lib/libodbcmyS.so

FileUsage: 1

You should have a driver set up before setting up a DSN. After having done so, you may want to set up a system DSN. You do this by selecting the "System DSN" tab, clicking on 'New', specifying the driver to use and filling in the required information. You will want to select the driver name you just defined as the Driver in the first screen that displays, and click OK.

Doing this as root will create and edit the /usr/local/etc/odbcinst.ini (for the driver info) and /usr/local/etc/odbc.ini (for the system DSN) files. Early versions of unixODBC would put these files in /etc, and you can still use a configure option : --sysconfdir=/etc to put those files in that location.

Do this as a normal user:

The process for setting up a user DSN is identical to setting up a system DSN. You simply select the "User DSN" tab in ODBCConfig and fill out the required fields. The following is how I filled out a User DSN.

Name: mysqltest
Description: myodbc
Driver: myodbc
Trace: Yes
TraceFile: mysql.log
Host: localhost
Port: 3306
Socket:
Database: test

This will create and edit a file named ~/.odbc.ini . Since the test database comes without any tables, you may want to specify mysql as the database instead, so you can see the tables when running DataManager.

Run DataManager

Now you should be able to run DataManager and see your drivers, DSNs and tables for each DSN. See the unixODBC web site for screen shots of what it should look like.

OK, Now What ?

UnixODBC is not so much an end user program, but rather an intermediary between a program and one or more databases. There is information in the unixODBC documentation for example, about setting up StarOffice to use an ODBC connection. I am in the process of writing a program that makes use of unixODBC and numerous others are as well. It may well be that in time unixODBC will be included in numerous Linux distributions and installed by default. Until that time I hope that this document helps you get this sofware up and running.

Charles Morrison
cmorrison@info2000.net

unixODBC-2.3.9/doc/AdministratorManual/php3.html0000755000175000017500000000371012262474475016365 00000000000000 Installing PHP with unixODBC

Installing PHP with unixODBC

This install procedure is based on apache 1.3.6 and PHP 3.0.9. The PHP4 from beta 3 will have a configure option to use unixODBC so most of the following will be redundant.

This document assumes that unixODBC has been built and installed, in this case in the default location /usr/local, and that both Apache and PHP have been untarred in the users home directory.

  1. In the Apache directory run the following command
       ./configure --prefix=/www
    
    plus any other local config you need

  2. Create a file in /usr/local/include called odbc.h containing the following three lines
       #include <sql.h>
       #include <sqlext.h>
       #include <odbcinst.h>
    
    replacing /www with your desired apache install path

  3. Move to the PHP directory Define the following environment variables
       CFLAGS="-I/usr/local/include"
       LDFLAGS=
       CUSTOM_ODBC_LIBS="-L/usr/local/lib -lodbc"
    
    remember to export these variables
       export CFLAGS LDFLAGS CUSTOM_ODBC_LIBS 
    

  4. Configure PHP with
       ./configure --with-apache=../apache_1.3.6 --with-custom-odbc=/usr/local  --enable-track-vars
    
    plus any other local config you need then...
       make
       make install
    

  5. Go back to your apache directory, and do
       ./configure --prefix=/www --activate-module=src/modules/php3/libphp3.a
       make
       make install
    

  6. Back to the PHP directory Then to quote from the PHP INSTALL
       cp php3.ini-dist /usr/local/lib/php3.ini
       You can edit /usr/local/lib/php3.ini file to set PHP options.
       Edit your httpd.conf or srm.conf file and add:
         AddType application/x-httpd-php3 .php3
    
    
    
And that should be that.

If this is of any help to someone, good, any problems let me know.

Nick Gorham unixODBC-2.3.9/doc/AdministratorManual/index.html0000755000175000017500000003002712262474475016623 00000000000000 unixODBC - Administrator Manual unixODBC


ADMINISTRATOR MANUAL

Introduction

Welcome to the unixODBC Administrator Manual. This manual has been created to help system administrators install and manage the ODBC sub-system.

Getting Started

At this point you know what ODBC is and what it can offer the Users of your system(s) - now you want to get it on your system(s).

Platforms

unixODBC implements ODBC on the following platforms;

  • Linux
  • Mac OSX
  • VMS
  • and various flavours of UNIX
This manual covers all platforms and will give special indication of differences for any particular platform.

Do You Have It?
 
It is possible that your system already has unixODBC installed. The best way to check for this is to drop to a terminal and execute 'odbcinst --version'.
 
[root@p12 qt]# odbcinst --version
unixODBC 2.1.1
[root@p12 qt]#

Downloading

You can get the source from Source Forge.

You can get binary distributions from various places. One place to look is with the vendor of your operating system. You can also go to Source Forge and take a look at the Home Page to see the availibility and location of binary distributions.

Whether you choose a binary distribution or source code depends largely upon your site policy and which operating system you are working with. I recommend the following;

  • Mac OSX - use a binary distribution
  • Others - use a source distribution (tar-ball NOT CVS)


Installing From Source

There are two options when installing from source. You can install from a source distribution (a gzipped tar-ball) or from CVS. In either case you will find README files in the main directory which should help you build and install unixODBC.

The unixODBC build process uses the GNU auto-tools. This will be a concern to you if you choose to build from CVS because you must start the build process with 'make -f Makefile.cvs' - this, in turn, uses the GNU auto-tools (i.e. automake, autoconf) to build a 'configure' script. Unfortunately; the GNU auto-tools can be very version sensitive. See the README file(s) for more on this if you plan to build from CVS source.
 
[root@p12 unixODBC]# make -f Makefile.cvs 

You do not have to 'make -f Makefile.cvs' when using a source distribution. Regardless of whether you choose to use CVS or a source distribution you will want to execute the 'configure' script with options appropriate for your needs.
 
[root@p12 unixODBC]# ./configure --help

The 'configure' script will check your system for features of interest and build some make files as well as create some include file(s) which will ensure that unixODBC will build without errors and only with features supported by your operating system.

At this point it is important to think about whether or not GUI tools are important to you (and your Users). The 'configure' script will try to detect support for the GUI applications in unixODBC and will build them if such support exists. unixODBC includes GUI tools based upon the Qt class library and GTK. The Qt based tools will be built if libqt*so can be found. Linux systems will probably have this. You can get this from Troll Tech.

Now you are ready to build the sources. Do this with the usual build sequence of commands.
 
[root@p12 unixODBC]# make
[root@p12 unixODBC]# make install

Mac OSX: The Apple folks seem to be grappling with their support for the GNU auto-tools at the time of this writing. I recommend installing from a binary distribution of unixODBC. If you must install from source, and you are having problems with the GNU auto-tools, then you may want to try the qmake build. The qmake build process is not well documented at this time. People familiar with qmake should be able to build unixODBC with the included qmake project files.

Installing From Binary

RPM

Various RPMs exist for unixODBC. The best idea is to use any RPM files you can from your O/S vendor. Typically RPM distributions break unixODBC into more than one RPM distribution such as; core, and GUI.

Mac OSX Disk Images

A binary distribution for OSX has recently become availible in the downloads section at CodeByDesign. This includes proper Mac installs. The install should be done in the following order;

  1. Qt Runtime
  2. unixODBC
  3. drivers in any order
Others

Proper install packages are also avalible for other platforms such as the Debian package format for Debian Linux. Check with the O/S vendor.

Where Are Installed Files

The location for files vary somewhat depending upon how you installed unixODBC (source or binary) and which platform you installed on. Furthermore; the location can be changed during a source install by './configure --prefix='.

Typically;

  • library files will go in /usr/lib or /usr/local/lib
  • binaries will go in /usr/bin or /usr/local/bin
  • system config files will go in /etc or /usr/local/etc
The system config files are;
  • odbcinst.ini - list of registered drivers
  • odbc.ini - system data source names
The location of the system config files can be changed by setting the ODBCSYSINI environment variable at run-time. The system config files can be edited using a simple text editor but it is recommended that you use the ODBCConfig GUI tool or the odcinst command-line tool because they will validate the reading and writing of these files while ensuring that the current location is used.

Mac OSX: The OSX binary install will use; /usr/lib, /usr/bin, /Applications/Utilities and /etc.

Post Install

You now have an ODBC sub-system installed on your system(s). What is the system administrators role from here? The system administrator is the only person who can install and register ODBC drivers and create/edit/delete system Data Source Names (DSN).

Drivers

Drivers should be installed and configured based upon the driver vendors instructions. Many drivers do not include a full install process - lacking the driver registration step. These drivers can be registered using the ODBCConfig GUI tool or the odbcinst command-line tool.

System DSN

These can be created using the ODBCConfig GUI tool or the odbcinst command-line tool. ODBCConfig is the prefered method but not all drivers have a User Interface (U.I.) part.

Mac OSX: In some cases the ODBCConfig icon will not open. In such a case you should drop to a terminal window and use the open command.
 
# open /Applications/Utilities/ODBCConfig.app

Summary

unixODBC implements an ODBC sub-system for a wide variety of platforms. unixODBC can be installed using; binary, source and source from CVS. Drivers can be installed using installation methods created by the driver vendor with unixODBC tools availible to fill any gaps. ODBC system information can be managed using; ODBCConfig, odbcinst, or a text editor.
 



 
  unixODBC-2.3.9/doc/AdministratorManual/Makefile.in0000664000175000017500000003233313725127175016671 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/AdministratorManual ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ index.html \ unixODBC.gif \ odbcinst.html \ php3.html \ unixODBCsetup.html all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/AdministratorManual/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/AdministratorManual/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/doc/AdministratorManual/Makefile.am0000755000175000017500000000013712262474475016661 00000000000000EXTRA_DIST = \ index.html \ unixODBC.gif \ odbcinst.html \ php3.html \ unixODBCsetup.html unixODBC-2.3.9/doc/index.html0000755000175000017500000002024712262474475012650 00000000000000 unixODBC

unixODBC is...

News


unixODBC is an implementation of the ODBC standard which is;
  • open source
  • licensed under LGPL/GPL
  • community developed and community supported
  • proven with over a decade of active use/development

March 15th 2007
New look for unixodbc.org
The old web site was serving the project fine but it seemed like it was about time to make it all 'fresh'. We hope you find it more pleasing to use.
October 13th 2006
2.2.12 Released
More...

Key features...

Architecture


Software Development Kit (SDK) - Develop ODBC applications and drivers using the C language and the unixODBC SDK.

Driver Manager (DM)  - The unixODBC DM allows the end-User to switch data sources without recompiling/linking application source code. The application does not have to be linked to a specific vendors product.

Tools - unixODBC includes CrossPlatform command-line and GUI tools to make working with ODBC easy.

Applications typically link with the unixODBC Driver Manager (DM) which then uses the appropriate Driver to communicate with the data source. The DM understands ODBC but relies on the Driver to understand specifics of the data source.

The Driver is typically provided by the data source Vendor. The Driver understands ODBC and the specifics of the data source.


CrossPlatform

Applications built using unixODBC are compatible with the Microsoft implementation of ODBC. unixODBC is provided with all majour Linux distributions. unixODBC has been ported to all majour UNIX and UNIX-like platforms;
- Linux, Solaris, SGI, etc
- VMS, OS/2, etc
CrossDatabase

unixODBC supports drivers from all majour database vendors including;
- Oracle
- DB2
- Interbase
- Mimer
- MySQL
- others
License

unixODBC was developed by the open source community and is provided under the LGPL and GPL licenses. Commercial applications can be developed using unixODBC without paying for a license or royalty. Free support is provided by the community.
More... More... More...

unixODBC-2.3.9/doc/ProgrammerManual/0000775000175000017500000000000013725127522014167 500000000000000unixODBC-2.3.9/doc/ProgrammerManual/unixODBC.gif0000755000175000017500000000023412262474475016220 00000000000000GIF89a ÂÀÀÀøøÐløÿÿÿÿÿÿÿÿÿ!ÿ NETSCAPE2.0!þMade with GIMP!ù , ¬ºÜþ†Ig¼ŠŽÍ·ÅÍÔŠ$Y}R¦±¶/LÜwµ€[«¸ Œ×óýJBËøCÅ’¹]óCF‹5ÖÎunixODBC-2.3.9/doc/ProgrammerManual/Tutorial/0000775000175000017500000000000013725127522015772 500000000000000unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/query.html0000755000175000017500000000702012262474475017754 00000000000000 executing a query
Executing a query

If you want to execute a query you will need to specify a handle (SQL_HANDLE_STMT) for a SQL-statement. In order to get one you have to allocate one with SQLAllocHandle.

Then you have to think about the SQL statement you want to execute. As I mentioned in the introduction I assume that we have a table tkeyuser which contains the following data:

iduser dtname dtmaxSize
1 Christa 10000
2 Nicole 9000

In this example, we want to execute a query which returns all the rows for the fields iduser and dtname in this table ordered by iduser. So the SQL statement would be:

SELECT iduser,dtname FROM tkeydata ORDER BY iduser

If you execute this statement you would get two rows each with two columns of data. This data has to be stored somewhere so that your programm can actually use it, so you need to define a variable for each of the columns. So you need to bind a column to variable in your program. Binding a variable automatically stores the data of the column in the variable when you retrieve a result row from the connection. It is important that your variables match the type of the column in the table within the database.

So we need to bin column #1 to a variable of type SQLINTEGER and the second column to a variable of type char. This is done by SQLBindCol. Therefore we add the variables:

SQLHSTMT V_OD_hstmt;   // Handle for a statement
SQLINTEGER V_OD_err,V_OD_id;
char V_OD_buffer[200];

Now we can bind the variables:

SQLBindCol(V_OD_hstmt,1,SQL_C_CHAR, &V_OD_buffer,200,&V_OD_err);
SQLBindCol(V_OD_hstmt,2,SQL_C_ULONG,&V_OD_id,sizeof(V_OD_id),&V_OD_err);

Yes you should check for the return code of the function call. I'm to lazy to code it here once again :(

Now we can execute the query by calling SQLExecDirect:

 V_OD_erg=SQLExecDirect(V_OD_hstmt,
             "SELECT dtname,iduser FROM tkeyuser order by iduser",SQL_NTS);
 if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
    {
     printf("Error Select %d\n",V_OD_erg);
     SQLGetDiagRec(SQL_HANDLE_DBC, V_OD_hdbc,1, V_OD_stat, &V_OD_err,
	               V_OD_msg,100,&V_OD_mlen);
     printf("%s (%d)\n",V_OD_msg,V_OD_err);
     SQLFreeHandle(SQL_HANDLE_DBC,V_OD_hdbc);
     SQLFreeHandle(SQL_HANDLE_STMT,V_OD_hstmt);
     SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
     exit(0);
    }
  
unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/dsn.html0000755000175000017500000000513412262474475017377 00000000000000 Obtainign Datasources
Obtaining a Datasourcename

A simple query should be a nobrainer right now. But what if your programm runs on a system where you can't be sure which datasource names are configured?

Then you should use SQLDataSources(). After allocating a environment handle you may use this to find out about the DSN and the supplied description for the datasource.

As ODBC knows systemwide and userwide datasources, you need to give a direction which datasource types you are looking for. There you may specify either of the following values:

SQL_FETCH_FIRST Sets up SQLDataSources() to lookup the first of all available datasources (either user or systemwide).
SQL_FETCH_FIRST_USER Sets up SQLDataSources() to lookup the first of the available user datasources.
SQL_FETCH_FIRST_SYSTEM Sets up SQLDataSources() to lookup the first of the available system datasources.
SQL_FETCH_NEXT Fetches the next datasource. Depending on SQL_FETCH_FIRST_USER, SQL_FETCH_FIRST_SYSTEM or SQL_FETCH_FIRST this may only be a user datasource, only a system datasource or one of either.

So let's have a look on a small function, which will return all available datasource names. You may insert this code into the program which you built before and call it somewhere after you've obtained an environment handle.

void OD_ListDSN(void)
{
 char       l_dsn[100],l_desc[100];
 short int  l_len1,l_len2,l_next;

 l_next=SQL_FETCH_FIRST;
 while( SQLDataSources(V_OD_Env,l_next,l_dsn, sizeof(l_dsn),
        &l_len1, l_desc, sizeof(l_desc), &l_len2) == SQL_SUCCESS)
     {
      printf("Server=(%s) Beschreibung=(%s)\n",l_dsn,l_desc);
      l_next=SQL_FETCH_NEXT;
     }
}
unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/navi.html0000755000175000017500000000177712262474475017561 00000000000000 Navigation
ODBC Programming Tutorial
 
Introduction
Connection
Closing
Queries
Results
Obtaining DSN
Index / Glossary
unixODBC Home
unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/odbc.css0000755000175000017500000001522112262474475017344 00000000000000/* Style Sheet for odbc documentation =20 M.Rathmann */ BODY {background-color: white; color: black; font-family: Arial; font-style: normal; font-size: medium; background-attachment: fixed; } /*=20 2. Die Verweise: Standard: Text unterstrichen link: #008080=20 vlink=3D"#800000" alink=3D"#008080" */ a:link {color: #2222ff; text-decoration: none; } a:visited {color: #3333ee; text-decoration: none; } a:active {color: #4444dd; text-decoration: none; } TH {border-style: none; background-color: #dddddd; font-family: Arial; font-size: normal; color: white; vertical-align: top; text-align: center; } TD {border-style: none; background-color: white; font-family: Arial; font-size: normal; color: black; border-width: 3px; border-color: white; vertical-align: top; text-align: justify; } TD.center {border-style: none; background-color: #ddddff; text-align: center; font-family: Arial; font-size: medium; color: black; border-width: 3px; border-color: white; vertical-align: top; } TD.head {border-style: none; background-color: #ddddff; text-align: left; font-family: Arial; font-size: medium; color: black; font-weight: bold; vertical-align: top; } Th.head {border-style: none; background-color: #dddddd;=09 text-align: center; font-family: Arial; font-size: medium; color: black; font-weight: bold; vertical-align: top; } TD.big { font-family: Arial; font-size: x-large; } TD.small { font-family: Arial; font-size: x-small; } /* 5. =DCberschriften immer in Rot, Zeichensatz Arial */ H4 { color: black; font-family: Arial; font-size: small; font-weight: bold; } H5 { color: black; font-size: x-small; font-family: courier; } /* 6. Blockquote St=E4rkere Einr=FCckung=20 */ Blockquote {margin-left: 10pt; } CODE.list {margin-left: 10 pt; font-size: xx-small; } } /* 7. Listen */ UL {color: black; font-family: Arial } OL {color: black; list-style-type: decimal} LI {color: black} P {font-family: Arial; font-size: normal; } TD P {font-family: Arial; font-size: normal; } small {font-family: Arial; font-size: x-small } From - Sun Jun 6 14:11:04 1999 Return-path: Envelope-to: pharvey@interlog.com Delivery-date: Sun, 6 Jun 1999 03:55:51 -0400 Received: from plus.interlog.com ([207.34.202.21] ident=root) by mailhub4.interlog.com with esmtp (Exim 2.05 #1) id 10qXmY-0002kw-00 for pharvey@interlog.com; Sun, 6 Jun 1999 03:55:50 -0400 Received: from lilly.ping.de (qmailr@lilly.ping.de [195.37.120.2]) by plus.interlog.com (8.9.3/8.9.3) with SMTP id DAA23367 for ; Sun, 6 Jun 1999 03:55:48 -0400 (EDT) Received: (qmail 26070 invoked by alias); 6 Jun 1999 07:55:45 -0000 Received: (qmail 26063 invoked from network); 6 Jun 1999 07:55:37 -0000 Received: from suprimo-54.ping.de (HELO koala) (195.37.122.54) by lilly.ping.de with SMTP; 6 Jun 1999 07:55:37 -0000 Message-ID: <001a01beaff2$66b90320$030aa8c0@koala> From: "Markus Rathmann" To: "Peter Harvey" Subject: The newest docu, to be sure :) Date: Sun, 6 Jun 1999 09:58:43 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0017_01BEB003.29819060" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Mozilla-Status: 8001 X-Mozilla-Status2: 00000000 X-UIDL: ea3859ca9b1d73dac919ee5e69391b0b This is a multi-part message in MIME format. ------=_NextPart_000_0017_01BEB003.29819060 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Peter, I'm sorry, but I think that you haven't got the newest version. Therefore I'm sending it to you again. It has one more page (Obtaining Datasource names) and a few display glitches (mainly Netscape) solved. Furthermore I've added a link to the unixODBC Homepage, so that you may use the complete browser window (if you like). Bye Markus ------=_NextPart_000_0017_01BEB003.29819060 Content-Type: text/css; name="ODBC.CSS" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ODBC.CSS" /* Style Sheet for odbc documentation =20 M.Rathmann */ BODY {background-color: white; color: black; font-family: Arial; font-style: normal; font-size: medium; background-attachment: fixed; } /*=20 2. Die Verweise: Standard: Text unterstrichen link: #008080=20 vlink=3D"#800000" alink=3D"#008080" */ a:link {color: #2222ff; text-decoration: none; } a:visited {color: #3333ee; text-decoration: none; } a:active {color: #4444dd; text-decoration: none; } TH {border-style: none; background-color: #dddddd; font-family: Arial; font-size: normal; color: white; vertical-align: top; text-align: center; } TD {border-style: none; background-color: white; font-family: Arial; font-size: normal; color: black; border-width: 3px; border-color: white; vertical-align: top; text-align: justify; } TD.center {border-style: none; background-color: #ddddff; text-align: center; font-family: Arial; font-size: medium; color: black; border-width: 3px; border-color: white; vertical-align: top; } TD.head {border-style: none; background-color: #ddddff; text-align: left; font-family: Arial; font-size: medium; color: black; font-weight: bold; vertical-align: top; } Th.head {border-style: none; background-color: #dddddd;=09 text-align: center; font-family: Arial; font-size: medium; color: black; font-weight: bold; vertical-align: top; } TD.big { font-family: Arial; font-size: x-large; } TD.small { font-family: Arial; font-size: x-small; } /* 5. =DCberschriften immer in Rot, Zeichensatz Arial */ H4 { color: black; font-family: Arial; font-size: small; font-weight: bold; } H5 { color: black; font-size: x-small; font-family: courier; } /* 6. Blockquote St=E4rkere Einr=FCckung=20 */ Blockquote {margin-left: 10pt; } CODE.list {margin-left: 10 pt; font-size: xx-small; } } /* 7. Listen */ UL {color: black; font-family: Arial } OL {color: black; list-style-type: decimal} LI {color: black} P {font-family: Arial; font-size: normal; } TD P {font-family: Arial; font-size: normal; } small {font-family: Arial; font-size: x-small } unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/index.html0000755000175000017500000000042512262474475017720 00000000000000 Dokumenttitel unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/intro.html0000755000175000017500000000450612262474475017750 00000000000000 Introduction
Introduction
Welcome to a short tutorial on ODBC programming. The goal of this tutorial is to introduce a C-Programmer to ODBC programming. During this tutorial we will code a simple program which connects to a database via ODBC and reads some data. There won't be any information on how to program ODBC Drivers or about unixODBC internals. Configuration won't be covered too. The program developed throughout this tutorial was originally coded under WinNT and later ported without any adjustments to Linux and unixODBC. This is how compatibility should work :)

The information given within this tutorial are brief at best. Please take it as a pointer where and how to start.


Requirements   I assume that you have
 
  • a system with unixODBC installed and with at least one working datasource configured.
  • the include files installed under /usr/include/odbc
  • a compiler installed and that you know how to use it ;)
Compiling   If gcc is installed type:
  gcc odbc.c -o odbc -lodbc
which will result in an executable named "odbc".
Database   Our database will have a single table:
 
tkeyuser
iduser sequence
dtname char(40)
dtmaxSize Integer

Our datasource will be named "web" and access is granted to the user "christa" with no password.
unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/resul.html0000755000175000017500000001545412262474475017753 00000000000000 Fetching Data
Fetching data from a result set

If the execution of the statement went fine you are now able to fetch the data column by column. May be you would first like to know how many columns there are in the result set (if you use a SELECT * FROM tkeyuser you wouldn't know in your program). A call to SQLNumResultCols. This function takes the statement handle and a pointer to an integer variable which will yield the number of columns after the call.

Knowing that much we can add this to our program:
// At the beginning add:
SQLSMALLINT      V_OD_colanz;    // Num of columns

// At the end add:
   V_OD_erg=SQLNumResultCols(V_OD_hstmt,&V_OD_colanz);
   if ((V_OD_erg != SQL_SUCCESS) && 
       (V_OD_erg != SQL_SUCCESS_WITH_INFO))
      {
       printf("Fehler im ResultCols %d\n",V_OD_erg);
       SQLFreeHandle(SQL_HANDLE_STMT,V_OD_hstmt);
       SQLFreeHandle(SQL_HANDLE_DBC,V_OD_hdbc);
       SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
       exit(0);
      }
   printf("Number of Columns %d\n",V_OD_colanz);

  

The next thing you need to know is how many rows have been returned by the query. A call to SQLRowCount should quench your thirst for knowledge.

The last thing to do is to fetch the data itself from the result set. You should call SQLFetch with a statement handle (which has been allocated and SQLBind has been called for all columns). SQLFetch returns SQL_NO_DATA if there is no more data in the result set.

So here is the complete source code. Real C-programmers will moan in disgust how inefficient the program is coded, but I prefer it that way (doesn't it look a little bit like PASCAL?). Take it as a starting point for your own endeavors with ODBC.

/* odbc.c

    testing unixODBC
*/
#include <stdlib.h>
#include <stdio.h>
#include <odbc/sql.h>
#include <odbc/sqlext.h>
#include <odbc/sqltypes.h>

SQLHENV			 V_OD_Env;			// Handle ODBC environment
long			 V_OD_erg;			// result of functions
SQLHDBC			 V_OD_hdbc;			// Handle connection

char			 V_OD_stat[10];		// Status SQL
SQLINTEGER		 V_OD_err,V_OD_rowanz,V_OD_id;
SQLSMALLINT		 V_OD_mlen,V_OD_colanz;
char             V_OD_msg[200],V_OD_buffer[200];


int main(int argc,char *argv[])
{
	// 1. allocate Environment handle and register version 
	V_OD_erg=SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&V_OD_Env);
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Error AllocHandle\n");
		exit(0);
	}
	V_OD_erg=SQLSetEnvAttr(V_OD_Env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); 
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Error SetEnv\n");
		SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
		exit(0);
	}
	// 2. allocate connection handle, set timeout
	V_OD_erg = SQLAllocHandle(SQL_HANDLE_DBC, V_OD_Env, &V_OD_hdbc); 
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Error AllocHDB %d\n",V_OD_erg);
		SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
		exit(0);
	}
	SQLSetConnectAttr(V_OD_hdbc, SQL_LOGIN_TIMEOUT, (SQLPOINTER *)5, 0);
	// 3. Connect to the datasource "web" 
	V_OD_erg = SQLConnect(V_OD_hdbc, (SQLCHAR*) "web", SQL_NTS,
                                     (SQLCHAR*) "christa", SQL_NTS,
                                     (SQLCHAR*) "", SQL_NTS);
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Error SQLConnect %d\n",V_OD_erg);
		SQLGetDiagRec(SQL_HANDLE_DBC, V_OD_hdbc,1, 
		              V_OD_stat, &V_OD_err,V_OD_msg,100,&V_OD_mlen);
		printf("%s (%d)\n",V_OD_msg,V_OD_err);
		SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
		exit(0);
	}
	printf("Connected !\n");
	V_OD_erg=SQLAllocHandle(SQL_HANDLE_STMT, V_OD_hdbc, &V_OD_hstmt);
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Fehler im AllocStatement %d\n",V_OD_erg);
		SQLGetDiagRec(SQL_HANDLE_DBC, V_OD_hdbc,1, V_OD_stat,&V_OD_err,V_OD_msg,100,&V_OD_mlen);
		printf("%s (%d)\n",V_OD_msg,V_OD_err);
		SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
		exit(0);
	}
    SQLBindCol(V_OD_hstmt,1,SQL_C_CHAR, &V_OD_buffer,150,&V_OD_err);
    SQLBindCol(V_OD_hstmt,2,SQL_C_ULONG,&V_OD_id,150,&V_OD_err);
	
    V_OD_erg=SQLExecDirect(V_OD_hstmt,"SELECT dtname,iduser FROM tkeyuser order by iduser",SQL_NTS);   
    if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
    {
       printf("Error in Select %d\n",V_OD_erg);
       SQLGetDiagRec(SQL_HANDLE_DBC, V_OD_hdbc,1, V_OD_stat,&V_OD_err,V_OD_msg,100,&V_OD_mlen);
       printf("%s (%d)\n",V_OD_msg,V_OD_err);
       SQLFreeHandle(SQL_HANDLE_STMT,V_OD_hstmt);
       SQLFreeHandle(SQL_HANDLE_DBC,V_OD_hdbc);
       SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
       exit(0);
    }
    V_OD_erg=SQLNumResultCols(V_OD_hstmt,&V_OD_colanz);
    if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
    {
        SQLFreeHandle(SQL_HANDLE_STMT,V_OD_hstmt);
        SQLDisconnect(V_OD_hdbc);
        SQLFreeHandle(SQL_HANDLE_DBC,V_OD_hdbc);
        SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
        exit(0);
    }
    printf("Number of Columns %d\n",V_OD_colanz);
    V_OD_erg=SQLRowCount(V_OD_hstmt,&V_OD_rowanz);
    if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
    {
      printf("Number ofRowCount %d\n",V_OD_erg);
      SQLFreeHandle(SQL_HANDLE_STMT,V_OD_hstmt);
      SQLDisconnect(V_OD_hdbc);
      SQLFreeHandle(SQL_HANDLE_DBC,V_OD_hdbc);
      SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
      exit(0);
    }
    printf("Number of Rows %d\n",V_OD_rowanz);
    V_OD_erg=SQLFetch(V_OD_hstmt);  
    while(V_OD_erg != SQL_NO_DATA)
    {
     printf("Result: %d %s\n",V_OD_id,V_OD_buffer);
     V_OD_erg=SQLFetch(V_OD_hstmt);  
    }  ;
    SQLFreeHandle(SQL_HANDLE_STMT,V_OD_hstmt);
    SQLDisconnect(V_OD_hdbc);
    SQLFreeHandle(SQL_HANDLE_DBC,V_OD_hdbc);
    SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
    return(0);
}
  
If I find some more time I will add something about diagnostics, cursor positioning updating and and and...
unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/conne.html0000755000175000017500000001165212262474475017717 00000000000000 Connecting
Connecting to a Datasource

First thing you will need is a variable of type SQLHENV. This is a handle (pointer) to an internal ODBC structure which holds all informationen about the ODBC environment. Without a handle of that kind you won't be able do to very much. To get this handle you call SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &V_OD_Env). V_OD_Erg is a variable of type SQLHENV which holds the allocated environment handle.

If you have allocated the handle you need to define which version of ODBC to use. Therefore you should call SQLSetEnvAttr(V_OD_Env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0). The constant SQL_ATTR_ODBC_VERSION defines that the needed version of ODBC will be defined and SQL_OV_ODBC3 says that the program will need ODBC 3.0.

Next thing to do is to create a handle for the database connection which is of the type SQLHDBC. Once again you call SQLAllocHandle this time with SQL_HANDLE_DBC and the variable to the environment returned by the first call to SQLAllocHandle.

Then you may choose to modify the connection attributes, mainly the timeout for any given action on the connection. You do this by calling SQLSetConnectAttr with the connection handle, attribute and value pointer and the string length (if available).

Finally we are able to connect to the database via SQLConnect, which needs the name of the data source, the username and password as parameters. For each parameter you need to specify how long the string is or just gib SQL_NTS which says that it is a string which length has to be determined by SQLConnect

That's it, we are connected to the database. Please note, that all functions mentioned on this page return either SQL_SUCCESS, SQL_SUCCESS_WITH_INFO if all went smoothly or SQL_ERROR or SQL_INVALID_HANDLE in case of an error. We will have a look on how to get diagnostic messages a little later.

So let's have a look at the code:


  
/* odbc.c

    testing unixODBC
*/
#include <stdlib.h>
#include <stdio.h>
#include <odbc/sql.h>
#include <odbc/sqlext.h>
#include <odbc/sqltypes.h>

SQLHENV			 V_OD_Env;     // Handle ODBC environment
long			 V_OD_erg;     // result of functions
SQLHDBC			 V_OD_hdbc;    // Handle connection

char			 V_OD_stat[10]; // Status SQL
SQLINTEGER		 V_OD_err,V_OD_rowanz,V_OD_id;
SQLSMALLINT		 V_OD_mlen;
char             V_OD_msg[200],V_OD_buffer[200];


int main(int argc,char *argv[])
{
	// 1. allocate Environment handle and register version 
	V_OD_erg=SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&V_OD_Env);
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Error AllocHandle\n");
		exit(0);
	}
	V_OD_erg=SQLSetEnvAttr(V_OD_Env, SQL_ATTR_ODBC_VERSION, 
                               (void*)SQL_OV_ODBC3, 0); 
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Error SetEnv\n");
		SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
		exit(0);
	}
	// 2. allocate connection handle, set timeout
	V_OD_erg = SQLAllocHandle(SQL_HANDLE_DBC, V_OD_Env, &V_OD_hdbc); 
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Error AllocHDB %d\n",V_OD_erg);
		SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
		exit(0);
	}
	SQLSetConnectAttr(V_OD_hdbc, SQL_LOGIN_TIMEOUT, (SQLPOINTER *)5, 0);
	// 3. Connect to the datasource "web" 
	V_OD_erg = SQLConnect(V_OD_hdbc, (SQLCHAR*) "web", SQL_NTS,
                                     (SQLCHAR*) "christa", SQL_NTS,
                                     (SQLCHAR*) "", SQL_NTS);
	if ((V_OD_erg != SQL_SUCCESS) && (V_OD_erg != SQL_SUCCESS_WITH_INFO))
	{
		printf("Error SQLConnect %d\n",V_OD_erg);
		SQLGetDiagRec(SQL_HANDLE_DBC, V_OD_hdbc,1, 
		              V_OD_stat, &V_OD_err,V_OD_msg,100,&V_OD_mlen);
		printf("%s (%d)\n",V_OD_msg,V_OD_err);
		SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);
		exit(0);
	}
	printf("Connected !\n");
	/* continued on next page */
  
  
unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/Makefile.in0000664000175000017500000003244313725127175017771 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/ProgrammerManual/Tutorial ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ close.html \ conne.html \ dsn.html \ gloss.html \ index.html \ intro.html \ navi.html \ odbc.css \ query.html \ resul.html all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/ProgrammerManual/Tutorial/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/ProgrammerManual/Tutorial/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/gloss.html0000755000175000017500000004722212262474475017746 00000000000000 Glossary
Index / Glossary
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
C   Column
 

A column is another name for field in a SQL table. It has a data type (Integer, Char, Money etc) and a name by which it is addressed.

You specify the name of a column in a query (either DELETE, UPDATE, SELECT or INSERT)

D   data source
  A data source defines all informationen needed by ODBC to connect to a database. This includes the name of the driver to use (Postgres, mySQL etc.), the name of the user, his password, the server name on which the database resides and of course the name of the database. There are a lot more options available.
  Data Types
 

The following table show some ODBC data types and how the relate to standard C data types:

Type identifier ODBC typedef C typedef
SQL_C_CHAR SQLCHAR * unsigned char *
SQL_C_SSHORT SQLSMALLINT short int
SQL_C_USHORT SQLUSMALLINT unsigned short int
SQL_C_SLONG SQLINTEGER long int
SQL_C_FLOAT SQLREAL float
SQL_C_DOUBLE SQLDOUBLE, SQLFLOAT double
SQL_C_BINARY SQLCHAR * unsigned char
SQL_C_TYPE_DATE SQL_DATE_STRUCT struct
tagDATE_STRUCT {
SQLSMALLINT year;
SQLUSMALLINT month;
SQLUSMALLINT day;
} DATE_STRUCT;
SQL_C_TYPE_TIME SQL_TIME_STRUCT struct
tagTIME_STRUCT {
SQLUSMALLINT hour;
SQLUSMALLINT minute;
SQLUSMALLINT second;
} TIME_STRUCT;

You will need the type identifier in calls to SQLBindCol.

 
O   odbc.ini
  /etc/odbc.ini is the configuration file for system data sources. It contains information which will be needed when connecting to a database. It is modified by a graphical utility ODBCConfig.
R   Row
  A row is a set of columns in a query. For example in our table there are two users. Each user makes up a row in the table or in the result of our query.
S   SQLAllocHandle
  allocates needed handles.
SQLRETURN 
SQLAllocHandle(SQLSMALLINT  HandleType,     
               SQLHANDLE    InputHandle, 
               SQLHANDLE   *OutputHandlePtr); 

	  

Arguments

HandleType

Defines the type of handle to be allocated by SQLAllocHandle. There are four possible values:

SQL_HANDLE_ENV
SQL_HANDLE_DBC
SQL_HANDLE_STMT
SQL_HANDLE_DESC
InputHandle
This is the input handle in whose context the new handle will be allocated. If HandleType is SQL_HANDLE_ENV, this is SQL_NULL_HANDLE. For a handle of type SQL_HANDLE_DBC, this has to be an environment handle, and if it is SQL_HANDLE_STMT or SQL_HANDLE_DESC, it must be a connection handle.
OutputHandlePtr
Pointer to a buffer in which to return the allocated handle.

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, or SQL_ERROR.
  SQLBindCol
  binds a variable to a column in the result.
SQLRETURN 
SQLBindCol(SQLHSTMT      StatementHandle, 
           SQLUSMALLINT  ColumnNumber, 
           SQLSMALLINT   TargetType,  
           SQLPOINTER    TargetValuePtr, 
           SQLINTEGER    BufferLength, 
           SQLINTEGER   *StrLen_or_IndPtr); 

Arguments

StatementHandle
StatementHandle must have been allocated by SQLAllocHandle and will hold all information and the result set of the statement.
ColumnNumber
Number of the column in the result set. Starts with 1.
TargetType
Type identifier of the data type
TargetValuePtr
The pointer to the variable in which the data will be stored.
BufferLength
The size of the buffer TargetValuePtr points at in bytes.
StrLen_or_IndPtr
When data is fetched, returns either
  • The length of the data available to return
  • SQL_NO_TOTAL
  • SQL_NULL_DATA

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE.
  SQLConnect
  connects to a datasource
SQLRETURN SQLConnect(SQLHDBC     ConnectionHandle, 
                     SQLCHAR    *ServerName, 
                     SQLSMALLINT NameLength1, 
                     SQLCHAR    *UserName, 
                     SQLSMALLINT NameLength2, 
                     SQLCHAR    *Authentication, 
                     SQLSMALLINT NameLength3); 

Arguments

ConnectionHandle
ConnectionHandle must have been allocated by SQLAllocHandle and will hold all information about the connection.
ServerName
Name of the database server
NameLength1
The length of ServerName or SQL_NTS
UserName
The name of the user who connects to the database.
NameLength2
The length of UserName or SQL_NTS
Authentication
Password of the user
NameLength3
The length of Authentication or SQL_NTS

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE.
  SQLDataSources
  fetches avaible datasource names either user, system or both.
SQLRETURN 
SQLDataSources(SQLHENV      EnvironmentHandle, 
               SQLUSMALLINT Direction, 
               SQLCHAR     *ServerName, 
               SQLSMALLINT  BufferLength1, 
               SQLSMALLINT *NameLength1Ptr, 
               SQLCHAR     *Description, 
               SQLSMALLINT  BufferLength2, 
               SQLSMALLINT *NameLength2Ptr); 

Arguments

EnvironmentHandle
EnvironmentHandle must have been allocated by SQLAllocHandle.
Direction
Which DSN we are looking for. May be on of:
SQL_FETCH_FIRST Sets up SQLDataSources() to lookup the first of all available datasources (either user or systemwide).
SQL_FETCH_FIRST_USER Sets up SQLDataSources() to lookup the first of the available user datasources.
SQL_FETCH_FIRST_SYSTEM Sets up SQLDataSources() to lookup the first of the available system datasources.
SQL_FETCH_NEXT Fetches the next datasource. Depending on SQL_FETCH_FIRST_USER, SQL_FETCH_FIRST_SYSTEM or SQL_FETCH_FIRST this may only be a user datasource, only a system datasource or one of either.
ServerName
The name of the datasource is returned herein.
BufferLength1
Defines how many chars Servername may contain at most.
NameLength1Ptr
The pointer to the variable in which the actual length of the datasource name is stored. If NameLength1Ptr is greater than BufferLength1, then the DSN in ServerName is truncated to fit.
BufferLength
The size of the buffer TargetValuePtr points at in bytes.
Description
The description supplied with the datasource, giving more information on the datasource in human readable form.
BufferLength2
Defines how many chars Description may contain at most.
NameLength2Ptr
The pointer to the variable in which the actual length of the description is stored. If NameLength2Ptr is greater than BufferLength2, then the description in Description is truncated to fit.

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, SQL_NO_DATA> or SQL_INVALID_HANDLE.
  SQLExecDirect
  Executes a SQL statement
SQLRETURN SQLExecDirect(SQLHSTMT    StatementHandle, 
                        SQLCHAR    *StatementText, 
                        SQLINTEGER  TextLength); 

Arguments

StatementHandle
StatementHandle must have been allocated by SQLAllocHandle and will hold all information and the result set of the statement.
StatementText
The SQL statement to be executed
TextLength
The length of StatementText or SQL_NTS

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE.
  SQLDisconnect
  disconnects the specified connection
SQLRETURN SQLDisconnect(SQLHDBC     ConnectionHandle);

	  

Arguments

ConnectionHandle
The handle of the connection to be closed.

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, or SQL_ERROR.
  SQLFetch
  Fetches the next row of the result set.
SQLRETURN SQLFetch(SQLHDBC     StatementHandle);

	  

Arguments

StatementHandle
The handle of the statement to be closed fromwhich the data should be fetched.

Returns

SQL_SUCCESS, SQL_NO_DATA, SQL_STILL_EXECUTING, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, or SQL_ERROR.


  SQLFreeHandle
  frees allocated handles.
SQLRETURN SQLFreeHandle(SQLSMALLINT  HandleType,     
                        SQLHANDLE    InputHandle);

	  

Arguments

HandleType

Defines the type of handle to be freed. There are four possible values:

SQL_HANDLE_ENV
SQL_HANDLE_DBC
SQL_HANDLE_STMT
SQL_HANDLE_DESC
InputHandle
The handle to be freed. Should match the type stated by HandleType

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_INVALID_HANDLE, or SQL_ERROR.
  SQLNumResultCols
  returns the number of columns in the result set.
SQLRETURN SQLNumResultCols(SQLHSTMT     StatementHandle, 
                           SQLSMALLINT *ColumnCountPtr); 
	  

Arguments

StatementHandle
StatementHandle must have been allocated by SQLAllocHandle and holds all information and the result set of the statement.
ColumnCountPtr
A pointer to a variable to hold the result value.

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING, SQL_INVALID_HANDLE, or SQL_ERROR.


  SQLRowCount
  returns the number of rows affected by INSERT, UPDATE or DELETE. Many drivers (but not all) return the number of rows returned by the last executed SELECT statement too.
SQLRETURN SQLSQLRowCount(SQLHSTMT     StatementHandle, 
                         SQLSMALLINT *RowCountPtr); 
	  

Arguments

StatementHandle
StatementHandle must have been allocated by SQLAllocHandle and holds all information and the result set of the statement.
RowCountPtr
A pointer to a variable to hold the result value.

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING, SQL_INVALID_HANDLE, or SQL_ERROR.


  SQLSetConnectAttr
  modifies attributes of connections.
SQLRETURN SQLSetConnectAttr(SQLHDBC    ConnectionHandle, 
                            SQLINTEGER Attribute, 
                            SQLPOINTER ValuePtr, 
                            SQLINTEGER StringLength); 

Arguments

ConnectionHandle
ConnectionHandle must have been allocated by SQLAllocHandle and defines the connection which will be modified.
Attribute
which attribute to set
ValuePtr
Pointer to the value for Attribute. Depending on Attribute, ValuePtr will be a 32-bit integer value or a pointer to a null-terminated string.
StringLength
If ValuePtr points to a character string or a binary buffer, this argument should be the length of *ValuePtr. Otherwise, for ValuePtr of type integer StringLength is ignored.

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE.


  SQLSetEnvAttr
  sets attributes of environments.
SQLRETURN  SQLSetEnvAttr(SQLHENV    EnvironmentHandle, 
                         SQLINTEGER Attribute, 
                         SQLPOINTER ValuePtr, 
                         SQLINTEGER StringLength); 

Arguments

EnvironmentHandle
EnvironmentHandle must have been allocated by SQLAllocHandle
Attribute
which attribute to set
ValuePtr
Pointer to the value for Attribute. Depending on Attribute, ValuePtr will be a 32-bit integer value or a pointer to a null-terminated string.
StringLength
If ValuePtr points to a character string or a binary buffer, this argument should be the length of *ValuePtr. Otherwise, for ValuePtr of type integer StringLength is ignored.

Returns

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR or SQL_INVALID_HANDLE.
unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/Makefile.am0000755000175000017500000000022512262474475017755 00000000000000EXTRA_DIST = \ close.html \ conne.html \ dsn.html \ gloss.html \ index.html \ intro.html \ navi.html \ odbc.css \ query.html \ resul.html unixODBC-2.3.9/doc/ProgrammerManual/Tutorial/close.html0000755000175000017500000000270412262474475017720 00000000000000 Closing a connection
Closing a connection

Before your program terminates you need to free all resources you have allocated. If you checked the source on the previous page, you certainly spotted SQLFreeHandle. This function must be used to free each allocated handle. It expects a parameter which states the type of the handle to be freed and the handle itself. So if you want to free an environment handle you should call (in our example program):

SQLFreeHandle(SQL_HANDLE_ENV, V_OD_Env);

Before you free any handle make sure that it is no longer needed, wouldn't be funny, if you released to connection handle but forgot to close the connection ;)

And if you want to close a connection you need SQLDisconnect. This closes the connection associated with the connection handle offered as argument to SQLDisconnect. In our programm we need to call:

SQLDisconnect(V_OD_hdbc);

If you need source code, please have a look here.

unixODBC-2.3.9/doc/ProgrammerManual/index.html0000755000175000017500000001135412262474475016120 00000000000000 unixODBC

PROGRAMMER MANUAL
Peter Harvey
19.DEC.01

Introduction

Welcome to the unixODBC Programmer Manual. This manual is a starting point for a programmer who is interested in developing an application which *uses* ODBC. This manual does not address Driver development or any other development which is internal to the ODBC sub-system.

Why Use ODBC?

ODBC provides a portable Application Programmers Interface (API) with which to access data. This means that your data access code will recompile without changes on all popular platforms. In practice; portability is sometimes hampered by incomplete drivers. However; the core ODBC functionality (the most used functionality) is always supported any working driver. Other advantages to developing with ODBC include;

  • most popular API of its kind
  • most mature API of its kind
  • skills more reusable/easily found
  • hundreds, if not thousands, of applications use it
  • availible on all majour platforms
  • easy to change data storage solution/vendor (ah; freedom)
  • easy to upscale data storage (developer and end-user)
  • arguably the most complete API of its kind
  • many books on the subject
  • greater support base
Languages Supported

ODBC is based upon a C API. C++ programmers will find a number of C++ class libraries for using the ODBC API. These are wrappers - using the C API internally but can provide a much nicer way to use ODBC for C++ programmers.

Any language which can call a C API should be able to use the ODBC API and most languages, such as PHP and Perl, provide an interface to work with ODBC but these are not covered in this manual.

Architecture

Client Libraries

These are client libraries which are specific to the particular database being used. These, often, provide a C API of their own which is used by Driver developers. In some cases these exist inside of the Driver itself or are staticly linked into the Driver. Any Client Libraries required by a Driver will be a part of the installation of your Driver or will simply be a requirement for the installation of your Driver. Sometimes Client Libraries must be configured before any ODBC configuration.

Driver

Driver Manager

The Driver Manager acts as a gateway to the ODBC drivers. The main advantage to having a Driver Manager is that the end-user can configure the Driver Manager to use a different Driver than the one original conceived of by the programmer.

It as virtualy identical functions declarations as a Driver which means that one *could* create an application
 



 
  unixODBC-2.3.9/doc/ProgrammerManual/Makefile.in0000664000175000017500000004663613725127175016177 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/ProgrammerManual ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = Tutorial EXTRA_DIST = \ index.html \ unixODBC.gif all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/ProgrammerManual/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/ProgrammerManual/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/doc/ProgrammerManual/Makefile.am0000755000175000017500000000007712262474475016157 00000000000000SUBDIRS = Tutorial EXTRA_DIST = \ index.html \ unixODBC.gif unixODBC-2.3.9/doc/Makefile.in0000664000175000017500000004666513725127175012730 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = \ AdministratorManual \ ProgrammerManual \ UserManual \ lst EXTRA_DIST = \ index.html \ smallbook.gif \ unixODBC.gif all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/doc/smallbook.gif0000755000175000017500000000021712262474475013320 00000000000000GIF89a€€€€€ÀÀÀÿÿÿÿÿÿÿÿÿÿÿÿ!þMade with GIMP!ù ,B8ºÀá^\3èzóÞ€¥xˆQ%h‘)  utèÈ¢F“Dªô#Ó¦MŸ‚ðS*Ô¡V=R¸5fÖ«;¿v@–lM±`s¦=ºv-Ú¶ßÂE)w.úvIâÍ{På^¾%uþ<Ðï`Âq Für1â”»þ3;™+Wªe/¤,Ù¦BÇ:–ÌÙòdÌœ»–ùthÅ#Uo¥¬ùôl½w_ãÖ]r¢ëÇ¿çÖ ž—8\¼Æí&O»x9TçW]C:ý¹Óê<±'5Þ@;LïXéþ‚gË»wOÖåÓoÌÚY´ú÷è¶ÿ ¿þyùÇÛ7:³ó툂u·ß€ ½äŸiÊÔ~®d`Aÿ%ˆ_ƒéÚ‚2ŸxfH݆†xׂ W¢ˆÛ‘È ‡+Vˆâ‹ž…x"ŒµÈ†2ªh#<ˆc°‰ÕŒßéhä‘Hþ(¤zRÍçÞ’)y\CNÒe[$*¸CeÑ–Û•.n!‚‰)¶£}DÒ%&AæGPš`ö ›d–IeœÌ˜‘”xZħ1xfŸoêIè¡9 úÞŸvéåYŠunixODBC-2.3.9/doc/lst/InternalStructure.html0000755000175000017500000000272612262474475016042 00000000000000 LST - Doubly Linked List
LST
Doubly Linked List

LST - Doubly Linked List

Description

This diagram depicts a single, doubly linked, list with 4 items. The actual data being stored in each item is pointed to by pData. Doubly Linked lists are great for storing  things in memory. LST makes working with a linked list very easy. The following pages will describe more advanced features of LST such as cursors.

Related Functions

lstOpen, lstClose, lstAppend, lstFirst, lstEOL, lstNext, lstGet


[Next]

Page 1 of 9

unixODBC-2.3.9/doc/lst/InternalStructure9.gif0000755000175000017500000000155312262474475015731 00000000000000GIF89a¨Æ÷ÿ@€ÿ @ € ÿ@@@@€@ÿ``@`€`ÿ€€@€€€ÿ  @ € ÿÀÀ@À€Àÿÿÿ@ÿ€ÿÿ @ € ÿ @ € ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿ@@@@€@ÿ@ @ @@ €@ ÿ@@@@@@@€@@ÿ@`@`@@`€@`ÿ@€@€@@€€@€ÿ@ @ @@ €@ ÿ@À@À@@À€@Àÿ@ÿ@ÿ@@ÿ€@ÿÿ``@`€`ÿ` ` @` €` ÿ`@`@@`@€`@ÿ````@``€``ÿ`€`€@`€€`€ÿ` ` @` €` ÿ`À`À@`À€`Àÿ`ÿ`ÿ@`ÿ€`ÿÿ€€@€€€ÿ€ € @€ €€ ÿ€@€@@€@€€@ÿ€`€`@€`€€`ÿ€€€€@€€€€€ÿ€ € @€ €€ ÿ€À€À@€À€€Àÿ€ÿ€ÿ@€ÿ€€ÿÿ  @ € ÿ    @  €  ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿÀÀ@À€ÀÿÀ À @À €À ÿÀ@À@@À@€À@ÿÀ`À`@À`€À`ÿÀ€À€@À€€À€ÿÀ À @À €À ÿÀÀÀÀ@ÀÀ€ÀÀÿÀÿÀÿ@Àÿ€Àÿÿÿÿ@ÿ€ÿÿÿ ÿ @ÿ €ÿ ÿÿ@ÿ@@ÿ@€ÿ@ÿÿ`ÿ`@ÿ`€ÿ`ÿÿ€ÿ€@ÿ€€ÿ€ÿÿ ÿ @ÿ €ÿ ÿÿÀÿÀ@ÿÀ€ÿÀÿÿÿÿÿ@ÿÿ€ÿÿÿ!ùÿ,¨Æ@þÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠIr"€“%SJ< @¥Ë”àb¾œ©0&8š8?6ÈÉsàΞ@ƒunixODBC-2.3.9/doc/lst/InternalStructure7.gif0000755000175000017500000000232112262474475015721 00000000000000GIF89aˆ“÷ÿ@€ÿ @ € ÿ@@@@€@ÿ``@`€`ÿ€€@€€€ÿ  @ € ÿÀÀ@À€Àÿÿÿ@ÿ€ÿÿ @ € ÿ @ € ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿ@@@@€@ÿ@ @ @@ €@ ÿ@@@@@@@€@@ÿ@`@`@@`€@`ÿ@€@€@@€€@€ÿ@ @ @@ €@ ÿ@À@À@@À€@Àÿ@ÿ@ÿ@@ÿ€@ÿÿ``@`€`ÿ` ` @` €` ÿ`@`@@`@€`@ÿ````@``€``ÿ`€`€@`€€`€ÿ` ` @` €` ÿ`À`À@`À€`Àÿ`ÿ`ÿ@`ÿ€`ÿÿ€€@€€€ÿ€ € @€ €€ ÿ€@€@@€@€€@ÿ€`€`@€`€€`ÿ€€€€@€€€€€ÿ€ € @€ €€ ÿ€À€À@€À€€Àÿ€ÿ€ÿ@€ÿ€€ÿÿ  @ € ÿ    @  €  ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿÀÀ@À€ÀÿÀ À @À €À ÿÀ@À@@À@€À@ÿÀ`À`@À`€À`ÿÀ€À€@À€€À€ÿÀ À @À €À ÿÀÀÀÀ@ÀÀ€ÀÀÿÀÿÀÿ@Àÿ€Àÿÿÿÿ@ÿ€ÿÿÿ ÿ @ÿ €ÿ ÿÿ@ÿ@@ÿ@€ÿ@ÿÿ`ÿ`@ÿ`€ÿ`ÿÿ€ÿ€@ÿ€€ÿ€ÿÿ ÿ @ÿ €ÿ ÿÿÀÿÀ@ÿÀ€ÿÀÿÿÿÿÿ@ÿÿ€ÿÿÿ!ùÿ,ˆ“@þÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠ9±É“M¢\ÉR Ê–0¾ŒI³ãÌš8oâÜiQ'O–> utèÈ¢F“Dªô#Ó¦JŸ‚ðS*Ô¡V=R¸5fÖ«;¿v@–lM±`Ϧ=ºv-Ú¶ßÂE)w.úvÙæå¨ï^›7öõ˜bY„ »˜XqJŽ]ÿ™•Ì•+Õ²–NŽ X¦cº n®,ùò殣A>müÙòaÖQoœ¹ôl’«[‹„½÷-oÇ¿íÖ Þô0çÄçâM.\7EÖÌÁFOû{:Iã ­Kwª½ªó’»»þ«ýQ{ñ±Ç%/Ñorôì·;<®~ü¼_é{©þ>uˆú!dŸIÍÄÙmåtÞ€b%ZA&(à‚õ× [f`}mxá_ÄñFᇽ—‘… ŽH¢wª­è"D ª—Œ/#s(¶c»ñè#_5ž÷cváŽ/Þ(äL6yÔ’N.eQŽQ¶¥W!1Xe– yx–ŸÑH^VÆy¹eNb2&%CT xæwBHunixODBC-2.3.9/doc/lst/InternalStructure5.html0000755000175000017500000000311012262474475016113 00000000000000 LST - Cursor On Cursor - Add B3
LST
Cursor On Cursor
Add B3


LST - Cursor On Cursor - Add B3

Description

This diagram depicts what happens when a new item (B3) is added to cursor list (B) which is also a base list (for C).

Notice that the addition of a new item in a base list has no immediate affect on the derived list (C).

Related Functions

lstAppend, lstInsert


[Back][Next]

Page 5 of 9

unixODBC-2.3.9/doc/lst/InternalStructure8.gif0000755000175000017500000000341512262474475015727 00000000000000GIF89aˆ“÷ÿ@€ÿ @ € ÿ@@@@€@ÿ``@`€`ÿ€€@€€€ÿ  @ € ÿÀÀ@À€Àÿÿÿ@ÿ€ÿÿ @ € ÿ @ € ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿ@@@@€@ÿ@ @ @@ €@ ÿ@@@@@@@€@@ÿ@`@`@@`€@`ÿ@€@€@@€€@€ÿ@ @ @@ €@ ÿ@À@À@@À€@Àÿ@ÿ@ÿ@@ÿ€@ÿÿ``@`€`ÿ` ` @` €` ÿ`@`@@`@€`@ÿ````@``€``ÿ`€`€@`€€`€ÿ` ` @` €` ÿ`À`À@`À€`Àÿ`ÿ`ÿ@`ÿ€`ÿÿ€€@€€€ÿ€ € @€ €€ ÿ€@€@@€@€€@ÿ€`€`@€`€€`ÿ€€€€@€€€€€ÿ€ € @€ €€ ÿ€À€À@€À€€Àÿ€ÿ€ÿ@€ÿ€€ÿÿ  @ € ÿ    @  €  ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿÀÀ@À€ÀÿÀ À @À €À ÿÀ@À@@À@€À@ÿÀ`À`@À`€À`ÿÀ€À€@À€€À€ÿÀ À @À €À ÿÀÀÀÀ@ÀÀ€ÀÀÿÀÿÀÿ@Àÿ€Àÿÿÿÿ@ÿ€ÿÿÿ ÿ @ÿ €ÿ ÿÿ@ÿ@@ÿ@€ÿ@ÿÿ`ÿ`@ÿ`€ÿ`ÿÿ€ÿ€@ÿ€€ÿ€ÿÿ ÿ @ÿ €ÿ ÿÿÀÿÀ@ÿÀ€ÿÀÿÿÿÿÿ@ÿÿ€ÿÿÿ!ùÿ,ˆ“@þÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠ9±É“M¢\Éò¸—-c&| N¦Í*oê˜s§O‹=¶ *´hCšFY"MÊT!Ѧ"ŸB*ujǪV.Íúq+צX¿b +v'Ù²%Ñ6õªö"Û¶fár<+w%]ŒòP0¯_¾'ïÖÛ ðÀ·ýîíû0Iă£Î)Ø¢bŽ17¶ùgå΃~m2i…lGŸv8Ùðj‰DU¿†(û cÀ|qc&˜{÷¿Û!ÏÖž]дDà¿“+ÏÜ{ùâ®0{$rÝΕkN›øXï¬þ‚h||y†Ó³bM?8½ëñ ÙË•?°5|ç½çO;Yí]úpZ÷¸Ñ]™¡gà‚ÒA”àB:Å Q>(á„ Fø†¢Å!‡× uiØ'ƒ¶õ¡ʹ!w™ˆÜo)"y'O‰2ŠP‘4vêÛ£6ºç•7=%ª¦‘úåsªÈc“þ¨ÆšÒ©fJ­²B¨*I»æê«“½þÊ¢ž¸ÒlQÅ «,NÉIœ6›£´WÙºìµðY;"ž ]zá³Þi«h Ÿr‹í¹.›’x/²$.aC’)’'îU)nô«.ºüz¶oZ¬òèév¦ŽèÚ¿Lr*°«ÙÁÚïÃ""‘Ä:ú!µ_Q ñÆÄi ,Ʊa<«ÈqÌnºˆ’ Õ»õ}¦2J,û$çËñÖÜžÇÆVs|4ËŒ3Aûm·PÐÊâ:©L ÿ¬©ÒÁËô¨ýM^tÝÒ;©b*æÛòÓTÙ|ëÎýr]¨a=¯EõÀhFµÉsÆØ˜¥¶[vÄsÏ·©ØeѤ÷þÞ|7À÷ß{›¬$GqWTø”ßb‹7¿ªm·à£ ”‹C>ù‹•3›ù²uó hd›[>®Ž¯Úíåw¦æÐŽ.ú›Û'¯V Š5ܶþ:Wvç”ê»—%²Â=2ì#¨ÁûjhòÌTvèÍSÞnôÔ·WõÑ;ŠýöðJV:÷œƒ/>˜ë‘+tâã |úçÎü½¹ Ijû½Gjù>û×ã/¾ö <£ñåZŸþ¶5@3ñ¯€,TÕsÀ:Ѐ ô"HAT °Q÷« 8A"5pƒ aTô}P„(La€¦§ÂºpIË{¡ gHÃunixODBC-2.3.9/doc/lst/InternalStructure4.html0000755000175000017500000000341012262474475016115 00000000000000 LST - Cursor On Cursor - Add C2
LST
Cursor On Cursor
Add C2


LST - Cursor On Cursor - Add C2

Description

This diagram depicts what happens when a new item (C2) is appended to a cursor list (C) using lstAppend().

Notice that the item is appended to the root list and a reference item is added to the cursor list. No intermediate lists are affected.

A call to lstGet on (C) while the current item is (C2) would return the pData in (A5).

Related Functions

lstAppend, lstInsert, lstGet


[Back][Next]

Page 4 of 9

unixODBC-2.3.9/doc/lst/InternalStructure8.html0000755000175000017500000000320412262474475016122 00000000000000 LST - Cursor On Cursor - Del B
LST
Cursor On Cursor
Del B


LST - Cursor On Cursor - Del B

Description

This diagram depicts the closing of list (B) using the lstClose function.

Notice that no lists or items are actually removed. The reference counter in (B) is decremented but it is not actually closed because its reference count is still greater than zero. It is, in effect, flagged for deletion.

Related Functions

lstClose


[Back][Next]

Page 8 of 9

unixODBC-2.3.9/doc/lst/InternalStructure6.gif0000755000175000017500000000221512262474475015722 00000000000000GIF89aˆQ÷ÿ@€ÿ @ € ÿ@@@@€@ÿ``@`€`ÿ€€@€€€ÿ  @ € ÿÀÀ@À€Àÿÿÿ@ÿ€ÿÿ @ € ÿ @ € ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿ@@@@€@ÿ@ @ @@ €@ ÿ@@@@@@@€@@ÿ@`@`@@`€@`ÿ@€@€@@€€@€ÿ@ @ @@ €@ ÿ@À@À@@À€@Àÿ@ÿ@ÿ@@ÿ€@ÿÿ``@`€`ÿ` ` @` €` ÿ`@`@@`@€`@ÿ````@``€``ÿ`€`€@`€€`€ÿ` ` @` €` ÿ`À`À@`À€`Àÿ`ÿ`ÿ@`ÿ€`ÿÿ€€@€€€ÿ€ € @€ €€ ÿ€@€@@€@€€@ÿ€`€`@€`€€`ÿ€€€€@€€€€€ÿ€ € @€ €€ ÿ€À€À@€À€€Àÿ€ÿ€ÿ@€ÿ€€ÿÿ  @ € ÿ    @  €  ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿÀÀ@À€ÀÿÀ À @À €À ÿÀ@À@@À@€À@ÿÀ`À`@À`€À`ÿÀ€À€@À€€À€ÿÀ À @À €À ÿÀÀÀÀ@ÀÀ€ÀÀÿÀÿÀÿ@Àÿ€Àÿÿÿÿ@ÿ€ÿÿÿ ÿ @ÿ €ÿ ÿÿ@ÿ@@ÿ@€ÿ@ÿÿ`ÿ`@ÿ`€ÿ`ÿÿ€ÿ€@ÿ€€ÿ€ÿÿ ÿ @ÿ €ÿ ÿÿÀÿÀ@ÿÀ€ÿÀÿÿÿÿÿ@ÿÿ€ÿÿÿ!ùÿ,ˆQ@þÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠ9±É“M¢\ÉR Ê–0¾ŒI³ãÌš8oâÜiQ'O–> utèÈ¢F“Dªô#Ó¦JŸ‚ðS*Ô¡V=R¸5fÖ«;¿v@–lM±`Ϧ=ºv-Ú¶ßÂE)w.úvÙæå¨ïÞ”:ýþ%ØWð`ˆk|iXqJŽ]ÿ™•Ì•+Õ²–NŽlSacÇw!Ü\YòåÍ]Iƒ|úôÁÖSoœÙôl’¬]‹„÷-oÅ¿çÖ Þ[÷ããÆ)oûy9XçiyC7:ý¹ÓêU“K\Þ»Zíˆéþz_9>êEâåÁ_ÍÊyazõv¿¶÷ ¿¾rˆóeÚßZsÁÛÖ"4g(SwïH×hÿ•¦ Cù9¸Wp°1há…!yÇ`ƒ„^ˆ$zö!ˆ% XbReaÆß‡+:ãŒ=…¨"цc€unixODBC-2.3.9/doc/lst/InternalStructure.gif0000755000175000017500000000445012262474475015637 00000000000000GIF89aÏü÷ÿ@€ÿ @ € ÿ@@@@€@ÿ``@`€`ÿ€€@€€€ÿ  @ € ÿÀÀ@À€Àÿÿÿ@ÿ€ÿÿ @ € ÿ @ € ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿ@@@@€@ÿ@ @ @@ €@ ÿ@@@@@@@€@@ÿ@`@`@@`€@`ÿ@€@€@@€€@€ÿ@ @ @@ €@ ÿ@À@À@@À€@Àÿ@ÿ@ÿ@@ÿ€@ÿÿ``@`€`ÿ` ` @` €` ÿ`@`@@`@€`@ÿ````@``€``ÿ`€`€@`€€`€ÿ` ` @` €` ÿ`À`À@`À€`Àÿ`ÿ`ÿ@`ÿ€`ÿÿ€€@€€€ÿ€ € @€ €€ ÿ€@€@@€@€€@ÿ€`€`@€`€€`ÿ€€€€@€€€€€ÿ€ € @€ €€ ÿ€À€À@€À€€Àÿ€ÿ€ÿ@€ÿ€€ÿÿ  @ € ÿ    @  €  ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿÀÀ@À€ÀÿÀ À @À €À ÿÀ@À@@À@€À@ÿÀ`À`@À`€À`ÿÀ€À€@À€€À€ÿÀ À @À €À ÿÀÀÀÀ@ÀÀ€ÀÀÿÀÿÀÿ@Àÿ€Àÿÿÿÿ@ÿ€ÿÿÿ ÿ @ÿ €ÿ ÿÿ@ÿ@@ÿ@€ÿ@ÿÿ`ÿ`@ÿ`€ÿ`ÿÿ€ÿ€@ÿ€€ÿ€ÿÿ ÿ @ÿ €ÿ ÿÿÀÿÀ@ÿÀ€ÿÀÿÿÿÿÿ@ÿÿ€ÿÿÿ!ùÿ,Ïü@þÿ H° Áƒ*\Ȱ¡Ã‡#JœHQ €‹3jÜ8ð"Ž CŠ´ˆq¤É“$?¢\ɡǖ03¾ŒIåÌšUâ,xs§O™% Ít¨Q‡=Wª\š³)Í™“*ujͪD£Zõ‰ukË® £õ,Ù“f#ŠM{¶­[‰kãÊ»ö­Ý»lÕŽ5ÈÔåÝ¿#o þUgÝ”€o¥Ë¸q^ÅÊL¹2O±–3{}ü³æÏ=74Û÷ NШýX¸#fĨcstL{®ìÛ0'ãÞ-ù5ïße÷š>ü4ðã|‰5Î×bBæÈñ®vN˜zßë°£kOY»»òíà/þO^ãøòè³vFú=ýgÑ IS7í¾íàêø±ç·Þ¾¾eïBç߀ŠÁ'›ä!˜Z*šƒÛA8‘o\18 „™G xõI×…þö؇†È„bx”Š•±ÈVº7"{ÆH™‹„½¦ŸaÖõˆŸ¹M·_ްíh"∤ft-iã‘NfbFÙ"”ñéè#Cêg¥I÷]·TIFRùe’Xžy mjÊhf›R¾éTXi¹އíØÑ–>Ú¹žuúiŸ’‚¾Õd¡àŠèfý•F§œ‹VihZv¹§¥CF —¢ÅiêiE†*ê¨Þ©Ihb§Þ–ê_«ÆÖª]þ¯¢Ù!§ÚÅê–­LÒ§©ºÂõãO¸îz'OBû_¯W"+¢²~ÍÙÜSºùª—MMúgQÎjínX‘˜ž±ŒÊ™mtà.å¸Ü2 ™‚ÞâV®U*²ùžºêÊ𤿫o¾ î+ï§TY(0½o:)¤ï¬^`•–fœ£ùmëé}—n›”Ä _Ëe™zæˆqÆ"ú1ÈÀŽL²¡ž|ì¡*¯œrË.à «¿ÑÊSZ\>jóU Z›0È"CÕçÃóñ·³k9÷I#±Gƒ)$Ç|zÜt&»DðÔVuÉ0n-Ë^ßÚnØ3_Mv–4£{v¿>föÔlåõsÆA“94ÓDÙ4þÅJ»÷Ú…uÅüi 8Òiw}8No/ÎöÜŽ#^säCMNùŠo¸Ú—£=Ú¯ eðŒ~w8³yÞíTÞ¢×*$á”þmzèOuëo®øì¼÷º¯;¯ÂO3ñÚ"ï¦áä6Ž2óÈáθóóBŸ¬òßRŸ«õ7j/löÜ/þºÞ¯œü™Òó<~ºë£ZþõÀ‚~çûÝ·ú¥\cÏ8þ’ê_^úgàÍèR€î³ÿä·@–XnCÓzÝ‹(¹—ˆ‚˜rMѾ² .ïf…Ó¥–ªï|âÙÝÿˆ9*q.z,ìÍ›^(>>J…Ç1¡M46àèP)þX¢¡¬>x:®i„b«š·ÈA&Ð^„øBÖC)¢'^ÿ2Ís¯êâŸÆ2ŠêqÃû]é²45z.> ì”uÆÆ5ΑŒk#ïw8‘UéG†ÁHaœø$Ô5l>t™Æ¸ ð]¬ƒ§‘ ɾBì t£à0Õ1J¢¯v¼] æÇ;â1x¦ LST - Cursor On Cursor - Add D
LST
Cursor On Cursor
Add D


LST - Cursor On Cursor - Add D

Description

This diagram depicts the creation of a new cursor list (D)... the second one based on the root list (A).

Reference counts are increased in (A), (A2), and (A6).

The filter function for (D) was never presented with (A4) as it is flagged for deletion.

Related Functions

lstOpenCursor


[Back][Next]

Page 7 of 9

unixODBC-2.3.9/doc/lst/InternalStructure3.html0000755000175000017500000000357312262474475016126 00000000000000 LST - Cursor On Cursor - Add C
LST
Cursor On Cursor
Add C

LST - Cursor On Cursor - Add C

Description

This diagram depicts a cursor (C) which is based upon another cursor (B). It shows how a list can be incrementally reduced using calls to lstOpenCursor() with a filter function.

Notice that the item (C1) is a direct reference to the root list (A) even though the cursor is based upon (B).

Symantics

(B) and (C) are cursors.

(C) is based upon (B).

(B) is the base list for (C).

(A) is the root list for (B) and (C).

(A) is the base list for (B).

Related Functions

lstOpenCursor()


[Back][Next]

Page 3 of 9

unixODBC-2.3.9/doc/lst/InternalStructure2.html0000755000175000017500000000340012262474475016112 00000000000000 LST - Cursor - Add B
LST
Cursor
Add B

LST - Cursor - Add B


Description

This diagram depicts a cursor (B) which is based upon the root list (A). The cursor was created with a call to lstOpenCursor(). This cursor contains a subset of items from the base list because a filter function was provided. Cursors can be manipulated using the same functions as a normal list and they are closed with a simple call to lstClose().

The pData in cursor items refer directly to the corresponding item in the root list. Reference counters are increased in the base list (A) and in each item. This prevents underlying data from being deleted while a derived cursor is still in use.

Related Functions

lstOpenCursor


[Back][Next]

Page 2 of 9

unixODBC-2.3.9/doc/lst/next.gif0000755000175000017500000000031012262474475013107 00000000000000GIF87a ¢ÿÿÿÀÀÀ€€€ÀÀÀ, “8´Üþp)@«½8ƒ°´ÿ›ÐmAižhz "A©p\²£l£´KÞwþž ^Ê·+ŒBu45yK`ê)‹:aT•Ë®Z¿«ÍØr„Y3¹«ϰšž¹™¶z»&…é¿|b(8w}&„C†‚‰Z‹H0joBfIŠ—Ž™š…œ{.e,¤¥¦§¨A¨«¬¦ ±² ;unixODBC-2.3.9/doc/lst/back.gif0000755000175000017500000000030412262474475013034 00000000000000GIF87a ¢ÿÿÿÀÀÀ€€€ÀÀÀ, 8´Üþp)@«½8ƒ°´ÿ›ÐmAižhz "A©p\²£l£´KÞwþò¨®õrÝŒ¨´ KM_ö4E™NdêZ£jU\ª Kä˜y—–­­Æä° ç½··;Ø=ó÷+Xyxtƒu&RqrŒ‰‚‹gŠ‹0“”)–—…~š›!, ¡¢£¤B¤§¨¢ ­® ;unixODBC-2.3.9/doc/lst/InternalStructure2.gif0000755000175000017500000000161012262474475015714 00000000000000GIF89a¯÷÷ÿ@€ÿ @ € ÿ@@@@€@ÿ``@`€`ÿ€€@€€€ÿ  @ € ÿÀÀ@À€Àÿÿÿ@ÿ€ÿÿ @ € ÿ @ € ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿ@@@@€@ÿ@ @ @@ €@ ÿ@@@@@@@€@@ÿ@`@`@@`€@`ÿ@€@€@@€€@€ÿ@ @ @@ €@ ÿ@À@À@@À€@Àÿ@ÿ@ÿ@@ÿ€@ÿÿ``@`€`ÿ` ` @` €` ÿ`@`@@`@€`@ÿ````@``€``ÿ`€`€@`€€`€ÿ` ` @` €` ÿ`À`À@`À€`Àÿ`ÿ`ÿ@`ÿ€`ÿÿ€€@€€€ÿ€ € @€ €€ ÿ€@€@@€@€€@ÿ€`€`@€`€€`ÿ€€€€@€€€€€ÿ€ € @€ €€ ÿ€À€À@€À€€Àÿ€ÿ€ÿ@€ÿ€€ÿÿ  @ € ÿ    @  €  ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿÀÀ@À€ÀÿÀ À @À €À ÿÀ@À@@À@€À@ÿÀ`À`@À`€À`ÿÀ€À€@À€€À€ÿÀ À @À €À ÿÀÀÀÀ@ÀÀ€ÀÀÿÀÿÀÿ@Àÿ€Àÿÿÿÿ@ÿ€ÿÿÿ ÿ @ÿ €ÿ ÿÿ@ÿ@@ÿ@€ÿ@ÿÿ`ÿ`@ÿ`€ÿ`ÿÿ€ÿ€@ÿ€€ÿ€ÿÿ ÿ @ÿ €ÿ ÿÿÀÿÀ@ÿÀ€ÿÀÿÿÿÿÿ@ÿÿ€ÿÿÿ!ùÿ,¯÷@þÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱã? =Š ÀÈ“(E6HÉòâÊ–0=–ŒIÓáÌš8s|©³çNŸ@Þ šs(Ñ£y"¥©téQ£NYBJbÓª'¯b-unixODBC-2.3.9/doc/lst/InternalStructure4.gif0000755000175000017500000000167412262474475015730 00000000000000GIF89aŒ&÷ÿ@€ÿ @ € ÿ@@@@€@ÿ``@`€`ÿ€€@€€€ÿ  @ € ÿÀÀ@À€Àÿÿÿ@ÿ€ÿÿ @ € ÿ @ € ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿ@@@@€@ÿ@ @ @@ €@ ÿ@@@@@@@€@@ÿ@`@`@@`€@`ÿ@€@€@@€€@€ÿ@ @ @@ €@ ÿ@À@À@@À€@Àÿ@ÿ@ÿ@@ÿ€@ÿÿ``@`€`ÿ` ` @` €` ÿ`@`@@`@€`@ÿ````@``€``ÿ`€`€@`€€`€ÿ` ` @` €` ÿ`À`À@`À€`Àÿ`ÿ`ÿ@`ÿ€`ÿÿ€€@€€€ÿ€ € @€ €€ ÿ€@€@@€@€€@ÿ€`€`@€`€€`ÿ€€€€@€€€€€ÿ€ € @€ €€ ÿ€À€À@€À€€Àÿ€ÿ€ÿ@€ÿ€€ÿÿ  @ € ÿ    @  €  ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿÀÀ@À€ÀÿÀ À @À €À ÿÀ@À@@À@€À@ÿÀ`À`@À`€À`ÿÀ€À€@À€€À€ÿÀ À @À €À ÿÀÀÀÀ@ÀÀ€ÀÀÿÀÿÀÿ@Àÿ€Àÿÿÿÿ@ÿ€ÿÿÿ ÿ @ÿ €ÿ ÿÿ@ÿ@@ÿ@€ÿ@ÿÿ`ÿ`@ÿ`€ÿ`ÿÿ€ÿ€@ÿ€€ÿ€ÿÿ ÿ @ÿ €ÿ ÿÿÀÿÀ@ÿÀ€ÿÀÿÿÿÿÿ@ÿÿ€ÿÿÿ!ùÿ,Œ&@þÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠy±É“M¢\ÉòŸÊ–0¾ŒI³ãÌš8oâÜ™Q'Ï–> mt(É¢F“Dªô#Ó¦P]Ò ôiÔªSR­iõ*Ï®ˆ›Ó«Y‚`ÏNL«h[lߢŒ+—!ݺsñrTyW/Å:ûú]*Pð`ˆ€ unixODBC-2.3.9/doc/lst/InternalStructure3.gif0000755000175000017500000000242012262474475015715 00000000000000GIF89a‡÷÷ÿ@€ÿ @ € ÿ@@@@€@ÿ``@`€`ÿ€€@€€€ÿ  @ € ÿÀÀ@À€Àÿÿÿ@ÿ€ÿÿ @ € ÿ @ € ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿ@@@@€@ÿ@ @ @@ €@ ÿ@@@@@@@€@@ÿ@`@`@@`€@`ÿ@€@€@@€€@€ÿ@ @ @@ €@ ÿ@À@À@@À€@Àÿ@ÿ@ÿ@@ÿ€@ÿÿ``@`€`ÿ` ` @` €` ÿ`@`@@`@€`@ÿ````@``€``ÿ`€`€@`€€`€ÿ` ` @` €` ÿ`À`À@`À€`Àÿ`ÿ`ÿ@`ÿ€`ÿÿ€€@€€€ÿ€ € @€ €€ ÿ€@€@@€@€€@ÿ€`€`@€`€€`ÿ€€€€@€€€€€ÿ€ € @€ €€ ÿ€À€À@€À€€Àÿ€ÿ€ÿ@€ÿ€€ÿÿ  @ € ÿ    @  €  ÿ @ @@ @€ @ÿ ` `@ `€ `ÿ € €@ €€ €ÿ    @  €  ÿ À À@ À€ Àÿ ÿ ÿ@ ÿ€ ÿÿÀÀ@À€ÀÿÀ À @À €À ÿÀ@À@@À@€À@ÿÀ`À`@À`€À`ÿÀ€À€@À€€À€ÿÀ À @À €À ÿÀÀÀÀ@ÀÀ€ÀÀÿÀÿÀÿ@Àÿ€Àÿÿÿÿ@ÿ€ÿÿÿ ÿ @ÿ €ÿ ÿÿ@ÿ@@ÿ@€ÿ@ÿÿ`ÿ`@ÿ`€ÿ`ÿÿ€ÿ€@ÿ€€ÿ€ÿÿ ÿ @ÿ €ÿ ÿÿÀÿÀ@ÿÀ€ÿÀÿÿÿÿÿ@ÿÿ€ÿÿÿ!ùÿ,‡÷@þÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠi€I’()š²¥Ë ^Êds¦M5oê˜s§Ï‰+Ú *´(ÄžF["MÊÔàÒ¦#ŸBeJtªÈªV§JÍÊq+ן^¿f +vèÉ™Xe¦-+”,È•,uºeûr®Ç¸ñÊ´KåÚUõþƒ{–äß¾o cå[²°`ÅJÛl@9'ãÆxŽ,Ùçá΃n]—4Æ¥—MWL­š êÖ† gÌ,eÜÛm×ÞÍû®ìÜpaãäH{°ñãzu#Ï+Ò.káNGǽü¸õæŸCÏû{»ÂÏGþ{¨]uyç%§'}~}_ðã¹ ^¨X|üƒîÕ7§?¿~1Uv߀Á—ÛC¨`Bsu§ þ×Ð|Fx_‚ah¡…¢·á‡®HŸcÌÕvQ‹ bbÓñFÝ‹½}VŸ}+šW"Œƒ¡èbˆUÖa"Þ¸cu8Â$l3&©¤’,Îx$büuæã“rQiå€K^Yš•SjI“—`R¹$…aÔe™=ªè?¢éævcnGVq µù&LjF5¡ƒ ÞéçŸ&& ÕvªÑ”lzøQX•˜£mg¥¥¡”zgDº¨cuŠ>Xh¥õ„ã¨CunixODBC-2.3.9/doc/lst/InternalStructure6.html0000755000175000017500000000375012262474475016126 00000000000000 LST - Cursor On Cursor - Del B2
LST
Cursor On Cursor
Del B2


LST - Cursor On Cursor - Del B2

Description

This diagram depicts what happens when an item (B2) is deleted.

Notice that the reference item (B2) is removed immediatly. This causes the reference counter in (A4) to be reduced. A delete flag is set in (A4) because there are still references to it and deletion is delayed until all references are removed. (C) and (C1) are oblivious to the delete.

Navigation is affected by (A4) being flagged for delete. Navigation functions such as; lstFirst and lstNext will skip (hide) any items which are flagged for delete. This prevents deleted items from getting more references.

Related Functions

lstDelete


[Back][Next]

Page 6 of 9

unixODBC-2.3.9/doc/lst/InternalStructure9.html0000755000175000017500000000277512262474475016137 00000000000000 LST - Cursor On Cursor - Del C
LST
Cursor On Cursor
Del C

LST - Cursor On Cursor - Del C

Description

This diagram depicts the state Before a call to close list (C) and After it has been called.

Notice that lstClose on list (C) detected that list (B) could be closed. Item (A4) was removed because it was flagged for delete and had no more references to it.

Related Functions

lstClose


[Back]

Page 9 of 9

unixODBC-2.3.9/doc/lst/Makefile.in0000664000175000017500000003314613725127175013520 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/lst ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ InternalStructure.gif \ InternalStructure.html \ InternalStructure.vsd \ InternalStructure2.gif \ InternalStructure2.html \ InternalStructure3.gif \ InternalStructure3.html \ InternalStructure4.gif \ InternalStructure4.html \ InternalStructure5.gif \ InternalStructure5.html \ InternalStructure6.gif \ InternalStructure6.html \ InternalStructure7.gif \ InternalStructure7.html \ InternalStructure8.gif \ InternalStructure8.html \ InternalStructure9.gif \ InternalStructure9.html \ back.gif \ next.gif all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/lst/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/lst/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/doc/lst/InternalStructure.vsd0000755000175000017500000000000612262474475015657 00000000000000ÐÏࡱunixODBC-2.3.9/doc/lst/Makefile.am0000755000175000017500000000103212262474475013500 00000000000000EXTRA_DIST = \ InternalStructure.gif \ InternalStructure.html \ InternalStructure.vsd \ InternalStructure2.gif \ InternalStructure2.html \ InternalStructure3.gif \ InternalStructure3.html \ InternalStructure4.gif \ InternalStructure4.html \ InternalStructure5.gif \ InternalStructure5.html \ InternalStructure6.gif \ InternalStructure6.html \ InternalStructure7.gif \ InternalStructure7.html \ InternalStructure8.gif \ InternalStructure8.html \ InternalStructure9.gif \ InternalStructure9.html \ back.gif \ next.gif unixODBC-2.3.9/doc/Makefile.am0000755000175000017500000000021012262474475012673 00000000000000SUBDIRS = \ AdministratorManual \ ProgrammerManual \ UserManual \ lst EXTRA_DIST = \ index.html \ smallbook.gif \ unixODBC.gif unixODBC-2.3.9/ini/0000775000175000017500000000000013725127520010726 500000000000000unixODBC-2.3.9/ini/iniAppend.c0000755000175000017500000000445312262474470012734 00000000000000/********************************************************************************** * iniAppend * * - Appends Sections which do not exist in hIni. Ignores all else. * - Does not try to append 'missing' Entries to existing Sections (does not try to merge). * - hIni will become ReadOnly * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniAppend( HINI hIni, char *pszFileName ) { FILE *hFile; char szLine[INI_MAX_LINE+1]; char szObjectName[INI_MAX_OBJECT_NAME+1]; char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char szPropertyValue[INI_MAX_PROPERTY_VALUE+1]; /* SANITY CHECK */ if ( strlen( pszFileName ) > ODBC_FILENAME_MAX ) return INI_ERROR; /* OPEN FILE */ hFile = uo_fopen( pszFileName, "r" ); if ( !hFile ) return INI_ERROR; iniObjectLast( hIni ); iniPropertyLast( hIni ); /* SCAN UNTIL WE GET TO AN OBJECT NAME OR EOF */ szLine[0] = '\0'; if ( _iniScanUntilObject( hIni, hFile, szLine ) == INI_SUCCESS ) { do { if ( szLine[0] == hIni->cLeftBracket ) { _iniObjectRead( hIni, szLine, szObjectName ); if ( iniObjectSeek( hIni, szObjectName ) == INI_SUCCESS ) { iniObjectLast( hIni ); iniPropertyLast( hIni ); if ( _iniScanUntilNextObject( hIni, hFile, szLine ) != INI_SUCCESS) break; } else { iniObjectInsert( hIni, szObjectName ); if ( uo_fgets( szLine, INI_MAX_LINE, hFile ) == NULL ) break; } } else if ( (strchr( hIni->cComment, szLine[0] ) == NULL ) && isalnum(szLine[0]) ) { _iniPropertyRead( hIni, szLine, szPropertyName, szPropertyValue ); iniPropertyInsert( hIni, szPropertyName, szPropertyValue ); if ( uo_fgets( szLine, INI_MAX_LINE, hFile ) == NULL ) break; } else { if ( uo_fgets( szLine, INI_MAX_LINE, hFile ) == NULL ) break; } } while( 1 ); } /* WE ARE NOT GOING TO TRY TO BE SMART ENOUGH TO SAVE THIS STUFF */ hIni->bReadOnly = 1; /* CLEANUP */ if ( hFile != NULL ) uo_fclose( hFile ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniCursor.c0000755000175000017500000000133012262474470012771 00000000000000/********************************************************************************** * iniCursor * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * PAH = Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 18.MAR.99 Created. **************************************************/ #include #include "ini.h" int iniCursor( HINI hIni, HINI hIniCursor ) { if ( hIni == NULL || hIniCursor == NULL ) return INI_ERROR; memcpy( hIniCursor, hIni, sizeof(INI) ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniObjectLast.c0000755000175000017500000000152312262474470013552 00000000000000/********************************************************************************** * iniObjectLast * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * PAH = Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 19.MAR.99 Now sets hCurProperty to hFirstProperty when found **************************************************/ #include #include "ini.h" int iniObjectLast( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; hIni->hCurObject = hIni->hLastObject; iniPropertyFirst( hIni ); if ( hIni->hCurObject == NULL ) return INI_NO_DATA; return INI_SUCCESS; } unixODBC-2.3.9/ini/iniOpen.c0000755000175000017500000003040012263753763012423 00000000000000/********************************************************************************** * iniOpen * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * PAH = Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 06.MAR.99 Can now create file-less INI. Pass NULL for * pszFileName. Then copy a file name into hIni->szFileName * before calling iniCommit. **************************************************/ #include #include "ini.h" /* * Changes sent by MQJoe, to avoid limit on number of open file handles */ /*************************************************** * Override fstream command to overcome 255 file * handle limit ***************************************************/ #include #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #include #include #if defined( HAVE_VSNPRINTF ) && defined( USE_LL_FIO ) FILE *uo_fopen( const char *filename, const char *mode ) { int fp; long oMode = 0, pMode = 0; pMode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; switch ( mode[0] ) { case 'r': oMode = O_RDONLY; break; case 'w': oMode = O_RDWR | O_CREAT | O_TRUNC; break; case 'o': oMode = O_RDWR | O_CREAT | O_TRUNC; break; case 'a': oMode = O_CREAT | O_APPEND | O_WRONLY; break; default: return FALSE; } fp = open(filename, oMode, pMode ); return(fp != -1) ? (FILE*)fp : NULL; } int uo_fclose( FILE *stream ) { close((int)stream); return 0; } char *uo_fgets( char *buffer, int n, FILE *stream ) { int fp = (int)stream; char ch; int i = 0, c = 0; buffer[0] = 0; do { c = read(fp, &ch, 1); if ( c == 1 ) { buffer[i++] = ch; if ( ch == '\n' ) break; } } while ( c && i < n ); buffer[i] = 0; return(c) ? buffer : NULL; } int uo_vfprintf( FILE *stream, const char *fmt, va_list ap) { int fp = (int)stream; long lNeededSize = 256; char* szBuffer = NULL; long lBufSize = 0; int r = 0; do { if ( lNeededSize > lBufSize ) { if ( szBuffer ) free(szBuffer); szBuffer = (char*)malloc(lNeededSize); lBufSize = lNeededSize; } lNeededSize = vsnprintf(szBuffer, lBufSize, fmt, ap); lNeededSize++; } while ( lNeededSize > lBufSize ); r = write(fp, szBuffer, (lNeededSize - 1) ); if ( szBuffer ) free(szBuffer); return r; } int uo_fprintf( FILE *stream, const char *fmt, ...) { int r; va_list ap; va_start(ap, fmt); r = uo_vfprintf(stream,fmt,ap); va_end(ap); return r; } #endif /***************************************************/ #ifdef __OS2__ int iniOpen( HINI *hIni, char *pszFileName, char *cComment, char cLeftBracket, char cRightBracket, char cEqual, int bCreate, int bFileType ) { FILE *hFile; char szLine[INI_MAX_LINE+1]; char szObjectName[INI_MAX_OBJECT_NAME+1]; char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char szPropertyValue[INI_MAX_PROPERTY_VALUE+1]; int nValidFile; char *ObjectList; char *PropertyList; char *ValueList; int numberObject; int ObjectNumber; int numberProperty; int PropertyNumber; int nValidProperty; char *tmpObjectName; char *tmpPropertyName; char *tmpProperyValue; #ifdef __OS2DEBUG__ printf("iniOpen entered \n"); #endif /* INIT STATEMENT */ *hIni = malloc( sizeof(INI) ); if ( pszFileName && pszFileName != STDINFILE ) strncpy((*hIni)->szFileName, pszFileName, ODBC_FILENAME_MAX ); else if ( pszFileName == STDINFILE ) strncpy((*hIni)->szFileName, "stdin", ODBC_FILENAME_MAX ); else strncpy((*hIni)->szFileName, "", ODBC_FILENAME_MAX ); strcpy( (*hIni)->cComment, cComment ); (*hIni)->cLeftBracket = cLeftBracket; (*hIni)->cRightBracket = cRightBracket; (*hIni)->cEqual = cEqual; (*hIni)->bChanged = FALSE; (*hIni)->hCurObject = NULL; (*hIni)->hFirstObject = NULL; (*hIni)->hLastObject = NULL; (*hIni)->nObjects = 0; (*hIni)->bReadOnly = 0; (*hIni)->iniFileType = bFileType; #ifdef __OS2DEBUG__ printf("iniOpen file is mode %d \n", bFileType); #endif /* OPEN FILE */ if ( pszFileName ) { if ( pszFileName == STDINFILE ) { hFile = stdin; (*hIni)->iniFileType = 0; /* stdin is always text */ } else { if ( (*hIni)->iniFileType == 0 ) hFile = uo_fopen( pszFileName, "r" ); else hFile = (FILE *)iniOS2Open( pszFileName); } if ( !hFile ) { /* * This could fail because of something other than the file not existing... */ if ( bCreate == TRUE ) { if ( (*hIni)->iniFileType == 0 ) hFile = uo_fopen( pszFileName, "w+" ); else hFile = (FILE *)iniOS2Open( pszFileName); } } if ( !hFile ) { free( *hIni ); *hIni = NULL; return INI_ERROR; } if ( (*hIni)->iniFileType == 1 ) { nValidFile = INI_ERROR; ObjectList = (char *)iniOS2LoadObjectList( hFile, &numberObject); if ( numberObject > 0 ) { nValidFile = INI_SUCCESS; ObjectNumber = 0; do { tmpObjectName = (char *)(ObjectList + ObjectNumber); strcpy(szObjectName, tmpObjectName); iniObjectInsert( (*hIni), szObjectName ); PropertyList = (char *)iniOS2LoadPropertyList( hFile, szObjectName, &numberProperty); if ( numberProperty > 0 ) { PropertyNumber = 0; do { tmpPropertyName = PropertyList + PropertyNumber; strcpy(szPropertyName, tmpPropertyName); ValueList = (char *)iniOS2Read( hFile, szObjectName, szPropertyName, szPropertyValue); strcpy(szPropertyValue, ValueList); iniPropertyInsert( (*hIni), szPropertyName, szPropertyValue); PropertyNumber = PropertyNumber + strlen(szPropertyName) + 1; } while ( PropertyNumber < numberProperty ); free(PropertyList); } ObjectNumber = ObjectNumber + strlen(szObjectName) + 1; } while ( ObjectNumber < numberObject ); free(ObjectList); } } else { nValidFile = _iniScanUntilObject( *hIni, hFile, szLine ); if ( nValidFile == INI_SUCCESS ) { char *ptr; do { if ( szLine[0] == cLeftBracket ) { _iniObjectRead( (*hIni), szLine, szObjectName ); iniObjectInsert( (*hIni), szObjectName ); } else if ( (strchr( cComment, szLine[0] ) == NULL ) && !isspace(szLine[0]) ) { _iniPropertyRead( (*hIni), szLine, szPropertyName, szPropertyValue ); iniPropertyInsert( (*hIni), szPropertyName, szPropertyValue ); } } while ( (ptr = uo_fgets( szLine, INI_MAX_LINE, hFile )) != NULL ); } } if ( nValidFile == INI_ERROR ) { /* INVALID FILE */ if ( hFile != NULL ) { if ( (*hIni)->iniFileType == 0 ) uo_fclose( hFile ); else iniOS2Close(hFile); } free( *hIni ); *hIni = NULL; return INI_ERROR; } /* CLEANUP */ if ( hFile != NULL ) { if ( (*hIni)->iniFileType == 0 ) { uo_fclose( hFile ); } else iniOS2Close(hFile); } iniObjectFirst( *hIni ); } /* if file given */ return INI_SUCCESS; } #else int iniOpen( HINI *hIni, char *pszFileName, char *cComment, char cLeftBracket, char cRightBracket, char cEqual, int bCreate ) { FILE *hFile; char szLine[INI_MAX_LINE+1]; char szObjectName[INI_MAX_OBJECT_NAME+1]; char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char szPropertyValue[INI_MAX_PROPERTY_VALUE+1]; int nValidFile; /* INIT STATEMENT */ *hIni = malloc( sizeof(INI) ); if ( pszFileName && pszFileName != STDINFILE ) strncpy((*hIni)->szFileName, pszFileName, ODBC_FILENAME_MAX ); else if ( pszFileName == STDINFILE ) strncpy((*hIni)->szFileName, "stdin", ODBC_FILENAME_MAX ); else strncpy((*hIni)->szFileName, "", ODBC_FILENAME_MAX ); strcpy( (*hIni)->cComment, cComment ); (*hIni)->cLeftBracket = cLeftBracket; (*hIni)->cRightBracket = cRightBracket; (*hIni)->cEqual = cEqual; (*hIni)->bChanged = FALSE; (*hIni)->hCurObject = NULL; (*hIni)->hFirstObject = NULL; (*hIni)->hLastObject = NULL; (*hIni)->nObjects = 0; (*hIni)->bReadOnly = 0; /* OPEN FILE */ if ( pszFileName ) { errno = 0; if ( pszFileName == STDINFILE ) { hFile = stdin; } else { hFile = uo_fopen( pszFileName, "r" ); } if ( ( !hFile ) && ( errno != ENFILE ) && ( errno != EMFILE ) && ( errno != ENOMEM ) && ( errno != EACCES ) && ( errno != EFBIG ) && ( errno != EINTR ) && ( errno != ENOSPC ) && ( errno != EOVERFLOW ) && ( errno != EWOULDBLOCK )) { /* * This could fail because of something other than the file not existing... * so open as w+ just in case */ if ( bCreate == TRUE ) { hFile = uo_fopen( pszFileName, "w+" ); } } if ( !hFile ) { free( *hIni ); *hIni = NULL; return INI_ERROR; } nValidFile = _iniScanUntilObject( *hIni, hFile, szLine ); if ( nValidFile == INI_SUCCESS ) { char *ptr; ptr = szLine; do { /* * remove leading spaces */ while( isspace( *ptr )) { ptr ++; } if ( *ptr == '\0' ) { continue; } if ( *ptr == cLeftBracket ) { _iniObjectRead( (*hIni), ptr, szObjectName ); iniObjectInsert( (*hIni), szObjectName ); } else if ((strchr( cComment, *ptr ) == NULL )) { _iniPropertyRead( (*hIni), ptr, szPropertyName, szPropertyValue ); iniPropertyInsert( (*hIni), szPropertyName, szPropertyValue ); } } while ( (ptr = uo_fgets( szLine, INI_MAX_LINE, hFile )) != NULL ); } else if ( nValidFile == INI_ERROR ) { /* INVALID FILE */ if ( hFile != NULL ) uo_fclose( hFile ); free( *hIni ); *hIni = NULL; return INI_ERROR; } /* CLEANUP */ if ( hFile != NULL ) uo_fclose( hFile ); iniObjectFirst( *hIni ); } /* if file given */ return INI_SUCCESS; } #endif unixODBC-2.3.9/ini/iniClose.c0000755000175000017500000000154612262474470012572 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" /****************************** * iniClose * * 1. free memory previously allocated for HINI * 2. DO NOT save any changes (see iniCommit) ******************************/ int iniClose( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; hIni->hCurObject = hIni->hFirstObject; while ( iniObjectDelete( hIni ) == INI_SUCCESS ) { } free( hIni ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniPropertyEOL.c0000755000175000017500000000124412262474470013704 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniPropertyEOL( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return TRUE; if ( hIni->hCurObject == NULL ) return TRUE; if ( hIni->hCurProperty == NULL ) return TRUE; return FALSE; } unixODBC-2.3.9/ini/iniDelete.c0000755000175000017500000000141412262474470012721 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" /****************************** * iniDelete * ******************************/ int iniDelete( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; /* REMOVE ALL SUBORDINATE INFO */ iniObjectFirst( hIni ); while ( iniObjectDelete( hIni ) == INI_SUCCESS ) { } return INI_SUCCESS; } unixODBC-2.3.9/ini/iniElement.c0000755000175000017500000000773712262474470013126 00000000000000/********************************************************************************** * iniElement * * Use when; * 1. strtok is scary (also does not handle empty elements well) * 2. strstr is not portable * 3. performance is less important than simplicity and the above (feel free to improve on this) * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniElement( char *pszData, char cSeperator, char cTerminator, int nElement, char *pszElement, int nMaxElement ) { int nCurElement = 0; int nChar = 0; int nCharInElement = 0; memset( pszElement, '\0', nMaxElement ); for ( ; nCurElement <= nElement && (nCharInElement+1) < nMaxElement; nChar++ ) { /* check for end of data */ if ( cSeperator != cTerminator && pszData[nChar] == cTerminator ) { break; } if ( cSeperator == cTerminator && pszData[nChar] == cSeperator && pszData[nChar+1] == cTerminator ) { break; } /* check for end of element */ if ( pszData[nChar] == cSeperator ) { nCurElement++; } else if ( nCurElement == nElement ) { pszElement[nCharInElement] = pszData[nChar]; nCharInElement++; } } if ( pszElement[0] == '\0' ) { return INI_NO_DATA; } return INI_SUCCESS; } /* Like iniElement(), but rather than a terminator, the input buffer length is given */ int iniElementMax( char *pData, char cSeperator, int nDataLen, int nElement, char *pszElement, int nMaxElement ) { int nCurElement = 0; int nChar = 0; int nCharInElement = 0; memset( pszElement, '\0', nMaxElement ); for ( ; nCurElement <= nElement && (nCharInElement+1) < nMaxElement && nChar < nDataLen ; nChar++ ) { /* check for end of element */ if ( pData[nChar] == cSeperator ) { nCurElement++; } else if ( nCurElement == nElement ) { pszElement[nCharInElement] = pData[nChar]; nCharInElement++; } } if ( pszElement[0] == '\0' ) { return INI_NO_DATA; } return INI_SUCCESS; } int iniElementEOL( char *pszData, char cSeperator, char cTerminator, int nElement, char *pszElement, int nMaxElement ) { int nCurElement = 0; int nChar = 0; int nCharInElement = 0; memset( pszElement, '\0', nMaxElement ); for ( ;(nCharInElement+1) < nMaxElement; nChar++ ) { /* check for end of data */ if ( cSeperator != cTerminator && pszData[nChar] == cTerminator ) { break; } if ( cSeperator == cTerminator && pszData[nChar] == cSeperator && pszData[nChar+1] == cTerminator ) { break; } /* check for end of element */ if ( pszData[nChar] == cSeperator && nCurElement < nElement ) { nCurElement++; } else if ( nCurElement >= nElement ) { pszElement[nCharInElement] = pszData[nChar]; nCharInElement++; } } if ( pszElement[0] == '\0' ) { return INI_NO_DATA; } return INI_SUCCESS; } int iniElementToEnd( char *pszData, char cSeperator, char cTerminator, int nElement, char *pszElement, int nMaxElement ) { int nCurElement = 0; int nChar = 0; int nCharInElement = 0; memset( pszElement, '\0', nMaxElement ); for ( ; nCurElement <= nElement && (nCharInElement+1) < nMaxElement; nChar++ ) { /* check for end of data */ if ( cSeperator != cTerminator && pszData[nChar] == cTerminator ) break; if ( cSeperator == cTerminator && pszData[nChar] == cSeperator && pszData[nChar+1] == cTerminator ) break; /* check for end of element */ if ( pszData[nChar] == cSeperator && ( nCurElement < nElement )) nCurElement++; else if ( nCurElement == nElement ) { pszElement[nCharInElement] = pszData[nChar]; nCharInElement++; } } if ( pszElement[0] == '\0' ) return INI_NO_DATA; return INI_SUCCESS; } unixODBC-2.3.9/ini/_iniObjectRead.c0000755000175000017500000000217212262474470013662 00000000000000/********************************************************************************** * _iniObjectRead * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int _iniObjectRead( HINI hIni, char *szLine, char *pszObjectName ) { int nChar; /* SANITY CHECK */ if ( hIni == NULL ) return INI_ERROR; /* SCAN LINE TO EXTRACT OBJECT NAME WITH NO BRACKETS */ nChar = 1; while ( 1 ) { if ( (szLine[nChar] == '\0') || (nChar == INI_MAX_OBJECT_NAME) ) { pszObjectName[nChar-1] = '\0'; break; } if ( szLine[nChar] == hIni->cRightBracket ) { pszObjectName[nChar-1] = '\0'; break; } pszObjectName[nChar-1] = szLine[nChar]; nChar++; } iniAllTrim( pszObjectName ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniPropertyUpdate.c0000755000175000017500000000163212262474470014510 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniPropertyUpdate( HINI hIni, char *pszProperty, char *pszValue ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_ERROR; if ( hIni->hCurProperty == NULL ) return INI_ERROR; /* Ok */ strncpy( hIni->hCurProperty->szName, pszProperty, INI_MAX_PROPERTY_NAME ); strncpy( hIni->hCurProperty->szValue, pszValue, INI_MAX_PROPERTY_VALUE ); return INI_SUCCESS; } unixODBC-2.3.9/ini/_iniScanUntilObject.c0000755000175000017500000000304312262474470014705 00000000000000/********************************************************************************** * _iniScanUntilObject * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int _iniScanUntilObject( HINI hIni, FILE *hFile, char *pszLine ) { /* SCAN UNTIL WE GET TO AN OBJECT NAME OR EOF */ pszLine[0] = '\0'; while ( 1 ) { if ( uo_fgets( pszLine, INI_MAX_LINE, hFile ) == NULL ) { return INI_NO_DATA; } /* printf( "[PAH][%s][%d] Line=[%s]\n", __FILE__, __LINE__, pszLine ); */ if ( pszLine[0] == hIni->cLeftBracket ) { return INI_SUCCESS; } iniAllTrim( pszLine ); if ( pszLine[0] == '\0' ) { continue; } if ( strchr( hIni->cComment, pszLine[0] ) == NULL ) { return INI_ERROR; } } return INI_SUCCESS; } int _iniScanUntilNextObject( HINI hIni, FILE *hFile, char *pszLine ) { /* SCAN UNTIL WE GET TO AN OBJECT NAME OR EOF, SKIPPING BODY */ pszLine[0] = '\0'; while ( 1 ) { if ( uo_fgets( pszLine, INI_MAX_LINE, hFile ) == NULL ) { return INI_NO_DATA; } if ( pszLine[0] == hIni->cLeftBracket ) { return INI_SUCCESS; } } return INI_SUCCESS; } unixODBC-2.3.9/ini/iniGotoBookmark.c0000755000175000017500000000144712262474470014123 00000000000000/********************************************************************************** * iniGotoBookmark * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * PAH = Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 18.MAR.99 Created. **************************************************/ #include #include "ini.h" int iniGotoBookmark( INIBOOKMARK IniBookmark ) { if ( IniBookmark.hIni == NULL ) return INI_ERROR; (IniBookmark.hIni)->hCurObject = IniBookmark.hCurObject; (IniBookmark.hIni)->hCurProperty = IniBookmark.hCurProperty; return INI_SUCCESS; } unixODBC-2.3.9/ini/iniCommit.c0000755000175000017500000000223612262474470012752 00000000000000/********************************************************************************** * iniCommit * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniCommit( HINI hIni ) { FILE *hFile; /* SANITY CHECK */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->bReadOnly ) return INI_ERROR; /* OPEN FILE */ #ifdef __OS2__ if (hIni->iniFileType == 0) { #endif hFile = uo_fopen( hIni->szFileName, "w" ); #ifdef __OS2__ } else { hFile = (FILE *)iniOS2Open (hIni->szFileName); } #endif if ( !hFile ) return INI_ERROR; _iniDump( hIni, hFile ); /* CLEANUP */ if ( hFile != NULL ) { #ifdef __OS2__ if (hIni->iniFileType == 0) #endif uo_fclose( hFile ); #ifdef __OS2__ else iniOS2Close( hFile); #endif } return INI_SUCCESS; } unixODBC-2.3.9/ini/README0000755000175000017500000000214412262474470011534 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | INI lib (libini.so) | +-------------------------------------------------------------+ This library provides some usefull functions for processing INI files (such as odbc.ini). It is heavily used in unixODBC by the ODBCConfig and unixODBC Driver Config libs. Peter Harvey pharvey@codebydesign.com 22.MAR.99 +-------------------------------------------------------------+ | Please visit; | | www.unixodbc.org | +-------------------------------------------------------------+ unixODBC-2.3.9/ini/iniPropertySeek.c0000755000175000017500000000265312262474470014161 00000000000000/********************************************************************************** * iniPropertySeek * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniPropertySeek( HINI hIni, char *pszObject, char *pszProperty, char *pszValue ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; /* Ok */ iniObjectFirst( hIni ); while ( iniObjectEOL( hIni ) != TRUE ) { if ( pszObject[0] == '\0' || strcasecmp( pszObject, hIni->hCurObject->szName ) == 0 ) { /* EITHER THE OBJECT HAS BEEN FOUND OR THE OBJECT DOES NOT MATTER */ /* IN ANYCASE LETS SCAN FOR PROPERTY */ iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) != TRUE ) { if ( pszProperty[0] == '\0' || strcasecmp( pszProperty, hIni->hCurProperty->szName ) == 0 ) { if ( pszValue[0] == '\0' || strcasecmp( pszValue, hIni->hCurProperty->szValue ) == 0 ) { /* FOUND IT !! */ return INI_SUCCESS; } } iniPropertyNext( hIni ); } if ( pszObject[0] != '\0' ) { hIni->hCurObject = NULL; return INI_NO_DATA; } } iniObjectNext( hIni ); } return INI_NO_DATA; } unixODBC-2.3.9/ini/iniPropertyNext.c0000755000175000017500000000151012262474470014177 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniPropertyNext( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_NO_DATA; if ( hIni->hCurProperty == NULL ) return INI_NO_DATA; hIni->hCurProperty = hIni->hCurProperty->pNext; if ( hIni->hCurProperty == NULL ) return INI_NO_DATA; return INI_SUCCESS; } unixODBC-2.3.9/ini/iniObjectEOL.c0000755000175000017500000000116312262474470013266 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniObjectEOL( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return TRUE; return FALSE; } unixODBC-2.3.9/ini/iniObjectDelete.c0000755000175000017500000000263112262474470014052 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" /****************************** * iniObjectDelete * ******************************/ int iniObjectDelete( HINI hIni ) { HINIOBJECT hObject; /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_NO_DATA; hObject = hIni->hCurObject; /* REMOVE ALL SUBORDINATE INFO */ hIni->hCurProperty = hObject->hFirstProperty; while ( iniPropertyDelete( hIni ) == INI_SUCCESS ) { } /* REMOVE FROM LIST */ if ( hIni->hFirstObject == hObject ) hIni->hFirstObject = hObject->pNext; if ( hIni->hLastObject == hObject ) hIni->hLastObject = hObject->pPrev; hIni->hCurObject = NULL; if ( hObject->pNext ) { hObject->pNext->pPrev = hObject->pPrev; hIni->hCurObject = hObject->pNext; } if ( hObject->pPrev ) { hObject->pPrev->pNext = hObject->pNext; hIni->hCurObject = hObject->pPrev; } hIni->nObjects--; /* FREE MEMORY */ free( hObject ); iniPropertyFirst( hIni ); return INI_SUCCESS; } unixODBC-2.3.9/ini/_iniDump.c0000755000175000017500000000513112262474470012563 00000000000000/********************************************************************************** * _iniDump * * Dump contents to hStream. * * - iniCommit calls this. You can bypass iniCommit restrictions to get some debugging information by calling directly. * - Make sure the stream is open before calling. * - leaves list position at iniObjectFirst() * - always returns true * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int __iniDebug( HINI hIni ) { /* SANITY CHECK */ if ( hIni == NULL ) return INI_ERROR; /* SCAN OBJECTS */ iniObjectFirst( hIni ); while ( iniObjectEOL( hIni ) == FALSE ) { printf( "%c%s%c\n", hIni->cLeftBracket, hIni->hCurObject->szName, hIni->cRightBracket ); iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) == FALSE ) { printf( "%s%c%s\n", hIni->hCurProperty->szName, hIni->cEqual, hIni->hCurProperty->szValue ); iniPropertyNext( hIni ); } printf( "\n" ); iniPropertyFirst( hIni ); iniObjectNext( hIni ); } iniObjectFirst( hIni ); return INI_SUCCESS; } int _iniDump( HINI hIni, FILE *hStream ) { /* SANITY CHECK */ if ( hIni == NULL ) return INI_ERROR; if ( !hStream ) return INI_ERROR; /* SCAN OBJECTS */ iniObjectFirst( hIni ); while ( iniObjectEOL( hIni ) == FALSE ) { #ifdef __OS2__ if ( hIni->iniFileType == 0 ) #endif uo_fprintf( hStream, "%c%s%c\n", hIni->cLeftBracket, hIni->hCurObject->szName, hIni->cRightBracket ); iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) == FALSE ) { #ifdef __OS2__ if ( hIni->iniFileType == 0 ) { #endif uo_fprintf( hStream, "%s%c%s\n", hIni->hCurProperty->szName, hIni->cEqual, hIni->hCurProperty->szValue ); #ifdef __OS2__ } else { iniOS2Write( hStream, hIni->hCurObject->szName, hIni->hCurProperty->szName, hIni->hCurProperty->szValue); } #endif iniPropertyNext( hIni ); } #ifdef __OS2__ if ( hIni->iniFileType == 0 ) #endif uo_fprintf( hStream, "\n" ); iniPropertyFirst( hIni ); iniObjectNext( hIni ); } iniObjectFirst( hIni ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniPropertyInsert.c0000644000175000017500000000303513670376263014533 00000000000000/********************************************************************************** * iniPropertyInsert * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniPropertyInsert( HINI hIni, char *pszProperty, char *pszValue ) { HINIOBJECT hObject; HINIPROPERTY hProperty; /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_ERROR; if ( pszProperty == NULL ) return INI_ERROR; hObject = hIni->hCurObject; /* CREATE PROPERTY STRUCT */ hProperty = (HINIPROPERTY)malloc( sizeof(INIPROPERTY) ); strncpy( hProperty->szName, pszProperty, INI_MAX_PROPERTY_NAME ); if ( pszValue ) { strncpy( hProperty->szValue, pszValue, INI_MAX_PROPERTY_VALUE ); } else { strcpy( hProperty->szValue, "" ); } hProperty->pNext = NULL; iniAllTrim( hProperty->szName ); iniAllTrim( hProperty->szValue ); /* APPEND TO LIST */ if ( hObject->hFirstProperty == NULL ) hObject->hFirstProperty = hProperty; hProperty->pPrev = hObject->hLastProperty; hObject->hLastProperty = hProperty; if ( hProperty->pPrev != NULL ) hProperty->pPrev->pNext = hProperty; hIni->hCurProperty = hProperty; hObject->nProperties++; return INI_SUCCESS; } unixODBC-2.3.9/ini/iniObjectInsert.c0000755000175000017500000000263312262474470014116 00000000000000/********************************************************************************** * iniObjectInsert * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniObjectInsert( HINI hIni, char *pszObject ) { HINIOBJECT hObject; char szObjectName[INI_MAX_OBJECT_NAME+1]; /* SANITY CHECK */ if ( hIni == NULL ) return INI_ERROR; if ( pszObject == NULL ) return INI_ERROR; strncpy( szObjectName, pszObject, INI_MAX_OBJECT_NAME ); iniAllTrim( szObjectName ); /* CREATE OBJECT STRUCT */ hObject = malloc( sizeof(INIOBJECT) ); hIni->hCurProperty = NULL; hObject->hFirstProperty = NULL; hObject->hLastProperty = NULL; hObject->nProperties = 0; hObject->pNext = NULL; hObject->pPrev = NULL; strncpy( hObject->szName, szObjectName, INI_MAX_OBJECT_NAME ); /* APPEND TO OBJECT LIST */ if ( hIni->hFirstObject == NULL ) hIni->hFirstObject = hObject; hObject->pPrev = hIni->hLastObject; hIni->hLastObject = hObject; if ( hObject->pPrev != NULL ) hObject->pPrev->pNext = hObject; hIni->hCurObject = hObject; hIni->nObjects++; return INI_SUCCESS; } unixODBC-2.3.9/ini/_iniPropertyRead.c0000755000175000017500000000210612262474470014275 00000000000000/********************************************************************************** * _iniPropertyRead * * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int _iniPropertyRead( HINI hIni, char *szLine, char *pszPropertyName, char *pszPropertyValue ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_ERROR; /* SCAN LINE TO EXTRACT PROPERTY NAME AND VALUE WITH NO TRAILING SPACES */ strcpy( pszPropertyName, "" ); strcpy( pszPropertyValue, "" ); iniElement( szLine, '=', '\0', 0, pszPropertyName, INI_MAX_PROPERTY_NAME ); iniElementToEnd( szLine, '=', '\0', 1, pszPropertyValue, INI_MAX_PROPERTY_VALUE ); iniAllTrim( pszPropertyName ); iniAllTrim( pszPropertyValue ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniPropertySeekSure.c0000755000175000017500000000217512262474470015017 00000000000000/********************************************************************************** * iniPropertySeek * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 06.MAR.99 Added this func **************************************************/ #include #include "ini.h" int iniPropertySeekSure( HINI hIni, char *pszObject, char *pszProperty, char *pszValue ) { int nReturn; /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( !pszObject ) return INI_ERROR; if ( !pszProperty ) return INI_ERROR; if ( !pszValue ) return INI_ERROR; /* OK */ if ( (nReturn = iniPropertySeek( hIni, pszObject, pszProperty, "" )) == INI_NO_DATA ) { iniObjectSeekSure( hIni, pszObject ); return iniPropertyInsert( hIni, pszProperty, pszValue ); } else if ( nReturn == INI_SUCCESS ) return iniValue( hIni, pszValue ); return nReturn; } unixODBC-2.3.9/ini/iniElementCount.c0000755000175000017500000000176012262474470014125 00000000000000/********************************************************************************** * iniElementCount * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 05.APR.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniElementCount( char *pszData, char cSeperator, char cTerminator ) { int nToManyElements = 30000; int nCurElement = 0; int nChar = 0; for ( ; nCurElement <= nToManyElements; nChar++ ) { /* check for end of data */ if ( cSeperator != cTerminator && pszData[nChar] == cTerminator ) break; if ( cSeperator == cTerminator && pszData[nChar] == cSeperator && pszData[nChar+1] == cTerminator ) break; /* check for end of element */ if ( pszData[nChar] == cSeperator ) nCurElement++; } return nCurElement; } unixODBC-2.3.9/ini/iniObjectNext.c0000755000175000017500000000160412262474470013565 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * PAH = Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 19.MAR.99 Now sets hCurProperty to hFirstProperty when found **************************************************/ #include #include "ini.h" int iniObjectNext( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_NO_DATA; hIni->hCurObject = hIni->hCurObject->pNext; iniPropertyFirst( hIni ); if ( hIni->hCurObject == NULL ) return INI_NO_DATA; return INI_SUCCESS; } unixODBC-2.3.9/ini/iniToUpper.c0000755000175000017500000000116512262474470013120 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniToUpper( char *pszString ) { int n = 0; for ( n = 0; pszString[n] != '\0'; n++ ) pszString[n] = toupper((unsigned char)pszString[n]); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniAllTrim.c0000755000175000017500000000212512262474470013063 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniAllTrim( char *pszString ) { int nForwardCursor = 0; int nTrailingCursor = 0; int bTrim = 1; /* TRIM LEFT */ for ( nForwardCursor=0; pszString[nForwardCursor] != '\0'; nForwardCursor++ ) { if ( bTrim && isspace( pszString[nForwardCursor] ) ) { /* DO NOTHING */ } else { bTrim = 0; pszString[nTrailingCursor] = pszString[nForwardCursor]; nTrailingCursor++; } } pszString[nTrailingCursor] = '\0'; /* TRIM RIGHT */ for ( nForwardCursor=strlen(pszString)-1; nForwardCursor >= 0 && isspace( pszString[nForwardCursor] ); nForwardCursor-- ) { } pszString[nForwardCursor+1] = '\0'; return INI_SUCCESS; } unixODBC-2.3.9/ini/iniObjectSeek.c0000755000175000017500000000164212262474470013540 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * PAH = Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 19.MAR.99 Now sets hCurProperty to hFirstProperty when found **************************************************/ #include #include "ini.h" int iniObjectSeek( HINI hIni, char *pszObject ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; iniObjectFirst( hIni ); while ( iniObjectEOL( hIni ) == FALSE ) { if ( strcasecmp( pszObject, hIni->hCurObject->szName ) == 0 ) return INI_SUCCESS; iniObjectNext( hIni ); } return INI_NO_DATA; } unixODBC-2.3.9/ini/iniPropertyValue.c0000755000175000017500000000252412262474470014343 00000000000000/********************************************************************************** * . * totally untested * * see iniElement instead **********************************************************************************/ #include #include "ini.h" int iniPropertyValue( char *pszString, char *pszProperty, char *pszValue, char cEqual, char cPropertySep ) { char szBuffer[INI_MAX_LINE+1]; char szEqual[2]; char szPropertySep[2]; char *pProperty; char *pValue; char *pValueLastChar; szEqual[0] = cEqual; szEqual[1] = '\0'; szPropertySep[0] = cPropertySep; szPropertySep[1] = '\0'; strcpy( pszValue, "" ); strncpy( szBuffer, pszString, INI_MAX_LINE ); /* find pszProperty */ while ( 1 ) { pProperty = (char *)strtok( szBuffer, (const char *)szPropertySep ); if ( pProperty == NULL ) break; else { /* extract pszValue */ if ( strncmp( pProperty, pszProperty, strlen(pszProperty) ) == 0 ) { pValue = (char *)strtok( szBuffer, (const char *)szEqual ); if ( pValue ) { /* truncate any other data */ pValueLastChar = (char *)strchr( pValue, szPropertySep[ 0 ] ); if ( pValueLastChar ) pValueLastChar[0] = '\0'; strncpy( pszValue, pValue, INI_MAX_PROPERTY_VALUE ); iniAllTrim( pszValue ); } break; } } } return INI_SUCCESS; } unixODBC-2.3.9/ini/iniObjectUpdate.c0000755000175000017500000000136612262474470014076 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniObjectUpdate( HINI hIni, char *pszObject ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_ERROR; /* Ok */ strncpy( hIni->hCurObject->szName, pszObject, INI_MAX_OBJECT_NAME ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniObject.c0000755000175000017500000000147212262474470012731 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" /****************************** * iniObject * ******************************/ int iniObject( HINI hIni, char *pszObject ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_NO_DATA; /* Ok */ strncpy( pszObject, hIni->hCurObject->szName, INI_MAX_OBJECT_NAME ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniValue.c0000755000175000017500000000155312262474470012577 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" /****************************** * iniValue * ******************************/ int iniValue( HINI hIni, char *pszValue ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_NO_DATA; if ( hIni->hCurProperty == NULL ) return INI_NO_DATA; strncpy( pszValue, hIni->hCurProperty->szValue, INI_MAX_PROPERTY_VALUE ); return INI_SUCCESS; } unixODBC-2.3.9/ini/Makefile.in0000664000175000017500000005572213725127175012734 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = ini ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libinilc_la_DEPENDENCIES = ../extras/libodbcextraslc.la am_libinilc_la_OBJECTS = iniAllTrim.lo iniAppend.lo iniDelete.lo \ iniClose.lo iniCommit.lo iniObject.lo iniObjectFirst.lo \ iniObjectLast.lo iniObjectNext.lo iniObjectSeek.lo \ iniObjectSeekSure.lo iniObjectUpdate.lo iniObjectInsert.lo \ iniObjectDelete.lo iniObjectEOL.lo iniOpen.lo iniProperty.lo \ iniPropertyFirst.lo iniPropertyLast.lo iniPropertyNext.lo \ iniPropertySeek.lo iniPropertySeekSure.lo iniPropertyUpdate.lo \ iniPropertyInsert.lo iniPropertyDelete.lo iniPropertyEOL.lo \ iniPropertyValue.lo iniValue.lo iniToUpper.lo iniElement.lo \ iniElementCount.lo iniGetBookmark.lo iniGotoBookmark.lo \ iniCursor.lo _iniObjectRead.lo _iniPropertyRead.lo _iniDump.lo \ _iniScanUntilObject.lo libinilc_la_OBJECTS = $(am_libinilc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libinilc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libinilc_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinilc_la_SOURCES) DIST_SOURCES = $(libinilc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libinilc.la AM_CPPFLAGS = -I@top_srcdir@/include libinilc_la_LDFLAGS = -no-undefined libinilc_la_LIBADD = \ ../extras/libodbcextraslc.la libinilc_la_SOURCES = \ iniAllTrim.c \ iniAppend.c \ iniDelete.c \ iniClose.c \ iniCommit.c \ iniObject.c \ iniObjectFirst.c \ iniObjectLast.c \ iniObjectNext.c \ iniObjectSeek.c \ iniObjectSeekSure.c \ iniObjectUpdate.c \ iniObjectInsert.c \ iniObjectDelete.c \ iniObjectEOL.c \ iniOpen.c \ iniProperty.c \ iniPropertyFirst.c \ iniPropertyLast.c \ iniPropertyNext.c \ iniPropertySeek.c \ iniPropertySeekSure.c \ iniPropertyUpdate.c \ iniPropertyInsert.c \ iniPropertyDelete.c \ iniPropertyEOL.c \ iniPropertyValue.c \ iniValue.c \ iniToUpper.c \ iniElement.c \ iniElementCount.c \ iniGetBookmark.c \ iniGotoBookmark.c \ iniCursor.c \ _iniObjectRead.c \ _iniPropertyRead.c \ _iniDump.c \ _iniScanUntilObject.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ini/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu ini/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinilc.la: $(libinilc_la_OBJECTS) $(libinilc_la_DEPENDENCIES) $(EXTRA_libinilc_la_DEPENDENCIES) $(AM_V_CCLD)$(libinilc_la_LINK) $(libinilc_la_OBJECTS) $(libinilc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_iniDump.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_iniObjectRead.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_iniPropertyRead.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_iniScanUntilObject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniAllTrim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniAppend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniClose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniCommit.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniCursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniDelete.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniElement.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniElementCount.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniGetBookmark.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniGotoBookmark.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectDelete.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectEOL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectFirst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectInsert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectLast.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectNext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectSeek.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectSeekSure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniObjectUpdate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniOpen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniProperty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertyDelete.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertyEOL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertyFirst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertyInsert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertyLast.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertyNext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertySeek.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertySeekSure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertyUpdate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniPropertyValue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniToUpper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iniValue.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/ini/iniPropertyLast.c0000755000175000017500000000140712262474470014171 00000000000000/********************************************************************************** * iniPropertyLast * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniPropertyLast( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_NO_DATA; hIni->hCurProperty = hIni->hCurObject->hLastProperty; if ( hIni->hCurProperty == NULL ) return INI_NO_DATA; return INI_SUCCESS; } unixODBC-2.3.9/ini/iniProperty.c0000755000175000017500000000145612262474470013351 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniProperty( HINI hIni, char *pszProperty ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_NO_DATA; if ( hIni->hCurProperty == NULL ) return INI_NO_DATA; /* Ok */ strncpy( pszProperty, hIni->hCurProperty->szName, INI_MAX_PROPERTY_NAME ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniPropertyFirst.c0000755000175000017500000000137312262474470014357 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" int iniPropertyFirst( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_NO_DATA; hIni->hCurProperty = hIni->hCurObject->hFirstProperty; if ( hIni->hCurProperty == NULL ) return INI_NO_DATA; return INI_SUCCESS; } unixODBC-2.3.9/ini/iniGetBookmark.c0000755000175000017500000000150612262474470013726 00000000000000/********************************************************************************** * iniGetBookmark * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * PAH = Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 18.MAR.99 Created. **************************************************/ #include #include "ini.h" int iniGetBookmark( HINI hIni, HINIBOOKMARK hIniBookmark ) { if ( hIni == NULL || hIniBookmark == NULL ) return INI_ERROR; hIniBookmark->hIni = hIni; hIniBookmark->hCurObject = hIni->hCurObject; hIniBookmark->hCurProperty = hIni->hCurProperty; return INI_SUCCESS; } unixODBC-2.3.9/ini/Makefile.am0000755000175000017500000000162312262755716012716 00000000000000noinst_LTLIBRARIES = libinilc.la AM_CPPFLAGS = -I@top_srcdir@/include libinilc_la_LDFLAGS = -no-undefined libinilc_la_LIBADD = \ ../extras/libodbcextraslc.la libinilc_la_SOURCES = \ iniAllTrim.c \ iniAppend.c \ iniDelete.c \ iniClose.c \ iniCommit.c \ iniObject.c \ iniObjectFirst.c \ iniObjectLast.c \ iniObjectNext.c \ iniObjectSeek.c \ iniObjectSeekSure.c \ iniObjectUpdate.c \ iniObjectInsert.c \ iniObjectDelete.c \ iniObjectEOL.c \ iniOpen.c \ iniProperty.c \ iniPropertyFirst.c \ iniPropertyLast.c \ iniPropertyNext.c \ iniPropertySeek.c \ iniPropertySeekSure.c \ iniPropertyUpdate.c \ iniPropertyInsert.c \ iniPropertyDelete.c \ iniPropertyEOL.c \ iniPropertyValue.c \ iniValue.c \ iniToUpper.c \ iniElement.c \ iniElementCount.c \ iniGetBookmark.c \ iniGotoBookmark.c \ iniCursor.c \ _iniObjectRead.c \ _iniPropertyRead.c \ _iniDump.c \ _iniScanUntilObject.c unixODBC-2.3.9/ini/iniObjectSeekSure.c0000755000175000017500000000154512262474470014401 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 06.MAR.99 Added this func **************************************************/ #include #include "ini.h" int iniObjectSeekSure( HINI hIni, char *pszObject ) { int nReturn; /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( !pszObject ) return INI_ERROR; if ( (nReturn = iniObjectSeek( hIni, pszObject )) == INI_NO_DATA ) return iniObjectInsert( hIni, pszObject ); return nReturn; } unixODBC-2.3.9/ini/iniPropertyDelete.c0000755000175000017500000000260712262474470014473 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "ini.h" /****************************** * iniPropertyDelete * ******************************/ int iniPropertyDelete( HINI hIni ) { HINIPROPERTY hProperty; HINIOBJECT hObject; /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; if ( hIni->hCurObject == NULL ) return INI_ERROR; if ( hIni->hCurProperty == NULL ) return INI_NO_DATA; hObject = hIni->hCurObject; hProperty = hIni->hCurProperty; if ( hObject->hFirstProperty == hProperty ) hObject->hFirstProperty = hProperty->pNext; if ( hObject->hLastProperty == hProperty ) hObject->hLastProperty = hProperty->pPrev; hIni->hCurProperty = NULL; if ( hProperty->pNext ) { hProperty->pNext->pPrev = hProperty->pPrev; hIni->hCurProperty = hProperty->pNext; } if ( hProperty->pPrev ) { hProperty->pPrev->pNext = hProperty->pNext; hIni->hCurProperty = hProperty->pPrev; } hObject->nProperties--; /* FREE MEMORY */ free( hProperty ); return INI_SUCCESS; } unixODBC-2.3.9/ini/iniObjectFirst.c0000755000175000017500000000151212262474470013734 00000000000000/********************************************************************************** * . * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * PAH = Peter Harvey - pharvey@codebydesign.com * ----------------------------------------------- * * PAH 19.MAR.99 Now sets hCurProperty to hFirstProperty when found **************************************************/ #include #include "ini.h" int iniObjectFirst( HINI hIni ) { /* SANITY CHECKS */ if ( hIni == NULL ) return INI_ERROR; hIni->hCurObject = hIni->hFirstObject; iniPropertyFirst( hIni ); if ( hIni->hCurObject == NULL ) return INI_NO_DATA; return INI_SUCCESS; } unixODBC-2.3.9/README.VMS0000755000175000017500000001217712262474476011436 00000000000000Building unixODBC on OpenVMS (non-VAX only) ========================================= Here's an initial go at building unixODBC on OpenVMS, at present this will only run on alpha and itanium, but if anyone requires use of this on VAX drop me an email (suypport@easysoft.com) and I'll do the necessary transfer vector macro's to export the required symbols from the two shared objects (ODBC.EXE and ODBCINST.EXE). Current components which have been built on OpenVMS LIBODBC.OLB Driver manager as an OpenVMS static object library LIBODBCINST.OLB ODBC installer / setup static object library LIBODBCPSQL.OLB Postgres 6.5 driver static object library LIBODBC.EXE Driver manager shareable image LIBODBCINST.EXE ODBC installer / setup shareable image LIBODBCPSQL.EXE Postgres 6.5 driver shareable image ISQL.EXE Command line SQL tool DLTEST.EXE Program to test loading shared libraries Additional components included to perform building on OpenVMS VMSBUILD.COM - DCL script which compiles, links and installs unixODBC [.EXTRAS]VMS.C - Contains OpenVMS specific wrappers (dlopen, etc..) [.VMS]INSTALL_IMAGE.COM - DCL script to install shareable images [.VMS]ODBCINST_AXP.OPT - Linker options file for ODBC installer shared image [.VMS]ODBC_AXP.OPT - Linker options file for Driver manager shared image [.VMS]ODBC2_AXP.OPT - Linker options file for ODBC 2 drivers [.VMS]ODBC_SETUP.COM - DCL script to set up logicals and commands Building unixODBC on OpenVMS ============================ After unpacking the archive, change into the unixodbc directory and perform the following functions. COMPILING $ @vmsbuild COMPILE LINKING $ @vmsbuild LINK COPYING SHARED LIBRARIES TO THEIR INSTALLED LOCATION Define the logical name ODBC_LIBDIR to point to wherever you would like the libraries to reside and run the build procedure again with the "install" option as in the following example: $ define ODBC_LIBDIR DISK$DBSTUFF:[ODBCLIB] ! will be created if it doesn't exist $ @vmsbuild install If the ODBC_LIBDIR logical is not defined, it will be defined for you and a [.odbclib] directory will be created under the top level of the source directory. Note that the build procedure can be run in batch if you prefer. It is also possible to specify ALL as the parameter and do the compile, link, and install in one fell swoop. For example: $ submit/noprint/param=all vmsbuild.com Post-installation tasks ====================================== To use the installed software, you need to run the command procedure ODBC_SETUP.COM, which will have been installed in the same directory as the libraries. This procedure defines the ODBC_LIBDIR logical name and additional logical names that are needed for the image activator to locate the libraries. It also defines the ISQL command. Put a line similar to the following (with your own disk and directory specification) in your LOGIN.COM, or (to make the software available system-wide) in SYS$MANAGER:SYLOGIN.COM: $ @disk$dbstuff:[odbclib]odbc_setup N.B. It may be tempting to simply dump the libraries into SYS$SHARE and depend on the image activator's default behavior to locate the images. That works, but it's the surest way to what is known on another popular platform as DLL hell. If you'll be programming with ODBC rather than just using ISQL, be sure to hang on to the contents of the [.include] and [.doc] directories. Look at the compiler flags and link commands in vmsbuild.com for examples of what you need to do to build programs using the libraries. For performance reasons it may be desireable to install the libraries as known images (which has nothing to do with "install" in the sense of copying software to its target location). See the documentation to the INSTALL command or use the command procedure [.vms]install_image.com provided with this kit. Installing the images with privileges is not recommended unless there is a compelling reason (Hint: failure to set up file permissions properly on your .ini files is not a compelling reason). Locations of ODBC.INI and ODBCINST.INI ====================================== After running the @VMSBUILD INSTALL command a blank odbc.ini and odbcinst.ini will be created in ODBC_LIBDIR. To override the default locations of the user odbc.ini or the directory where the system odbc.ini and odbcinst.ini reside define the following logicals. $ define/log ODBCINI "DKA100:[MYDIR.ODBC]ODBC.INI" $ define/log ODBCSYSINI "DKA100:[MYDIR.SYS]" Example Setup With Postgres 6.5 =============================== ODBC_LIBDIR:ODBCINST.INI [PostgreSQL] Description = Postgres SQL Driver Driver = LIBODBCPSQL Setup = FileUsage = 1 ODBC_LIBDIR:ODBC.INI [Postgres] Description = Test to Postgres Driver = PostgreSQL Trace = No Database = sample Servername = myserver.mydomain.com UserName = postgres Password = password Port = 5432 Protocol = 6.4 ReadOnly = No RowVersioning = No ShowSystemTables = No ShowOidColumn = No FakeOidIndex = No ConnSettings = Jason last updated 12-Jul-2013 by Craig A. Berry -- craigberry@mac.com unixODBC-2.3.9/mkinstalldirs0000755000175000017500000000133512262474476012707 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.2 2001/10/27 16:35:18 peteralexharvey Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here unixODBC-2.3.9/config.guess0000755000175000017500000012367213725127167012427 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # This file 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: unixODBC-2.3.9/acinclude.m40000755000175000017500000006165212262763025012274 00000000000000## -*- autoconf -*- dnl unixODBC dnl dnl This file has been customized for unixODBC. dnl dnl AC_CHECK_LIBPT_NOC(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, OTHER-LIBRARIES]]]) AC_DEFUN([AC_CHECK_LIBPT_NOC], [AC_MSG_CHECKING([for $2 in -l$1]) dnl Use a cache variable name containing both the library and function name, dnl because the test really is for library $1 defining function $2, not dnl just for library $1. Separate tests with the same $1 and different $2s dnl may have different results. ac_save_LIBS="$LIBS" LIBS="-l$1 $5 $LIBS" AC_TRY_LINK(dnl [ #ifdef __cplusplus extern "C" #endif #include ], [$2(0)], eval "ac_cv_lib_$ac_lib_var=yes", eval "ac_cv_lib_$ac_lib_var=no") LIBS="$ac_save_LIBS" dnl if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$3], , [changequote(, )dnl ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_lib) LIBS="-l$1 $LIBS" ], [$3]) else AC_MSG_RESULT(no) ifelse([$4], , , [$4 ])dnl fi ]) dnl Check if the compiler works with a given command line option dnl AC_CHECK_COMP_OPT(OPTION) AC_DEFUN([AC_CHECK_COMP_OPT], [AC_MSG_CHECKING([if compiler accepts -$1]) echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then AC_MSG_RESULT(yes) CFLAGS="$CFLAGS -$1" else AC_MSG_RESULT(no) fi rm -f conftest* ]) dnl Check for a lib, without checking the cache first dnl AC_CHECK_LIB_NOC(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, OTHER-LIBRARIES]]]) AC_DEFUN([AC_CHECK_LIB_NOC], [AC_MSG_CHECKING([for $2 in -l$1 $5]) ac_save_LIBS="$LIBS" LIBS="-l$1 $5 $LIBS" AC_TRY_LINK(dnl [/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $2(); ], [$2()], eval "ac_cv_lib_$ac_lib_var=yes", eval "ac_cv_lib_$ac_lib_var=no") LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then AC_MSG_RESULT(yes) ifelse([$3], , [changequote(, )dnl ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` changequote([, ])dnl AC_DEFINE_UNQUOTED($ac_tr_lib) LIBS="-l$1 $LIBS" ], [$3]) else AC_MSG_RESULT(no) ifelse([$4], , , [$4 ])dnl fi ]) dnl ## dnl ## GNU Pth - The GNU Portable Threads dnl ## Copyright (c) 1999-2000 Ralf S. Engelschall dnl ## dnl ## This file is part of GNU Pth, a non-preemptive thread scheduling dnl ## library which can be found at http://www.gnu.org/software/pth/. dnl ## dnl ## This library is free software; you can redistribute it and/or dnl ## modify it under the terms of the GNU Lesser General Public dnl ## License as published by the Free Software Foundation; either dnl ## version 2.1 of the License, or (at your option) any later version. dnl ## dnl ## This library is distributed in the hope that it will be useful, dnl ## but WITHOUT ANY WARRANTY; without even the implied warranty of dnl ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl ## Lesser General Public License for more details. dnl ## dnl ## You should have received a copy of the GNU Lesser General Public dnl ## License along with this library; if not, write to the Free Software dnl ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 dnl ## USA, or contact Ralf S. Engelschall . dnl ## dnl ## pth.m4: Autoconf macro for locating GNU Pth from within dnl ## configure.in of third-party software packages dnl ## dnl ## dnl ## Synopsis: dnl ## AC_CHECK_PTH([MIN-VERSION [, # minimum Pth version, e.g. 1.2b3 dnl ## DEFAULT-WITH-PTH [, # default value for --with-pth option dnl ## DEFAULT-WITH-PTH-TEST [,# default value for --with-pth-test option dnl ## EXTEND-VARS [, # whether CFLAGS/LDFLAGS/etc are extended dnl ## ACTION-IF-FOUND [, # action to perform if Pth was found dnl ## ACTION-IF-NOT-FOUND # action to perform if Pth was not found dnl ## ]]]]]]) dnl ## Examples: dnl ## AC_CHECK_PTH(1.2.0) dnl ## AC_CHECK_PTH(1.2.0,,,no,CFLAGS="$CFLAGS -DHAVE_PTH $PTH_CFLAGS") dnl ## AC_CHECK_PTH(1.2.0,yes,yes,yes,CFLAGS="$CFLAGS -DHAVE_PTH") dnl ## dnl dnl # auxilliary macros AC_DEFUN([_AC_PTH_ERROR], [dnl AC_MSG_RESULT([*FAILED*]) echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 $1 EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 ]) AC_DEFUN([_AC_PTH_VERBOSE], [dnl if test ".$verbose" = .yes; then AC_MSG_RESULT([ $1]) fi ]) dnl # the user macro AC_DEFUN([AC_CHECK_PTH], [dnl dnl dnl # prerequisites AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CPP])dnl dnl PTH_CPPFLAGS='' PTH_CFLAGS='' PTH_LDFLAGS='' PTH_LIBS='' AC_SUBST(PTH_CPPFLAGS) AC_SUBST(PTH_CFLAGS) AC_SUBST(PTH_LDFLAGS) AC_SUBST(PTH_LIBS) dnl # command line options AC_MSG_CHECKING(for GNU Pth) _AC_PTH_VERBOSE([]) AC_ARG_WITH(pth,dnl [ --with-pth[=ARG] Build with GNU Pth Library (default=]ifelse([$2],,yes,$2)[)],dnl ,dnl with_pth="ifelse([$2],,yes,$2)" )dnl AC_ARG_WITH(pth-test,dnl [ --with-pth-test Perform GNU Pth Sanity Test (default=]ifelse([$3],,yes,$3)[)],dnl ,dnl with_pth_test="ifelse([$3],,yes,$3)" )dnl _AC_PTH_VERBOSE([+ Command Line Options:]) _AC_PTH_VERBOSE([ o --with-pth=$with_pth]) _AC_PTH_VERBOSE([ o --with-pth-test=$with_pth_test]) dnl dnl # configuration if test ".$with_pth" != .no; then _pth_subdir=no _pth_subdir_opts='' case "$with_pth" in subdir:* ) _pth_subdir=yes changequote(, )dnl _pth_subdir_opts=`echo $with_pth | sed -e 's/^subdir:[^ ]*[ ]*//'` with_pth=`echo $with_pth | sed -e 's/^subdir:\([^ ]*\).*$/\1/'` changequote([, ])dnl ;; esac _pth_version="" _pth_location="" _pth_type="" _pth_cppflags="" _pth_cflags="" _pth_ldflags="" _pth_libs="" if test ".$with_pth" = .yes; then # via config script in $PATH changequote(, )dnl _pth_version=`(pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` changequote([, ])dnl if test ".$_pth_version" != .; then _pth_location=`pth-config --prefix` _pth_type='installed' _pth_cppflags=`pth-config --cflags` _pth_cflags=`pth-config --cflags` _pth_ldflags=`pth-config --ldflags` _pth_libs=`pth-config --libs` fi elif test -d "$with_pth"; then with_pth=`echo $with_pth | sed -e 's;/*$;;'` _pth_found=no # via locally included source tree if test ".$_pth_subdir" = .yes; then _pth_location="$with_pth" _pth_type='local' _pth_cppflags="-I$with_pth" _pth_cflags="-I$with_pth" if test -f "$with_pth/ltconfig"; then _pth_ldflags="-L$with_pth/.libs" else _pth_ldflags="-L$with_pth" fi _pth_libs="-lpth" changequote(, )dnl _pth_version=`grep '^const char PTH_Hello' $with_pth/pth_vers.c |\ sed -e 's;^.*Version[ ]*\([0-9]*\.[0-9]*[.ab][0-9]*\)[ ].*$;\1;'` changequote([, ])dnl _pth_found=yes ac_configure_args="$ac_configure_args --enable-subdir $_pth_subdir_opts" with_pth_test=no fi # via config script under a specified directory # (a standard installation, but not a source tree) if test ".$_pth_found" = .no; then for _dir in $with_pth/bin $with_pth; do if test -f "$_dir/pth-config"; then test -f "$_dir/pth-config.in" && continue # pth-config in source tree! changequote(, )dnl _pth_version=`($_dir/pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` changequote([, ])dnl if test ".$_pth_version" != .; then _pth_location=`$_dir/pth-config --prefix` _pth_type="installed" _pth_cppflags=`$_dir/pth-config --cflags` _pth_cflags=`$_dir/pth-config --cflags` _pth_ldflags=`$_dir/pth-config --ldflags` _pth_libs=`$_dir/pth-config --libs` _pth_found=yes break fi fi done fi # in any subarea under a specified directory # (either a special installation or a Pth source tree) if test ".$_pth_found" = .no; then changequote(, )dnl _pth_found=0 for _file in x `find $with_pth -name "pth.h" -type f -print`; do test .$_file = .x && continue _dir=`echo $_file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` _pth_version=`($_dir/pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` if test ".$_pth_version" = .; then _pth_version=`grep '^#define PTH_VERSION_STR' $_file |\ sed -e 's;^#define[ ]*PTH_VERSION_STR[ ]*"\([0-9]*\.[0-9]*[.ab][0-9]*\)[ ].*$;\1;'` fi _pth_cppflags="-I$_dir" _pth_cflags="-I$_dir" _pth_found=`expr $_pth_found + 1` done for _file in x `find $with_pth -name "libpth.[aso]" -type f -print`; do test .$_file = .x && continue _dir=`echo $_file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` _pth_ldflags="-L$_dir" _pth_libs="-lpth" _pth_found=`expr $_pth_found + 1` done changequote([, ])dnl if test ".$_pth_found" = .2; then _pth_location="$with_pth" _pth_type="uninstalled" else _pth_version='' fi fi fi _AC_PTH_VERBOSE([+ Determined Location:]) _AC_PTH_VERBOSE([ o path: $_pth_location]) _AC_PTH_VERBOSE([ o type: $_pth_type]) if test ".$_pth_version" = .; then if test ".$with_pth" != .yes; then _AC_PTH_ERROR([dnl Unable to locate GNU Pth under $with_pth. Please specify the correct path to either a GNU Pth installation tree (use --with-pth=DIR if you used --prefix=DIR for installing GNU Pth in the past) or to a GNU Pth source tree (use --with-pth=DIR if DIR is a path to a pth-X.Y.Z/ directory; but make sure the package is already built, i.e., the "configure; make" step was already performed there).]) else _AC_PTH_ERROR([dnl Unable to locate GNU Pth in any system-wide location (see \$PATH). Please specify the correct path to either a GNU Pth installation tree (use --with-pth=DIR if you used --prefix=DIR for installing GNU Pth in the past) or to a GNU Pth source tree (use --with-pth=DIR if DIR is a path to a pth-X.Y.Z/ directory; but make sure the package is already built, i.e., the "configure; make" step was already performed there).]) fi fi dnl # dnl # Check whether the found version is sufficiently new dnl # _req_version="ifelse([$1],,1.0.0,$1)" for _var in _pth_version _req_version; do eval "_val=\"\$${_var}\"" _major=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\1/'` _minor=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\2/'` _rtype=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\3/'` _micro=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\4/'` case $_rtype in "a" ) _rtype=0 ;; "b" ) _rtype=1 ;; "." ) _rtype=2 ;; esac _hex=`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, rtype, micro); }' \ "major=$_major" "minor=$_minor" "rtype=$_rtype" "micro=$_micro"` eval "${_var}_hex=\"\$_hex\"" done _AC_PTH_VERBOSE([+ Determined Versions:]) _AC_PTH_VERBOSE([ o existing: $_pth_version -> 0x$_pth_version_hex]) _AC_PTH_VERBOSE([ o required: $_req_version -> 0x$_req_version_hex]) _ok=0 if test ".$_pth_version_hex" != .; then if test ".$_req_version_hex" != .; then if test $_pth_version_hex -ge $_req_version_hex; then _ok=1 fi fi fi if test ".$_ok" = .0; then _AC_PTH_ERROR([dnl Found Pth version $_pth_version, but required at least version $_req_version. Upgrade Pth under $_pth_location to $_req_version or higher first, please.]) fi dnl # dnl # Perform Pth Sanity Compile Check dnl # if test ".$with_pth_test" = .yes; then _ac_save_CPPFLAGS="$CPPFLAGS" _ac_save_CFLAGS="$CFLAGS" _ac_save_LDFLAGS="$LDFLAGS" _ac_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $_pth_cppflags" CFLAGS="$CFLAGS $_pth_cflags" LDFLAGS="$LDFLAGS $_pth_ldflags" LIBS="$LIBS $_pth_libs" _AC_PTH_VERBOSE([+ Test Build Environment:]) _AC_PTH_VERBOSE([ o CPPFLAGS=\"$CPPFLAGS\"]) _AC_PTH_VERBOSE([ o CFLAGS=\"$CFLAGS\"]) _AC_PTH_VERBOSE([ o LDFLAGS=\"$LDFLAGS\"]) _AC_PTH_VERBOSE([ o LIBS=\"$LIBS\"]) cross_compile=no define(_code1, [dnl #include #include ]) define(_code2, [dnl int main(int argc, char *argv[]) { FILE *fp; if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "hmm"); fclose(fp); pth_init(); pth_kill(); if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "yes"); fclose(fp); exit(0); } ]) _AC_PTH_VERBOSE([+ Performing Sanity Checks:]) _AC_PTH_VERBOSE([ o pre-processor test]) AC_TRY_CPP(_code1, _ok=yes, _ok=no) if test ".$_ok" != .yes; then _AC_PTH_ERROR([dnl Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity pre-processor check. This means the GNU Pth header pth.h was not found. We used the following build environment: >> CPP="$CPP" >> CPPFLAGS="$CPPFLAGS" See config.log for possibly more details.]) fi _AC_PTH_VERBOSE([ o link check]) AC_TRY_LINK(_code1, _code2, _ok=yes, _ok=no) if test ".$_ok" != .yes; then _AC_PTH_ERROR([dnl Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity linker check. This means the GNU Pth library libpth.a was not found. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details.]) fi _AC_PTH_VERBOSE([ o run-time check]) AC_TRY_RUN(_code1 _code2, _ok=`cat conftestval`, _ok=no, _ok=no) if test ".$_ok" != .yes; then if test ".$_ok" = .no; then _AC_PTH_ERROR([dnl Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity execution check. This usually means that the GNU Pth shared library libpth.so is present but \$LD_LIBRARY_PATH is incomplete to execute a Pth test. In this case either disable this test via --without-pth-test, or extend \$LD_LIBRARY_PATH, or build GNU Pth as a static library only via its --disable-shared Autoconf option. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details.]) else _AC_PTH_ERROR([dnl Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity run-time check. This usually means that the GNU Pth library failed to work and possibly caused a core dump in the test program. In this case it is strongly recommended that you re-install GNU Pth and this time make sure that it really passes its "make test" procedure. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details.]) fi fi _extendvars="ifelse([$4],,yes,$4)" if test ".$_extendvars" != .yes; then CPPFLAGS="$_ac_save_CPPFLAGS" CFLAGS="$_ac_save_CFLAGS" LDFLAGS="$_ac_save_LDFLAGS" LIBS="$_ac_save_LIBS" fi else _extendvars="ifelse([$4],,yes,$4)" if test ".$_extendvars" = .yes; then if test ".$_pth_subdir" = .yes; then CPPFLAGS="$CPPFLAGS $_pth_cppflags" CFLAGS="$CFLAGS $_pth_cflags" LDFLAGS="$LDFLAGS $_pth_ldflags" LIBS="$LIBS $_pth_libs" fi fi fi PTH_CPPFLAGS="$_pth_cppflags" PTH_CFLAGS="$_pth_cflags" PTH_LDFLAGS="$_pth_ldflags" PTH_LIBS="$_pth_libs" AC_SUBST(PTH_CPPFLAGS) AC_SUBST(PTH_CFLAGS) AC_SUBST(PTH_LDFLAGS) AC_SUBST(PTH_LIBS) _AC_PTH_VERBOSE([+ Final Results:]) _AC_PTH_VERBOSE([ o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"]) _AC_PTH_VERBOSE([ o PTH_CFLAGS=\"$PTH_CFLAGS\"]) _AC_PTH_VERBOSE([ o PTH_LDFLAGS=\"$PTH_LDFLAGS\"]) _AC_PTH_VERBOSE([ o PTH_LIBS=\"$PTH_LIBS\"]) fi if test ".$with_pth" != .no; then AC_MSG_RESULT([version $_pth_version, $_pth_type under $_pth_location]) ifelse([$5], , :, [$5]) else AC_MSG_RESULT([no]) ifelse([$6], , :, [$6]) fi ]) # AC_CHECK_LONG_LONG #------------------- AC_DEFUN([AC_CHECK_LONG_LONG], [ AC_MSG_CHECKING(for long long) AC_CACHE_VAL(ac_cv_type_long_long, [ AC_TRY_COMPILE([ #include ], [ long long x; ], ac_cv_type_long_long=yes, ac_cv_type_long_long=no) ]) AC_MSG_RESULT($ac_cv_type_long_long) if eval "test \"`echo $ac_cv_type_long_long`\" = yes"; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long]) fi ])# AC_CHECK_LONG_LONG dnl From Bruno Haible. AC_DEFUN([AM_ICONV], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_ARG_WITH([libiconv-prefix], [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done ]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi LIBICONV= if test "$am_cv_lib_iconv" = yes; then LIBICONV="-liconv" fi AC_SUBST(LIBICONV) ]) # AC_LIBLTDL_CONVENIENCE_G([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE_G], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience CFLAGS=-DWITHOUT_RTLD_GROUP" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE AC_DEFUN([AC_CHECK_SEMUNDOO], [ AC_LANG_C AC_MSG_CHECKING([for semundo union]) AC_CACHE_VAL(ac_cv_semundo_union, [ AC_TRY_LINK([ #include #include #include ], [ union semun semctl_arg; ], ac_cv_semundo_union=no, ac_cv_semundo_union=yes) ]) AC_MSG_RESULT($ac_cv_semundo_union) if eval "test \"`echo $ac_cv_semundo_union`\" = yes"; then AC_DEFINE(NEED_SEMUNDO_UNION, 1, [Define if you need semundo union]) fi ]) # =========================================================================== # http://autoconf-archive.cryp.to/ac_define_dir.html # =========================================================================== # # SYNOPSIS # # AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) # # DESCRIPTION # # This macro sets VARNAME to the expansion of the DIR variable, taking # care of fixing up ${prefix} and such. # # VARNAME is then offered as both an output variable and a C preprocessor # symbol. # # Example: # # AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) # # LAST MODIFICATION # # 2008-04-12 # # COPYLEFT # # Copyright (c) 2008 Stepan Kasal # Copyright (c) 2008 Andreas Schwab # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2008 Alexandre Oliva # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AC_DEFUN([AC_DEFINE_DIR], [ prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn dnl refers to ${prefix}. Thus we have to use `eval' twice. eval ac_define_dir="\"[$]$2\"" eval ac_define_dir="\"$ac_define_dir\"" AC_SUBST($1, "$ac_define_dir") AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE ]) dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) unixODBC-2.3.9/log/0000775000175000017500000000000013725127520010730 500000000000000unixODBC-2.3.9/log/logClear.c0000755000175000017500000000137112262474476012561 00000000000000#include #include "log.h" /*! * \brief Clear all log messages. * * \param hLog * * \return int * \retval LOG_ERROR * \retval LOG_SUCCESS * * \sa logOpen * logClose */ int logClear( HLOG hLog ) { /* we have to be logOpen to logClear messages */ if ( !hLog ) return LOG_ERROR; /* We rely upon a callback being set to handle clearing mem used by each msg. This should be set in logOpen but just in case - we check it here. */ if ( !hLog->hMessages->pFree ) return LOG_ERROR; /* go to last message and delete until no more messages */ lstLast( hLog->hMessages ); while ( !lstEOL( hLog->hMessages ) ) { lstDelete( hLog->hMessages ); } return LOG_SUCCESS; } unixODBC-2.3.9/log/logClose.c0000755000175000017500000000254012262474476012577 00000000000000/********************************************************************** * logClose * * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "log.h" /*! * \brief Closes log. * * This will clear all messages and close the log. All memory used * by the messages is automatically freed by calls to _logFreeMsg. * All remaining mem used by the log is also freed - including the * log handle itself. * * \param hLog A log handle init by \sa logOpen. * * \return int * \retval LOG_SUCCESS * * \sa logOpen */ int logClose( HLOG hLog ) { /* we must be logOpen to logClose */ if ( !hLog ) return LOG_ERROR; /* clear all messages - including the handle */ /* _logFreeMsg will automatically be called for each msg */ lstClose( hLog->hMessages ); /* free remaining mem used by log - including the handle */ if ( hLog->pszProgramName ) free( hLog->pszProgramName ); if ( hLog->pszLogFile ) free( hLog->pszLogFile ); free( hLog ); return LOG_SUCCESS; } unixODBC-2.3.9/log/logPopMsg.c0000755000175000017500000000235512262474476012743 00000000000000/********************************************************************** * logPopMsg * * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "log.h" /*! * \brief Removes the oldest message from the log. * * The log is a FIFO stack and we implement a possible max on the * number of messages we can store. When we hot the max we 'pop' * a message out. The mem used by the message is automatically * freed with a call to \sa _logFreeMsg. * * \param hLog * * \return int * \retval LOG_NO_DATA * \retval LOG_ERROR * \retval LOG_SUCCESS * * \sa logPushMsg * logPeekMsg */ int logPopMsg( HLOG hLog ) { /* we must be logOpen to logPopMsg */ if ( !hLog ) return LOG_ERROR; /* FIFO */ lstFirst( hLog->hMessages ); /* do we have a message to delete? */ if ( lstEOL( hLog->hMessages ) ) return LOG_NO_DATA; return lstDelete( hLog->hMessages ); } unixODBC-2.3.9/log/README0000755000175000017500000000212612262474476011544 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | LOG lib (liblog.so) | +-------------------------------------------------------------+ This library provides some usefull functions for managing log/debug messages. +-------------------------------------------------------------+ | Peter Harvey | | http://www.genix.net/unixODBC | | pharvey@codebydesign.com | | 10.APR.99 | +-------------------------------------------------------------+ unixODBC-2.3.9/log/logPushMsg.c0000755000175000017500000001371212262474476013123 00000000000000/********************************************************************** * logPushMsg * * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "log.h" #include "ini.h" /* Define this as a fall through, HAVE_STDARG_H is probably already set */ /*#define HAVE_VARARGS_H*/ /* varargs declarations: */ #if defined(HAVE_STDARG_H) # include #define VA_LOCAL_DECL va_list ap #define VA_START(f) va_start(ap, f) #define VA_SHIFT(v,t) ; /* no-op for ANSI */ #define VA_END va_end(ap) #else #if defined(HAVE_VARARGS_H) #define VA_LOCAL_DECL va_list ap #define VA_START(f) va_start(ap) /* f is ignored! */ #define VA_SHIFT(v,t) v = va_arg(ap,t) #define VA_END va_end(ap) #else #error No variable argument support #endif #endif #ifndef HAVE_VSNPRINTF int uodbc_vsnprintf (char *str, size_t count, const char *fmt, va_list args); #endif int logPushMsg( HLOG hLog, char *pszModule, char *pszFunctionName, int nLine, int nSeverity, int nCode, char *pszMessage ) { HLOGMSG hMsg; FILE *hFile; if ( !hLog ) return LOG_ERROR; if ( !hLog->hMessages ) return LOG_ERROR; if ( !hLog->bOn ) return LOG_SUCCESS; if ( !pszModule ) return LOG_ERROR; if ( !pszFunctionName ) return LOG_ERROR; if ( !pszMessage ) return LOG_ERROR; /* check for, and handle, max msg */ if ( hLog->nMaxMsgs && hLog->hMessages->nItems >= hLog->nMaxMsgs ) logPopMsg( hLog ); hMsg = malloc( sizeof(LOGMSG) ); if (!hMsg) goto error_abort0; hMsg->pszModuleName = (char *)strdup( pszModule ); if (!hMsg->pszModuleName) goto error_abort1; hMsg->pszFunctionName = (char *)strdup( pszFunctionName ); if (!hMsg->pszFunctionName) goto error_abort2; hMsg->pszMessage = (char *)strdup( pszMessage ); if (!hMsg->pszMessage) goto error_abort3; hMsg->nLine = nLine; hMsg->nSeverity = nSeverity; hMsg->nCode = nCode; /* append to list */ lstAppend( hLog->hMessages, hMsg ); /* append to file */ if ( hLog->pszLogFile ) { hFile = uo_fopen( hLog->pszLogFile, "a" ); if ( !hFile ) return LOG_ERROR; uo_fprintf( hFile, "[%s][%s][%s][%d]%s\n", hLog->pszProgramName, pszModule, pszFunctionName, nLine, pszMessage ); uo_fclose( hFile ); } return LOG_SUCCESS; error_abort3: free(hMsg->pszFunctionName); error_abort2: free(hMsg->pszModuleName); error_abort1: free(hMsg); error_abort0: return LOG_ERROR; } int logvPushMsgf( HLOG hLog, char *pszModule, char *pszFunctionName, int nLine, int nSeverity, int nCode, char *pszMessageFormat, va_list args ) { HLOGMSG hMsg=NULL; FILE *hFile; int mlen=0; if ( !hLog ) return LOG_ERROR; if ( !hLog->hMessages ) return LOG_ERROR; if ( !hLog->bOn ) return LOG_SUCCESS; if ( !pszModule ) return LOG_ERROR; if ( !pszFunctionName ) return LOG_ERROR; if ( !pszMessageFormat ) return LOG_ERROR; /* check for, and handle, max msg */ if ( hLog->nMaxMsgs && hLog->hMessages->nItems == hLog->nMaxMsgs ) logPopMsg( hLog ); hMsg = malloc( sizeof(LOGMSG) ); if (!hMsg) goto error_abort0; hMsg->pszModuleName = (char *)strdup( pszModule ); if (!hMsg->pszModuleName) goto error_abort1; hMsg->pszFunctionName = (char *)strdup( pszFunctionName ); if (!hMsg->pszFunctionName) goto error_abort2; #if defined( HAVE_VSNPRINTF ) mlen=vsnprintf(NULL,0,pszMessageFormat,args); #else mlen=uodbc_vsnprintf(NULL,0,pszMessageFormat,args); #endif mlen++; hMsg->pszMessage = malloc(mlen); if (!hMsg->pszMessage) goto error_abort3; #if defined( HAVE_VSNPRINTF ) vsnprintf(hMsg->pszMessage,mlen,pszMessageFormat,args); #else uodbc_vsnprintf(hMsg->pszMessage,mlen,pszMessageFormat,args); #endif hMsg->nLine = nLine; hMsg->nSeverity = nSeverity; hMsg->nCode = nCode; /* append to list */ lstAppend( hLog->hMessages, hMsg ); /* append to file */ if ( hLog->pszLogFile ) { hFile = uo_fopen( hLog->pszLogFile, "a" ); if ( !hFile ) return LOG_ERROR; if (hMsg) { uo_fprintf( hFile, "[%s][%s][%s][%d]%s\n", hLog->pszProgramName, pszModule, pszFunctionName, nLine, hMsg->pszMessage ); } else { uo_fprintf( hFile, "[%s][%s][%s][%d]", hLog->pszProgramName, pszModule, pszFunctionName, nLine ); uo_vfprintf( hFile, pszMessageFormat, args ); uo_fprintf( hFile, "\n" ); } uo_fclose( hFile ); } return LOG_SUCCESS; error_abort3: free(hMsg->pszFunctionName); error_abort2: free(hMsg->pszModuleName); error_abort1: free(hMsg); error_abort0: return LOG_ERROR; } #ifdef HAVE_STDARGS int logPushMsgf( HLOG hLog, char *pszModule, char *pszFunctionName, int nLine, int nSeverity, int nCode, char *pszMessageFormat, ... ) #else int logPushMsgf( va_alist ) va_dcl #endif { int err; #ifndef HAVE_STDARGS HLOG hLog; char *pszModule; char *pszFunctionName; int nLine; int nSeverity; int nCode; char *pszMessageFormat; #endif VA_LOCAL_DECL; VA_START (pszMessageFormat); VA_SHIFT (hLog, HLOG); VA_SHIFT (pszModule, char *); VA_SHIFT (pszFunctionName, char *); VA_SHIFT (nLine, int ); VA_SHIFT (nSeverity, int ); VA_SHIFT (nCode, int ); VA_SHIFT (pszMessageFormat, char *); err=logvPushMsgf(hLog,pszModule,pszFunctionName,nLine,nSeverity,nCode,pszMessageFormat,ap); VA_END; return err; } unixODBC-2.3.9/log/logPeekMsg.c0000755000175000017500000000336112262474476013067 00000000000000/********************************************************************** * logPopMsg * * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "log.h" /*! * \brief Returns a specific message. * * This returns a reference to a specific message and does * NOT delete the message or remove it from the log. This is * good for 'peeking' at messages in the stack. * * \param hLog Input. Viable log handle. * \param nMsg Input. This is the index to the desired message. The * index is 1 based with 1 being the oldest message. * \param phMsg Output. A reference to the message in the log. This * message is still maintained/owned by the log. The * reference is only valid until some other code modifies * the log. * * \return int * \retval LOG_NO_DATA No message at nMsg. * \retval LOG_ERROR * \retval LOG_SUCCESS * * \sa logPopMsg */ int logPeekMsg( HLOG hLog, long nMsg, HLOGMSG *phMsg ) { /* we must be logOpen to logPeekMsg */ if ( !hLog ) return LOG_ERROR; /* get reference */ /* \todo This can be terribly slow as we scan for each call. We may want to implement this over a vector instead of a list. */ *phMsg = (HLOGMSG)lstGoto( hLog->hMessages, nMsg - 1 ); /* was it found? */ if ( lstEOL( hLog->hMessages ) ) return LOG_NO_DATA; return LOG_SUCCESS; } unixODBC-2.3.9/log/_logFreeMsg.c0000755000175000017500000000202412262474476013216 00000000000000/********************************************************************** * _logFreeMsg * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "log.h" /*! * \brief Callback function to free mem used by a message. * * This function is set in logOpen and is automatically used * to free mem used by a message when the message is deleted. * * \param pMsg * * \sa logOpen */ void _logFreeMsg( void *pMsg ) { HLOGMSG hMsg = (HLOGMSG)pMsg; if ( !hMsg ) return; /* free msg memory */ if ( hMsg->pszModuleName != NULL ) free(hMsg->pszModuleName); if ( hMsg->pszFunctionName != NULL ) free(hMsg->pszFunctionName); if ( hMsg->pszMessage != NULL ) free(hMsg->pszMessage); free( hMsg ); } unixODBC-2.3.9/log/logOpen.c0000755000175000017500000000414212262474476012433 00000000000000/********************************************************************** * logOpen * * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "log.h" /*! * \brief Open (init) a log (hLog). * * This function must be called before any other in this API. * _logFreeMsg is applied to the log to ensure that all message * mem is freed. * * \param phLog Output. Log handle returned here. * \param pszProgramName Input. Default program name. This is attached to * each message when written to file. It is only used * if a viable pszLogFile given. Can be NULL. * \param pszLogFile Input. File name of log file. Can be NULL. * \param nMaxMsgs Input. Max messages to store. When this limit is * reached - oldest message will be deleted. This * can be set to 0 to remove any limit. * * \return int * \retval LOG_ERROR * \retval LOG_SUCCESS * * \sa logClose */ int logOpen( HLOG *phLog, char *pszProgramName, char *pszLogFile, long nMaxMsgs ) { /* sanity check */ if ( !phLog ) return LOG_ERROR; /* LOG STRUCT */ *phLog = malloc( sizeof(LOG) ); (*phLog)->nMaxMsgs = nMaxMsgs; (*phLog)->hMessages = lstOpen(); (*phLog)->bOn = 0; (*phLog)->pszLogFile = NULL; (*phLog)->pszProgramName = NULL; /* each msg will be freed when deleted by this (_logFreeMsg) callback */ lstSetFreeFunc( (*phLog)->hMessages, _logFreeMsg ); /* PROGRAM NAME */ if ( pszProgramName ) (*phLog)->pszProgramName = (char *)strdup( pszProgramName ); else (*phLog)->pszProgramName = (char *)strdup( "UNKNOWN" ); /* LOG FILE */ if ( pszLogFile ) (*phLog)->pszLogFile = (char*)strdup( pszLogFile ); return LOG_SUCCESS; } unixODBC-2.3.9/log/Makefile.in0000664000175000017500000004630113725127175012727 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = log ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libloglc_la_DEPENDENCIES = am_libloglc_la_OBJECTS = _logFreeMsg.lo logClear.lo logClose.lo \ logOn.lo logOpen.lo logPeekMsg.lo logPopMsg.lo logPushMsg.lo libloglc_la_OBJECTS = $(am_libloglc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libloglc_la_SOURCES) DIST_SOURCES = $(libloglc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libloglc.la AM_CPPFLAGS = -I@top_srcdir@/include libloglc_la_SOURCES = \ _logFreeMsg.c \ logClear.c \ logClose.c \ logOn.c \ logOpen.c \ logPeekMsg.c \ logPopMsg.c \ logPushMsg.c libloglc_la_LIBADD = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu log/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu log/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libloglc.la: $(libloglc_la_OBJECTS) $(libloglc_la_DEPENDENCIES) $(EXTRA_libloglc_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libloglc_la_OBJECTS) $(libloglc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_logFreeMsg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logClear.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logClose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logOn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logOpen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logPeekMsg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logPopMsg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logPushMsg.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/log/logOn.c0000755000175000017500000000206112262474476012104 00000000000000/********************************************************************** * logOn * * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "log.h" /*! * \brief Turn logging on/off. * * Logging is turned OFF by default. Turn it on when you want * logged messages to be stored. Turn it back off when you want to * 'pause' logging. * * This may be used during debugging sessions to reduce clutter * in the log results. * * \param hLog * \param bOn * * \return int * \retval LOG_SUCCESS * * \sa logOpen * logClose */ int logOn( HLOG hLog, int bOn ) { /* log must be logOpen to logOn */ if ( !hLog ) return LOG_ERROR; hLog->bOn = bOn; return LOG_SUCCESS; } unixODBC-2.3.9/log/Makefile.am0000755000175000017500000000035112262755723012713 00000000000000noinst_LTLIBRARIES = libloglc.la AM_CPPFLAGS = -I@top_srcdir@/include libloglc_la_SOURCES = \ _logFreeMsg.c \ logClear.c \ logClose.c \ logOn.c \ logOpen.c \ logPeekMsg.c \ logPopMsg.c \ logPushMsg.c libloglc_la_LIBADD = unixODBC-2.3.9/man/0000775000175000017500000000000013725127522010724 500000000000000unixODBC-2.3.9/man/dltest.10000644000175000017500000000162013270324737012224 00000000000000.TH dltest 1 "Thu 13 Feb 2014" "version 2.3.6" "UnixODBC manual pages" .SH NAME dltest \- A simple library symbol test .SH SYNOPSIS .B dltest .R [ .I library symbol .R ] .SH DESCRIPTION .B dltest is simple test of occurence of the .I symbol in the .IR library . The .I library must be a full (with path) file name of the shared object, in which the search for .I symbol should be performed. Without any parameters, dltest print short help message. .SH EXAMPLES To determine if the symbol .B printf is found in the .IR libc-2\.18\.so : .RS $ dltest /usr/lib/libc-2.18.so printf .RE .SH AUTHORS The authors of unixODBC are .MT pharvey@codebydesign.com Peter Harvey .ME and .MT nick@lurcher.org Nick Gorham .ME . For the full list of contributors see the .I AUTHORS file. .SH COPYRIGHT unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the .I COPYING file. unixODBC-2.3.9/man/odbc_config.10000644000175000017500000000430313450627100013150 00000000000000.TH odbc_config 1 "Thu 13 Feb 2014" "version 2.3.6" "UnixODBC manual pages" .SH NAME odbc_config \- get compile options for compiling unixODBC client .SH SYNOPSIS .SY odbc_config .OP \-\-prefix .OP \-\-exec-prefix .OP \-\-include-prefix .OP \-\-lib-prefix .OP \-\-bin-prefix .OP \-\-version .OP \-\-libs .OP \-\-static-libs .OP \-\-libtool-libs .OP \-\-cflags .OP \-\-odbcversion .OP \-\-odbcini .OP \-\-odbcinstini .OP \-\-header .OP \-\-ulen .YS .SH DESCRIPTION .B odbc_config provides built-in options, specified at build time of the unixODBC suite, which are useful for building unixODBC clients and similar programs. .SH OPTIONS .B .IP \-\-prefix Prefix for architecture-independent file tree. .B .IP \-\-exec-prefix Prefix for architecture-dependent file tree. .B .IP \-\-include-prefix Directory with C header files for unixODBC. .B .IP \-\-lib-prefix Directory with object code (.so) libraries. .B .IP \-\-bin-prefix Location of user executables. .B .IP \-\-version unixODBC version. .B .IP \-\-libs Compiler flags for linking dynamic libraries. .B .IP \-\-static-libs Absolute file name of static unixODBC library. .B .IP \-\-libtool-libs Absolute file name of libtool unixODBC library. .B .IP \-\-cflags Compiler flags to find include files and critical compiler flags and defines used when compiling the libodbc library. .B .IP \-\-odbcversion Version of the ODBC specification used by the unixODBC. .B .IP \-\-odbcini Absolute file name of the system-wide DSN configuration file .IR odbc.ini . .B .IP \-\-odbcinstini Absolute file name of the driver configuration file .IR odbcinst.ini . .B .IP \-\-header Definitions of used C preprocessor constants. It is suitable to be piped into C header file. .B .IP \-\-ulen Compiler flag for defining .IR SIZEOF_SQLULEN . .SH SEE ALSO .BR unixODBC (7), .BR odbcinst.ini (5), .BR odbc.ini (5) .R "The \fIunixODBC\fB Administrator Manual (HTML)" .SH AUTHORS The authors of unixODBC are .MT pharvey@codebydesign.com Peter Harvey .ME and .MT nick@lurcher.org Nick Gorham .ME . For the full list of contributors see the .I AUTHORS file. .SH COPYRIGHT unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the .I COPYING file. unixODBC-2.3.9/man/odbcinst.ini.50000644000175000017500000000605213450627100013306 00000000000000.TH odbcinst.ini 5 "Thu 27 Jun 2013" "version 2.3.6" "unixODBC manual pages" .SH NAME /etc/odbcinst.ini - An unixODBC drivers configuration .SH DESCRIPTION .B /etc/odbcinst.ini is a text configuration file for unixODBC drivers. It can be edited by hand, but the recommended way to update this file is to use the .BR odbcinst (1) utility. .SH FILE FORMAT The general .ini file format is: .RS .nf .BI [ SectionName1 ] .IB key1 " = " value1 .IB key2 " = " value2 .B ... .BI [ SectionName2 ] .IB key1 " = " value1 .IB key2 " = " value2 .B ... .fi .RE Each ODBC driver has its own section and can be referred to by the name of its section. Configuration keys recognised in driver sections by unixODBC itself are: .IP \fBDescription A text string briefly describing the driver. .IP \fBDriver A filesystem path to the actual driver library. .IP \fBSetup A filesystem path to the driver setup library. .IP \fBFileUsage The section named \fB[ODBC]\fR configures global options. Keys recognised in the \fB[ODBC]\fR section include: .IP \fBTrace\fB Enable ODBC driver trace output, which is written to the path specified by \fBTraceFile\fR. Note that some drivers have their own separate trace control options. Unlike the \fBTrace\fR option these are usually specified at the DSN level. Values recognised as enabled are any case variation of "1", "y", "yes" or "on". .IP \fBTraceFile\fB Path or path-pattern to write the ODBC trace file to. Has no effect unless \fBTrace\fR is enabled. Default \fB/tmp/sql.log\fR. \fIWARNING\fR: setting \fBTraceFile\fB to a path writeable by multiple users may not work correctly as only the first user will be able to create and open the file. .SS TEMPLATE FILES The recommended way to manage the drivers is using the .BR odbcinst (1) utility. You can install the drivers by supplying it with template file, which has the same format as this file. .SH EXAMPLES An example of the actual PostgreSQL driver: .RS .nf [PostgreSQL] Description = PostgreSQL driver for GNU/Linux Driver = /usr/lib/psqlodbcw.so Setup = /usr/lib/libodbcpsqlS.so FileUsage = 1 .fi .RE Note that driver paths may vary, and some drivers require \fBDriver64\fR and \fBSetup64\fR entries too. By specifying the driver like that, you can then reference it in the .BR odbc.ini (5) as follows: .RS .nf Driver = PostgreSQL .fi .RE The recommended way to add that driver is by creating a template file containing: .RS .nf [PostgreSQL] Description = PostgreSQL driver for GNU/Linux Driver = /usr/lib/psqlodbcw.so Setup = /usr/lib/libodbcpsqlS.so .fi .RE and call the .BR odbcinst (1): .RS .BI "# odbcinst -i -d -f " template.ini .RE .SH "SEE ALSO" .BR unixODBC (7), .BR odbcinst (1), .BR odbc.ini (5) .R "The \fIunixODBC\fB Administrator Manual (HTML)" .SH AUTHORS The authors of unixODBC are Peter Harvey <\fIpharvey@codebydesign.com\fR> and Nick Gorham <\fInick@lurcher.org\fR>. For the full list of contributors see the AUTHORS file. .SH COPYRIGHT unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the COPYING file. unixODBC-2.3.9/man/odbc.ini.50000644000175000017500000000523513450627100012412 00000000000000.TH odbc.ini 5 "Thu 27 Jun 2013" "version 2.3.6" "unixODBC manual pages" .SH NAME /etc/odbc.ini, $HOME/.odbc.ini - unixODBC data sources configuration .SH DESCRIPTION .B /etc/odbc.ini is text configuration file for the system wide ODBC data sources (i. e. database connections). .B $HOME/.odbc.ini contains the configuration for user-specific data sources. Both paths may be overridden by \fIunixODBC\fR build options, see \fBodbcinst -j\fR for the definitive paths on your system. .SH NOTES .SS "Templates" Where possible, install ODBC DSNs using the \fBodbcinst\fR utility from a template .ini file. Many drivers supply templates. .SS "FILE FORMAT" \fBodbc.ini\fR follows the pesudo-standard \fIini file\fB syntax convention of one or more \fB[section headings]\fR, each followed by zero or more \fBkey = value\fR attributes. .IP "\fB[ODBC Data Sources]\fR section" 4 The required section \fB[ODBC Data Sources]\fR lists each data source name (\fIDSN\fR) as a key. The associated values serve as comments. Each entry must be matched by an ini file \fB[section]\fR describing the data source. .IP "\fB[\fIdsn\fR]\fR sections" 4 Each data source is identified by a \fB[section header]\fR, which is the DSN name used by applications. Each DSN definition section may contain values for the keys: .RS 4 .IP "\(bu Driver (\fBREQUIRED\fR)" 8 Name of the ODBC driver to use for this DSN. The name must exactly match the \fB[section name]\fR of the driver definition in \fBodbcinst.ini\fR as listed by \fBodbcinst -q -d\fR. .IP "\(bu Description" 8 Human-readable data source description. .IP "\(bu Database" 8 Database name or identifier. Meaning is driver-specific. May specify a file path, unix socket path, identifier relative to a server name, etc. .IP "\(bu Servername" 8 Server name. Meaning is driver specific, but generally specifies a DNS name, IP network address, or driver-specific discovery identifier. .RE For a full list of supported parameters see the HTML-format "Administrator Manual" shipped with \fIunixODBC\fR, the documentation for your driver, and any datasource templates supplied by your driver. .SH EXAMPLES An example \fBodbc.init\fR is shown in the "Administrator Manual" shipped with \fIunixODBC\fR. .SH "SEE ALSO" .BR unixODBC (7), .BR odbcinst (1), .BR isql (1), .BR iusql (1), .BR odbcinst.ini (5) .R "The \fIunixODBC\fB Administrator Manual (HTML)" .SH AUTHORS The authors of unixODBC are Peter Harvey <\fIpharvey@codebydesign.com\fR> and Nick Gorham <\fInick@lurcher.org\fR>. For the full list of contributors see the AUTHORS file. .SH COPYRIGHT unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the COPYING file. unixODBC-2.3.9/man/isql.10000644000175000017500000001237213450627100011671 00000000000000\" vim:fileencoding=utf-8: .TH isql 1 "Tue 25 Jun 2013" "version 2.3.6" "UnixODBC manual pages" .SH NAME isql, iusql \- unixODBC command-line interactive SQL tool .SH SYNOPSIS \fBisql\fR \fIDSN\fR [\fIUSER\fR [\fIPASSWORD\fR]] [\fIoptions\fR] .SH DESCRIPTION .B isql is a command line tool which allows the user to execute SQL in batch or interactively. It has some interesting options such as an option to generate output wrapped in an HTML table. .B iusql is the same tool with built-in Unicode support. Some datasources only work with \fBiusql\fR. .SH ARGUMENTS .IP \fBDSN\fR The Data Source Name, which should be used to make connection to the database. The data source is looked for in the /etc/odbc.ini and $HOME/.odbc.ini files in that order, with the latter overwriting the former. A bare name is looked up in the above files. If the DSN name begins with a semicolon then it's treated as a connection string instead. The connection string may contain a DSN name and/or other semicolon-separated parameters. .IP \fBUSER\fR Specifies the database user/role under which the connection should be made. Overrides any \fBUID\fR specified in the DSN. .IP \fBPASSWORD\fR Password for the specified \fBUSER\fR. Overrides any \fBPassword\fR specified in the DSN. .SH OPTIONS .IP \fB-b\fR Run isql in non-interactive batch mode. In this mode, the isql processes its standard input, expecting one SQL command per line. .IP \fB-d\fIDELIMITER\fR Delimits columns with \fIdelimiter\fR. .IP \fB-x\fIHEX\fR Delimits columns with \fIHEX\fR, which is a hexadecimal code of the delimiting character in the format 0xNN - i.e. 0x09 for the TAB character. .IP \fB-w\fR Format the result as HTML table. .IP \fB-c\fR Output the names of the columns on the first row. Has any effect only with the \fB-d\fR or \fB-x\fR options. .IP \fB-m\fINUM\fR Limit the column display width to \fINUM\fR characters. .IP \fB-l\fILOCALE\fR Sets locale to \fILOCALE\fR. .IP \fB-q\fR Wrap the character fields in double quotes. .IP \fB-3\fR Use the ODBC 3 calls. .IP \fB-n\fR Use the new line processing. (multiple lines of SQL, terminated with command GO). .IP \fB-e\fR Use the SQLExecDirect instead of Prepare. .IP \fB-k\fR Use SQLDriverConnect. .IP \fB-v\fR Turn on the verbose mode, where the errors are fully described. Useful for debugging. .IP \fB--version\fR Prints the program version and exits. .IP \fB-L\fINUM\fR Alter the maximum number of characters displayed from a character field to \fINUM\fR characters. Default is 300. .SH COMMANDS This section briefly describes some isql runtime commands. .B help .RS List all tables in the database. .RE .B help \fItable\fR .RS List all columns in the \fItable\fR. .RE .B help help .RS List all help options. .RE .SH EXAMPLES .IP "A bare DSN name:" .nf $ iusql WebDB MyID MyPWD -w -b < My.sql .fi Connects to the WebDB as user MyID with password MyPWD, then execute the commands in the My.sql file and returns the results wrapped in HTML table. Each line in My.sql must contain exactly 1 SQL command, except for the last line, which must be blank (unless the \fB-n\fR option is specified). .IP "A DSN name in a connection string:" Note the leading semicolon on the connection string: .nf $ iusql ";DSN=WebDB" MyID MyPWD -w -b < My.sql .fi Options in the DSN may be overridden in the connection string: .nf $ iusql ";DSN=WebDB;Driver=PostgreSQL ODBC;UID=MyID;PASSWORD=secret;Debug=1;CommLog=1" -v .fi .IP "A string DSN:" A string DSN may be provided in its entirety, with no file DSN reference at all: .nf $ iusql ";Driver=PostgreSQL Unicode;UID=MyID;PASSWORD=secret" -v .fi .SH TROUBLESHOOTING .IP "Cryptic error messages" Re-run \fBiusql\fR or \fBisql\fR with the \fB-v\fR flag to get more detail from errors, and/or enable \fBTrace\fR mode in \fBodbcinst.ini\fR. .IP "Missing driver definition" Check that the driver name specified by the \fBDriver\fR entry in the \fBodbc.ini\fR data-source definition is present in \fBodbcinst.ini\fR and exactly matches the odbcinst \fI[section name]\fR. .IP "Unloadable or incompatible driver" If the driver is properly specified for the datasource it's possible that the driver may not be loadable. Check for mixups between Unicode and ANSI drivers. Verify the driver paths in the \fBodbcinst.ini\fR section name. .IP "Unicode datasources with ANSI clients" Some datasources are Unicode-only and only work with \fBiusql\fR. If \fBisql\fR reports .nf [IM002][unixODBC][Driver Manager]Data source name not found and no default driver specified [ISQL]ERROR: Could not SQLConnect .fi but the datasource is listed by .nf odbcinst -q -d .fi and the driver it uses is listed by .nf odbcinst -q -d .fi then try \fBiusql\fR. .SH FILES .I /etc/odbc.ini .RS System-wide DSN definitions. See .BR odbc.ini (5) for details. .RE .I $HOME/.odbc.ini .RS User-specific DSN definitions. See .BR odbc.ini (5) for details. .RE .SH SEE ALSO .BR unixODBC (7), .BR odbcinst (1), .BR odbc.ini (5) .R "The \fIunixODBC\fB Administrator Manual (HTML)" .SH AUTHORS The authors of unixODBC are Peter Harvey <\fIpharvey@codebydesign.com\fR> and Nick Gorham <\fInick@lurcher.org\fR>. For the full list of contributors see the AUTHORS file. .SH COPYRIGHT unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the COPYING file. unixODBC-2.3.9/man/unixODBC.70000644000175000017500000000356413450627100012345 00000000000000.TH unixODBC 7 "Tue 22. Oct 2013" "version 2.3.6" "unixODBC manual pages" .SH NAME unixODBC \- An ODBC implementation for Unix .SH DESCRIPTION ODBC is an open specification for providing application developers with a predictable API with which to access Data Sources. Data Sources include SQL Servers and any Data Source with an ODBC Driver. The unixODBC Project goals are to develop and promote unixODBC to be the definitive standard for ODBC on non MS Windows platforms. The HTML-format "Administrator Manual" shipped with \fIunixODBC\fR provides additional details on configuration and usage to supplement these man pages. .SH ENVIRONMENT VARIABLES .IP \fBODBCSYSINI Overloads path to unixODBC configuration files. By default equals to '/etc'. .IP \fBODBCINSTINI Overloads the name of the drivers configuration file. It is relative to \fBODBCSYSINI\fR and by default set to 'odbcinst.ini'. .IP \fBODBCINSTUI Overloads the library name for UI. The final name that is searched for is evaluated as "lib$ODBCINSTUI". By default it is set to 'odbcinstQ4', so the resulting library name is 'libodbcinstQ4'. .IP \fBODBCSEARCH Overloads the configuration mode and determines where to look for configuration files. Must be set to one of ODBC_SYSTEM_DSN, ODBC_USER_DSN or ODBC_BOTH_DSN (the last one is the default value). .IP \fBODBCINI Overloads the path to user configuration file. By default it is set to "~/.odbc.ini". .SH SEE ALSO .BR unixODBC (7), .BR isql (1), .BR odbcinst (1), .BR odbc.ini (5), .BR odbcinst.ini (5) .R "The \fIunixODBC\fB Administrator Manual (HTML)" .SH AUTHORS The authors of unixODBC are Peter Harvey <\fIpharvey@codebydesign.com\fR> and Nick Gorham <\fInick@unixodbc.org\fR>. For the full list of contributors see the AUTHORS file. .SH COPYRIGHT unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the COPYING file. unixODBC-2.3.9/man/Makefile.in0000664000175000017500000004724313725127175012727 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(man7dir)" man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 NROFF = nroff MANS = $(dist_man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ dist_man_MANS = isql.1 odbc.ini.5 odbcinst.1 odbcinst.ini.5 unixODBC.7 dltest.1 iusql.1 odbc_config.1 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu man/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man7: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.7[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man5 install-man7 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 uninstall-man5 uninstall-man7 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-man5 install-man7 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 uninstall-man5 \ uninstall-man7 .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/man/iusql.10000755000175000017500000000002013270324737012056 00000000000000.so man1/isql.1 unixODBC-2.3.9/man/odbcinst.10000644000175000017500000000520213270324737012532 00000000000000.TH odbcinst 1 "Wed 26 Jun 2013" "version 2.3.6" "unixODBC manual pages" .SH NAME odbcinst - An unixODBC tool for manipulating configuration files .SH SYNOPSIS .B odbcinst .I ACTION OBJECT OPTIONS .SH DESCRIPTION .B odbcinst is a command line tool which has been created for allowing people who are developing the install scripts/RPMs for Drivers to be able to easily create/remove entries in odbc.ini and odbcinst.ini. This command line tool is a complement to the shared library of the same name (libodbcinst.so). This tool is a part of the odbcinst component of unixODBC. .SH OPTIONS .SS ACTIONS .IP -i Install (add section to config file) new \fIOBJECT\fR. .IP -u Uninstall (remove section from config file) existing \fIOBJECT\fR. .IP -q Query the config files and print the options for specified \fIOBJECT\fR. .IP -j Prints current configuration of unixODBC, listing (among others) the paths to the configuration files. .IP -c Calls SQLCreateDataSource .IP -m Calls SQLManageDataSources .IP --version Prints program version and exits. .SS OBJECTS .IP -d The \fIACTION\fR affect drivers (and thus the odbcinst.ini configuration file). .IP -s The \fIACTION\fR affect data sources (and thus the user or system odbc.ini configuration file). .SS OPTIONS .IP "-f \fIFILE\fR" The \fIFILE\fR is template file, describing the configuration of installed \fIOBJECT\fR (only valid for the -i \fIACTION\fR). .IP -r Same as the -f \fIOPTION\fR, only take the standard input as the template file. .IP "-n \fINAME\fR" Specifies the \fINAME\fR of the \fIOBJECT\fR. .IP -v Turn off verbose mode. This turns off all information, warning and error messages. .IP -l The specified data source is system-wide. Has any effect only with the -s \fIOBJECT\fR. .IP -h The specified data source is user-specific. Has any effect only with the -s \fIOBJECT\fR. .SH "RETURN VALUES" This command returns zero on success and non-zero value on failure. .SH FILES .I /etc/odbinst.ini .RS Configuration file containing all the database drivers specifications. See .BR odbcinst.ini (5) for more details. .RE .I /etc/odbc.ini .RS System-wide data sources specifications. See .BR odbc.ini (5) for more details. .RE .I $HOME/.odbc.ini .RS User-specific data sources specifications. See .BR odbc.ini (5) for more details. .RE .SH "SEE ALSO" .BR odbcinst.ini (5), .BR odbc.ini (5) .SH AUTHORS The authors of unixODBC are Peter Harvey <\fIpharvey@codebydesign.com\fR> and Nick Gorham <\fInick@lurcher.org\fR>. For the full list of contributors see the AUTHORS file. .SH COPYRIGHT unixODBC is licensed under the GNU Lesser General Public License. For details about the license, see the COPYING file. unixODBC-2.3.9/man/Makefile.am0000755000175000017500000000015212300625601012664 00000000000000dist_man_MANS = isql.1 odbc.ini.5 odbcinst.1 odbcinst.ini.5 unixODBC.7 dltest.1 iusql.1 odbc_config.1 unixODBC-2.3.9/aclocal.m40000664000175000017500000012367613725127171011750 00000000000000# generated automatically by aclocal 1.15.1 -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/libtool.m4]) m4_include([m4/ltargz.m4]) m4_include([m4/ltdl.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([acinclude.m4]) unixODBC-2.3.9/libltdl/0000775000175000017500000000000013725127520011575 500000000000000unixODBC-2.3.9/libltdl/lt_error.c0000644000175000017500000000562713725127167013530 00000000000000/* lt_error.c -- error propagation interface Copyright (C) 1999-2001, 2004-2005, 2007, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_error.h" static const char *last_error = 0; static const char error_strings[LT_ERROR_MAX][LT_ERROR_LEN_MAX + 1] = { #define LT_ERROR(name, diagnostic) diagnostic, lt_dlerror_table #undef LT_ERROR }; static const char **user_error_strings = 0; static int errorcount = LT_ERROR_MAX; int lt_dladderror (const char *diagnostic) { int errindex = 0; int result = -1; const char **temp = (const char **) 0; assert (diagnostic); errindex = errorcount - LT_ERROR_MAX; temp = REALLOC (const char *, user_error_strings, 1 + errindex); if (temp) { user_error_strings = temp; user_error_strings[errindex] = diagnostic; result = errorcount++; } return result; } int lt_dlseterror (int errindex) { int errors = 0; if (errindex >= errorcount || errindex < 0) { /* Ack! Error setting the error message! */ LT__SETERROR (INVALID_ERRORCODE); ++errors; } else if (errindex < LT_ERROR_MAX) { /* No error setting the error message! */ LT__SETERRORSTR (error_strings[errindex]); } else { /* No error setting the error message! */ LT__SETERRORSTR (user_error_strings[errindex - LT_ERROR_MAX]); } return errors; } const char * lt__error_string (int errorcode) { assert (errorcode >= 0); assert (errorcode < LT_ERROR_MAX); return error_strings[errorcode]; } const char * lt__get_last_error (void) { return last_error; } const char * lt__set_last_error (const char *errormsg) { return last_error = errormsg; } unixODBC-2.3.9/libltdl/lt__strl.c0000644000175000017500000000703213725127167013512 00000000000000/* lt__strl.c -- size-bounded string copying and concatenation Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "lt__strl.h" /* lt_strlcat appends the NULL-terminated string src to the end of dst. It will append at most dstsize - strlen(dst) - 1 bytes, NULL-terminating the result. The total length of the string that would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcat(), which is available under NetBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcat(dst, src, dstsize) >= dstsize) return -1; */ #if !defined HAVE_STRLCAT size_t lt_strlcat(char *dst, const char *src, const size_t dstsize) { size_t length; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); length=strlen(dst); /* Copy remaining characters from src while constraining length to size - 1. */ for ( p = dst + length, q = src; (*q != 0) && (length < dstsize - 1); length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined HAVE_STRLCAT */ /* lt_strlcpy copies up to dstsize - 1 characters from the NULL-terminated string src to dst, NULL-terminating the result. The total length of the string that would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcpy(), which is available under OpenBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcpy(dst, src, dstsize) >= dstsize) return -1; */ #if !defined HAVE_STRLCPY size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize) { size_t length=0; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); /* Copy src to dst within bounds of size-1. */ for ( p=dst, q=src, length=0; (*q != 0) && (length < dstsize-1); length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined HAVE_STRLCPY */ unixODBC-2.3.9/libltdl/slist.c0000644000175000017500000002314613725127167013032 00000000000000/* slist.c -- generalised singly linked lists Copyright (C) 2000, 2004, 2007-2009, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "slist.h" #include static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata); /* Call DELETE repeatedly on each element of HEAD. CAVEAT: If you call this when HEAD is the start of a list of boxed items, you must remember that each item passed back to your DELETE function will be a boxed item that must be slist_unbox()ed before operating on its contents. e.g. void boxed_delete (void *item) { item_free (slist_unbox (item)); } ... slist = slist_delete (slist, boxed_delete); ... */ SList * slist_delete (SList *head, void (*delete_fct) (void *item)) { assert (delete_fct); while (head) { SList *next = head->next; (*delete_fct) (head); head = next; } return 0; } /* Call FIND repeatedly with MATCHDATA and each item of *PHEAD, until FIND returns non-NULL, or the list is exhausted. If a match is found the matching item is destructively removed from *PHEAD, and the value returned by the matching call to FIND is returned. CAVEAT: To avoid memory leaks, unless you already have the address of the stale item, you should probably return that from FIND if it makes a successful match. Don't forget to slist_unbox() every item in a boxed list before operating on its contents. */ SList * slist_remove (SList **phead, SListCallback *find, void *matchdata) { SList *stale = 0; void *result = 0; assert (find); if (!phead || !*phead) return 0; /* Does the head of the passed list match? */ result = (*find) (*phead, matchdata); if (result) { stale = *phead; *phead = stale->next; } /* what about the rest of the elements? */ else { SList *head; for (head = *phead; head->next; head = head->next) { result = (*find) (head->next, matchdata); if (result) { stale = head->next; head->next = stale->next; break; } } } return (SList *) result; } /* Call FIND repeatedly with each element of SLIST and MATCHDATA, until FIND returns non-NULL, or the list is exhausted. If a match is found the value returned by the matching call to FIND is returned. */ void * slist_find (SList *slist, SListCallback *find, void *matchdata) { void *result = 0; assert (find); for (; slist; slist = slist->next) { result = (*find) (slist, matchdata); if (result) break; } return result; } /* Return a single list, composed by destructively concatenating the items in HEAD and TAIL. The values of HEAD and TAIL are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_concat (slist1, slist2); */ SList * slist_concat (SList *head, SList *tail) { SList *last; if (!head) { return tail; } last = head; while (last->next) last = last->next; last->next = tail; return head; } /* Return a single list, composed by destructively appending all of the items in SLIST to ITEM. The values of ITEM and SLIST are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_cons (slist_box (data), slist1); */ SList * slist_cons (SList *item, SList *slist) { if (!item) { return slist; } assert (!item->next); item->next = slist; return item; } /* Return a list starting at the second item of SLIST. */ SList * slist_tail (SList *slist) { return slist ? slist->next : NULL; } /* Return a list starting at the Nth item of SLIST. If SLIST is less than N items long, NULL is returned. Just to be confusing, list items are counted from 1, to get the 2nd element of slist: e.g. shared_list = slist_nth (slist, 2); */ SList * slist_nth (SList *slist, size_t n) { for (;n > 1 && slist; n--) slist = slist->next; return slist; } /* Return the number of items in SLIST. We start counting from 1, so the length of a list with no items is 0, and so on. */ size_t slist_length (SList *slist) { size_t n; for (n = 0; slist; ++n) slist = slist->next; return n; } /* Destructively reverse the order of items in SLIST. The value of SLIST is undefined after calling this function. CAVEAT: You must store the result of this function, or you might not be able to get all the items except the first one back again. e.g. slist = slist_reverse (slist); */ SList * slist_reverse (SList *slist) { SList *result = 0; SList *next; while (slist) { next = slist->next; slist->next = result; result = slist; slist = next; } return result; } /* Call FOREACH once for each item in SLIST, passing both the item and USERDATA on each call. */ void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata) { void *result = 0; assert (foreach); while (slist) { SList *next = slist->next; result = (*foreach) (slist, userdata); if (result) break; slist = next; } return result; } /* Destructively merge the items of two ordered lists LEFT and RIGHT, returning a single sorted list containing the items of both -- Part of the quicksort algorithm. The values of LEFT and RIGHT are undefined after calling this function. At each iteration, add another item to the merged list by taking the lowest valued item from the head of either LEFT or RIGHT, determined by passing those items and USERDATA to COMPARE. COMPARE should return less than 0 if the head of LEFT has the lower value, greater than 0 if the head of RIGHT has the lower value, otherwise 0. */ static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata) { SList merged, *insert; insert = &merged; while (left && right) { if ((*compare) (left, right, userdata) <= 0) { insert = insert->next = left; left = left->next; } else { insert = insert->next = right; right = right->next; } } insert->next = left ? left : right; return merged.next; } /* Perform a destructive quicksort on the items in SLIST, by repeatedly calling COMPARE with a pair of items from SLIST along with USERDATA at every iteration. COMPARE is a function as defined above for slist_sort_merge(). The value of SLIST is undefined after calling this function. e.g. slist = slist_sort (slist, compare, 0); */ SList * slist_sort (SList *slist, SListCompare *compare, void *userdata) { SList *left, *right; if (!slist) return slist; /* Be sure that LEFT and RIGHT never contain the same item. */ left = slist; right = slist->next; if (!right) return left; /* Skip two items with RIGHT and one with SLIST, until RIGHT falls off the end. SLIST must be about half way along. */ while (right && (right = right->next)) { if (!right || !(right = right->next)) break; slist = slist->next; } right = slist->next; slist->next = 0; /* Sort LEFT and RIGHT, then merge the two. */ return slist_sort_merge (slist_sort (left, compare, userdata), slist_sort (right, compare, userdata), compare, userdata); } /* Aside from using the functions above to manage chained structures of any type that has a NEXT pointer as its first field, SLISTs can be comprised of boxed items. The boxes are chained together in that case, so there is no need for a NEXT field in the item proper. Some care must be taken to slist_box and slist_unbox each item in a boxed list at the appropriate points to avoid leaking the memory used for the boxes. It us usually a very bad idea to mix boxed and non-boxed items in a single list. */ /* Return a 'boxed' freshly mallocated 1 element list containing USERDATA. */ SList * slist_box (const void *userdata) { SList *item = (SList *) malloc (sizeof *item); if (item) { item->next = 0; item->userdata = userdata; } return item; } /* Return the contents of a 'boxed' ITEM, recycling the box itself. */ void * slist_unbox (SList *item) { void *userdata = 0; if (item) { /* Strip the const, because responsibility for this memory passes to the caller on return. */ userdata = (void *) item->userdata; free (item); } return userdata; } unixODBC-2.3.9/libltdl/lt_dlloader.c0000644000175000017500000001371013725127167014155 00000000000000/* lt_dlloader.c -- dynamic library loader interface Copyright (C) 2004, 2007-2008, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #define RETURN_SUCCESS 0 #define RETURN_FAILURE 1 static void * loader_callback (SList *item, void *userdata); /* A list of all the dlloaders we know about, each stored as a boxed SList item: */ static SList *loaders = 0; /* Return NULL, unless the loader in this ITEM has a matching name, in which case we return the matching item so that its address is passed back out (for possible freeing) by slist_remove. */ static void * loader_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; const char * name = (const char *) userdata; assert (vtable); return STREQ (vtable->name, name) ? (void *) item : NULL; } /* Hook VTABLE into our global LOADERS list according to its own PRIORITY field value. */ int lt_dlloader_add (const lt_dlvtable *vtable) { SList *item; if ((vtable == 0) /* diagnose invalid vtable fields */ || (vtable->module_open == 0) || (vtable->module_close == 0) || (vtable->find_sym == 0) || ((vtable->priority != LT_DLLOADER_PREPEND) && (vtable->priority != LT_DLLOADER_APPEND))) { LT__SETERROR (INVALID_LOADER); return RETURN_FAILURE; } item = slist_box (vtable); if (!item) { (*lt__alloc_die) (); /* Let the caller know something went wrong if lt__alloc_die doesn't abort. */ return RETURN_FAILURE; } if (vtable->priority == LT_DLLOADER_PREPEND) { loaders = slist_cons (item, loaders); } else { assert (vtable->priority == LT_DLLOADER_APPEND); loaders = slist_concat (loaders, item); } return RETURN_SUCCESS; } #ifdef LT_DEBUG_LOADERS static void * loader_dump_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; fprintf (stderr, ", %s", (vtable && vtable->name) ? vtable->name : "(null)"); return 0; } void lt_dlloader_dump (void) { fprintf (stderr, "loaders: "); if (!loaders) { fprintf (stderr, "(empty)"); } else { const lt_dlvtable *head = (const lt_dlvtable *) loaders->userdata; fprintf (stderr, "%s", (head && head->name) ? head->name : "(null)"); if (slist_tail (loaders)) slist_foreach (slist_tail (loaders), loader_dump_callback, NULL); } fprintf (stderr, "\n"); } #endif /* An iterator for the global loader list: if LOADER is NULL, then return the first element, otherwise the following element. */ lt_dlloader lt_dlloader_next (lt_dlloader loader) { SList *item = (SList *) loader; return (lt_dlloader) (item ? item->next : loaders); } /* Non-destructive unboxing of a loader. */ const lt_dlvtable * lt_dlloader_get (lt_dlloader loader) { return (const lt_dlvtable *) (loader ? ((SList *) loader)->userdata : NULL); } /* Return the contents of the first item in the global loader list with a matching NAME after removing it from that list. If there was no match, return NULL; if there is an error, return NULL and set an error for lt_dlerror; do not set an error if only resident modules need this loader; in either case, the loader list is not changed if NULL is returned. */ lt_dlvtable * lt_dlloader_remove (const char *name) { const lt_dlvtable * vtable = lt_dlloader_find (name); static const char id_string[] = "lt_dlloader_remove"; lt_dlinterface_id iface; lt_dlhandle handle = 0; int in_use = 0; int in_use_by_resident = 0; if (!vtable) { LT__SETERROR (INVALID_LOADER); return 0; } /* Fail if there are any open modules that use this loader. */ iface = lt_dlinterface_register (id_string, NULL); while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur->vtable == vtable) { in_use = 1; if (lt_dlisresident (handle)) in_use_by_resident = 1; } } lt_dlinterface_free (iface); if (in_use) { if (!in_use_by_resident) LT__SETERROR (REMOVE_LOADER); return 0; } /* Call the loader finalisation function. */ if (vtable && vtable->dlloader_exit) { if ((*vtable->dlloader_exit) (vtable->dlloader_data) != 0) { /* If there is an exit function, and it returns non-zero then it must set an error, and we will not remove it from the list. */ return 0; } } /* If we got this far, remove the loader from our global list. */ return (lt_dlvtable *) slist_unbox ((SList *) slist_remove (&loaders, loader_callback, (void *) name)); } const lt_dlvtable * lt_dlloader_find (const char *name) { return lt_dlloader_get (slist_find (loaders, loader_callback, (void *) name)); } unixODBC-2.3.9/libltdl/aclocal.m40000644000175000017500000012257213725127167013373 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([../m4/libtool.m4]) m4_include([../m4/ltargz.m4]) m4_include([../m4/ltdl.m4]) m4_include([../m4/ltoptions.m4]) m4_include([../m4/ltsugar.m4]) m4_include([../m4/ltversion.m4]) m4_include([../m4/lt~obsolete.m4]) unixODBC-2.3.9/libltdl/libltdl/0000775000175000017500000000000013725127520013223 500000000000000unixODBC-2.3.9/libltdl/libltdl/lt__dirent.h0000644000175000017500000000473513725127167015455 00000000000000/* lt__dirent.h -- internal directory entry scanning interface Copyright (C) 2001, 2004, 2006, 2011-2015 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__DIRENT_H #define LT__DIRENT_H 1 #if defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include "lt_system.h" #ifdef HAVE_DIRENT_H /* We have a fully operational dirent subsystem. */ # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) #elif defined __WINDOWS__ /* Use some wrapper code to emulate dirent on windows.. */ # define WINDOWS_DIRENT_EMULATION 1 # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) # define dirent lt__dirent # define DIR lt__DIR # define opendir lt__opendir # define readdir lt__readdir # define closedir lt__closedir LT_BEGIN_C_DECLS struct dirent { char d_name[LT_FILENAME_MAX]; int d_namlen; }; typedef struct { HANDLE hSearch; WIN32_FIND_DATA Win32FindData; BOOL firsttime; struct dirent file_info; } DIR; LT_SCOPE DIR * opendir (const char *path); LT_SCOPE struct dirent *readdir (DIR *entry); LT_SCOPE void closedir (DIR *entry); LT_END_C_DECLS #else /* !defined __WINDOWS__*/ ERROR - cannot find dirent #endif /*!defined __WINDOWS__*/ #endif /*!defined LT__DIRENT_H*/ unixODBC-2.3.9/libltdl/libltdl/lt__strl.h0000644000175000017500000000370413725127167015147 00000000000000/* lt__strl.h -- size-bounded string copying and concatenation Copyright (C) 2004, 2006, 2011-2015 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined LT__STRL_H #define LT__STRL_H 1 #if defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include #include "lt_system.h" #if !defined HAVE_STRLCAT # define strlcat(dst,src,dstsize) lt_strlcat(dst,src,dstsize) LT_SCOPE size_t lt_strlcat(char *dst, const char *src, const size_t dstsize); #endif /* !defined HAVE_STRLCAT */ #if !defined HAVE_STRLCPY # define strlcpy(dst,src,dstsize) lt_strlcpy(dst,src,dstsize) LT_SCOPE size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize); #endif /* !defined HAVE_STRLCPY */ #endif /*!defined LT__STRL_H*/ unixODBC-2.3.9/libltdl/libltdl/lt_error.h0000644000175000017500000000707713725127167015164 00000000000000/* lt_error.h -- error propagation interface Copyright (C) 1999-2001, 2004, 2007, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined LT_ERROR_H #define LT_ERROR_H 1 #include LT_BEGIN_C_DECLS /* Defining error strings alongside their symbolic names in a macro in this way allows us to expand the macro in different contexts with confidence that the enumeration of symbolic names will map correctly onto the table of error strings. \0 is appended to the strings to expilicitely initialize the string terminator. */ #define lt_dlerror_table \ LT_ERROR(UNKNOWN, "unknown error\0") \ LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available\0") \ LT_ERROR(INVALID_LOADER, "invalid loader\0") \ LT_ERROR(INIT_LOADER, "loader initialization failed\0") \ LT_ERROR(REMOVE_LOADER, "loader removal failed\0") \ LT_ERROR(FILE_NOT_FOUND, "file not found\0") \ LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found\0") \ LT_ERROR(NO_SYMBOLS, "no symbols defined\0") \ LT_ERROR(CANNOT_OPEN, "can't open the module\0") \ LT_ERROR(CANNOT_CLOSE, "can't close the module\0") \ LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found\0") \ LT_ERROR(NO_MEMORY, "not enough memory\0") \ LT_ERROR(INVALID_HANDLE, "invalid module handle\0") \ LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow\0") \ LT_ERROR(INVALID_ERRORCODE, "invalid errorcode\0") \ LT_ERROR(SHUTDOWN, "library already shutdown\0") \ LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module\0") \ LT_ERROR(INVALID_MUTEX_ARGS, "internal error (code withdrawn)\0")\ LT_ERROR(INVALID_POSITION, "invalid search path insert position\0")\ LT_ERROR(CONFLICTING_FLAGS, "symbol visibility can be global or local\0") /* Enumerate the symbolic error names. */ enum { #define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), lt_dlerror_table #undef LT_ERROR LT_ERROR_MAX }; /* Should be max of the error string lengths above (plus one for C++) */ #define LT_ERROR_LEN_MAX (41) /* These functions are only useful from inside custom module loaders. */ LT_SCOPE int lt_dladderror (const char *diagnostic); LT_SCOPE int lt_dlseterror (int errorcode); LT_END_C_DECLS #endif /*!defined LT_ERROR_H*/ unixODBC-2.3.9/libltdl/libltdl/lt__alloc.h0000644000175000017500000000420213725127167015247 00000000000000/* lt__alloc.h -- internal memory management interface Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__ALLOC_H #define LT__ALLOC_H 1 #include "lt_system.h" LT_BEGIN_C_DECLS #define MALLOC(tp, n) (tp*) lt__malloc((n) * sizeof(tp)) #define REALLOC(tp, mem, n) (tp*) lt__realloc((mem), (n) * sizeof(tp)) #define FREE(mem) LT_STMT_START { \ free (mem); mem = NULL; } LT_STMT_END #define MEMREASSIGN(p, q) LT_STMT_START { \ if ((p) != (q)) { free (p); (p) = (q); (q) = 0; } \ } LT_STMT_END /* If set, this function is called when memory allocation has failed. */ LT_SCOPE void (*lt__alloc_die) (void); LT_SCOPE void *lt__malloc (size_t n); LT_SCOPE void *lt__zalloc (size_t n); LT_SCOPE void *lt__realloc (void *mem, size_t n); LT_SCOPE void *lt__memdup (void const *mem, size_t n); LT_SCOPE char *lt__strdup (const char *string); LT_END_C_DECLS #endif /*!defined LT__ALLOC_H*/ unixODBC-2.3.9/libltdl/libltdl/lt__argz_.h0000644000175000017500000000426313725127167015266 00000000000000/* lt__argz.h -- internal argz interface for non-glibc systems Copyright (C) 2004, 2007-2008, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__ARGZ_H #define LT__ARGZ_H 1 #include #define __need_error_t #include #include #if defined LTDL # include "lt__glibc.h" # include "lt_system.h" #else # define LT_SCOPE #endif #if defined __cplusplus extern "C" { #endif LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len); LT_SCOPE error_t argz_create_sep(const char *str, int delim, char **pargz, size_t *pargz_len); LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); LT_SCOPE char * argz_next (char *argz, size_t argz_len, const char *entry); LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep); #if defined __cplusplus } #endif #if !defined LTDL # undef LT_SCOPE #endif #endif /*!defined LT__ARGZ_H*/ unixODBC-2.3.9/libltdl/libltdl/lt_dlloader.h0000644000175000017500000000621313725127167015610 00000000000000/* lt_dlloader.h -- dynamic library loader interface Copyright (C) 2004, 2007-2008, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined LT_DLLOADER_H #define LT_DLLOADER_H 1 #include LT_BEGIN_C_DECLS typedef void * lt_dlloader; typedef void * lt_module; typedef void * lt_user_data; typedef struct lt__advise * lt_dladvise; /* Function pointer types for module loader vtable entries: */ typedef lt_module lt_module_open (lt_user_data data, const char *filename, lt_dladvise advise); typedef int lt_module_close (lt_user_data data, lt_module module); typedef void * lt_find_sym (lt_user_data data, lt_module module, const char *symbolname); typedef int lt_dlloader_init (lt_user_data data); typedef int lt_dlloader_exit (lt_user_data data); /* Default priority is LT_DLLOADER_PREPEND if none is explicitly given. */ typedef enum { LT_DLLOADER_PREPEND = 0, LT_DLLOADER_APPEND } lt_dlloader_priority; /* This structure defines a module loader, as populated by the get_vtable entry point of each loader. */ typedef struct { const char * name; const char * sym_prefix; lt_module_open * module_open; lt_module_close * module_close; lt_find_sym * find_sym; lt_dlloader_init * dlloader_init; lt_dlloader_exit * dlloader_exit; lt_user_data dlloader_data; lt_dlloader_priority priority; } lt_dlvtable; LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable); LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader); LT_SCOPE lt_dlvtable * lt_dlloader_remove (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_find (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader); /* Type of a function to get a loader's vtable: */ typedef const lt_dlvtable *lt_get_vtable (lt_user_data data); #ifdef LT_DEBUG_LOADERS LT_SCOPE void lt_dlloader_dump (void); #endif LT_END_C_DECLS #endif /*!defined LT_DLLOADER_H*/ unixODBC-2.3.9/libltdl/libltdl/lt__glibc.h0000644000175000017500000000540013725127167015236 00000000000000/* lt__glibc.h -- support for non glibc environments Copyright (C) 2004, 2006-2007, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__GLIBC_H #define LT__GLIBC_H 1 #if defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #if !defined HAVE_ARGZ_H || !defined HAVE_WORKING_ARGZ /* Redefine any glibc symbols we reimplement to import the implementations into our lt__ namespace so we don't ever clash with the system library if our clients use argz_* from there in addition to libltdl. */ # undef argz_append # define argz_append lt__argz_append # undef argz_create_sep # define argz_create_sep lt__argz_create_sep # undef argz_insert # define argz_insert lt__argz_insert # undef argz_next # define argz_next lt__argz_next # undef argz_stringify # define argz_stringify lt__argz_stringify # include #else #ifdef __cplusplus extern "C" { #endif #include #ifdef __cplusplus } #endif #endif /*!defined HAVE_ARGZ_H || !defined HAVE_WORKING_ARGZ*/ # define slist_concat lt__slist_concat # define slist_cons lt__slist_cons # define slist_delete lt__slist_delete # define slist_remove lt__slist_remove # define slist_reverse lt__slist_reverse # define slist_sort lt__slist_sort # define slist_tail lt__slist_tail # define slist_nth lt__slist_nth # define slist_find lt__slist_find # define slist_length lt__slist_length # define slist_foreach lt__slist_foreach # define slist_box lt__slist_box # define slist_unbox lt__slist_unbox #include #endif /*!defined LT__GLIBC_H*/ unixODBC-2.3.9/libltdl/libltdl/lt_system.h0000644000175000017500000001233613725127167015351 00000000000000/* lt_system.h -- system portability abstraction layer Copyright (C) 2004, 2007, 2010-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined LT_SYSTEM_H #define LT_SYSTEM_H 1 #include #include #include /* Some systems do not define EXIT_*, even with STDC_HEADERS. */ #if !defined EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif #if !defined EXIT_FAILURE # define EXIT_FAILURE 1 #endif /* Just pick a big number... */ #define LT_FILENAME_MAX 2048 /* Saves on those hard to debug '\0' typos.... */ #define LT_EOS_CHAR '\0' /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at the end of C declarations. */ #if defined __cplusplus # define LT_BEGIN_C_DECLS extern "C" { # define LT_END_C_DECLS } #else # define LT_BEGIN_C_DECLS /* empty */ # define LT_END_C_DECLS /* empty */ #endif /* LT_STMT_START/END are used to create macros that expand to a a single compound statement in a portable way. */ #if defined __GNUC__ && !defined __STRICT_ANSI__ && !defined __cplusplus # define LT_STMT_START (void)( # define LT_STMT_END ) #else # if (defined sun || defined __sun__) # define LT_STMT_START if (1) # define LT_STMT_END else (void)0 # else # define LT_STMT_START do # define LT_STMT_END while (0) # endif #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* Canonicalise Windows and Cygwin recognition macros. To match the values set by recent Cygwin compilers, make sure that if __CYGWIN__ is defined (after canonicalisation), __WINDOWS__ is NOT! */ #if defined __CYGWIN32__ && !defined __CYGWIN__ # define __CYGWIN__ __CYGWIN32__ #endif #if defined __CYGWIN__ # if defined __WINDOWS__ # undef __WINDOWS__ # endif #elif defined _WIN32 # define __WINDOWS__ _WIN32 #elif defined WIN32 # define __WINDOWS__ WIN32 #endif #if defined __CYGWIN__ && defined __WINDOWS__ # undef __WINDOWS__ #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #if !defined LT_SCOPE # if defined __WINDOWS__ || defined __CYGWIN__ # if defined DLL_EXPORT /* defined by libtool (if required) */ # define LT_SCOPE extern __declspec(dllexport) # endif # if defined LIBLTDL_DLL_IMPORT /* define if linking with this dll */ /* note: cygwin/mingw compilers can rely instead on auto-import */ # define LT_SCOPE extern __declspec(dllimport) # endif # endif # if !defined LT_SCOPE /* static linking or !__WINDOWS__ */ # define LT_SCOPE extern # endif #endif #if defined __WINDOWS__ /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory separator when it is set. */ # define LT_DIRSEP_CHAR '\\' # define LT_PATHSEP_CHAR ';' #else # define LT_PATHSEP_CHAR ':' #endif #if defined _MSC_VER /* Visual Studio */ # define R_OK 4 #endif /* fopen() mode flags for reading a text file */ #undef LT_READTEXT_MODE #if defined __WINDOWS__ || defined __CYGWIN__ # define LT_READTEXT_MODE "rt" #else # define LT_READTEXT_MODE "r" #endif /* The extra indirection to the LT__STR and LT__CONC macros is required so that if the arguments to LT_STR() (or LT_CONC()) are themselves macros, they will be expanded before being quoted. */ #ifndef LT_STR # define LT__STR(arg) #arg # define LT_STR(arg) LT__STR(arg) #endif #ifndef LT_CONC # define LT__CONC(a, b) a##b # define LT_CONC(a, b) LT__CONC(a, b) #endif #ifndef LT_CONC3 # define LT__CONC3(a, b, c) a##b##c # define LT_CONC3(a, b, c) LT__CONC3(a, b, c) #endif #endif /*!defined LT_SYSTEM_H*/ unixODBC-2.3.9/libltdl/libltdl/slist.h0000644000175000017500000000624113725127167014462 00000000000000/* slist.h -- generalised singly linked lists Copyright (C) 2000, 2004, 2009, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* A generalised list. This is deliberately transparent so that you can make the NEXT field of all your chained data structures first, and then cast them to '(SList *)' so that they can be manipulated by this API. Alternatively, you can generate raw SList elements using slist_new(), and put the element data in the USERDATA field. Either way you get to manage the memory involved by yourself. */ #if !defined SLIST_H #define SLIST_H 1 #if defined LTDL # include # include #else # define LT_SCOPE #endif #include #if defined __cplusplus extern "C" { #endif typedef struct slist { struct slist *next; /* chain forward pointer*/ const void *userdata; /* for boxed 'SList' item */ } SList; typedef void * SListCallback (SList *item, void *userdata); typedef int SListCompare (const SList *item1, const SList *item2, void *userdata); LT_SCOPE SList *slist_concat (SList *head, SList *tail); LT_SCOPE SList *slist_cons (SList *item, SList *slist); LT_SCOPE SList *slist_delete (SList *slist, void (*delete_fct) (void *item)); LT_SCOPE SList *slist_remove (SList **phead, SListCallback *find, void *matchdata); LT_SCOPE SList *slist_reverse (SList *slist); LT_SCOPE SList *slist_sort (SList *slist, SListCompare *compare, void *userdata); LT_SCOPE SList *slist_tail (SList *slist); LT_SCOPE SList *slist_nth (SList *slist, size_t n); LT_SCOPE void * slist_find (SList *slist, SListCallback *find, void *matchdata); LT_SCOPE size_t slist_length (SList *slist); LT_SCOPE void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata); LT_SCOPE SList *slist_box (const void *userdata); LT_SCOPE void * slist_unbox (SList *item); #if defined __cplusplus } #endif #if !defined LTDL # undef LT_SCOPE #endif #endif /*!defined SLIST_H*/ unixODBC-2.3.9/libltdl/libltdl/lt__private.h0000644000175000017500000001063313725127167015634 00000000000000/* lt__private.h -- internal apis for libltdl Copyright (C) 2004-2008, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy con be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__PRIVATE_H #define LT__PRIVATE_H 1 #if defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include #include #include #include #include #if defined HAVE_UNISTD_H # include #endif /* Import internal interfaces... */ #include "lt__alloc.h" #include "lt__dirent.h" #include "lt__strl.h" #include "lt__glibc.h" /* ...and all exported interfaces. */ #include "ltdl.h" #if defined WITH_DMALLOC # include #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #ifndef LT_GLOBAL_DATA # if defined __WINDOWS__ || defined __CYGWIN__ # if defined DLL_EXPORT /* defined by libtool (if required) */ # define LT_GLOBAL_DATA __declspec(dllexport) # endif # endif # ifndef LT_GLOBAL_DATA # define LT_GLOBAL_DATA /* static linking or !__WINDOWS__ */ # endif #endif #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif #endif #ifndef LT__UNUSED # define LT__UNUSED __attribute__ ((__unused__)) #endif LT_BEGIN_C_DECLS #if !defined errno extern int errno; #endif LT_SCOPE void lt__alloc_die_callback (void); /* For readability: */ #define STRNEQ(s1, s2) (strcmp((s1), (s2)) != 0) #define STREQ(s1, s2) (strcmp((s1), (s2)) == 0) /* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ /* This type is used for the array of interface data sets in each handler. */ typedef struct { lt_dlinterface_id key; void * data; } lt_interface_data; struct lt__handle { lt_dlhandle next; const lt_dlvtable * vtable; /* dlopening interface */ lt_dlinfo info; /* user visible fields */ int depcount; /* number of dependencies */ lt_dlhandle * deplibs; /* dependencies */ lt_module module; /* system module handle */ void * system; /* system specific data */ lt_interface_data * interface_data; /* per caller associated data */ int flags; /* various boolean stats */ }; struct lt__advise { unsigned int try_ext:1; /* try system library extensions. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ unsigned int try_preload_only:1;/* only preloaded modules will be tried. */ }; /* --- ERROR HANDLING --- */ /* Extract the diagnostic strings from the error table macro in the same order as the enumerated indices in lt_error.h. */ #define LT__STRERROR(name) lt__error_string(LT_CONC(LT_ERROR_,name)) #define LT__GETERROR(lvalue) (lvalue) = lt__get_last_error() #define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg) #define LT__SETERROR(errorcode) LT__SETERRORSTR(LT__STRERROR(errorcode)) LT_SCOPE const char *lt__error_string (int errorcode); LT_SCOPE const char *lt__get_last_error (void); LT_SCOPE const char *lt__set_last_error (const char *errormsg); LT_END_C_DECLS #endif /*!defined LT__PRIVATE_H*/ unixODBC-2.3.9/libltdl/README0000644000175000017500000000126513725127167012406 00000000000000This is GNU libltdl, a system independent dlopen wrapper for GNU libtool. It supports the following dlopen interfaces: * dlopen (POSIX) * shl_load (HP-UX) * LoadLibrary (Win16 and Win32) * load_add_on (BeOS) * GNU DLD (emulates dynamic linking for static libraries) * dyld (darwin/Mac OS X) * libtool's dlpreopen -- Copyright (C) 1999, 2003, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 This file is part of GNU Libtool. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. unixODBC-2.3.9/libltdl/configure.ac0000664000175000017500000000507213725127167014016 00000000000000# Process this file with autoconf to create configure. -*- autoconf -*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # NOTE: The canonical source of this file is maintained with the # GNU Libtool package. Report bugs to bug-libtool@gnu.org. # # GNU Libltdl is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # As a special exception to the GNU Lesser General Public License, # if you distribute this file as part of a program or library that # is built using GNU libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libltdl 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 Lesser General Public License for more details. # # You should have received a copy of the GNU LesserGeneral Public # License along with GNU Libltdl; see the file COPYING.LIB. If not, a # copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #### # This configure.ac is not used at all by the libtool bootstrap, but # is copied to the ltdl subdirectory if you libtoolize --ltdl your own # project. Adding LT_WITH_LTDL to your project configure.ac will then # configure this directory if your user doesn't want to use the installed # libltdl. AC_PREREQ(2.59)dnl We use AS_HELP_STRING ## ------------------------ ## ## Autoconf initialisation. ## ## ------------------------ ## AC_INIT([libltdl], [2.4.3a], [bug-libtool@gnu.org]) AC_CONFIG_HEADERS([config.h:config-h.in]) AC_CONFIG_SRCDIR([ltdl.c]) AC_CONFIG_AUX_DIR([..]) LT_CONFIG_LTDL_DIR([.]) # I am me! ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## AM_INIT_AUTOMAKE([gnu subdir-objects]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) ## ------------------------------- ## ## Libtool specific configuration. ## ## ------------------------------- ## pkgdatadir='$datadir'"/$PACKAGE" ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## LT_INIT([dlopen win32-dll]) _LTDL_SETUP ## -------- ## ## Outputs. ## ## -------- ## AC_CONFIG_FILES([Makefile]) AC_OUTPUT unixODBC-2.3.9/libltdl/ltdl.h0000644000175000017500000001311513725127167012633 00000000000000/* ltdl.h -- generic dlopen functions Copyright (C) 1998-2000, 2004-2005, 2007-2008, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined LTDL_H #define LTDL_H 1 #include #include #include LT_BEGIN_C_DECLS /* LT_STRLEN can be used safely on NULL pointers. */ #define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) /* --- DYNAMIC MODULE LOADING API --- */ typedef struct lt__handle *lt_dlhandle; /* A loaded module. */ /* Initialisation and finalisation functions for libltdl. */ LT_SCOPE int lt_dlinit (void); LT_SCOPE int lt_dlexit (void); /* Module search path manipulation. */ LT_SCOPE int lt_dladdsearchdir (const char *search_dir); LT_SCOPE int lt_dlinsertsearchdir (const char *before, const char *search_dir); LT_SCOPE int lt_dlsetsearchpath (const char *search_path); LT_SCOPE const char *lt_dlgetsearchpath (void); LT_SCOPE int lt_dlforeachfile ( const char *search_path, int (*func) (const char *filename, void *data), void *data); /* User module loading advisors. */ LT_SCOPE int lt_dladvise_init (lt_dladvise *advise); LT_SCOPE int lt_dladvise_destroy (lt_dladvise *advise); LT_SCOPE int lt_dladvise_ext (lt_dladvise *advise); LT_SCOPE int lt_dladvise_resident (lt_dladvise *advise); LT_SCOPE int lt_dladvise_local (lt_dladvise *advise); LT_SCOPE int lt_dladvise_global (lt_dladvise *advise); LT_SCOPE int lt_dladvise_preload (lt_dladvise *advise); /* Portable libltdl versions of the system dlopen() API. */ LT_SCOPE lt_dlhandle lt_dlopen (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenext (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise); LT_SCOPE void * lt_dlsym (lt_dlhandle handle, const char *name); LT_SCOPE const char *lt_dlerror (void); LT_SCOPE int lt_dlclose (lt_dlhandle handle); /* --- PRELOADED MODULE SUPPORT --- */ /* A preopened symbol. Arrays of this type comprise the exported symbols for a dlpreopened module. */ typedef struct { const char *name; void *address; } lt_dlsymlist; typedef int lt_dlpreload_callback_func (lt_dlhandle handle); LT_SCOPE int lt_dlpreload (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_default (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func); #define lt_preloaded_symbols lt__PROGRAM__LTX_preloaded_symbols /* Ensure C linkage. */ extern LT_DLSYM_CONST lt_dlsymlist lt__PROGRAM__LTX_preloaded_symbols[]; #define LTDL_SET_PRELOADED_SYMBOLS() \ lt_dlpreload_default(lt_preloaded_symbols) /* --- MODULE INFORMATION --- */ /* Associating user data with loaded modules. */ typedef void * lt_dlinterface_id; typedef int lt_dlhandle_interface (lt_dlhandle handle, const char *id_string); LT_SCOPE lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface); LT_SCOPE void lt_dlinterface_free (lt_dlinterface_id key); LT_SCOPE void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data); LT_SCOPE void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle); /* Read only information pertaining to a loaded module. */ typedef struct { char * filename; /* file name */ char * name; /* module name */ int ref_count; /* number of times lt_dlopened minus number of times lt_dlclosed. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ } lt_dlinfo; LT_SCOPE const lt_dlinfo *lt_dlgetinfo (lt_dlhandle handle); LT_SCOPE lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place); LT_SCOPE lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name); LT_SCOPE int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data); /* Deprecated module residency management API. */ LT_SCOPE int lt_dlmakeresident (lt_dlhandle handle); LT_SCOPE int lt_dlisresident (lt_dlhandle handle); #define lt_ptr void * LT_END_C_DECLS #endif /*!defined LTDL_H*/ unixODBC-2.3.9/libltdl/loaders/0000775000175000017500000000000013725127520013226 500000000000000unixODBC-2.3.9/libltdl/loaders/dld_link.c0000644000175000017500000001071713725127167015105 00000000000000/* loader-dld_link.c -- dynamic linking with dld Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dld_link_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dld_link"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined HAVE_DLD_H # include #endif /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { lt_module module = lt__strdup (filename); if (dld_link (filename) != 0) { LT__SETERROR (CANNOT_OPEN); FREE (module); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (dld_unlink_by_file ((char*)(module), 1) != 0) { LT__SETERROR (CANNOT_CLOSE); ++errors; } else { FREE (module); } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module LT__UNUSED, const char *name) { void *address = dld_get_func (name); if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } return address; } unixODBC-2.3.9/libltdl/loaders/dlopen.c0000644000175000017500000001664113725127167014610 00000000000000/* loader-dlopen.c -- dynamic linking with dlopen/dlsym Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dlopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dlopen"; #if defined DLSYM_USCORE vtable->sym_prefix = "_"; #endif vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined HAVE_DLFCN_H # include #endif #if defined HAVE_SYS_DL_H # include #endif /* We may have to define LT_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #if !defined LT_LAZY_OR_NOW # if defined RTLD_LAZY # define LT_LAZY_OR_NOW RTLD_LAZY # else # if defined DL_LAZY # define LT_LAZY_OR_NOW DL_LAZY # endif # endif /* !RTLD_LAZY */ #endif #if !defined LT_LAZY_OR_NOW # if defined RTLD_NOW # define LT_LAZY_OR_NOW RTLD_NOW # else # if defined DL_NOW # define LT_LAZY_OR_NOW DL_NOW # endif # endif /* !RTLD_NOW */ #endif #if !defined LT_LAZY_OR_NOW # define LT_LAZY_OR_NOW 0 #endif /* !LT_LAZY_OR_NOW */ /* We only support local and global symbols from modules for loaders that provide such a thing, otherwise the system default is used. */ #if !defined RTLD_GLOBAL # if defined DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # endif #endif /* !RTLD_GLOBAL */ #if !defined RTLD_LOCAL # if defined DL_LOCAL # define RTLD_LOCAL DL_LOCAL # endif #endif /* !RTLD_LOCAL */ #if defined HAVE_DLERROR # define DLERROR(arg) dlerror () #else # define DLERROR(arg) LT__STRERROR (arg) #endif #define DL__SETERROR(errorcode) \ LT__SETERRORSTR (DLERROR (errorcode)) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise) { int module_flags = LT_LAZY_OR_NOW; lt_module module; #ifdef RTLD_MEMBER int len = LT_STRLEN (filename); #endif if (advise) { #ifdef RTLD_GLOBAL /* If there is some means of asking for global symbol resolution, do so. */ if (advise->is_symglobal) module_flags |= RTLD_GLOBAL; #else /* Otherwise, reset that bit so the caller can tell it wasn't acted on. */ advise->is_symglobal = 0; #endif /* And similarly for local only symbol resolution. */ #ifdef RTLD_LOCAL if (advise->is_symlocal) module_flags |= RTLD_LOCAL; #else advise->is_symlocal = 0; #endif } #ifdef RTLD_MEMBER /* AIX */ if (len >= 4) /* at least "l(m)" */ { /* Advise loading an archive member only if the filename really contains both the opening and closing parent, and a member. */ if (filename[len-1] == ')') { const char *opening = strrchr(filename, '('); if (opening && opening < (filename+len-2) && strchr(opening+1, '/') == NULL) module_flags |= RTLD_MEMBER; } } #endif module = dlopen (filename, module_flags); #if defined RTLD_MEMBER && defined LT_SHARED_LIB_MEMBER if (!module && len && !(module_flags & RTLD_MEMBER) && errno == ENOEXEC) { /* Loading without a member specified failed with "Exec format error". So the file is there, but either has wrong bitwidth, or is an archive eventually containing the default shared archive member. Retry with default member, getting same error in worst case. */ const char *member = LT_SHARED_LIB_MEMBER; char *attempt = MALLOC (char, len + strlen (member) + 1); if (!attempt) { LT__SETERROR (NO_MEMORY); return module; } sprintf (attempt, "%s%s", filename, member); module = vm_open (loader_data, attempt, advise); FREE (attempt); return module; } #endif if (!module) { DL__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (dlclose (module) != 0) { DL__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = dlsym (module, name); if (!address) { DL__SETERROR (SYMBOL_NOT_FOUND); } return address; } unixODBC-2.3.9/libltdl/loaders/dyld.c0000644000175000017500000003246113725127167014261 00000000000000/* loader-dyld.c -- dynamic linking on darwin and OS X Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2015 Free Software Foundation, Inc. Written by Peter O'Gorman, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dyld_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dyld"; vtable->sym_prefix = "_"; vtable->dlloader_init = vl_init; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined HAVE_MACH_O_DYLD_H # if !defined __APPLE_CC__ && !defined __MWERKS__ && !defined __private_extern__ /* Is this correct? Does it still function properly? */ # define __private_extern__ extern # endif # include #endif #include /* We have to put some stuff here that isn't in older dyld.h files */ #if !defined ENUM_DYLD_BOOL # define ENUM_DYLD_BOOL # undef FALSE # undef TRUE enum DYLD_BOOL { FALSE, TRUE }; #endif #if !defined LC_REQ_DYLD # define LC_REQ_DYLD 0x80000000 #endif #if !defined LC_LOAD_WEAK_DYLIB # define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) #endif #if !defined NSADDIMAGE_OPTION_NONE # define NSADDIMAGE_OPTION_NONE 0x0 #endif #if !defined NSADDIMAGE_OPTION_RETURN_ON_ERROR # define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 #endif #if !defined NSADDIMAGE_OPTION_WITH_SEARCHING # define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 #endif #if !defined NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED # define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 #endif #if !defined NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME # define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 #endif #if !defined NSLOOKUPSYMBOLINIMAGE_OPTION_BIND # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 #endif #if !defined NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 #endif #if !defined NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 #endif #if !defined NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR # define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 #endif #define LT__SYMLOOKUP_OPTS (NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW \ | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) #if defined __BIG_ENDIAN__ # define LT__MAGIC MH_MAGIC #else # define LT__MAGIC MH_CIGAM #endif #define DYLD__SETMYERROR(errmsg) LT__SETERRORSTR (dylderror (errmsg)) #define DYLD__SETERROR(errcode) DYLD__SETMYERROR (LT__STRERROR (errcode)) typedef struct mach_header mach_header; typedef struct dylib_command dylib_command; static const char *dylderror (const char *errmsg); static const mach_header *lt__nsmodule_get_header (NSModule module); static const char *lt__header_get_instnam (const mach_header *mh); static const mach_header *lt__match_loadedlib (const char *name); static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh); static const mach_header *(*lt__addimage) (const char *image_name, unsigned long options) = 0; static NSSymbol (*lt__image_symbol) (const mach_header *image, const char *symbolName, unsigned long options) = 0; static enum DYLD_BOOL (*lt__image_symbol_p) (const mach_header *image, const char *symbolName) = 0; static enum DYLD_BOOL (*lt__module_export) (NSModule module) = 0; static int dyld_cannot_close = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data loader_data) { int errors = 0; if (! dyld_cannot_close) { if (!_dyld_present ()) { ++errors; } else { (void) _dyld_func_lookup ("__dyld_NSAddImage", (unsigned long*) <__addimage); (void) _dyld_func_lookup ("__dyld_NSLookupSymbolInImage", (unsigned long*)<__image_symbol); (void) _dyld_func_lookup ("__dyld_NSIsSymbolNameDefinedInImage", (unsigned long*) <__image_symbol_p); (void) _dyld_func_lookup ("__dyld_NSMakePrivateModulePublic", (unsigned long*) <__module_export); dyld_cannot_close = lt_dladderror ("can't close a dylib"); } } return errors; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise LT__UNUSED) { lt_module module = 0; NSObjectFileImage ofi = 0; if (!filename) { return (lt_module) -1; } switch (NSCreateObjectFileImageFromFile (filename, &ofi)) { case NSObjectFileImageSuccess: module = NSLinkModule (ofi, filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE | NSLINKMODULE_OPTION_BINDNOW); NSDestroyObjectFileImage (ofi); if (module) { lt__module_export (module); } break; case NSObjectFileImageInappropriateFile: if (lt__image_symbol_p && lt__image_symbol) { module = (lt_module) lt__addimage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); } break; case NSObjectFileImageFailure: case NSObjectFileImageArch: case NSObjectFileImageFormat: case NSObjectFileImageAccess: /*NOWORK*/ break; } if (!module) { DYLD__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data, lt_module module) { int errors = 0; if (module != (lt_module) -1) { const mach_header *mh = (const mach_header *) module; int flags = 0; if (mh->magic == LT__MAGIC) { lt_dlseterror (dyld_cannot_close); ++errors; } else { /* Currently, if a module contains c++ static destructors and it is unloaded, we get a segfault in atexit(), due to compiler and dynamic loader differences of opinion, this works around that. */ if ((const struct section *) NULL != getsectbynamefromheader (lt__nsmodule_get_header (module), "__DATA", "__mod_term_func")) { flags |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; } #if defined __ppc__ flags |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; #endif if (!NSUnLinkModule (module, flags)) { DYLD__SETERROR (CANNOT_CLOSE); ++errors; } } } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data, lt_module module, const char *name) { NSSymbol *nssym = 0; const mach_header *mh = (const mach_header *) module; char saveError[256] = "Symbol not found"; if (module == (lt_module) -1) { void *address, *unused; _dyld_lookup_and_bind (name, (unsigned long*) &address, &unused); return address; } if (mh->magic == LT__MAGIC) { if (lt__image_symbol_p && lt__image_symbol) { if (lt__image_symbol_p (mh, name)) { nssym = lt__image_symbol (mh, name, LT__SYMLOOKUP_OPTS); } } } else { nssym = NSLookupSymbolInModule (module, name); } if (!nssym) { strlcpy (saveError, dylderror (LT__STRERROR (SYMBOL_NOT_FOUND)), 255); saveError[255] = 0; if (!mh) { mh = (mach_header *)lt__nsmodule_get_header (module); } nssym = lt__linkedlib_symbol (name, mh); } if (!nssym) { LT__SETERRORSTR (saveError); } return nssym ? NSAddressOfSymbol (nssym) : 0; } /* --- HELPER FUNCTIONS --- */ /* Return the dyld error string, or the passed in error string if none. */ static const char * dylderror (const char *errmsg) { NSLinkEditErrors ler; int lerno; const char *file; const char *errstr; NSLinkEditError (&ler, &lerno, &file, &errstr); if (! (errstr && *errstr)) { errstr = errmsg; } return errstr; } /* There should probably be an apple dyld api for this. */ static const mach_header * lt__nsmodule_get_header (NSModule module) { int i = _dyld_image_count(); const char *modname = NSNameOfModule (module); const mach_header *mh = 0; if (!modname) return NULL; while (i > 0) { --i; if (strneq (_dyld_get_image_name (i), modname)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* NSAddImage is also used to get the loaded image, but it only works if the lib is installed, for uninstalled libs we need to check the install_names against each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a different lib was loaded as a result. */ static const char * lt__header_get_instnam (const mach_header *mh) { unsigned long offset = sizeof(mach_header); const char* result = 0; int j; for (j = 0; j < mh->ncmds; j++) { struct load_command *lc; lc = (struct load_command*) (((unsigned long) mh) + offset); if (LC_ID_DYLIB == lc->cmd) { result=(char*)(((dylib_command*) lc)->dylib.name.offset + (unsigned long) lc); } offset += lc->cmdsize; } return result; } static const mach_header * lt__match_loadedlib (const char *name) { const mach_header *mh = 0; int i = _dyld_image_count(); while (i > 0) { const char *id; --i; id = lt__header_get_instnam (_dyld_get_image_header (i)); if (id && strneq (id, name)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* Safe to assume our mh is good. */ static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh) { NSSymbol symbol = 0; if (lt__image_symbol && NSIsSymbolNameDefined (symname)) { unsigned long offset = sizeof(mach_header); struct load_command *lc; int j; for (j = 0; j < mh->ncmds; j++) { lc = (struct load_command*) (((unsigned long) mh) + offset); if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) { unsigned long base = ((dylib_command *) lc)->dylib.name.offset; char *name = (char *) (base + (unsigned long) lc); const mach_header *mh1 = lt__match_loadedlib (name); if (!mh1) { /* Maybe NSAddImage can find it */ mh1 = lt__addimage (name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | NSADDIMAGE_OPTION_WITH_SEARCHING | NSADDIMAGE_OPTION_RETURN_ON_ERROR); } if (mh1) { symbol = lt__image_symbol (mh1, symname, LT__SYMLOOKUP_OPTS); if (symbol) break; } } offset += lc->cmdsize; } } return symbol; } unixODBC-2.3.9/libltdl/loaders/loadlibrary.c0000644000175000017500000002512413725127167015627 00000000000000/* loader-loadlibrary.c -- dynamic linking for Win32 Copyright (C) 1998-2000, 2004-2008, 2010-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #if defined __CYGWIN__ # include #endif /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable loadlibrary_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlinterface_id iface_id = 0; static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); iface_id = lt_dlinterface_register ("ltdl loadlibrary", NULL); } if (vtable && !vtable->name) { vtable->name = "lt_loadlibrary"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include #define LOCALFREE(mem) LT_STMT_START { \ if (mem) { LocalFree ((void *)mem); mem = NULL; } } LT_STMT_END #define LOADLIB__SETERROR(errmsg) LT__SETERRORSTR (loadlibraryerror (errmsg)) #define LOADLIB_SETERROR(errcode) LOADLIB__SETERROR (LT__STRERROR (errcode)) static const char *loadlibraryerror (const char *default_errmsg); static DWORD WINAPI wrap_getthreaderrormode (void); static DWORD WINAPI fallback_getthreaderrormode (void); static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode); static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode); typedef DWORD (WINAPI getthreaderrormode_type) (void); typedef BOOL (WINAPI setthreaderrormode_type) (DWORD, DWORD *); static getthreaderrormode_type *getthreaderrormode = wrap_getthreaderrormode; static setthreaderrormode_type *setthreaderrormode = wrap_setthreaderrormode; static char *error_message = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; LOCALFREE (error_message); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { lt_module module = 0; char *ext; char wpath[MAX_PATH]; size_t len; if (!filename) { /* Get the name of main module */ *wpath = 0; GetModuleFileName (NULL, wpath, sizeof (wpath)); filename = wpath; } else { len = LT_STRLEN (filename); if (len >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } #if HAVE_DECL_CYGWIN_CONV_PATH if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, filename, wpath, MAX_PATH)) { LT__SETERROR (CANNOT_OPEN); return 0; } len = 0; #elif defined __CYGWIN__ cygwin_conv_to_full_win32_path (filename, wpath); len = 0; #else strcpy(wpath, filename); #endif ext = strrchr (wpath, '.'); if (!ext) { /* Append a '.' to stop Windows from adding an implicit '.dll' extension. */ if (!len) len = strlen (wpath); if (len + 1 >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } wpath[len] = '.'; wpath[len+1] = '\0'; } } { /* Silence dialog from LoadLibrary on some failures. */ DWORD errormode = getthreaderrormode (); DWORD last_error; setthreaderrormode (errormode | SEM_FAILCRITICALERRORS, NULL); module = LoadLibrary (wpath); /* Restore the error mode. */ last_error = GetLastError (); setthreaderrormode (errormode, NULL); SetLastError (last_error); } /* libltdl expects this function to fail if it is unable to physically load the library. Sadly, LoadLibrary will search the loaded libraries for a match and return one of them if the path search load fails. We check whether LoadLibrary is returning a handle to an already loaded module, and simulate failure if we find one. */ { lt_dlhandle cur = 0; while ((cur = lt_dlhandle_iterate (iface_id, cur))) { if (!cur->module) { cur = 0; break; } if (cur->module == module) { break; } } if (!module) LOADLIB_SETERROR (CANNOT_OPEN); else if (cur) { LT__SETERROR (CANNOT_OPEN); module = 0; } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (FreeLibrary ((HMODULE) module) == 0) { LOADLIB_SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = (void *) GetProcAddress ((HMODULE) module, name); if (!address) { LOADLIB_SETERROR (SYMBOL_NOT_FOUND); } return address; } /* --- HELPER FUNCTIONS --- */ /* Return the windows error message, or the passed in error message on failure. */ static const char * loadlibraryerror (const char *default_errmsg) { size_t len; LOCALFREE (error_message); FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError (), 0, (char *) &error_message, 0, NULL); /* Remove trailing CRNL */ len = LT_STRLEN (error_message); if (len && error_message[len - 1] == '\n') error_message[--len] = LT_EOS_CHAR; if (len && error_message[len - 1] == '\r') error_message[--len] = LT_EOS_CHAR; return len ? error_message : default_errmsg; } /* A function called through the getthreaderrormode variable that checks if the system supports GetThreadErrorMode (or GetErrorMode) and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static DWORD WINAPI wrap_getthreaderrormode (void) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetThreadErrorMode"); if (!getthreaderrormode) getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetErrorMode"); if (!getthreaderrormode) getthreaderrormode = fallback_getthreaderrormode; return getthreaderrormode (); } /* A function called through the getthreaderrormode variable for cases where the system does not support GetThreadErrorMode or GetErrorMode */ static DWORD WINAPI fallback_getthreaderrormode (void) { /* Prior to Windows Vista, the only way to get the current error mode was to set a new one. In our case, we are setting a new error mode right after "getting" it while ignoring the error mode in effect when setting the new error mode, so that's fairly ok. */ return (DWORD) SetErrorMode (SEM_FAILCRITICALERRORS); } /* A function called through the setthreaderrormode variable that checks if the system supports SetThreadErrorMode and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); setthreaderrormode = (setthreaderrormode_type *) GetProcAddress (kernel32, "SetThreadErrorMode"); if (!setthreaderrormode) setthreaderrormode = fallback_setthreaderrormode; return setthreaderrormode (mode, oldmode); } /* A function called through the setthreaderrormode variable for cases where the system does not support SetThreadErrorMode. */ static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode) { /* Prior to Windows 7, there was no way to set the thread local error mode, so set the process global error mode instead. */ DWORD old = (DWORD) SetErrorMode (mode); if (oldmode) *oldmode = old; return TRUE; } unixODBC-2.3.9/libltdl/loaders/load_add_on.c0000644000175000017500000001126313725127167015545 00000000000000/* loader-load_add_on.c -- dynamic linking for BeOS Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable load_add_on_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_load_add_on"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { image_id image = 0; if (filename) { image = load_add_on (filename); } else { image_info info; int32 cookie = 0; if (get_next_image_info (0, &cookie, &info) == B_OK) image = load_add_on (info.name); } if (image <= 0) { LT__SETERROR (CANNOT_OPEN); image = 0; } return (lt_module) image; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (unload_add_on ((image_id) module) != B_OK) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = 0; image_id image = (image_id) module; if (get_image_symbol (image, name, B_SYMBOL_TYPE_ANY, address) != B_OK) { LT__SETERROR (SYMBOL_NOT_FOUND); address = 0; } return address; } unixODBC-2.3.9/libltdl/loaders/preopen.c0000644000175000017500000002312513725127167014772 00000000000000/* loader-preopen.c -- emulate dynamic linking using preloaded_symbols Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable preopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_preopen"; vtable->sym_prefix = 0; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_init = vl_init; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ /* Wrapper type to chain together symbol lists of various origins. */ typedef struct symlist_chain { struct symlist_chain *next; const lt_dlsymlist *symlist; } symlist_chain; static int add_symlist (const lt_dlsymlist *symlist); static int free_symlists (void); /* The start of the symbol lists chain. */ static symlist_chain *preloaded_symlists = 0; /* A symbol list preloaded before lt_init() was called. */ static const lt_dlsymlist *default_preloaded_symbols = 0; /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data loader_data LT__UNUSED) { int errors = 0; preloaded_symlists = 0; if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } return errors; } /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; free_symlists (); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { symlist_chain *lists; lt_module module = 0; if (!preloaded_symlists) { LT__SETERROR (NO_SYMBOLS); goto done; } /* Can't use NULL as the reflective symbol header, as NULL is used to mark the end of the entire symbol list. Self-dlpreopened symbols follow this magic number, chosen to be an unlikely clash with a real module name. */ if (!filename) { filename = "@PROGRAM@"; } for (lists = preloaded_symlists; lists; lists = lists->next) { const lt_dlsymlist *symbol; for (symbol= lists->symlist; symbol->name; ++symbol) { if (!symbol->address && STREQ (symbol->name, filename)) { /* If the next symbol's name and address is 0, it means the module just contains the originator and no symbols. In this case we pretend that we never saw the module and hope that some other loader will be able to load the module and have access to its symbols */ const lt_dlsymlist *next_symbol = symbol +1; if (next_symbol->address && next_symbol->name) { module = (lt_module) lists->symlist; goto done; } } } } LT__SETERROR (FILE_NOT_FOUND); done: return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module LT__UNUSED) { /* Just to silence gcc -Wall */ module = 0; return 0; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { lt_dlsymlist *symbol = (lt_dlsymlist*) module; if (symbol[1].name && STREQ (symbol[1].name, "@INIT@")) { symbol++; /* Skip optional init entry. */ } symbol +=2; /* Skip header (originator then libname). */ while (symbol->name) { if (STREQ (symbol->name, name)) { return symbol->address; } ++symbol; } LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } /* --- HELPER FUNCTIONS --- */ /* The symbol lists themselves are not allocated from the heap, but we can unhook them and free up the chain of links between them. */ static int free_symlists (void) { symlist_chain *lists; lists = preloaded_symlists; while (lists) { symlist_chain *next = lists->next; FREE (lists); lists = next; } preloaded_symlists = 0; return 0; } /* Add a new symbol list to the global chain. */ static int add_symlist (const lt_dlsymlist *symlist) { symlist_chain *lists; int errors = 0; /* Search for duplicate entries: */ for (lists = preloaded_symlists; lists && lists->symlist != symlist; lists = lists->next) /*NOWORK*/; /* Don't add the same list twice: */ if (!lists) { symlist_chain *tmp = (symlist_chain *) lt__zalloc (sizeof *tmp); if (tmp) { tmp->symlist = symlist; tmp->next = preloaded_symlists; preloaded_symlists = tmp; if (symlist[1].name && STREQ (symlist[1].name, "@INIT@")) { void (*init_symlist)(void); *(void **)(&init_symlist) = symlist[1].address; (*init_symlist)(); } } else { ++errors; } } return errors; } /* --- PRELOADING API CALL IMPLEMENTATIONS --- */ /* Save a default symbol list for later. */ int lt_dlpreload_default (const lt_dlsymlist *preloaded) { default_preloaded_symbols = preloaded; return 0; } /* Add a symbol list to the global chain, or with a NULL argument, revert to just the default list. */ int lt_dlpreload (const lt_dlsymlist *preloaded) { int errors = 0; if (preloaded) { errors = add_symlist (preloaded); } else { free_symlists(); if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } } return errors; } /* Open all the preloaded modules from the named originator, executing a callback for each one. If ORIGINATOR is NULL, then call FUNC for each preloaded module from the program itself. */ int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func) { symlist_chain *list; int errors = 0; int found = 0; /* For each symlist in the chain... */ for (list = preloaded_symlists; list; list = list->next) { /* ...that was preloaded by the requesting ORIGINATOR... */ if ((originator && STREQ (list->symlist->name, originator)) || (!originator && STREQ (list->symlist->name, "@PROGRAM@"))) { const lt_dlsymlist *symbol; unsigned int idx = 0; ++found; /* ...load the symbols per source compilation unit: (we preincrement the index to skip over the originator entry) */ while ((symbol = &list->symlist[++idx])->name != 0) { if ((symbol->address == 0) && (STRNEQ (symbol->name, "@PROGRAM@"))) { lt_dlhandle handle = lt_dlopen (symbol->name); if (handle == 0) { ++errors; } else { errors += (*func) (handle); } } } } } if (!found) { LT__SETERROR(CANNOT_OPEN); ++errors; } return errors; } unixODBC-2.3.9/libltdl/loaders/shl_load.c0000644000175000017500000001504613725127167015112 00000000000000/* loader-shl_load.c -- dynamic linking with shl_load (HP-UX) Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable shl_load_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_shl_load"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined HAVE_DL_H # include #endif /* some flags are missing on some systems, so we provide * harmless defaults. * * Mandatory: * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. * BIND_DEFERRED - Delay code symbol resolution until actual reference. * * Optionally: * BIND_FIRST - Place the library at the head of the symbol search * order. * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all * unsatisfied symbols as fatal. This flag allows * binding of unsatisfied code symbols to be deferred * until use. * [Perl: For certain libraries, like DCE, deferred * binding often causes run time problems. Adding * BIND_NONFATAL to BIND_IMMEDIATE still allows * unresolved references in situations like this.] * BIND_NOSTART - Do not call the initializer for the shared library * when the library is loaded, nor on a future call to * shl_unload(). * BIND_VERBOSE - Print verbose messages concerning possible * unsatisfied symbols. * * hp9000s700/hp9000s800: * BIND_RESTRICTED - Restrict symbols visible by the library to those * present at library load time. * DYNAMIC_PATH - Allow the loader to dynamically search for the * library specified by the path argument. */ #if !defined DYNAMIC_PATH # define DYNAMIC_PATH 0 #endif #if !defined BIND_RESTRICTED # define BIND_RESTRICTED 0 #endif #define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { static shl_t self = (shl_t) 0; lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); /* Since searching for a symbol against a NULL module handle will also look in everything else that was already loaded and exported with the -E compiler flag, we always cache a handle saved before any modules are loaded. */ if (!self) { void *address; shl_findsym (&self, "main", TYPE_UNDEFINED, &address); } if (!filename) { module = self; } else { module = shl_load (filename, LT_BIND_FLAGS, 0L); if (!module) { LT__SETERROR (CANNOT_OPEN); } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (module && (shl_unload ((shl_t) (module)) != 0)) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = 0; /* sys_shl_open should never return a NULL module handle */ if (module == (lt_module) 0) { LT__SETERROR (INVALID_HANDLE); } else if (!shl_findsym((shl_t*) &module, name, TYPE_UNDEFINED, &address)) { if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } } return address; } unixODBC-2.3.9/libltdl/configure0000664000175000017500000160477513725127167013454 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libltdl 2.4.3a. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: bug-libtool@gnu.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libltdl' PACKAGE_TARNAME='libltdl' PACKAGE_VERSION='2.4.3a' PACKAGE_STRING='libltdl 2.4.3a' PACKAGE_BUGREPORT='bug-libtool@gnu.org' PACKAGE_URL='' ac_unique_file="ltdl.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LTDLOPEN LT_CONFIG_H CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE LT_ARGZ_H LIBOBJS sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL OBJDUMP DLLTOOL AS AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_ltdl_install ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libltdl 2.4.3a to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libltdl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libltdl 2.4.3a:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libltdl configure 2.4.3a generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libltdl $as_me 2.4.3a, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h:config-h.in" ac_aux_dir= for ac_dir in .. "$srcdir"/..; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in .. \"$srcdir\"/.." "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # I am me! ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libltdl' VERSION='2.4.3a' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ## ------------------------------- ## ## Libtool specific configuration. ## ## ------------------------------- ## pkgdatadir='$datadir'"/$PACKAGE" ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=yes enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking what extension is used for runtime loadable modules" >&5 $as_echo_n "checking what extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi if test -n "$shared_archive_member_spec"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_LIB_MEMBER "($shared_archive_member_spec.o)" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking what variable specifies run-time module search path" >&5 $as_echo_n "checking what variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var=$shlibpath_var fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path=$dir else sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required"; then LIBADD_DLOPEN=-ldl fi libltdl_cv_lib_dl_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" then lt_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS=$lt_save_LIBS fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD=-ldld fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" LIBS=$lt_dlload_save_LIBS ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test yes = "$lt_cv_sys_symbol_underscore"; then if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown dlsym_uscore_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" libname=conftmod # stay within 8.3 filename limits! cat >$libname.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } _LT_EOF # ltfn_module_cmds module_cmds # Execute tilde-delimited MODULE_CMDS with environment primed for # $module_cmds or $archive_cmds type content. ltfn_module_cmds () {( # subshell avoids polluting parent global environment module_cmds_save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$module_cmds_save_ifs libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. major=; versuffix=; verstring=; deplibs= ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= eval $cmd done IFS=$module_cmds_save_ifs )} # Compile a loadable module using libtool macro expansion results. $CC $pic_flag -c $libname.$ac_ext ltfn_module_cmds "${module_cmds:-$archive_cmds}" # Try to fetch fnord with dlsym(). libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 cat >conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifndef RTLD_GLOBAL # ifdef DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # else # define RTLD_GLOBAL 0 # endif #endif #ifndef RTLD_NOW # ifdef DL_NOW # define RTLD_NOW DL_NOW # else # define RTLD_NOW 0 # endif #endif int main () { void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); int status = $libltdl_dlunknown; if (handle) { if (dlsym (handle, "fnord")) status = $libltdl_dlnouscore; else { if (dlsym (handle, "_fnord")) status = $libltdl_dluscore; else puts (dlerror ()); } dlclose (handle); } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null libltdl_status=$? case x$libltdl_status in x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; x*) libltdl_cv_need_uscore=unknown ;; esac fi rm -rf conftest* $libname* LIBS=$dlsym_uscore_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test yes = "$libltdl_cv_need_uscore"; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this 'case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; bitrig*) lt_cv_sys_dlopen_deplibs=yes ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say 'no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to 'yes'. Without it, it would be 'no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say 'yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test yes != "$lt_cv_sys_dlopen_deplibs"; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi LT_ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else LT_ARGZ_H=lt__argz.h; case " $LIBOBJS " in *" lt__argz.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__argz.$ac_objext" ;; esac fi done if test -z "$LT_ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test yes = "$lt_cv_sys_argz_works"; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else LT_ARGZ_H=lt__argz.h case " $LIBOBJS " in *" lt__argz.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__argz.$ac_objext" ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test yes = "$libltdl_cv_preloaded_symbols"; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,$enable_ltdl_install,$enable_ltdl_convenience in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test no != "${enable_ltdl_install-no}"; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test no != "${enable_ltdl_convenience-no}"; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in closedir opendir readdir do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" lt__dirent.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__dirent.$ac_objext" ;; esac fi done for ac_func in strlcat strlcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" lt__strl.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__strl.$ac_objext" ;; esac fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" ## -------- ## ## Outputs. ## ## -------- ## ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=config.h : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libltdl $as_me 2.4.3a, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libltdl config.status 2.4.3a configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi unixODBC-2.3.9/libltdl/lt__alloc.c0000644000175000017500000000437213725127167013624 00000000000000/* lt__alloc.c -- internal memory management interface Copyright (C) 2004, 2006-2007, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include "lt__alloc.h" static void alloc_die_default (void); void (*lt__alloc_die) (void) = alloc_die_default; /* Unless overridden, exit on memory failure. */ static void alloc_die_default (void) { fprintf (stderr, "Out of memory.\n"); exit (EXIT_FAILURE); } void * lt__malloc (size_t n) { void *mem; if (! (mem = malloc (n))) (*lt__alloc_die) (); return mem; } void * lt__zalloc (size_t n) { void *mem; if ((mem = lt__malloc (n))) memset (mem, 0, n); return mem; } void * lt__realloc (void *mem, size_t n) { if (! (mem = realloc (mem, n))) (*lt__alloc_die) (); return mem; } void * lt__memdup (void const *mem, size_t n) { void *newmem; if ((newmem = lt__malloc (n))) return memcpy (newmem, mem, n); return 0; } char * lt__strdup (const char *string) { return (char *) lt__memdup (string, strlen (string) +1); } unixODBC-2.3.9/libltdl/config-h.in0000644000175000017500000001137713725127167013555 00000000000000/* config-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Define to the shared archive member specification, say "(shr.o)". */ #undef LT_SHARED_LIB_MEMBER /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to a type to use for 'error_t' if it is not otherwise available. */ #undef error_t unixODBC-2.3.9/libltdl/lt__dirent.c0000644000175000017500000000570613725127167014021 00000000000000/* lt__dirent.c -- internal directory entry scanning interface Copyright (C) 2001, 2004, 2011-2015 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include "lt__dirent.h" #if defined __WINDOWS__ void closedir (DIR *entry) { assert (entry != (DIR *) NULL); FindClose (entry->hSearch); free (entry); } DIR * opendir (const char *path) { char file_spec[LT_FILENAME_MAX]; DIR *entry; assert (path != (char *) 0); if (lt_strlcpy (file_spec, path, sizeof file_spec) >= sizeof file_spec || lt_strlcat (file_spec, "\\", sizeof file_spec) >= sizeof file_spec) return (DIR *) 0; entry = (DIR *) malloc (sizeof(DIR)); if (entry != (DIR *) 0) { entry->firsttime = TRUE; entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); if (entry->hSearch == INVALID_HANDLE_VALUE) { if (lt_strlcat (file_spec, "\\*.*", sizeof file_spec) < sizeof file_spec) { entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); } if (entry->hSearch == INVALID_HANDLE_VALUE) { entry = (free (entry), (DIR *) 0); } } } return entry; } struct dirent * readdir (DIR *entry) { int status; if (entry == (DIR *) 0) return (struct dirent *) 0; if (!entry->firsttime) { status = FindNextFile (entry->hSearch, &entry->Win32FindData); if (status == 0) return (struct dirent *) 0; } entry->firsttime = FALSE; if (lt_strlcpy (entry->file_info.d_name, entry->Win32FindData.cFileName, sizeof entry->file_info.d_name) >= sizeof entry->file_info.d_name) return (struct dirent *) 0; entry->file_info.d_namlen = strlen (entry->file_info.d_name); return &entry->file_info; } #endif /*defined __WINDOWS__*/ unixODBC-2.3.9/libltdl/COPYING.LIB0000644000175000017500000006364213725127167013175 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! unixODBC-2.3.9/libltdl/Makefile.in0000664000175000017500000014773013725127167013605 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ##### VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_LTDL_TRUE@am__append_1 = ltdl.h @INSTALL_LTDL_TRUE@am__append_2 = libltdl.la @CONVENIENCE_LTDL_TRUE@am__append_3 = libltdlc.la subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../m4/libtool.m4 \ $(top_srcdir)/../m4/ltargz.m4 $(top_srcdir)/../m4/ltdl.m4 \ $(top_srcdir)/../m4/ltoptions.m4 \ $(top_srcdir)/../m4/ltsugar.m4 \ $(top_srcdir)/../m4/ltversion.m4 \ $(top_srcdir)/../m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__include_HEADERS_DIST) \ $(am__ltdlinclude_HEADERS_DIST) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(ltdlincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) dld_link_la_DEPENDENCIES = am__dirstamp = $(am__leading_dot)dirstamp am_dld_link_la_OBJECTS = loaders/dld_link.lo dld_link_la_OBJECTS = $(am_dld_link_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = dld_link_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dld_link_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = dlopen_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dlopen_la_OBJECTS = loaders/dlopen.lo dlopen_la_OBJECTS = $(am_dlopen_la_OBJECTS) dlopen_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dlopen_la_LDFLAGS) $(LDFLAGS) -o $@ dyld_la_LIBADD = am_dyld_la_OBJECTS = loaders/dyld.lo dyld_la_OBJECTS = $(am_dyld_la_OBJECTS) dyld_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dyld_la_LDFLAGS) $(LDFLAGS) -o $@ am_libltdl_la_OBJECTS = loaders/libltdl_la-preopen.lo \ libltdl_la-lt__alloc.lo libltdl_la-lt_dlloader.lo \ libltdl_la-lt_error.lo libltdl_la-ltdl.lo libltdl_la-slist.lo libltdl_la_OBJECTS = $(am_libltdl_la_OBJECTS) libltdl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdl_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_LTDL_TRUE@am_libltdl_la_rpath = -rpath $(libdir) am__objects_1 = loaders/libltdlc_la-preopen.lo \ libltdlc_la-lt__alloc.lo libltdlc_la-lt_dlloader.lo \ libltdlc_la-lt_error.lo libltdlc_la-ltdl.lo \ libltdlc_la-slist.lo am_libltdlc_la_OBJECTS = $(am__objects_1) libltdlc_la_OBJECTS = $(am_libltdlc_la_OBJECTS) libltdlc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdlc_la_LDFLAGS) $(LDFLAGS) -o $@ @CONVENIENCE_LTDL_TRUE@am_libltdlc_la_rpath = load_add_on_la_LIBADD = am_load_add_on_la_OBJECTS = loaders/load_add_on.lo load_add_on_la_OBJECTS = $(am_load_add_on_la_OBJECTS) load_add_on_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(load_add_on_la_LDFLAGS) $(LDFLAGS) -o \ $@ loadlibrary_la_LIBADD = am_loadlibrary_la_OBJECTS = loaders/loadlibrary.lo loadlibrary_la_OBJECTS = $(am_loadlibrary_la_OBJECTS) loadlibrary_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(loadlibrary_la_LDFLAGS) $(LDFLAGS) -o \ $@ shl_load_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_shl_load_la_OBJECTS = loaders/shl_load.lo shl_load_la_OBJECTS = $(am_shl_load_la_OBJECTS) shl_load_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(shl_load_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/../depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) DIST_SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__include_HEADERS_DIST = ltdl.h am__ltdlinclude_HEADERS_DIST = libltdl/lt_system.h libltdl/lt_error.h \ libltdl/lt_dlloader.h HEADERS = $(include_HEADERS) $(ltdlinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config-h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config-h.in \ $(top_srcdir)/../compile \ $(top_srcdir)/../config.guess \ $(top_srcdir)/../config.sub \ $(top_srcdir)/../depcomp \ $(top_srcdir)/../install-sh \ $(top_srcdir)/../ltmain.sh \ $(top_srcdir)/../missing ../compile \ ../config.guess ../config.sub \ ../depcomp ../install-sh \ ../ltmain.sh \ ../missing COPYING.LIB \ README lt__argz.c lt__dirent.c lt__strl.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I ../m4 AUTOMAKE_OPTIONS = foreign # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS = -DLT_CONFIG_H='<$(LT_CONFIG_H)>' -DLTDL -I. -I$(srcdir) \ -Ilibltdl -I$(srcdir)/libltdl AM_LDFLAGS = -no-undefined BUILT_SOURCES = libltdl/$(LT_ARGZ_H) include_HEADERS = $(am__append_1) noinst_LTLIBRARIES = $(LT_DLLOADERS) $(am__append_3) lib_LTLIBRARIES = $(am__append_2) EXTRA_LTLIBRARIES = dlopen.la dld_link.la dyld.la load_add_on.la \ loadlibrary.la shl_load.la EXTRA_DIST = lt__dirent.c lt__strl.c COPYING.LIB README \ libltdl/lt__argz_.h lt__argz.c CLEANFILES = libltdl.la libltdlc.la libdlloader.la $(LIBOBJS) \ $(LTLIBOBJS) MOSTLYCLEANFILES = libltdl/lt__argz.h libltdl/lt__argz.h-t LTDL_VERSION_INFO = -version-info 10:1:3 @INSTALL_LTDL_TRUE@ltdlincludedir = $(includedir)/libltdl @INSTALL_LTDL_TRUE@ltdlinclude_HEADERS = libltdl/lt_system.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_error.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_dlloader.h libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES = $(libltdl_la_DEPENDENCIES) dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config-h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config-h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } loaders/$(am__dirstamp): @$(MKDIR_P) loaders @: > loaders/$(am__dirstamp) loaders/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) loaders/$(DEPDIR) @: > loaders/$(DEPDIR)/$(am__dirstamp) loaders/dld_link.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) dld_link.la: $(dld_link_la_OBJECTS) $(dld_link_la_DEPENDENCIES) $(EXTRA_dld_link_la_DEPENDENCIES) $(AM_V_CCLD)$(dld_link_la_LINK) $(dld_link_la_OBJECTS) $(dld_link_la_LIBADD) $(LIBS) loaders/dlopen.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) dlopen.la: $(dlopen_la_OBJECTS) $(dlopen_la_DEPENDENCIES) $(EXTRA_dlopen_la_DEPENDENCIES) $(AM_V_CCLD)$(dlopen_la_LINK) $(dlopen_la_OBJECTS) $(dlopen_la_LIBADD) $(LIBS) loaders/dyld.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) dyld.la: $(dyld_la_OBJECTS) $(dyld_la_DEPENDENCIES) $(EXTRA_dyld_la_DEPENDENCIES) $(AM_V_CCLD)$(dyld_la_LINK) $(dyld_la_OBJECTS) $(dyld_la_LIBADD) $(LIBS) loaders/libltdl_la-preopen.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES) $(EXTRA_libltdl_la_DEPENDENCIES) $(AM_V_CCLD)$(libltdl_la_LINK) $(am_libltdl_la_rpath) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS) loaders/libltdlc_la-preopen.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES) $(EXTRA_libltdlc_la_DEPENDENCIES) $(AM_V_CCLD)$(libltdlc_la_LINK) $(am_libltdlc_la_rpath) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS) loaders/load_add_on.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) load_add_on.la: $(load_add_on_la_OBJECTS) $(load_add_on_la_DEPENDENCIES) $(EXTRA_load_add_on_la_DEPENDENCIES) $(AM_V_CCLD)$(load_add_on_la_LINK) $(load_add_on_la_OBJECTS) $(load_add_on_la_LIBADD) $(LIBS) loaders/loadlibrary.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) loadlibrary.la: $(loadlibrary_la_OBJECTS) $(loadlibrary_la_DEPENDENCIES) $(EXTRA_loadlibrary_la_DEPENDENCIES) $(AM_V_CCLD)$(loadlibrary_la_LINK) $(loadlibrary_la_OBJECTS) $(loadlibrary_la_LIBADD) $(LIBS) loaders/shl_load.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) shl_load.la: $(shl_load_la_OBJECTS) $(shl_load_la_DEPENDENCIES) $(EXTRA_shl_load_la_DEPENDENCIES) $(AM_V_CCLD)$(shl_load_la_LINK) $(shl_load_la_OBJECTS) $(shl_load_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f loaders/*.$(OBJEXT) -rm -f loaders/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__argz.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__dirent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__strl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt__alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_dlloader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-ltdl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt__alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_dlloader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-ltdl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/dld_link.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/dlopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/dyld.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/libltdl_la-preopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/libltdlc_la-preopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/load_add_on.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/loadlibrary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/shl_load.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< loaders/libltdl_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT loaders/libltdl_la-preopen.lo -MD -MP -MF loaders/$(DEPDIR)/libltdl_la-preopen.Tpo -c -o loaders/libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) loaders/$(DEPDIR)/libltdl_la-preopen.Tpo loaders/$(DEPDIR)/libltdl_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loaders/preopen.c' object='loaders/libltdl_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o loaders/libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdl_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt__alloc.Tpo -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-lt__alloc.Tpo $(DEPDIR)/libltdl_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt__alloc.c' object='libltdl_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdl_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_dlloader.Tpo -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-lt_dlloader.Tpo $(DEPDIR)/libltdl_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt_dlloader.c' object='libltdl_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdl_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_error.Tpo -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-lt_error.Tpo $(DEPDIR)/libltdl_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt_error.c' object='libltdl_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdl_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdl_la-ltdl.Tpo -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-ltdl.Tpo $(DEPDIR)/libltdl_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ltdl.c' object='libltdl_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdl_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdl_la-slist.Tpo -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-slist.Tpo $(DEPDIR)/libltdl_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='slist.c' object='libltdl_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c loaders/libltdlc_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT loaders/libltdlc_la-preopen.lo -MD -MP -MF loaders/$(DEPDIR)/libltdlc_la-preopen.Tpo -c -o loaders/libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) loaders/$(DEPDIR)/libltdlc_la-preopen.Tpo loaders/$(DEPDIR)/libltdlc_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loaders/preopen.c' object='loaders/libltdlc_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o loaders/libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdlc_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt__alloc.Tpo -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-lt__alloc.Tpo $(DEPDIR)/libltdlc_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt__alloc.c' object='libltdlc_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdlc_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo $(DEPDIR)/libltdlc_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt_dlloader.c' object='libltdlc_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdlc_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_error.Tpo -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-lt_error.Tpo $(DEPDIR)/libltdlc_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt_error.c' object='libltdlc_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdlc_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-ltdl.Tpo -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-ltdl.Tpo $(DEPDIR)/libltdlc_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ltdl.c' object='libltdlc_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdlc_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-slist.Tpo -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-slist.Tpo $(DEPDIR)/libltdlc_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='slist.c' object='libltdlc_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf loaders/.libs loaders/_libs distclean-libtool: -rm -f libtool config.lt install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-ltdlincludeHEADERS: $(ltdlinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ltdlincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ltdlincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ltdlincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ltdlincludedir)" || exit $$?; \ done uninstall-ltdlincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ltdlincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(ltdlincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f loaders/$(DEPDIR)/$(am__dirstamp) -rm -f loaders/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(DEPDIR) ./$(DEPDIR) loaders/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-ltdlincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf $(DEPDIR) ./$(DEPDIR) loaders/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-ltdlincludeHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ clean-cscope clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES cscope cscopelist-am ctags ctags-am \ dist dist-all dist-bzip2 dist-gzip dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-includeHEADERS install-info \ install-info-am install-libLTLIBRARIES \ install-ltdlincludeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-ltdlincludeHEADERS .PRECIOUS: Makefile # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(LT_ARGZ_H) libltdl/lt__argz.h: libltdl/lt__argz_.h $(AM_V_at)$(mkinstalldirs) . libltdl $(AM_V_GEN)cp $(srcdir)/libltdl/lt__argz_.h $@-t $(AM_V_at)mv $@-t $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/libltdl/ltdl.c0000644000175000017500000015403413725127167012634 00000000000000/* ltdl.c -- system independent dlopen wrapper Copyright (C) 1998-2000, 2004-2008, 2011-2015 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_system.h" #include "lt_dlloader.h" /* --- MANIFEST CONSTANTS --- */ /* Standard libltdl search path environment variable name */ #undef LTDL_SEARCHPATH_VAR #define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" /* Standard libtool archive file extension. */ #undef LT_ARCHIVE_EXT #define LT_ARCHIVE_EXT ".la" /* max. filename length */ #if !defined LT_FILENAME_MAX # define LT_FILENAME_MAX 1024 #endif #if !defined LT_LIBEXT # define LT_LIBEXT "a" #endif #if !defined LT_LIBPREFIX # define LT_LIBPREFIX "lib" #endif /* This is the maximum symbol size that won't require malloc/free */ #undef LT_SYMBOL_LENGTH #define LT_SYMBOL_LENGTH 128 /* This accounts for the _LTX_ separator */ #undef LT_SYMBOL_OVERHEAD #define LT_SYMBOL_OVERHEAD 5 /* Various boolean flags can be stored in the flags field of an lt_dlhandle... */ #define LT_DLIS_RESIDENT(handle) ((handle)->info.is_resident) #define LT_DLIS_SYMGLOBAL(handle) ((handle)->info.is_symglobal) #define LT_DLIS_SYMLOCAL(handle) ((handle)->info.is_symlocal) static const char objdir[] = LT_OBJDIR; static const char archive_ext[] = LT_ARCHIVE_EXT; static const char libext[] = LT_LIBEXT; static const char libprefix[] = LT_LIBPREFIX; #if defined LT_MODULE_EXT static const char shlib_ext[] = LT_MODULE_EXT; #endif /* If the loadable module suffix is not the same as the linkable * shared library suffix, this will be defined. */ #if defined LT_SHARED_EXT static const char shared_ext[] = LT_SHARED_EXT; #endif #if defined LT_DLSEARCH_PATH static const char sys_dlsearch_path[] = LT_DLSEARCH_PATH; #endif /* --- DYNAMIC MODULE LOADING --- */ /* The type of a function used at each iteration of foreach_dirinpath(). */ typedef int foreach_callback_func (char *filename, void *data1, void *data2); /* foreachfile_callback itself calls a function of this type: */ typedef int file_worker_func (const char *filename, void *data); static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2); static int find_file_callback (char *filename, void *data1, void *data2); static int find_handle_callback (char *filename, void *data, void *ignored); static int foreachfile_callback (char *filename, void *data1, void *data2); static int canonicalize_path (const char *path, char **pcanonical); static int argzize_path (const char *path, char **pargz, size_t *pargz_len); static FILE *find_file (const char *search_path, const char *base_name, char **pdir); static lt_dlhandle *find_handle (const char *search_path, const char *base_name, lt_dlhandle *handle, lt_dladvise advise); static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise); static int has_library_ext (const char *filename); static int load_deplibs (lt_dlhandle handle, char *deplibs); static int trim (char **dest, const char *str); static int try_dlopen (lt_dlhandle *handle, const char *filename, const char *ext, lt_dladvise advise); static int tryall_dlopen (lt_dlhandle *handle, const char *filename, lt_dladvise padvise, const lt_dlvtable *vtable); static int unload_deplibs (lt_dlhandle handle); static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry); static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp); static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir); static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len); static int file_not_found (void); #ifdef HAVE_LIBDLLOADER static int loader_init_callback (lt_dlhandle handle); #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data); static char *user_search_path= 0; static lt_dlhandle handles = 0; static int initialized = 0; /* Our memory failure callback sets the error message to be passed back up to the client, so we must be careful to return from mallocation callers if allocation fails (as this callback returns!!). */ void lt__alloc_die_callback (void) { LT__SETERROR (NO_MEMORY); } #ifdef HAVE_LIBDLLOADER /* This function is called to initialise each preloaded module loader, and hook it into the list of loaders to be used when attempting to dlopen an application module. */ static int loader_init_callback (lt_dlhandle handle) { lt_get_vtable *vtable_func = (lt_get_vtable *) lt_dlsym (handle, "get_vtable"); return loader_init (vtable_func, 0); } #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data) { const lt_dlvtable *vtable = 0; int errors = 0; if (vtable_func) { vtable = (*vtable_func) (data); } /* lt_dlloader_add will LT__SETERROR if it fails. */ errors += lt_dlloader_add (vtable); assert (errors || vtable); if ((!errors) && vtable->dlloader_init) { if ((*vtable->dlloader_init) (vtable->dlloader_data)) { LT__SETERROR (INIT_LOADER); ++errors; } } return errors; } /* Bootstrap the loader loading with the preopening loader. */ #define get_vtable preopen_LTX_get_vtable #define preloaded_symbols LT_CONC3(lt_, LTDLOPEN, _LTX_preloaded_symbols) LT_BEGIN_C_DECLS LT_SCOPE const lt_dlvtable * get_vtable (lt_user_data data); LT_END_C_DECLS #ifdef HAVE_LIBDLLOADER extern LT_DLSYM_CONST lt_dlsymlist preloaded_symbols[]; #endif /* Initialize libltdl. */ int lt_dlinit (void) { int errors = 0; /* Initialize only at first call. */ if (++initialized == 1) { lt__alloc_die = lt__alloc_die_callback; handles = 0; user_search_path = 0; /* empty search path */ /* First set up the statically loaded preload module loader, so we can use it to preopen the other loaders we linked in at compile time. */ errors += loader_init (get_vtable, 0); /* Now open all the preloaded module loaders, so the application can use _them_ to lt_dlopen its own modules. */ #ifdef HAVE_LIBDLLOADER if (!errors) { errors += lt_dlpreload (preloaded_symbols); } if (!errors) { errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback); } #endif /* HAVE_LIBDLLOADER */ } #ifdef LT_DEBUG_LOADERS lt_dlloader_dump(); #endif return errors; } int lt_dlexit (void) { /* shut down libltdl */ lt_dlloader *loader = 0; lt_dlhandle handle = handles; int errors = 0; if (!initialized) { LT__SETERROR (SHUTDOWN); ++errors; goto done; } /* shut down only at last call. */ if (--initialized == 0) { int level; while (handles && LT_DLIS_RESIDENT (handles)) { handles = handles->next; } /* close all modules */ for (level = 1; handle; ++level) { lt_dlhandle cur = handles; int saw_nonresident = 0; while (cur) { lt_dlhandle tmp = cur; cur = cur->next; if (!LT_DLIS_RESIDENT (tmp)) { saw_nonresident = 1; if (tmp->info.ref_count <= level) { if (lt_dlclose (tmp)) { ++errors; } /* Make sure that the handle pointed to by 'cur' still exists. lt_dlclose recursively closes dependent libraries, which removes them from the linked list. One of these might be the one pointed to by 'cur'. */ if (cur) { for (tmp = handles; tmp; tmp = tmp->next) if (tmp == cur) break; if (! tmp) cur = handles; } } } } /* done if only resident modules are left */ if (!saw_nonresident) break; } /* When removing loaders, we can only find out failure by testing the error string, so avoid a spurious one from an earlier failed command. */ if (!errors) LT__SETERRORSTR (0); /* close all loaders */ for (loader = (lt_dlloader *) lt_dlloader_next (NULL); loader;) { lt_dlloader *next = (lt_dlloader *) lt_dlloader_next (loader); lt_dlvtable *vtable = (lt_dlvtable *) lt_dlloader_get (loader); if ((vtable = lt_dlloader_remove ((char *) vtable->name))) { FREE (vtable); } else { /* ignore errors due to resident modules */ const char *err; LT__GETERROR (err); if (err) ++errors; } loader = next; } FREE(user_search_path); } done: return errors; } /* Try VTABLE or, if VTABLE is NULL, all available loaders for FILENAME. If the library is not successfully loaded, return non-zero. Otherwise, the dlhandle is stored at the address given in PHANDLE. */ static int tryall_dlopen (lt_dlhandle *phandle, const char *filename, lt_dladvise advise, const lt_dlvtable *vtable) { lt_dlhandle handle = handles; const char * saved_error = 0; int errors = 0; #ifdef LT_DEBUG_LOADERS fprintf (stderr, "tryall_dlopen (%s, %s)\n", filename ? filename : "(null)", vtable ? vtable->name : "(ALL)"); #endif LT__GETERROR (saved_error); /* check whether the module was already opened */ for (;handle; handle = handle->next) { if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */ || (handle->info.filename && filename && STREQ (handle->info.filename, filename))) { break; } } if (handle) { ++handle->info.ref_count; *phandle = handle; goto done; } handle = *phandle; if (filename) { /* Comment out the check of file permissions using access. This call seems to always return -1 with error EACCES. */ /* We need to catch missing file errors early so that file_not_found() can detect what happened. if (access (filename, R_OK) != 0) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto done; } */ handle->info.filename = lt__strdup (filename); if (!handle->info.filename) { ++errors; goto done; } } else { handle->info.filename = 0; } { lt_dlloader loader = lt_dlloader_next (0); const lt_dlvtable *loader_vtable; do { if (vtable) loader_vtable = vtable; else loader_vtable = lt_dlloader_get (loader); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "Calling %s->module_open (%s)\n", (loader_vtable && loader_vtable->name) ? loader_vtable->name : "(null)", filename ? filename : "(null)"); #endif handle->module = (*loader_vtable->module_open) (loader_vtable->dlloader_data, filename, advise); #ifdef LT_DEBUG_LOADERS if (!handle->module) { char *error; LT__GETERROR(error); fprintf (stderr, " Result: Failed\n" " Error message << %s >>\n", error ? error : "(null)"); } else { fprintf (stderr, " Result: Success\n"); } #endif if (handle->module != 0) { if (advise) { handle->info.is_resident = advise->is_resident; handle->info.is_symglobal = advise->is_symglobal; handle->info.is_symlocal = advise->is_symlocal; } break; } } while (!vtable && (loader = lt_dlloader_next (loader))); /* If VTABLE was given but couldn't open the module, or VTABLE wasn't given but we exhausted all loaders without opening the module, bail out! */ if ((vtable && !handle->module) || (!vtable && !loader)) { FREE (handle->info.filename); ++errors; goto done; } handle->vtable = loader_vtable; } LT__SETERRORSTR (saved_error); done: return errors; } static int tryall_dlopen_module (lt_dlhandle *handle, const char *prefix, const char *dirname, const char *dlname, lt_dladvise advise) { int error = 0; char *filename = 0; size_t filename_len = 0; size_t dirname_len = LT_STRLEN (dirname); assert (handle); assert (dirname); assert (dlname); #if defined LT_DIRSEP_CHAR /* Only canonicalized names (i.e. with DIRSEP chars already converted) should make it into this function: */ assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); #endif if (dirname_len > 0) if (dirname[dirname_len -1] == '/') --dirname_len; filename_len = dirname_len + 1 + LT_STRLEN (dlname); /* Allocate memory, and combine DIRNAME and MODULENAME into it. The PREFIX (if any) is handled below. */ filename = MALLOC (char, filename_len + 1); if (!filename) return 1; sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); /* Now that we have combined DIRNAME and MODULENAME, if there is also a PREFIX to contend with, simply recurse with the arguments shuffled. Otherwise, attempt to open FILENAME as a module. */ if (prefix) { error += tryall_dlopen_module (handle, (const char *) 0, prefix, filename, advise); } else if (tryall_dlopen (handle, filename, advise, 0) != 0) { ++error; } FREE (filename); return error; } static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise) { /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable module is available. */ if (old_name && tryall_dlopen (handle, old_name, advise, lt_dlloader_find ("lt_preopen") ) == 0) { return 0; } /* Try to open the dynamic library. */ if (dlname) { /* try to open the installed module */ if (installed && libdir) { if (tryall_dlopen_module (handle, (const char *) 0, libdir, dlname, advise) == 0) return 0; } /* try to open the not-installed module */ if (!installed) { if (tryall_dlopen_module (handle, dir, objdir, dlname, advise) == 0) return 0; } /* maybe it was moved to another directory */ { if (dir && (tryall_dlopen_module (handle, (const char *) 0, dir, dlname, advise) == 0)) return 0; } } return 1; } static int canonicalize_path (const char *path, char **pcanonical) { char *canonical = 0; assert (path && *path); assert (pcanonical); canonical = MALLOC (char, 1+ LT_STRLEN (path)); if (!canonical) return 1; { size_t dest = 0; size_t src; for (src = 0; path[src] != LT_EOS_CHAR; ++src) { /* Path separators are not copied to the beginning or end of the destination, or if another separator would follow immediately. */ if (path[src] == LT_PATHSEP_CHAR) { if ((dest == 0) || (path[1+ src] == LT_PATHSEP_CHAR) || (path[1+ src] == LT_EOS_CHAR)) continue; } /* Anything other than a directory separator is copied verbatim. */ if ((path[src] != '/') #if defined LT_DIRSEP_CHAR && (path[src] != LT_DIRSEP_CHAR) #endif ) { canonical[dest++] = path[src]; } /* Directory separators are converted and copied only if they are not at the end of a path -- i.e. before a path separator or NULL terminator. */ else if ((path[1+ src] != LT_PATHSEP_CHAR) && (path[1+ src] != LT_EOS_CHAR) #if defined LT_DIRSEP_CHAR && (path[1+ src] != LT_DIRSEP_CHAR) #endif && (path[1+ src] != '/')) { canonical[dest++] = '/'; } } /* Add an end-of-string marker at the end. */ canonical[dest] = LT_EOS_CHAR; } /* Assign new value. */ *pcanonical = canonical; return 0; } static int argzize_path (const char *path, char **pargz, size_t *pargz_len) { error_t error; assert (path); assert (pargz); assert (pargz_len); if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } /* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns non-zero or all elements are exhausted. If BASE_NAME is non-NULL, it is appended to each SEARCH_PATH element before FUNC is called. */ static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2) { int result = 0; size_t filenamesize = 0; size_t lenbase = LT_STRLEN (base_name); size_t argz_len = 0; char *argz = 0; char *filename = 0; char *canonical = 0; if (!search_path || !*search_path) { LT__SETERROR (FILE_NOT_FOUND); goto cleanup; } if (canonicalize_path (search_path, &canonical) != 0) goto cleanup; if (argzize_path (canonical, &argz, &argz_len) != 0) goto cleanup; { char *dir_name = 0; while ((dir_name = argz_next (argz, argz_len, dir_name))) { size_t lendir = LT_STRLEN (dir_name); if (1+ lendir + lenbase >= filenamesize) { FREE (filename); filenamesize = 1+ lendir + 1+ lenbase; /* "/d" + '/' + "f" + '\0' */ filename = MALLOC (char, filenamesize); if (!filename) goto cleanup; } assert (filenamesize > lendir); strcpy (filename, dir_name); if (base_name && *base_name) { if (filename[lendir -1] != '/') filename[lendir++] = '/'; strcpy (filename +lendir, base_name); } if ((result = (*func) (filename, data1, data2))) { break; } } } cleanup: FREE (argz); FREE (canonical); FREE (filename); return result; } /* If FILEPATH can be opened, store the name of the directory component in DATA1, and the opened FILE* structure address in DATA2. Otherwise DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ static int find_file_callback (char *filename, void *data1, void *data2) { char **pdir = (char **) data1; FILE **pfile = (FILE **) data2; int is_done = 0; assert (filename && *filename); assert (pdir); assert (pfile); if ((*pfile = fopen (filename, LT_READTEXT_MODE))) { char *dirend = strrchr (filename, '/'); if (dirend > filename) *dirend = LT_EOS_CHAR; FREE (*pdir); *pdir = lt__strdup (filename); is_done = (*pdir == 0) ? -1 : 1; } return is_done; } static FILE * find_file (const char *search_path, const char *base_name, char **pdir) { FILE *file = 0; foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); return file; } static int find_handle_callback (char *filename, void *data, void *data2) { lt_dlhandle *phandle = (lt_dlhandle *) data; int notfound = access (filename, R_OK); lt_dladvise advise = (lt_dladvise) data2; /* Bail out if file cannot be read... */ if (notfound) return 0; /* Try to dlopen the file, but do not continue searching in any case. */ if (tryall_dlopen (phandle, filename, advise, 0) != 0) *phandle = 0; return 1; } /* If HANDLE was found return it, otherwise return 0. If HANDLE was found but could not be opened, *HANDLE will be set to 0. */ static lt_dlhandle * find_handle (const char *search_path, const char *base_name, lt_dlhandle *phandle, lt_dladvise advise) { if (!search_path) return 0; if (!foreach_dirinpath (search_path, base_name, find_handle_callback, phandle, advise)) return 0; return phandle; } #if !defined LTDL_DLOPEN_DEPLIBS static int load_deplibs (lt_dlhandle handle, char * deplibs LT__UNUSED) { handle->depcount = 0; return 0; } #else /* defined LTDL_DLOPEN_DEPLIBS */ static int load_deplibs (lt_dlhandle handle, char *deplibs) { char *p, *save_search_path = 0; int depcount = 0; int i; char **names = 0; int errors = 0; handle->depcount = 0; if (!deplibs) { return errors; } ++errors; if (user_search_path) { save_search_path = lt__strdup (user_search_path); if (!save_search_path) goto cleanup; } /* extract search paths and count deplibs */ p = deplibs; while (*p) { if (!isspace ((unsigned char) *p)) { char *end = p+1; while (*end && !isspace((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) { char save = *end; *end = 0; /* set a temporary string terminator */ if (lt_dladdsearchdir(p+2)) { goto cleanup; } *end = save; } else { ++depcount; } p = end; } else { ++p; } } if (!depcount) { errors = 0; goto cleanup; } names = MALLOC (char *, depcount); if (!names) goto cleanup; /* now only extract the actual deplibs */ depcount = 0; p = deplibs; while (*p) { if (isspace ((unsigned char) *p)) { ++p; } else { char *end = p+1; while (*end && !isspace ((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) { char *name; char save = *end; *end = 0; /* set a temporary string terminator */ if (strncmp(p, "-l", 2) == 0) { size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); name = MALLOC (char, 1+ name_len); if (name) sprintf (name, "lib%s", p+2); } else name = lt__strdup(p); if (!name) goto cleanup_names; names[depcount++] = name; *end = save; } p = end; } } /* load the deplibs (in reverse order) At this stage, don't worry if the deplibs do not load correctly, they may already be statically linked into the loading application for instance. There will be a more enlightening error message later on if the loaded module cannot resolve all of its symbols. */ if (depcount) { lt_dlhandle cur = handle; int j = 0; cur->deplibs = MALLOC (lt_dlhandle, depcount); if (!cur->deplibs) goto cleanup_names; for (i = 0; i < depcount; ++i) { cur->deplibs[j] = lt_dlopenext(names[depcount-1-i]); if (cur->deplibs[j]) { ++j; } } cur->depcount = j; /* Number of successfully loaded deplibs */ errors = 0; } cleanup_names: for (i = 0; i < depcount; ++i) { FREE (names[i]); } cleanup: FREE (names); /* restore the old search path */ if (save_search_path) { MEMREASSIGN (user_search_path, save_search_path); } return errors; } #endif /* defined LTDL_DLOPEN_DEPLIBS */ static int unload_deplibs (lt_dlhandle handle) { int i; int errors = 0; lt_dlhandle cur = handle; if (cur->depcount) { for (i = 0; i < cur->depcount; ++i) { if (!LT_DLIS_RESIDENT (cur->deplibs[i])) { errors += lt_dlclose (cur->deplibs[i]); } } FREE (cur->deplibs); } return errors; } static int trim (char **dest, const char *str) { /* remove the leading and trailing "'" from str and store the result in dest */ const char *end = strrchr (str, '\''); size_t len = LT_STRLEN (str); char *tmp; FREE (*dest); if (!end || end == str) return 1; if (len > 3 && str[0] == '\'') { tmp = MALLOC (char, end - str); if (!tmp) return 1; memcpy(tmp, &str[1], (end - str) - 1); tmp[(end - str) - 1] = LT_EOS_CHAR; *dest = tmp; } else { *dest = 0; } return 0; } /* Read the .la file FILE. */ static int parse_dotla_file(FILE *file, char **dlname, char **libdir, char **deplibs, char **old_name, int *installed) { int errors = 0; size_t line_len = LT_FILENAME_MAX; char * line = MALLOC (char, line_len); if (!line) { LT__SETERROR (FILE_NOT_FOUND); return 1; } while (!feof (file)) { line[line_len-2] = '\0'; if (!fgets (line, (int) line_len, file)) { break; } /* Handle the case where we occasionally need to read a line that is longer than the initial buffer size. Behave even if the file contains NUL bytes due to corruption. */ while (line[line_len-2] != '\0' && line[line_len-2] != '\n' && !feof (file)) { line = REALLOC (char, line, line_len *2); if (!line) { ++errors; goto cleanup; } line[line_len * 2 - 2] = '\0'; if (!fgets (&line[line_len -1], (int) line_len +1, file)) { break; } line_len *= 2; } if (line[0] == '\n' || line[0] == '#') { continue; } #undef STR_DLNAME #define STR_DLNAME "dlname=" if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) { errors += trim (dlname, &line[sizeof (STR_DLNAME) - 1]); } #undef STR_OLD_LIBRARY #define STR_OLD_LIBRARY "old_library=" else if (strncmp (line, STR_OLD_LIBRARY, sizeof (STR_OLD_LIBRARY) - 1) == 0) { errors += trim (old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); } /* Windows native tools do not understand the POSIX paths we store in libdir. */ #undef STR_LIBDIR #define STR_LIBDIR "libdir=" else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) { errors += trim (libdir, &line[sizeof(STR_LIBDIR) - 1]); #ifdef __WINDOWS__ /* Disallow following unix-style paths on MinGW. */ if (*libdir && (**libdir == '/' || **libdir == '\\')) **libdir = '\0'; #endif } #undef STR_DL_DEPLIBS #define STR_DL_DEPLIBS "dependency_libs=" else if (strncmp (line, STR_DL_DEPLIBS, sizeof (STR_DL_DEPLIBS) - 1) == 0) { errors += trim (deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); } else if (STREQ (line, "installed=yes\n")) { *installed = 1; } else if (STREQ (line, "installed=no\n")) { *installed = 0; } #undef STR_LIBRARY_NAMES #define STR_LIBRARY_NAMES "library_names=" else if (!*dlname && strncmp (line, STR_LIBRARY_NAMES, sizeof (STR_LIBRARY_NAMES) - 1) == 0) { char *last_libname; errors += trim (dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); if (!errors && *dlname && (last_libname = strrchr (*dlname, ' ')) != 0) { last_libname = lt__strdup (last_libname + 1); if (!last_libname) { ++errors; goto cleanup; } MEMREASSIGN (*dlname, last_libname); } } if (errors) break; } cleanup: FREE (line); return errors; } /* Try to open FILENAME as a module. */ static int try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext, lt_dladvise advise) { const char * saved_error = 0; char * archive_name = 0; char * canonical = 0; char * base_name = 0; char * dir = 0; char * name = 0; char * attempt = 0; int errors = 0; lt_dlhandle newhandle; assert (phandle); assert (*phandle == 0); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "try_dlopen (%s, %s)\n", filename ? filename : "(null)", ext ? ext : "(null)"); #endif LT__GETERROR (saved_error); /* dlopen self? */ if (!filename) { *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) return 1; newhandle = *phandle; /* lt_dlclose()ing yourself is very bad! Disallow it. */ newhandle->info.is_resident = 1; if (tryall_dlopen (&newhandle, 0, advise, 0) != 0) { FREE (*phandle); return 1; } goto register_handle; } assert (filename && *filename); if (ext) { attempt = MALLOC (char, LT_STRLEN (filename) + LT_STRLEN (ext) + 1); if (!attempt) return 1; sprintf(attempt, "%s%s", filename, ext); } else { attempt = lt__strdup (filename); if (!attempt) return 1; } /* Doing this immediately allows internal functions to safely assume only canonicalized paths are passed. */ if (canonicalize_path (attempt, &canonical) != 0) { ++errors; goto cleanup; } /* If the canonical module name is a path (relative or absolute) then split it into a directory part and a name part. */ base_name = strrchr (canonical, '/'); if (base_name) { size_t dirlen = (1+ base_name) - canonical; dir = MALLOC (char, 1+ dirlen); if (!dir) { ++errors; goto cleanup; } strlcpy (dir, canonical, dirlen); dir[dirlen] = LT_EOS_CHAR; ++base_name; } else MEMREASSIGN (base_name, canonical); assert (base_name && *base_name); ext = strrchr (base_name, '.'); if (!ext) { ext = base_name + LT_STRLEN (base_name); } /* extract the module name from the file name */ name = MALLOC (char, ext - base_name + 1); if (!name) { ++errors; goto cleanup; } /* canonicalize the module name */ { int i; for (i = 0; i < ext - base_name; ++i) { if (isalnum ((unsigned char)(base_name[i]))) { name[i] = base_name[i]; } else { name[i] = '_'; } } name[ext - base_name] = LT_EOS_CHAR; } /* Before trawling through the file system in search of a module, check whether we are opening a preloaded module. */ if (!dir) { const lt_dlvtable *vtable = lt_dlloader_find ("lt_preopen"); if (vtable) { /* libprefix + name + "." + libext + NULL */ archive_name = MALLOC (char, strlen (libprefix) + LT_STRLEN (name) + strlen (libext) + 2); *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if ((*phandle == NULL) || (archive_name == NULL)) { ++errors; goto cleanup; } newhandle = *phandle; /* Preloaded modules are always named according to their old archive name. */ if (strncmp(name, "lib", 3) == 0) { sprintf (archive_name, "%s%s.%s", libprefix, name + 3, libext); } else { sprintf (archive_name, "%s.%s", name, libext); } if (tryall_dlopen (&newhandle, archive_name, advise, vtable) == 0) { goto register_handle; } /* If we're still here, there was no matching preloaded module, so put things back as we found them, and continue searching. */ FREE (*phandle); newhandle = NULL; } } /* If we are allowing only preloaded modules, and we didn't find anything yet, give up on the search here. */ if (advise && advise->try_preload_only) { goto cleanup; } /* Check whether we are opening a libtool module (.la extension). */ if (ext && STREQ (ext, archive_ext)) { /* this seems to be a libtool module */ FILE * file = 0; char * dlname = 0; char * old_name = 0; char * libdir = 0; char * deplibs = 0; /* if we can't find the installed flag, it is probably an installed libtool archive, produced with an old version of libtool */ int installed = 1; /* Now try to open the .la file. If there is no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if (!dir) { const char *search_path = user_search_path; if (search_path) file = find_file (user_search_path, base_name, &dir); if (!file) { search_path = getenv (LTDL_SEARCHPATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #if defined LT_MODULE_PATH_VAR if (!file) { search_path = getenv (LT_MODULE_PATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #endif #if defined LT_DLSEARCH_PATH if (!file && *sys_dlsearch_path) { file = find_file (sys_dlsearch_path, base_name, &dir); } #endif } else { file = fopen (attempt, LT_READTEXT_MODE); } /* If we didn't find the file by now, it really isn't there. Set the status flag, and bail out. */ if (!file) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto cleanup; } /* read the .la file */ if (parse_dotla_file(file, &dlname, &libdir, &deplibs, &old_name, &installed) != 0) ++errors; fclose (file); /* allocate the handle */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) ++errors; if (errors) { FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); FREE (*phandle); goto cleanup; } assert (*phandle); if (load_deplibs (*phandle, deplibs) == 0) { newhandle = *phandle; /* find_module may replace newhandle */ if (find_module (&newhandle, dir, libdir, dlname, old_name, installed, advise)) { unload_deplibs (*phandle); ++errors; } } else { ++errors; } FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); if (errors) { FREE (*phandle); goto cleanup; } if (*phandle != newhandle) { unload_deplibs (*phandle); } } else { /* not a libtool module */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) { ++errors; goto cleanup; } newhandle = *phandle; /* If the module has no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if ((dir || (!find_handle (user_search_path, base_name, &newhandle, advise) && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, &newhandle, advise) #if defined LT_MODULE_PATH_VAR && !find_handle (getenv (LT_MODULE_PATH_VAR), base_name, &newhandle, advise) #endif #if defined LT_DLSEARCH_PATH && !find_handle (sys_dlsearch_path, base_name, &newhandle, advise) #endif ))) { if (tryall_dlopen (&newhandle, attempt, advise, 0) != 0) { newhandle = NULL; } } if (!newhandle) { FREE (*phandle); ++errors; goto cleanup; } } register_handle: MEMREASSIGN (*phandle, newhandle); if ((*phandle)->info.ref_count == 0) { (*phandle)->info.ref_count = 1; MEMREASSIGN ((*phandle)->info.name, name); (*phandle)->next = handles; handles = *phandle; } LT__SETERRORSTR (saved_error); cleanup: FREE (dir); FREE (attempt); FREE (name); if (!canonical) /* was MEMREASSIGNed */ FREE (base_name); FREE (canonical); FREE (archive_name); return errors; } /* If the last error message stored was 'FILE_NOT_FOUND', then return non-zero. */ static int file_not_found (void) { const char *error = 0; LT__GETERROR (error); if (error == LT__STRERROR (FILE_NOT_FOUND)) return 1; return 0; } /* Unless FILENAME already bears a suitable library extension, then return 0. */ static int has_library_ext (const char *filename) { const char * ext = 0; assert (filename); ext = strrchr (filename, '.'); if (ext && ((STREQ (ext, archive_ext)) #if defined LT_MODULE_EXT || (STREQ (ext, shlib_ext)) #endif #if defined LT_SHARED_EXT || (STREQ (ext, shared_ext)) #endif )) { return 1; } return 0; } /* Initialise and configure a user lt_dladvise opaque object. */ int lt_dladvise_init (lt_dladvise *padvise) { lt_dladvise advise = (lt_dladvise) lt__zalloc (sizeof (struct lt__advise)); *padvise = advise; return (advise ? 0 : 1); } int lt_dladvise_destroy (lt_dladvise *padvise) { if (padvise) FREE(*padvise); return 0; } int lt_dladvise_ext (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_ext = 1; return 0; } int lt_dladvise_resident (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_resident = 1; return 0; } int lt_dladvise_local (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symlocal = 1; return 0; } int lt_dladvise_global (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symglobal = 1; return 0; } int lt_dladvise_preload (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_preload_only = 1; return 0; } /* Libtool-1.5.x interface for loading a new module named FILENAME. */ lt_dlhandle lt_dlopen (const char *filename) { return lt_dlopenadvise (filename, NULL); } /* If FILENAME has an ARCHIVE_EXT or MODULE_EXT extension, try to open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, and if a file is still not found try again with MODULE_EXT appended instead. */ lt_dlhandle lt_dlopenext (const char *filename) { lt_dlhandle handle = 0; lt_dladvise advise; if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise)) handle = lt_dlopenadvise (filename, advise); lt_dladvise_destroy (&advise); return handle; } lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise) { lt_dlhandle handle = 0; int errors = 0; const char * saved_error = 0; LT__GETERROR (saved_error); /* Can't have symbols hidden and visible at the same time! */ if (advise && advise->is_symlocal && advise->is_symglobal) { LT__SETERROR (CONFLICTING_FLAGS); return 0; } if (!filename || !advise || !advise->try_ext || has_library_ext (filename)) { /* Just incase we missed a code path in try_dlopen() that reports an error, but forgot to reset handle... */ if (try_dlopen (&handle, filename, NULL, advise) != 0) return 0; return handle; } else if (filename && *filename) { /* First try appending ARCHIVE_EXT. */ errors += try_dlopen (&handle, filename, archive_ext, advise); /* If we found FILENAME, stop searching -- whether we were able to load the file as a module or not. If the file exists but loading failed, it is better to return an error message here than to report FILE_NOT_FOUND when the alternatives (foo.so etc) are not in the module search path. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #if defined LT_MODULE_EXT /* Try appending SHLIB_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shlib_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif #if defined LT_SHARED_EXT /* Try appending SHARED_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shared_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif } /* Still here? Then we really did fail to locate any of the file names we tried. */ LT__SETERROR (FILE_NOT_FOUND); return 0; } static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { error_t error; /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, pargz_len, NULL, entry) failed with EINVAL. */ if (before) error = argz_insert (pargz, pargz_len, before, entry); else error = argz_append (pargz, pargz_len, entry, 1 + strlen (entry)); if (error) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry) { char *before = 0; assert (pargz); assert (pargz_len); assert (entry && *entry); if (*pargz) while ((before = argz_next (*pargz, *pargz_len, before))) { int cmp = strcmp (entry, before); if (cmp < 0) break; if (cmp == 0) return 0; /* No duplicates! */ } return lt_argz_insert (pargz, pargz_len, before, entry); } static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp) { char *buf = 0; size_t buf_len = 0; char *end = 0; size_t end_offset = 0; size_t dir_len = 0; int errors = 0; assert (pargz); assert (pargz_len); assert (dp); dir_len = LT_STRLEN (dirnam); end = dp->d_name + D_NAMLEN(dp); /* Ignore version numbers. */ { char *p; for (p = end; p -1 > dp->d_name; --p) if (strchr (".0123456789", p[-1]) == 0) break; if (*p == '.') end = p; } /* Ignore filename extension. */ { char *p; for (p = end -1; p > dp->d_name; --p) if (*p == '.') { end = p; break; } } /* Prepend the directory name. */ end_offset = end - dp->d_name; buf_len = dir_len + 1+ end_offset; buf = MALLOC (char, 1+ buf_len); if (!buf) return ++errors; assert (buf); strcpy (buf, dirnam); strcat (buf, "/"); strncat (buf, dp->d_name, end_offset); buf[buf_len] = LT_EOS_CHAR; /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) ++errors; FREE (buf); return errors; } static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len) { DIR *dirp = 0; int errors = 0; assert (dirnam && *dirnam); assert (pargz); assert (pargz_len); assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); dirp = opendir (dirnam); if (dirp) { struct dirent *dp = 0; while ((dp = readdir (dirp))) if (dp->d_name[0] != '.') if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) { ++errors; break; } closedir (dirp); } else ++errors; return errors; } /* If there are any files in DIRNAME, call the function passed in DATA1 (with the name of each file and DATA2 as arguments). */ static int foreachfile_callback (char *dirname, void *data1, void *data2) { file_worker_func *func = *(file_worker_func **) data1; int is_done = 0; char *argz = 0; size_t argz_len = 0; if (list_files_by_dir (dirname, &argz, &argz_len) != 0) goto cleanup; if (!argz) goto cleanup; { char *filename = 0; while ((filename = argz_next (argz, argz_len, filename))) if ((is_done = (*func) (filename, data2))) break; } cleanup: FREE (argz); return is_done; } /* Call FUNC for each unique extensionless file in SEARCH_PATH, along with DATA. The filenames passed to FUNC would be suitable for passing to lt_dlopenext. The extensions are stripped so that individual modules do not generate several entries (e.g. libfoo.la, libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, then the same directories that lt_dlopen would search are examined. */ int lt_dlforeachfile (const char *search_path, int (*func) (const char *filename, void *data), void *data) { int is_done = 0; file_worker_func **fpptr = &func; if (search_path) { /* If a specific path was passed, search only the directories listed in it. */ is_done = foreach_dirinpath (search_path, 0, foreachfile_callback, fpptr, data); } else { /* Otherwise search the default paths. */ is_done = foreach_dirinpath (user_search_path, 0, foreachfile_callback, fpptr, data); if (!is_done) { is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0, foreachfile_callback, fpptr, data); } #if defined LT_MODULE_PATH_VAR if (!is_done) { is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0, foreachfile_callback, fpptr, data); } #endif #if defined LT_DLSEARCH_PATH if (!is_done && *sys_dlsearch_path) { is_done = foreach_dirinpath (sys_dlsearch_path, 0, foreachfile_callback, fpptr, data); } #endif } return is_done; } int lt_dlclose (lt_dlhandle handle) { lt_dlhandle cur, last; int errors = 0; /* check whether the handle is valid */ last = cur = handles; while (cur && handle != cur) { last = cur; cur = cur->next; } if (!cur) { LT__SETERROR (INVALID_HANDLE); ++errors; goto done; } cur = handle; cur->info.ref_count--; /* Note that even with resident modules, we must track the ref_count correctly incase the user decides to reset the residency flag later (even though the API makes no provision for that at the moment). */ if (cur->info.ref_count <= 0 && !LT_DLIS_RESIDENT (cur)) { lt_user_data data = cur->vtable->dlloader_data; if (cur != handles) { last->next = cur->next; } else { handles = cur->next; } errors += cur->vtable->module_close (data, cur->module); errors += unload_deplibs (handle); /* It is up to the callers to free the data itself. */ FREE (cur->interface_data); FREE (cur->info.filename); FREE (cur->info.name); FREE (cur); goto done; } if (LT_DLIS_RESIDENT (handle)) { LT__SETERROR (CLOSE_RESIDENT_MODULE); ++errors; } done: return errors; } void * lt_dlsym (lt_dlhandle place, const char *symbol) { size_t lensym; char lsym[LT_SYMBOL_LENGTH]; char *sym; void *address; lt_user_data data; lt_dlhandle handle; if (!place) { LT__SETERROR (INVALID_HANDLE); return 0; } handle = place; if (!symbol) { LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->vtable->sym_prefix) + LT_STRLEN (handle->info.name); if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) { sym = lsym; } else { sym = MALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); if (!sym) { LT__SETERROR (BUFFER_OVERFLOW); return 0; } } data = handle->vtable->dlloader_data; if (handle->info.name) { const char *saved_error; LT__GETERROR (saved_error); /* this is a libtool module */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, handle->info.name); } else { strcpy(sym, handle->info.name); } strcat(sym, "_LTX_"); strcat(sym, symbol); /* try "modulename_LTX_symbol" */ address = handle->vtable->find_sym (data, handle->module, sym); if (address) { if (sym != lsym) { FREE (sym); } return address; } LT__SETERRORSTR (saved_error); } /* otherwise try "symbol" */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, symbol); } else { strcpy(sym, symbol); } address = handle->vtable->find_sym (data, handle->module, sym); if (sym != lsym) { FREE (sym); } return address; } const char * lt_dlerror (void) { const char *error; LT__GETERROR (error); LT__SETERRORSTR (0); return error; } static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir) { int errors = 0; char *canonical = 0; char *argz = 0; size_t argz_len = 0; assert (ppath); assert (dir && *dir); if (canonicalize_path (dir, &canonical) != 0) { ++errors; goto cleanup; } assert (canonical && *canonical); /* If *PPATH is empty, set it to DIR. */ if (*ppath == 0) { assert (!before); /* BEFORE cannot be set without PPATH. */ assert (dir); /* Without DIR, don't call this function! */ *ppath = lt__strdup (dir); if (*ppath == 0) ++errors; goto cleanup; } assert (ppath && *ppath); if (argzize_path (*ppath, &argz, &argz_len) != 0) { ++errors; goto cleanup; } /* Convert BEFORE into an equivalent offset into ARGZ. This only works if *PPATH is already canonicalized, and hence does not change length with respect to ARGZ. We canonicalize each entry as it is added to the search path, and don't call this function with (uncanonicalized) user paths, so this is a fair assumption. */ if (before) { assert (*ppath <= before); assert ((int) (before - *ppath) <= (int) strlen (*ppath)); before = before - *ppath + argz; } if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) { ++errors; goto cleanup; } argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); MEMREASSIGN(*ppath, argz); cleanup: FREE (argz); FREE (canonical); return errors; } int lt_dladdsearchdir (const char *search_dir) { int errors = 0; if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) ++errors; } return errors; } int lt_dlinsertsearchdir (const char *before, const char *search_dir) { int errors = 0; if (before) { if ((before < user_search_path) || (before >= user_search_path + LT_STRLEN (user_search_path))) { LT__SETERROR (INVALID_POSITION); return 1; } } if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, (char *) before, search_dir) != 0) { ++errors; } } return errors; } int lt_dlsetsearchpath (const char *search_path) { int errors = 0; FREE (user_search_path); if (!search_path || !LT_STRLEN (search_path)) { return errors; } if (canonicalize_path (search_path, &user_search_path) != 0) ++errors; return errors; } const char * lt_dlgetsearchpath (void) { const char *saved_path; saved_path = user_search_path; return saved_path; } int lt_dlmakeresident (lt_dlhandle handle) { int errors = 0; if (!handle) { LT__SETERROR (INVALID_HANDLE); ++errors; } else { handle->info.is_resident = 1; } return errors; } int lt_dlisresident (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return -1; } return LT_DLIS_RESIDENT (handle); } /* --- MODULE INFORMATION --- */ typedef struct { char *id_string; lt_dlhandle_interface *iface; } lt__interface_id; lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface) { lt__interface_id *interface_id = (lt__interface_id *) lt__malloc (sizeof *interface_id); /* If lt__malloc fails, it will LT__SETERROR (NO_MEMORY), which can then be detected with lt_dlerror() if we return 0. */ if (interface_id) { interface_id->id_string = lt__strdup (id_string); if (!interface_id->id_string) FREE (interface_id); else interface_id->iface = iface; } return (lt_dlinterface_id) interface_id; } void lt_dlinterface_free (lt_dlinterface_id key) { lt__interface_id *interface_id = (lt__interface_id *)key; FREE (interface_id->id_string); FREE (interface_id); } void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data) { int n_elements = 0; void *stale = (void *) 0; lt_dlhandle cur = handle; int i; if (cur->interface_data) while (cur->interface_data[n_elements].key) ++n_elements; for (i = 0; i < n_elements; ++i) { if (cur->interface_data[i].key == key) { stale = cur->interface_data[i].data; break; } } /* Ensure that there is enough room in this handle's interface_data array to accept a new element (and an empty end marker). */ if (i == n_elements) { lt_interface_data *temp = REALLOC (lt_interface_data, cur->interface_data, 2+ n_elements); if (!temp) { stale = 0; goto done; } cur->interface_data = temp; /* We only need this if we needed to allocate a new interface_data. */ cur->interface_data[i].key = key; cur->interface_data[1+ i].key = 0; } cur->interface_data[i].data = data; done: return stale; } void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle) { void *result = (void *) 0; lt_dlhandle cur = handle; /* Locate the index of the element with a matching KEY. */ if (cur->interface_data) { int i; for (i = 0; cur->interface_data[i].key; ++i) { if (cur->interface_data[i].key == key) { result = cur->interface_data[i].data; break; } } } return result; } const lt_dlinfo * lt_dlgetinfo (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return 0; } return &(handle->info); } lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place) { lt_dlhandle handle = place; lt__interface_id *iterator = (lt__interface_id *) iface; assert (iface); /* iface is a required argument */ if (!handle) handle = handles; else handle = handle->next; /* advance while the interface check fails */ while (handle && iterator->iface && ((*iterator->iface) (handle, iterator->id_string) != 0)) { handle = handle->next; } return handle; } lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name) { lt_dlhandle handle = 0; assert (iface); /* iface is a required argument */ while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur && cur->info.name && STREQ (cur->info.name, module_name)) break; } return handle; } int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data) { lt__interface_id *iterator = (lt__interface_id *) iface; lt_dlhandle cur = handles; assert (iface); /* iface is a required argument */ while (cur) { int errorcode = 0; /* advance while the interface check fails */ while (cur && iterator->iface && ((*iterator->iface) (cur, iterator->id_string) != 0)) { cur = cur->next; } if ((errorcode = (*func) (cur, data)) != 0) return errorcode; } return 0; } unixODBC-2.3.9/libltdl/lt__argz.c0000644000175000017500000001341013725127167013466 00000000000000/* lt__argz.c -- argz implementation for non-glibc systems Copyright (C) 2004, 2006-2008, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if defined LTDL && defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include #include #include #include #include #include #define EOS_CHAR '\0' error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len) { size_t argz_len; char *argz; assert (pargz); assert (pargz_len); assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); /* If nothing needs to be appended, no more work is required. */ if (buf_len == 0) return 0; /* Ensure there is enough room to append BUF_LEN. */ argz_len = *pargz_len + buf_len; argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Copy characters from BUF after terminating '\0' in ARGZ. */ memcpy (argz + *pargz_len, buf, buf_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len) { size_t argz_len; char *argz = 0; assert (str); assert (pargz); assert (pargz_len); /* Make a copy of STR, but replacing each occurrence of DELIM with '\0'. */ argz_len = 1+ strlen (str); if (argz_len) { const char *p; char *q; argz = (char *) malloc (argz_len); if (!argz) return ENOMEM; for (p = str, q = argz; *p != EOS_CHAR; ++p) { if (*p == delim) { /* Ignore leading delimiters, and fold consecutive delimiters in STR into a single '\0' in ARGZ. */ if ((q > argz) && (q[-1] != EOS_CHAR)) *q++ = EOS_CHAR; else --argz_len; } else *q++ = *p; } /* Copy terminating EOS_CHAR. */ *q = *p; } /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ if (!argz_len) argz = (free (argz), (char *) 0); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { assert (pargz); assert (pargz_len); assert (entry && *entry); /* No BEFORE address indicates ENTRY should be inserted after the current last element. */ if (!before) return argz_append (pargz, pargz_len, entry, 1+ strlen (entry)); /* This probably indicates a programmer error, but to preserve semantics, scan back to the start of an entry if BEFORE points into the middle of it. */ while ((before > *pargz) && (before[-1] != EOS_CHAR)) --before; { size_t entry_len = 1+ strlen (entry); size_t argz_len = *pargz_len + entry_len; size_t offset = before - *pargz; char *argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Make BEFORE point to the equivalent offset in ARGZ that it used to have in *PARGZ incase realloc() moved the block. */ before = argz + offset; /* Move the ARGZ entries starting at BEFORE up into the new space at the end -- making room to copy ENTRY into the resulting gap. */ memmove (before + entry_len, before, *pargz_len - offset); memcpy (before, entry, entry_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; } return 0; } char * argz_next (char *argz, size_t argz_len, const char *entry) { assert ((argz && argz_len) || (!argz && !argz_len)); if (entry) { /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address within the ARGZ vector. */ assert ((!argz && !argz_len) || ((argz <= entry) && (entry < (argz + argz_len)))); /* Move to the char immediately after the terminating '\0' of ENTRY. */ entry = 1+ strchr (entry, EOS_CHAR); /* Return either the new ENTRY, or else NULL if ARGZ is exhausted. */ return (entry >= argz + argz_len) ? 0 : (char *) entry; } else { /* This should probably be flagged as a programmer error, since starting an argz_next loop with the iterator set to ARGZ is safer. To preserve semantics, handle the NULL case by returning the start of ARGZ (if any). */ if (argz_len > 0) return argz; else return 0; } } void argz_stringify (char *argz, size_t argz_len, int sep) { assert ((argz && argz_len) || (!argz && !argz_len)); if (sep) { --argz_len; /* don't stringify the terminating EOS */ while (--argz_len > 0) { if (argz[argz_len] == EOS_CHAR) argz[argz_len] = sep; } } } unixODBC-2.3.9/libltdl/Makefile.am0000664000175000017500000001203213725127167013556 00000000000000## ltdl.mk -- includable Makefile snippet ## ## Copyright (C) 2003-2005, 2007, 2011-2015 Free Software Foundation, ## Inc. ## Written by Gary V. Vaughan, 2003 ## ## NOTE: The canonical source of this file is maintained with the ## GNU Libtool package. Report bugs to bug-libtool@gnu.org. ## ## GNU Libltdl is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at your option) any later version. ## ## As a special exception to the GNU Lesser General Public License, ## if you distribute this file as part of a program or library that ## is built using GNU libtool, you may include this file under the ## same distribution terms that you use for the rest of that program. ## ## GNU Libltdl 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 Lesser General Public License for more details. ## ## You should have received a copy of the GNU LesserGeneral Public ## License along with GNU Libltdl; see the file COPYING.LIB. If not, a ## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, ## or obtained by writing to the Free Software Foundation, Inc., ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ##### ACLOCAL_AMFLAGS = -I ../m4 AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = AM_LDFLAGS = BUILT_SOURCES = include_HEADERS = noinst_LTLIBRARIES = lib_LTLIBRARIES = EXTRA_LTLIBRARIES = EXTRA_DIST = CLEANFILES = MOSTLYCLEANFILES = # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \ -DLTDL -I. -I$(srcdir) -Ilibltdl \ -I$(srcdir)/libltdl AM_LDFLAGS += -no-undefined LTDL_VERSION_INFO = -version-info 10:1:3 noinst_LTLIBRARIES += $(LT_DLLOADERS) if INSTALL_LTDL ltdlincludedir = $(includedir)/libltdl ltdlinclude_HEADERS = libltdl/lt_system.h \ libltdl/lt_error.h \ libltdl/lt_dlloader.h include_HEADERS += ltdl.h lib_LTLIBRARIES += libltdl.la endif if CONVENIENCE_LTDL noinst_LTLIBRARIES += libltdlc.la endif libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c EXTRA_DIST += lt__dirent.c \ lt__strl.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES= $(libltdl_la_DEPENDENCIES) ## The loaders are preopened by libltdl, itself always built from ## pic-objects (either as a shared library, or a convenience library), ## so the loaders themselves must be made from pic-objects too. We ## use convenience libraries for that purpose: EXTRA_LTLIBRARIES += dlopen.la \ dld_link.la \ dyld.la \ load_add_on.la \ loadlibrary.la \ shl_load.la dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) ## Make sure these will be cleaned even when they're not built by default: CLEANFILES += libltdl.la \ libltdlc.la \ libdlloader.la ## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects ## automatically: CLEANFILES += $(LIBOBJS) $(LTLIBOBJS) EXTRA_DIST += COPYING.LIB \ README ## --------------------------- ## ## Gnulib Makefile.am snippets ## ## --------------------------- ## BUILT_SOURCES += libltdl/$(LT_ARGZ_H) EXTRA_DIST += libltdl/lt__argz_.h \ lt__argz.c # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(LT_ARGZ_H) libltdl/lt__argz.h: libltdl/lt__argz_.h $(AM_V_at)$(mkinstalldirs) . libltdl $(AM_V_GEN)cp $(srcdir)/libltdl/lt__argz_.h $@-t $(AM_V_at)mv $@-t $@ MOSTLYCLEANFILES += libltdl/lt__argz.h \ libltdl/lt__argz.h-t unixODBC-2.3.9/cur/0000775000175000017500000000000013725127521010741 500000000000000unixODBC-2.3.9/cur/SQLColumns.c0000755000175000017500000000560713245017242013031 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColumns.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLColumns.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLColumns( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *column_name, SQLSMALLINT name_length4 ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLCOLUMNS( cl_statement -> cl_connection, cl_statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLNumResultCols.c0000755000175000017500000000366113245017242014166 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLNumResultCols.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLNumResultCols.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLNumResultCols( SQLHSTMT statement_handle, SQLSMALLINT *column_count ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, column_count ); } unixODBC-2.3.9/cur/SQLSetStmtAttr.c0000755000175000017500000001276313245017242013650 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetStmtAttr.c,v 1.8 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetStmtAttr.c,v $ * Revision 1.8 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.6 2005/10/27 17:54:49 lurcher * fix what I suspect is a typo in qt.m4 * * Revision 1.5 2003/12/01 16:37:17 lurcher * * Fix a bug in SQLWritePrivateProfileString * * Revision 1.4 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetStmtAttr( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLUINTEGER val; SQLRETURN ret = SQL_SUCCESS; switch( attribute ) { case SQL_ATTR_CONCURRENCY: val = ( SQLULEN ) value; if ( cl_statement -> concurrency == SQL_CURSOR_FORWARD_ONLY ) { if ( val != SQL_CONCUR_READ_ONLY ) { ret = SQL_SUCCESS_WITH_INFO; } } else { if ( val != SQL_CONCUR_READ_ONLY && val != SQL_CONCUR_VALUES ) { ret = SQL_SUCCESS_WITH_INFO; } } if ( ret == SQL_SUCCESS ) { cl_statement -> concurrency = ( SQLULEN ) value; } break; case SQL_ATTR_CURSOR_TYPE: val = ( SQLULEN ) value; if ( val != SQL_CURSOR_FORWARD_ONLY && val != SQL_CURSOR_STATIC ) { ret = SQL_SUCCESS_WITH_INFO; } else { cl_statement -> cursor_type = ( SQLULEN ) value; } break; case SQL_ATTR_PARAM_BIND_OFFSET_PTR: cl_statement -> param_bind_offset_ptr = ( SQLPOINTER ) value; break; case SQL_ATTR_PARAM_BIND_TYPE: cl_statement -> concurrency = ( SQLULEN ) value; break; case SQL_ATTR_ROW_BIND_OFFSET_PTR: cl_statement -> row_bind_offset_ptr = ( SQLPOINTER ) value; break; case SQL_ATTR_ROW_BIND_TYPE: cl_statement -> row_bind_type = ( SQLULEN ) value; break; case SQL_ATTR_ROW_ARRAY_SIZE: cl_statement -> rowset_array_size = ( SQLULEN ) value; break; case SQL_ROWSET_SIZE: cl_statement -> rowset_size = ( SQLULEN ) value; break; case SQL_ATTR_ROW_STATUS_PTR: cl_statement -> row_status_ptr = ( SQLUSMALLINT * ) value; break; case SQL_ATTR_ROWS_FETCHED_PTR: cl_statement -> rows_fetched_ptr = ( SQLULEN * ) value; break; case SQL_ATTR_SIMULATE_CURSOR: val = ( SQLULEN ) value; if ( val != SQL_SC_NON_UNIQUE ) { ret = SQL_SUCCESS_WITH_INFO; } else { cl_statement -> simulate_cursor = ( SQLULEN ) value; } break; case SQL_ATTR_USE_BOOKMARKS: cl_statement -> use_bookmarks = ( SQLULEN ) value; break; case SQL_ATTR_FETCH_BOOKMARK_PTR: cl_statement -> fetch_bookmark_ptr = ( SQLPOINTER ) value; break; default: return SQLSETSTMTATTR( cl_statement -> cl_connection, cl_statement -> driver_stmt, attribute, value, string_length ); } if ( ret == SQL_SUCCESS_WITH_INFO ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01S02, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } return ret; } unixODBC-2.3.9/cur/SQLGetConnectAttr.c0000755000175000017500000000411313245017242014264 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetConnectAttr.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetConnectAttr.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetConnectAttr( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { CLHDBC cl_connection = (CLHDBC) connection_handle; return SQLGETCONNECTATTR( cl_connection, cl_connection -> driver_dbc, attribute, value, buffer_length, string_length ); } unixODBC-2.3.9/cur/SQLSetPos.c0000755000175000017500000000630513245017242012622 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetPos.c,v 1.4 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetPos.c,v $ * Revision 1.4 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetPos( SQLHSTMT statement_handle, SQLSETPOSIROW irow, SQLUSMALLINT foption, SQLUSMALLINT flock ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; /* * this is implemented by the cursor lib */ if ( irow == 0 ) { /* * one day maybe, but what do you want, blood ? */ cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_HYC00, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } else if ( irow > cl_statement -> rowset_array_size ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1107, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } else if ( foption != SQL_POSITION || flock != SQL_LOCK_NO_CHANGE ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_HYC00, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } cl_statement -> cursor_pos = irow; return SQL_SUCCESS; } unixODBC-2.3.9/cur/SQLGetTypeInfo.c0000755000175000017500000000440213245017242013576 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetTypeInfo.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetTypeInfo.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2005/07/08 12:11:24 lurcher * * Fix a cursor lib problem (it was broken if you did metadata calls) * Alter the params to SQLParamOptions to use SQLULEN * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetTypeInfo( SQLHSTMT statement_handle, SQLSMALLINT data_type ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLGETTYPEINFO( cl_statement -> cl_connection, cl_statement -> driver_stmt, data_type ); cl_statement -> not_from_select = 1; return ret; } unixODBC-2.3.9/cur/SQLAllocHandle.c0000755000175000017500000001120513245017242013546 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLAllocHandle.c,v 1.6 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLAllocHandle.c,v $ * Revision 1.6 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.4 2005/07/08 12:11:23 lurcher * * Fix a cursor lib problem (it was broken if you did metadata calls) * Alter the params to SQLParamOptions to use SQLULEN * * Revision 1.3 2004/07/24 17:55:38 lurcher * Sync up CVS * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/03/28 14:57:22 nick * * Fix bugs in corsor lib introduced bu UNCODE and other changes * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/11/20 20:54:00 ngorham * * Asorted portability fixes * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLAllocHandle( SQLSMALLINT handle_type, SQLHANDLE input_handle, SQLHANDLE *output_handle, SQLHANDLE dm_handle ) { switch ( handle_type ) { case SQL_HANDLE_ENV: case SQL_HANDLE_DBC: /* * shouldn't be here */ return SQL_ERROR; break; case SQL_HANDLE_STMT: { CLHDBC cl_connection = (CLHDBC) input_handle; CLHSTMT cl_statement; DMHDBC connection = cl_connection -> dm_connection; SQLRETURN ret; /* * allocate a cursor lib statement */ cl_statement = malloc( sizeof( *cl_statement )); if ( !cl_statement ) { cl_connection -> dh.dm_log_write( "CL " __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); cl_connection -> dh.__post_internal_error( &connection -> error, ERROR_HY001, NULL, connection -> environment -> requested_version ); return SQL_ERROR; } memset( cl_statement, 0, sizeof( *cl_statement )); cl_statement -> cl_connection = cl_connection; cl_statement -> dm_statement = ( DMHSTMT ) dm_handle; cl_statement -> error_count = 0; cl_statement -> fetch_statement = SQL_NULL_HSTMT; ret = SQLALLOCHANDLE( cl_connection, handle_type, cl_connection -> driver_dbc, &cl_statement -> driver_stmt, NULL ); if ( SQL_SUCCEEDED( ret )) { *output_handle = ( SQLHSTMT ) cl_statement; } else { free( cl_statement ); } return ret; } break; case SQL_HANDLE_DESC: { CLHDBC cl_connection = (CLHDBC) input_handle; return SQLALLOCHANDLE( cl_connection, handle_type, input_handle, output_handle, NULL ); } break; } return SQL_ERROR; } unixODBC-2.3.9/cur/SQLSetScrollOptions.c0000755000175000017500000000641713245017242014677 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetScrollOptions.c,v 1.5 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetScrollOptions.c,v $ * Revision 1.5 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.3 2005/10/27 17:54:49 lurcher * fix what I suspect is a typo in qt.m4 * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/10/03 23:05:17 ngorham * * First public outing of the cursor lib * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetScrollOptions( SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset, SQLUSMALLINT crow_rowset ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; if ( crow_keyset != SQL_SCROLL_FORWARD_ONLY && crow_keyset != SQL_SCROLL_STATIC ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1107, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } if ( f_concurrency != SQL_CONCUR_READ_ONLY && f_concurrency != SQL_CONCUR_VALUES ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1108, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } cl_statement -> cursor_type = crow_keyset; cl_statement -> concurrency = f_concurrency; cl_statement -> rowset_array_size = crow_rowset; cl_statement -> rowset_size = crow_rowset; return SQL_SUCCESS; } unixODBC-2.3.9/cur/SQLSetParam.c0000755000175000017500000000457713245017242013132 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetParam.c,v 1.3 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetParam.c,v $ * Revision 1.3 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetParam( SQLHSTMT statement_handle, SQLUSMALLINT parameter_number, SQLSMALLINT value_type, SQLSMALLINT parameter_type, SQLULEN length_precision, SQLSMALLINT parameter_scale, SQLPOINTER parameter_value, SQLLEN *strlen_or_ind ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLSETPARAM( cl_statement -> cl_connection, cl_statement -> driver_stmt, parameter_number, value_type, parameter_type, length_precision, parameter_scale, parameter_value, strlen_or_ind ); } unixODBC-2.3.9/cur/SQLSpecialColumns.c0000755000175000017500000000573113245017242014330 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSpecialColumns.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSpecialColumns.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSpecialColumns( SQLHSTMT statement_handle, SQLUSMALLINT identifier_type, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT scope, SQLUSMALLINT nullable ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLSPECIALCOLUMNS( cl_statement -> cl_connection, cl_statement -> driver_stmt, identifier_type, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, scope, nullable ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLTablePrivileges.c0000755000175000017500000000555713245017242014476 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLTablePrivileges.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLTablePrivileges.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLTablePrivileges( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_table_name, SQLSMALLINT cb_table_name ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLTABLEPRIVILEGES( cl_statement -> cl_connection, cl_statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLExecute.c0000755000175000017500000000517513245017242013013 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLExecute.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLExecute.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.2 2001/03/28 14:57:22 nick * * Fix bugs in corsor lib introduced bu UNCODE and other changes * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLExecute( SQLHSTMT statement_handle ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLEXECUTE( cl_statement -> cl_connection, cl_statement -> driver_stmt ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; /* * if it's a SELECT statement it will generate columns * WARNING a stored procedure could get here as well */ if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } else { /* TODO Do DELETE/UPDATE WHERE CURRENT OF */ } } return ret; } unixODBC-2.3.9/cur/SQLSetDescField.c0000755000175000017500000000362313245017242013703 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetDescField.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetDescField.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetDescField( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length ) { /* * todo */ return SQL_ERROR; } unixODBC-2.3.9/cur/SQLNumParams.c0000755000175000017500000000364313245017242013312 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLNumParams.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLNumParams.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLNumParams( SQLHSTMT statement_handle, SQLSMALLINT *pcpar ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLNUMPARAMS( cl_statement -> cl_connection, cl_statement -> driver_stmt, pcpar ); } unixODBC-2.3.9/cur/SQLGetStmtAttr.c0000755000175000017500000001015413245017242013624 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetStmtAttr.c,v 1.5 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetStmtAttr.c,v $ * Revision 1.5 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.3 2005/10/27 17:54:49 lurcher * fix what I suspect is a typo in qt.m4 * * Revision 1.2 2003/12/01 16:37:17 lurcher * * Fix a bug in SQLWritePrivateProfileString * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/12/04 17:01:26 ngorham * * Remove C++ comments from the Postgres code * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetStmtAttr( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; switch( attribute ) { case SQL_ATTR_CONCURRENCY: *(( SQLUINTEGER * ) value ) = cl_statement -> concurrency; break; case SQL_ATTR_CURSOR_TYPE: *(( SQLUINTEGER * ) value ) = cl_statement -> cursor_type; break; case SQL_ATTR_PARAM_BIND_OFFSET_PTR: *(( SQLPOINTER * ) value ) = cl_statement -> param_bind_offset_ptr; break; case SQL_ATTR_PARAM_BIND_TYPE: *(( SQLUINTEGER * ) value ) = cl_statement -> param_bind_type; break; case SQL_ATTR_ROW_BIND_OFFSET_PTR: *(( SQLPOINTER * ) value ) = cl_statement -> row_bind_offset_ptr; break; case SQL_ATTR_ROW_BIND_TYPE: *(( SQLUINTEGER * ) value ) = cl_statement -> row_bind_type; break; case SQL_ATTR_ROW_ARRAY_SIZE: *(( SQLUINTEGER * ) value ) = cl_statement -> rowset_array_size; break; case SQL_ROWSET_SIZE: *(( SQLUINTEGER * ) value ) = cl_statement -> rowset_size; break; case SQL_ATTR_SIMULATE_CURSOR: *(( SQLUINTEGER * ) value ) = cl_statement -> simulate_cursor; break; case SQL_ATTR_USE_BOOKMARKS: *(( SQLULEN * ) value ) = cl_statement -> use_bookmarks; break; case SQL_ATTR_ROW_STATUS_PTR: *(( SQLUSMALLINT ** ) value ) = cl_statement -> row_status_ptr; break; case SQL_ATTR_ROWS_FETCHED_PTR: *(( SQLULEN ** ) value ) = cl_statement -> rows_fetched_ptr; break; case SQL_ATTR_FETCH_BOOKMARK_PTR: *(( SQLPOINTER * ) value ) = cl_statement -> fetch_bookmark_ptr; break; default: return SQLGETSTMTATTR( cl_statement -> cl_connection, cl_statement -> driver_stmt, attribute, value, buffer_length, string_length ); } return SQL_SUCCESS; } unixODBC-2.3.9/cur/SQLEndTran.c0000755000175000017500000000447013245017242012741 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLEndTran.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLEndTran.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLEndTran( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT completion_type ) { switch ( handle_type ) { case SQL_HANDLE_ENV: /* * the driver manager will not call this */ return SQL_ERROR; break; case SQL_HANDLE_DBC: { CLHDBC cl_connection = (CLHDBC) handle; return SQLENDTRAN( cl_connection, SQL_HANDLE_DBC, cl_connection -> driver_dbc, completion_type ); } break; default: return SQL_ERROR; } } unixODBC-2.3.9/cur/cursorlibrary.h0000755000175000017500000004526412262474476013761 00000000000000#ifndef _CURSORLIBRARY_H #define _CURSORLIBRARY_H #ifndef ODBCVER #define ODBCVER 0x0380 #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_PWD_H #include #endif #include #ifdef HAVE_STRING_H #include #endif #include /* THIS WILL BRING IN sql.h and sqltypes.h AS WELL AS PROVIDE MS EXTENSIONS */ #define MAX_CURSOR_NAME 18 /* * cursor positions */ #define CL_BEFORE_START -1 #define CL_AFTER_END -2 #include "drivermanager.h" typedef struct bound_column { struct bound_column *next; int column_number; SQLLEN len_ind; SQLPOINTER local_buffer; /* buffer that the CL binds in */ /* the driver (malloc'd) */ SQLPOINTER bound_buffer; /* buffer that the app binds */ SQLINTEGER bound_type; /* data type of binding */ SQLLEN bound_length; /* length of binding */ SQLLEN *bound_ind; /* ind ptr bound */ int rs_buffer_offset; int rs_ind_offset; /* offset onto the current rowset */ /* buffer */ } CLBCOL; typedef struct cl_connection { struct driver_func *functions; /* entry points, from the original */ /* driver */ DRV_SQLHANDLE driver_dbc; /* HDBC of the driver */ DMHDBC dm_connection; /* driver manager connection str */ DMHSTMT cl_handle; /* dummy to make the macro valid */ SQLUSMALLINT active_statement_allowed; /* can we have more than one active */ /* statement */ int error_count; /* used to call SQLGetDiagRec */ /* * Use these as entry points back to the driver manager */ struct driver_helper_funcs dh; } *CLHDBC; typedef struct cl_statement { DRV_SQLHANDLE driver_stmt; /* driver statement handle */ CLHDBC cl_connection; /* parent cursor lib connection */ DMHSTMT dm_statement; /* Driver manager statement */ DMHSTMT fetch_statement; /* Driver manager statement */ SQLUINTEGER cursor_type; /* statment attr's */ SQLUINTEGER concurrency; SQLPOINTER *fetch_bookmark_ptr; SQLUINTEGER *param_bind_offset_ptr; SQLUINTEGER param_bind_type; SQLPOINTER row_bind_offset_ptr; SQLUINTEGER row_bind_type; SQLUINTEGER rowset_array_size; SQLUINTEGER rowset_size; SQLUINTEGER simulate_cursor; SQLUINTEGER use_bookmarks; SQLULEN *rows_fetched_ptr; SQLUSMALLINT *row_status_ptr; SQLCHAR cursor_name[ MAX_CURSOR_NAME + 1 ]; CLBCOL *bound_columns; int first_fetch_done; char *sql_text; /* text of current statement */ char **column_names; /* names of each column */ SQLSMALLINT *data_type; SQLLEN *column_size; SQLSMALLINT *decimal_digits; int driver_stmt_closed; int not_from_select; int read_only; int fetch_done; /* * rowset info */ int rowset_position; int rowset_count; int rowset_complete; FILE *rowset_file; char *rowset_buffer; int buffer_length; int column_count; int curr_rowset_start; int cursor_pos; int error_count; /* used to call SQLGetDiagRec */ } *CLHSTMT; /* * cursor lib function defs */ SQLRETURN SQL_API CLAllocHandle( SQLSMALLINT handle_type, SQLHANDLE input_handle, SQLHANDLE *output_handle, SQLHANDLE dm_handle ); SQLRETURN SQL_API CLAllocHandleStd( SQLSMALLINT handle_type, SQLHANDLE input_handle, SQLHANDLE *output_handle, SQLHANDLE dm_handle ); SQLRETURN SQL_API CLAllocStmt( SQLHDBC connection_handle, SQLHSTMT *statement_handle, SQLHANDLE dm_handle ); SQLRETURN SQL_API CLBindCol( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLSMALLINT target_type, SQLPOINTER target_value, SQLLEN buffer_length, SQLLEN *strlen_or_ind ); SQLRETURN SQL_API CLBindParam( SQLHSTMT statement_handle, SQLUSMALLINT parameter_number, SQLSMALLINT value_type, SQLSMALLINT parameter_type, SQLULEN length_precision, SQLSMALLINT parameter_scale, SQLPOINTER parameter_value, SQLLEN *strlen_or_ind ); SQLRETURN SQL_API CLBindParameter( SQLHSTMT statement_handle, SQLUSMALLINT ipar, SQLSMALLINT f_param_type, SQLSMALLINT f_c_type, SQLSMALLINT f_sql_type, SQLULEN cb_col_def, SQLSMALLINT ib_scale, SQLPOINTER rgb_value, SQLLEN cb_value_max, SQLLEN *pcb_value ); SQLRETURN SQL_API CLBulkOperations( SQLHSTMT statement_handle, SQLSMALLINT operation ); SQLRETURN SQL_API CLCancel( SQLHSTMT statement_handle ); SQLRETURN SQL_API CLCloseCursor( SQLHSTMT statement_handle ); SQLRETURN SQL_API CLColAttribute ( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ); SQLRETURN SQL_API CLColAttributes( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ); SQLRETURN SQL_API CLColumnPrivileges( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *column_name, SQLSMALLINT name_length4 ); SQLRETURN SQL_API CLColumns( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *column_name, SQLSMALLINT name_length4 ); SQLRETURN SQL_API CLCopyDesc( SQLHDESC source_desc_handle, SQLHDESC target_desc_handle ); SQLRETURN SQL_API CLDescribeCol( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLCHAR *column_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length, SQLSMALLINT *data_type, SQLULEN *column_size, SQLSMALLINT *decimal_digits, SQLSMALLINT *nullable ); SQLRETURN SQL_API CLDescribeParam( SQLHSTMT statement_handle, SQLUSMALLINT ipar, SQLSMALLINT *pf_sql_type, SQLULEN *pcb_param_def, SQLSMALLINT *pib_scale, SQLSMALLINT *pf_nullable ); SQLRETURN SQL_API CLDisconnect( SQLHDBC connection_handle ); SQLRETURN SQL_API CLEndTran( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT completion_type ); SQLRETURN SQL_API CLError( SQLHENV environment_handle, SQLHDBC connection_handle, SQLHSTMT statement_handle, SQLCHAR *sqlstate, SQLINTEGER *native_error, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ); SQLRETURN SQL_API CLExecDirect( SQLHSTMT statement_handle, SQLCHAR *statement_text, SQLINTEGER text_length ); SQLRETURN SQL_API CLExecute( SQLHSTMT statement_handle ); SQLRETURN SQL_API CLExtendedFetch( SQLHSTMT statement_handle, SQLUSMALLINT f_fetch_type, SQLLEN irow, SQLULEN *pcrow, SQLUSMALLINT *rgf_row_status ); SQLRETURN SQL_API CLFetch( SQLHSTMT statement_handle ); SQLRETURN SQL_API CLFetchScroll( SQLHSTMT statement_handle, SQLSMALLINT fetch_orientation, SQLLEN fetch_offset ); SQLRETURN SQL_API CLForeignKeys( SQLHSTMT statement_handle, SQLCHAR *szpk_catalog_name, SQLSMALLINT cbpk_catalog_name, SQLCHAR *szpk_schema_name, SQLSMALLINT cbpk_schema_name, SQLCHAR *szpk_table_name, SQLSMALLINT cbpk_table_name, SQLCHAR *szfk_catalog_name, SQLSMALLINT cbfk_catalog_name, SQLCHAR *szfk_schema_name, SQLSMALLINT cbfk_schema_name, SQLCHAR *szfk_table_name, SQLSMALLINT cbfk_table_name ); SQLRETURN SQL_API CLFreeHandle( SQLSMALLINT handle_type, SQLHANDLE handle ); SQLRETURN SQL_API CLFreeStmt( SQLHSTMT statement_handle, SQLUSMALLINT option ); SQLRETURN SQL_API CLGetConnectOption( SQLHDBC connection_handle, SQLUSMALLINT option, SQLPOINTER value ); SQLRETURN SQL_API CLGetConnectAttr( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ); SQLRETURN SQL_API CLGetCursorName( SQLHSTMT statement_handle, SQLCHAR *cursor_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length ); SQLRETURN SQL_API CLGetData( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLSMALLINT target_type, SQLPOINTER target_value, SQLLEN buffer_length, SQLLEN *strlen_or_ind ); SQLRETURN SQL_API CLGetDescField( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ); SQLRETURN SQL_API CLGetDescRec( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLCHAR *name, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLSMALLINT *type, SQLSMALLINT *sub_type, SQLINTEGER *length, SQLSMALLINT *precision, SQLSMALLINT *scale, SQLSMALLINT *nullable ); SQLRETURN SQL_API CLGetDiagField( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLSMALLINT diag_identifier, SQLPOINTER diag_info_ptr, SQLSMALLINT buffer_length, SQLSMALLINT *string_length_ptr ); SQLRETURN SQL_API CLGetDiagRec( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLCHAR *sqlstate, SQLINTEGER *native, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length_ptr ); SQLRETURN SQL_API CLGetInfo( SQLHDBC connection_handle, SQLUSMALLINT info_type, SQLPOINTER info_value, SQLSMALLINT buffer_length, SQLSMALLINT *string_length ); SQLRETURN SQL_API CLGetStmtAttr( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ); SQLRETURN SQL_API CLGetStmtOption( SQLHSTMT statement_handle, SQLUSMALLINT option, SQLPOINTER value ); SQLRETURN SQL_API CLGetTypeInfo( SQLHSTMT statement_handle, SQLSMALLINT data_type ); SQLRETURN SQL_API CLMoreResults( SQLHSTMT statement_handle ); SQLRETURN SQL_API CLNativeSql( SQLHDBC hdbc, SQLCHAR *sz_sql_str_in, SQLINTEGER cb_sql_str_in, SQLCHAR *sz_sql_str, SQLINTEGER cb_sql_str_max, SQLINTEGER *pcb_sql_str ); SQLRETURN SQL_API CLNumParams( SQLHSTMT statement_handle, SQLSMALLINT *pcpar ); SQLRETURN SQL_API CLNumResultCols( SQLHSTMT statement_handle, SQLSMALLINT *column_count ); SQLRETURN SQL_API CLParamData( SQLHSTMT statement_handle, SQLPOINTER *value ); SQLRETURN SQL_API CLParamOptions( SQLHSTMT statement_handle, SQLULEN crow, SQLULEN *pirow ); SQLRETURN SQL_API CLPrepare( SQLHSTMT statement_handle, SQLCHAR *statement_text, SQLINTEGER text_length ); SQLRETURN SQL_API CLPrimaryKeys( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_table_name, SQLSMALLINT cb_table_name ); SQLRETURN SQL_API CLProcedureColumns( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_proc_name, SQLSMALLINT cb_proc_name, SQLCHAR *sz_column_name, SQLSMALLINT cb_column_name ); SQLRETURN SQL_API CLProcedures( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_proc_name, SQLSMALLINT cb_proc_name ); SQLRETURN SQL_API CLPutData( SQLHSTMT statement_handle, SQLPOINTER data, SQLINTEGER strlen_or_ind ); SQLRETURN SQL_API CLRowCount( SQLHSTMT statement_handle, SQLLEN *rowcount ); SQLRETURN SQL_API CLSetConnectAttr( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ); SQLRETURN SQL_API CLSetConnectOption( SQLHDBC connection_handle, SQLUSMALLINT option, SQLULEN value ); SQLRETURN SQL_API CLSetCursorName( SQLHSTMT statement_handle, SQLCHAR *cursor_name, SQLSMALLINT name_length ); SQLRETURN SQL_API CLSetDescField( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length ); SQLRETURN SQL_API CLSetDescRec( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT type, SQLSMALLINT subtype, SQLLEN length, SQLSMALLINT precision, SQLSMALLINT scale, SQLPOINTER data, SQLLEN *string_length, SQLLEN *indicator ); SQLRETURN SQL_API CLSetParam( SQLHSTMT statement_handle, SQLUSMALLINT parameter_number, SQLSMALLINT value_type, SQLSMALLINT parameter_type, SQLULEN length_precision, SQLSMALLINT parameter_scale, SQLPOINTER parameter_value, SQLLEN *strlen_or_ind ); SQLRETURN SQL_API CLSetPos( SQLHSTMT statement_handle, SQLSETPOSIROW irow, SQLUSMALLINT foption, SQLUSMALLINT flock ); SQLRETURN SQL_API CLSetScrollOptions( SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset, SQLUSMALLINT crow_rowset ); SQLRETURN SQL_API CLSetStmtAttr( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ); SQLRETURN SQL_API CLSetStmtOption( SQLHSTMT statement_handle, SQLUSMALLINT option, SQLULEN value ); SQLRETURN SQL_API CLSpecialColumns( SQLHSTMT statement_handle, SQLUSMALLINT identifier_type, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT scope, SQLUSMALLINT nullable ); SQLRETURN SQL_API CLStatistics( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT unique, SQLUSMALLINT reserved ); SQLRETURN SQL_API CLTablePrivileges( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_table_name, SQLSMALLINT cb_table_name ); SQLRETURN SQL_API CLTables( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *table_type, SQLSMALLINT name_length4 ); SQLRETURN SQL_API CLTransact( SQLHENV environment_handle, SQLHDBC connection_handle, SQLUSMALLINT completion_type ); /* * internal prototypes */ void free_rowset( CLHSTMT cl_statement ); int calculate_buffers( CLHSTMT cl_statement, int column_count ); int free_bound_columns( CLHSTMT cl_statement ); SQLRETURN do_fetch_scroll( CLHSTMT cl_statement, int fetch_orientation, SQLLEN fetch_offset, SQLUSMALLINT *row_status_ptr, SQLULEN *rows_fetched_ptr, int ext_fetch ); SQLRETURN get_column_names( CLHSTMT cl_statement ); SQLRETURN complete_rowset( CLHSTMT cl_statement, int complete_to ); SQLRETURN fetch_row( CLHSTMT cl_statement, int row_number, int offset ); #endif unixODBC-2.3.9/cur/SQLConnect.c0000644000175000017500000004376213676601766013025 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLConnect.c,v 1.7 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLConnect.c,v $ * Revision 1.7 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2007/02/12 11:49:35 lurcher * Add QT4 support to existing GUI parts * * Revision 1.5 2005/07/08 12:11:23 lurcher * * Fix a cursor lib problem (it was broken if you did metadata calls) * Alter the params to SQLParamOptions to use SQLULEN * * Revision 1.4 2005/05/03 17:16:49 lurcher * Backport a couple of changes from the Debian build * * Revision 1.3 2002/11/25 15:37:54 lurcher * * Fix problems in the cursor lib * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/03/28 14:57:22 nick * * Fix bugs in corsor lib introduced bu UNCODE and other changes * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.3 1999/11/20 20:54:00 ngorham * * Asorted portability fixes * * Revision 1.2 1999/11/10 03:51:35 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" static struct driver_func cl_template_func[] = { /* 00 */ { SQL_API_SQLALLOCCONNECT, "SQLAllocConnect", NULL, NULL, NULL }, /* 01 */ { SQL_API_SQLALLOCENV, "SQLAllocEnv", NULL, NULL, NULL }, /* 02 */ { SQL_API_SQLALLOCHANDLE, "SQLAllocHandle", NULL, NULL, (SQLRETURN (*)())CLAllocHandle }, /* 03 */ { SQL_API_SQLALLOCSTMT, "SQLAllocStmt", NULL, NULL, (SQLRETURN (*)())CLAllocStmt }, /* 04 */ { SQL_API_SQLALLOCHANDLESTD, "SQLAllocHandleStd", NULL, NULL, (SQLRETURN (*)())CLAllocHandleStd }, /* 05 */ { SQL_API_SQLBINDCOL, "SQLBindCol", NULL, NULL, (SQLRETURN (*)())CLBindCol }, /* 06 */ { SQL_API_SQLBINDPARAM, "SQLBindParam", NULL, NULL, (SQLRETURN (*)())CLBindParam }, /* 07 */ { SQL_API_SQLBINDPARAMETER, "SQLBindParameter", NULL, NULL, (SQLRETURN (*)())CLBindParameter }, /* 08 */ { SQL_API_SQLBROWSECONNECT, "SQLBrowseConnect", NULL, NULL, NULL }, /* 09 */ { SQL_API_SQLBULKOPERATIONS, "SQLBulkOperations", NULL, NULL, NULL }, /* 10 */ { SQL_API_SQLCANCEL, "SQLCancel", NULL, NULL, (SQLRETURN (*)())CLCancel }, /* 11 */ { SQL_API_SQLCLOSECURSOR, "SQLCloseCursor", NULL, NULL, (SQLRETURN (*)())CLCloseCursor }, /* 12 */ { SQL_API_SQLCOLATTRIBUTE, "SQLColAttribute", NULL, NULL, (SQLRETURN (*)())CLColAttribute }, /* 13 */ { SQL_API_SQLCOLATTRIBUTES, "SQLColAttributes", NULL, NULL, (SQLRETURN (*)())CLColAttributes }, /* 14 */ { SQL_API_SQLCOLUMNPRIVILEGES, "SQLColumnPrivileges", NULL, NULL, (SQLRETURN (*)())CLColumnPrivileges }, /* 15 */ { SQL_API_SQLCOLUMNS, "SQLColumns", NULL, NULL, (SQLRETURN (*)())CLColumns }, /* 16 */ { SQL_API_SQLCONNECT, "SQLConnect", NULL, NULL, NULL }, /* 17 */ { SQL_API_SQLCOPYDESC, "SQLCopyDesc", NULL, NULL, (SQLRETURN (*)())CLCopyDesc }, /* 18 */ { SQL_API_SQLDATASOURCES, "SQLDataSources", NULL, NULL, NULL }, /* 19 */ { SQL_API_SQLDESCRIBECOL, "SQLDescribeCol", NULL, NULL, (SQLRETURN (*)())CLDescribeCol }, /* 20 */ { SQL_API_SQLDESCRIBEPARAM, "SQLDescribeParam", NULL, NULL, (SQLRETURN (*)())CLDescribeParam }, /* 21 */ { SQL_API_SQLDISCONNECT, "SQLDisconnect", NULL, NULL, (SQLRETURN (*)())CLDisconnect }, /* 22 */ { SQL_API_SQLDRIVERCONNECT, "SQLDriverConnect", NULL, NULL, NULL }, /* 23 */ { SQL_API_SQLDRIVERS, "SQLDrivers", NULL, NULL, NULL }, /* 24 */ { SQL_API_SQLENDTRAN, "SQLEndTran", NULL, NULL, (SQLRETURN (*)())CLEndTran }, /* 25 */ { SQL_API_SQLERROR, "SQLError", NULL, NULL, (SQLRETURN (*)())CLError }, /* 26 */ { SQL_API_SQLEXECDIRECT, "SQLExecDirect", NULL, NULL, (SQLRETURN (*)())CLExecDirect }, /* 27 */ { SQL_API_SQLEXECUTE, "SQLExecute", NULL, NULL, (SQLRETURN (*)())CLExecute }, /* 28 */ { SQL_API_SQLEXTENDEDFETCH, "SQLExtendedFetch", NULL, NULL, (SQLRETURN (*)())CLExtendedFetch }, /* 29 */ { SQL_API_SQLFETCH, "SQLFetch", NULL, NULL, (SQLRETURN (*)())CLFetch }, /* 30 */ { SQL_API_SQLFETCHSCROLL, "SQLFetchScroll", NULL, NULL, (SQLRETURN (*)())CLFetchScroll }, /* 31 */ { SQL_API_SQLFOREIGNKEYS, "SQLForeignKeys", NULL, NULL, (SQLRETURN (*)())CLForeignKeys }, /* 32 */ { SQL_API_SQLFREEENV, "SQLFreeEnv", NULL, NULL, NULL }, /* 33 */ { SQL_API_SQLFREEHANDLE, "SQLFreeHandle", NULL, NULL, (SQLRETURN (*)())CLFreeHandle }, /* 34 */ { SQL_API_SQLFREESTMT, "SQLFreeStmt", NULL, NULL, (SQLRETURN (*)())CLFreeStmt }, /* 35 */ { SQL_API_SQLFREECONNECT, "SQLFreeConnect", NULL, NULL, NULL }, /* 36 */ { SQL_API_SQLGETCONNECTATTR, "SQLGetConnectAttr", NULL, NULL, (SQLRETURN (*)())CLGetConnectAttr }, /* 37 */ { SQL_API_SQLGETCONNECTOPTION, "SQLGetConnectOption", NULL, NULL, (SQLRETURN (*)())CLGetConnectOption }, /* 38 */ { SQL_API_SQLGETCURSORNAME, "SQLGetCursorName", NULL, NULL, (SQLRETURN (*)())CLGetCursorName }, /* 39 */ { SQL_API_SQLGETDATA, "SQLGetData", NULL, NULL, (SQLRETURN (*)())CLGetData }, /* 40 */ { SQL_API_SQLGETDESCFIELD, "SQLGetDescField", NULL, NULL, (SQLRETURN (*)())CLGetDescField }, /* 41 */ { SQL_API_SQLGETDESCREC, "SQLGetDescRec", NULL, NULL, (SQLRETURN (*)())CLGetDescRec }, /* 42 */ { SQL_API_SQLGETDIAGFIELD, "SQLGetDiagField", NULL, NULL, (SQLRETURN (*)())CLGetDiagField }, /* 43 */ { SQL_API_SQLGETENVATTR, "SQLGetEnvAttr", NULL, NULL, NULL }, /* 44 */ { SQL_API_SQLGETFUNCTIONS, "SQLGetFunctions", NULL, NULL, NULL }, /* 45 */ { SQL_API_SQLGETINFO, "SQLGetInfo", NULL, NULL, (SQLRETURN (*)())CLGetInfo }, /* 46 */ { SQL_API_SQLGETSTMTATTR, "SQLGetStmtAttr", NULL, NULL, (SQLRETURN (*)())CLGetStmtAttr }, /* 47 */ { SQL_API_SQLGETSTMTOPTION, "SQLGetStmtOption", NULL, NULL, (SQLRETURN (*)())CLGetStmtOption }, /* 48 */ { SQL_API_SQLGETTYPEINFO, "SQLGetTypeInfo", NULL, NULL, (SQLRETURN (*)())CLGetTypeInfo }, /* 49 */ { SQL_API_SQLMORERESULTS, "SQLMoreResults", NULL, NULL, (SQLRETURN (*)())CLMoreResults }, /* 50 */ { SQL_API_SQLNATIVESQL, "SQLNativeSql", NULL, NULL, (SQLRETURN (*)())CLNativeSql }, /* 51 */ { SQL_API_SQLNUMPARAMS, "SQLNumParams", NULL, NULL, (SQLRETURN (*)())CLNumParams }, /* 52 */ { SQL_API_SQLNUMRESULTCOLS, "SQLNumResultCols", NULL, NULL, (SQLRETURN (*)())CLNumResultCols }, /* 53 */ { SQL_API_SQLPARAMDATA, "SQLParamData", NULL, NULL, (SQLRETURN (*)())CLParamData }, /* 54 */ { SQL_API_SQLPARAMOPTIONS, "SQLParamOptions", NULL, NULL, (SQLRETURN (*)())CLParamOptions }, /* 55 */ { SQL_API_SQLPREPARE, "SQLPrepare", NULL, NULL, (SQLRETURN (*)())CLPrepare }, /* 56 */ { SQL_API_SQLPRIMARYKEYS, "SQLPrimaryKeys", NULL, NULL, (SQLRETURN (*)())CLPrimaryKeys }, /* 57 */ { SQL_API_SQLPROCEDURECOLUMNS, "SQLProcedureColumns", NULL, NULL, (SQLRETURN (*)())CLProcedureColumns }, /* 58 */ { SQL_API_SQLPROCEDURES, "SQLProcedures", NULL, NULL, (SQLRETURN (*)())CLProcedures }, /* 59 */ { SQL_API_SQLPUTDATA, "SQLPutData", NULL, NULL, (SQLRETURN (*)())CLPutData }, /* 60 */ { SQL_API_SQLROWCOUNT, "SQLRowCount", NULL, NULL, (SQLRETURN (*)())CLRowCount }, /* 61 */ { SQL_API_SQLSETCONNECTATTR, "SQLSetConnectAttr", NULL, NULL, (SQLRETURN (*)())CLSetConnectAttr }, /* 62 */ { SQL_API_SQLSETCONNECTOPTION, "SQLSetConnectOption", NULL, NULL, (SQLRETURN (*)())CLSetConnectOption }, /* 63 */ { SQL_API_SQLSETCURSORNAME, "SQLSetCursorName", NULL, NULL, (SQLRETURN (*)())CLSetCursorName }, /* 64 */ { SQL_API_SQLSETDESCFIELD, "SQLSetDescField", NULL, NULL, (SQLRETURN (*)())CLSetDescField }, /* 65 */ { SQL_API_SQLSETDESCREC, "SQLSetDescRec", NULL, NULL, (SQLRETURN (*)())CLSetDescRec }, /* 66 */ { SQL_API_SQLSETENVATTR, "SQLSetEnvAttr", NULL, NULL, NULL }, /* 67 */ { SQL_API_SQLSETPARAM, "SQLSetParam", NULL, NULL, (SQLRETURN (*)())CLSetParam }, /* 68 */ { SQL_API_SQLSETPOS, "SQLSetPos", NULL, NULL, (SQLRETURN (*)())CLSetPos }, /* 69 */ { SQL_API_SQLSETSCROLLOPTIONS, "SQLSetScrollOptions", NULL, NULL, (SQLRETURN (*)())CLSetScrollOptions }, /* 70 */ { SQL_API_SQLSETSTMTATTR, "SQLSetStmtAttr", NULL, NULL, (SQLRETURN (*)())CLSetStmtAttr }, /* 71 */ { SQL_API_SQLSETSTMTOPTION, "SQLSetStmtOption", NULL, NULL, (SQLRETURN (*)())CLSetStmtOption }, /* 72 */ { SQL_API_SQLSPECIALCOLUMNS, "SQLSpecialColumns", NULL, NULL, (SQLRETURN (*)())CLSpecialColumns }, /* 73 */ { SQL_API_SQLSTATISTICS, "SQLStatistics", NULL, NULL, (SQLRETURN (*)())CLStatistics }, /* 74 */ { SQL_API_SQLTABLEPRIVILEGES, "SQLTablePrivileges", NULL, NULL, (SQLRETURN (*)())CLTablePrivileges }, /* 75 */ { SQL_API_SQLTABLES, "SQLTables", NULL, NULL, (SQLRETURN (*)())CLTables }, /* 76 */ { SQL_API_SQLTRANSACT, "SQLTransact", NULL, NULL, (SQLRETURN (*)())CLTransact }, /* 77 */ { SQL_API_SQLGETDIAGREC, "SQLGetDiagRec", NULL, NULL, (SQLRETURN (*)())CLGetDiagRec }, }; /* * connect is done by the driver manager, the is called to put the * cursor lib in the call chain */ SQLRETURN CLConnect( DMHDBC connection, struct driver_helper_funcs *dh ) { int i; CLHDBC cl_connection; SQLRETURN ret; /* * Allocated a cursor connection structure */ cl_connection = malloc( sizeof( struct cl_connection )); if ( !cl_connection ) { dh ->dm_log_write( "CL " __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); dh ->__post_internal_error( &connection -> error, ERROR_HY001, NULL, connection -> environment -> requested_version ); return SQL_ERROR; } memset( cl_connection, 0, sizeof( struct cl_connection )); cl_connection -> functions = connection -> functions; cl_connection -> dm_connection = connection; cl_connection -> dh.__post_internal_error_ex = dh -> __post_internal_error_ex; cl_connection -> dh.__post_internal_error = dh -> __post_internal_error; cl_connection -> dh.dm_log_write = dh -> dm_log_write; /* * allocated a copy of the functions */ if ( !( cl_connection -> functions = malloc( sizeof( cl_template_func )))) { dh ->dm_log_write( "CL " __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); cl_connection -> dh.__post_internal_error( &connection -> error, ERROR_HY001, NULL, connection -> environment -> requested_version ); free( cl_connection ); return SQL_ERROR; } /* * replace the function pointers with the ones in the * cursor lib */ for ( i = 0; i < sizeof( cl_template_func ) / sizeof( cl_template_func[ 0 ] ); i ++ ) { cl_connection -> functions[ i ] = connection -> functions[ i ]; /* * if set replace the driver function with the function in * the template */ if ( cl_template_func[ i ].func && connection -> functions[ i ].func ) { connection -> functions[ i ] = cl_template_func[ i ]; /* * copy the can_supply from the drivers list */ connection -> functions[ i ].can_supply = cl_connection -> functions[ i ].can_supply; } } /* * add some functions the cursor lib will supply */ connection -> functions[ DM_SQLSETPOS ].can_supply = 1; connection -> functions[ DM_SQLSETPOS ].func = cl_template_func[ DM_SQLSETPOS ].func; connection -> functions[ DM_SQLSETSCROLLOPTIONS ].can_supply = 1; connection -> functions[ DM_SQLSETSCROLLOPTIONS ].func = cl_template_func[ DM_SQLSETSCROLLOPTIONS ].func; connection -> functions[ DM_SQLFETCHSCROLL ].can_supply = 1; connection -> functions[ DM_SQLFETCHSCROLL ].func = cl_template_func[ DM_SQLFETCHSCROLL ].func; connection -> functions[ DM_SQLEXTENDEDFETCH ].can_supply = 1; connection -> functions[ DM_SQLEXTENDEDFETCH ].func = cl_template_func[ DM_SQLEXTENDEDFETCH ].func; /* * blank off what we don't do */ connection -> functions[ DM_SQLBULKOPERATIONS ].can_supply = 0; connection -> functions[ DM_SQLBULKOPERATIONS ].func = NULL; /* * intercept the driver dbc */ cl_connection -> driver_dbc = connection -> driver_dbc; connection -> driver_dbc = ( DRV_SQLHANDLE ) cl_connection; /* * check the number of alowed active statements */ if ( CHECK_SQLGETINFO( cl_connection )) { ret = SQLGETINFO( cl_connection, cl_connection -> driver_dbc, SQL_MAX_CONCURRENT_ACTIVITIES, &cl_connection -> active_statement_allowed, sizeof( cl_connection -> active_statement_allowed ), NULL ); /* * assume the worst */ if ( !SQL_SUCCEEDED( ret )) { cl_connection -> active_statement_allowed = 1; } } else { cl_connection -> active_statement_allowed = 1; } return SQL_SUCCESS; } SQLRETURN CLDisconnect( SQLHDBC connection_handle ) { SQLRETURN ret; int i; CLHDBC cl_connection = (CLHDBC)connection_handle; DMHDBC connection = cl_connection -> dm_connection; /* * disconnect from the driver */ ret = SQLDISCONNECT( cl_connection, cl_connection -> driver_dbc ); if ( SQL_SUCCEEDED( ret )) { /* * replace the function pointers with the ones from the * cursor lib */ for ( i = 0; i < sizeof( cl_template_func ) / sizeof( cl_template_func[ 0 ] ); i ++ ) { connection -> functions[ i ] = cl_connection -> functions[ i ]; } /* * replace the driver dbc */ connection -> driver_dbc = cl_connection -> driver_dbc; /* * release the allocated memory */ if ( cl_connection -> functions ) { free( cl_connection -> functions ); } free( cl_connection ); } return ret; } unixODBC-2.3.9/cur/SQLParamOptions.c0000755000175000017500000000405513245017242014021 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLParamOptions.c,v 1.3 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLParamOptions.c,v $ * Revision 1.3 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2007/02/12 11:49:35 lurcher * Add QT4 support to existing GUI parts * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLParamOptions( SQLHSTMT statement_handle, SQLULEN crow, SQLULEN *pirow ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLPARAMOPTIONS( cl_statement -> cl_connection, cl_statement -> driver_stmt, crow, *pirow ); } unixODBC-2.3.9/cur/SQLTables.c0000755000175000017500000000560113245017242012615 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLTables.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLTables.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLTables( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *table_type, SQLSMALLINT name_length4 ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLTABLES( cl_statement -> cl_connection, cl_statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, table_type, name_length4 ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLRowCount.c0000755000175000017500000000466213245017242013171 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLRowCount.c,v 1.4 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLRowCount.c,v $ * Revision 1.4 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2007/02/12 11:49:35 lurcher * Add QT4 support to existing GUI parts * * Revision 1.2 2001/12/13 13:00:33 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLRowCount( SQLHSTMT statement_handle, SQLLEN *rowcount ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; if ( cl_statement -> first_fetch_done ) { if ( rowcount ) { *rowcount = cl_statement -> rowset_count; } return SQL_SUCCESS; } else { return DEF_SQLROWCOUNT( cl_statement -> cl_connection, cl_statement -> driver_stmt, rowcount ); } } unixODBC-2.3.9/cur/SQLSetConnectAttr.c0000755000175000017500000000401313245017242014277 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetConnectAttr.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetConnectAttr.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetConnectAttr( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { CLHDBC cl_connection = (CLHDBC) connection_handle; return SQLSETCONNECTATTR( cl_connection, cl_connection -> driver_dbc, attribute, value, string_length ); } unixODBC-2.3.9/cur/SQLTransact.c0000755000175000017500000000446513245017242013171 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLTransact.c,v 1.3 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLTransact.c,v $ * Revision 1.3 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2005/07/25 16:11:22 lurcher * Fix swapped about args in the cursor lib * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLTransact( SQLHENV environment_handle, SQLHDBC connection_handle, SQLUSMALLINT completion_type ) { if ( environment_handle ) { /* * the driver manager will not call this */ return SQL_ERROR; } else if ( connection_handle ) { CLHDBC cl_connection = (CLHDBC) connection_handle; return SQLTRANSACT( cl_connection, SQL_NULL_HENV, cl_connection -> driver_dbc, completion_type ); } else { return SQL_ERROR; } } unixODBC-2.3.9/cur/SQLStatistics.c0000755000175000017500000000560613245017242013542 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLStatistics.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLStatistics.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLStatistics( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT unique, SQLUSMALLINT reserved ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLSTATISTICS( cl_statement -> cl_connection, cl_statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, unique, reserved ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/README0000755000175000017500000000024412262474476011553 00000000000000A ODBC cursor lib provides cursor functionality ( client-side data caching and navigation ) in a generic manner so that drivers of any type can rely on it. unixODBC-2.3.9/cur/SQLSetStmtOption.c0000755000175000017500000001212613245017242014177 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetStmtOption.c,v 1.6 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetStmtOption.c,v $ * Revision 1.6 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.4 2005/10/27 17:54:49 lurcher * fix what I suspect is a typo in qt.m4 * * Revision 1.3 2005/05/03 17:16:50 lurcher * Backport a couple of changes from the Debian build * * Revision 1.2 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:51 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetStmtOption( SQLHSTMT statement_handle, SQLUSMALLINT option, SQLULEN value ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLUINTEGER val; SQLRETURN ret = SQL_SUCCESS; switch( option ) { case SQL_CONCURRENCY: val = ( SQLUINTEGER ) value; if ( cl_statement -> concurrency == SQL_CURSOR_FORWARD_ONLY ) { if ( val != SQL_CONCUR_READ_ONLY ) { ret = SQL_SUCCESS_WITH_INFO; } } else { if ( val != SQL_CONCUR_READ_ONLY && val != SQL_CONCUR_VALUES ) { ret = SQL_SUCCESS_WITH_INFO; } } if ( ret == SQL_SUCCESS ) { cl_statement -> concurrency = ( SQLUINTEGER ) value; } break; case SQL_CURSOR_TYPE: val = ( SQLUINTEGER ) value; if ( val != SQL_CURSOR_FORWARD_ONLY && val != SQL_CURSOR_TYPE ) { ret = SQL_SUCCESS_WITH_INFO; } else { cl_statement -> cursor_type = ( SQLUINTEGER ) value; } break; case SQL_BIND_TYPE: cl_statement -> row_bind_type = ( SQLUINTEGER ) value; break; case SQL_GET_BOOKMARK: cl_statement -> use_bookmarks = ( SQLUINTEGER ) value; break; case SQL_ROWSET_SIZE: cl_statement -> rowset_size = ( SQLUINTEGER ) value; break; case SQL_SIMULATE_CURSOR: val = ( SQLUINTEGER ) value; if ( val != SQL_SC_NON_UNIQUE ) { ret = SQL_SUCCESS_WITH_INFO; } else { cl_statement -> simulate_cursor = ( SQLUINTEGER ) value; } break; case SQL_ATTR_PARAM_BIND_OFFSET_PTR: cl_statement -> param_bind_offset_ptr = ( SQLPOINTER ) value; break; case SQL_ATTR_PARAM_BIND_TYPE: cl_statement -> concurrency = ( SQLUINTEGER ) value; break; case SQL_ATTR_ROW_BIND_OFFSET_PTR: cl_statement -> row_bind_offset_ptr = ( SQLPOINTER ) value; break; case SQL_ATTR_ROW_ARRAY_SIZE: cl_statement -> rowset_array_size = ( SQLUINTEGER ) value; break; case SQL_ATTR_ROW_STATUS_PTR: cl_statement -> row_status_ptr = ( SQLUSMALLINT * ) value; break; case SQL_ATTR_ROWS_FETCHED_PTR: cl_statement -> rows_fetched_ptr = ( SQLULEN * ) value; break; case SQL_ATTR_USE_BOOKMARKS: cl_statement -> use_bookmarks = ( SQLUINTEGER ) value; break; default: return SQLSETSTMTOPTION( cl_statement -> cl_connection, cl_statement -> driver_stmt, option, value ); } if ( ret == SQL_SUCCESS_WITH_INFO ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01S02, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } return ret; } unixODBC-2.3.9/cur/SQLFreeHandle.c0000755000175000017500000000772013245017242013404 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFreeHandle.c,v 1.4 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLFreeHandle.c,v $ * Revision 1.4 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.2 2004/07/24 17:55:38 lurcher * Sync up CVS * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLFreeHandle( SQLSMALLINT handle_type, SQLHANDLE handle ) { switch ( handle_type ) { case SQL_HANDLE_ENV: case SQL_HANDLE_DBC: return SQL_ERROR; case SQL_HANDLE_STMT: { CLHSTMT cl_statement = (CLHSTMT) handle; SQLRETURN ret = SQL_SUCCESS; /* * call the driver */ if ( !cl_statement -> driver_stmt_closed ) { if ( CHECK_SQLFREEHANDLE( cl_statement -> cl_connection )) { ret = SQLFREEHANDLE( cl_statement -> cl_connection, handle_type, cl_statement -> driver_stmt ); } else { ret = SQLFREESTMT( cl_statement -> cl_connection, cl_statement -> driver_stmt, SQL_DROP ); } if ( cl_statement -> fetch_statement != SQL_NULL_HSTMT ) { if ( CHECK_SQLFREEHANDLE( cl_statement -> cl_connection )) { ret = SQLFREEHANDLE( cl_statement -> cl_connection, handle_type, cl_statement -> fetch_statement ); } else { ret = SQLFREESTMT( cl_statement -> cl_connection, cl_statement -> fetch_statement, SQL_DROP ); } cl_statement -> fetch_statement = SQL_NULL_HSTMT; } } if ( SQL_SUCCEEDED( ret )) { /* * free any bound columns */ free_bound_columns( cl_statement ); /* * free up any rowset */ free_rowset( cl_statement ); free( cl_statement ); } return ret; } case SQL_HANDLE_DESC: /* * worry about this later, we need to get the connection */ return SQL_ERROR; } return SQL_ERROR; } unixODBC-2.3.9/cur/SQLGetDiagRec.c0000755000175000017500000000627113245017242013345 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDiagRec.c,v 1.7 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetDiagRec.c,v $ * Revision 1.7 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.5 2008/01/02 15:10:33 lurcher * Fix problems trying to use the cursor lib on a non select statement * * Revision 1.4 2007/02/12 11:49:35 lurcher * Add QT4 support to existing GUI parts * * Revision 1.3 2005/08/26 09:31:39 lurcher * Add call to allow the cursor lib to call SQLGetDiagRec * * Revision 1.2 2004/07/24 20:00:39 peteralexharvey * for OS2 port * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetDiagRec( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLCHAR *sqlstate, SQLINTEGER *native, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length_ptr ) { CLHDBC cl_connection = (CLHDBC) handle; DRV_SQLHANDLE dhandle; switch(handle_type) { case SQL_HANDLE_ENV: { return SQL_NO_DATA; } case SQL_HANDLE_DBC: { dhandle = cl_connection->driver_dbc; break; } case SQL_HANDLE_STMT: { CLHSTMT cl_statement = (CLHSTMT)handle; cl_connection = cl_statement->cl_connection; if ( cl_statement -> driver_stmt_closed ) { return SQL_NO_DATA; } dhandle = cl_statement->driver_stmt; break; } } return SQLGETDIAGREC(cl_connection, handle_type, dhandle, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr); } DMHDBC __get_connection( EHEAD * head ) { return 0; } unixODBC-2.3.9/cur/SQLGetInfo.c0000755000175000017500000001332013245017242012733 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetInfo.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetInfo.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetInfo( SQLHDBC connection_handle, SQLUSMALLINT info_type, SQLPOINTER info_value, SQLSMALLINT buffer_length, SQLSMALLINT *string_length ) { CLHDBC cl_connection = (CLHDBC) connection_handle; int do_it_here = 1; SQLUINTEGER value; SQLRETURN ret; char *cval = NULL; switch( info_type ) { case SQL_BOOKMARK_PERSISTENCE: value = 0; break; case SQL_DYNAMIC_CURSOR_ATTRIBUTES1: value = 0; break; case SQL_DYNAMIC_CURSOR_ATTRIBUTES2: value = 0; break; case SQL_FETCH_DIRECTION: value = SQL_FD_FETCH_ABSOLUTE | SQL_FD_FETCH_FIRST | SQL_FD_FETCH_LAST | SQL_FD_FETCH_NEXT | SQL_FD_FETCH_PRIOR | SQL_FD_FETCH_RELATIVE | SQL_FD_FETCH_BOOKMARK; break; case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1: value = SQL_CA1_NEXT | SQL_CA1_ABSOLUTE | SQL_CA1_RELATIVE | SQL_CA1_LOCK_NO_CHANGE | SQL_CA1_POS_POSITION | SQL_CA1_POSITIONED_DELETE | SQL_CA1_POSITIONED_UPDATE | SQL_CA1_SELECT_FOR_UPDATE; break; case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2: value = SQL_CA2_READ_ONLY_CONCURRENCY | SQL_CA2_OPT_VALUES_CONCURRENCY | SQL_CA2_SENSITIVITY_UPDATES; break; case SQL_KEYSET_CURSOR_ATTRIBUTES1: value = 0; break; case SQL_KEYSET_CURSOR_ATTRIBUTES2: value = 0; break; case SQL_LOCK_TYPES: value = SQL_LCK_NO_CHANGE; break; case SQL_STATIC_CURSOR_ATTRIBUTES1: value = SQL_CA1_NEXT | SQL_CA1_ABSOLUTE | SQL_CA1_RELATIVE | SQL_CA1_BOOKMARK | SQL_CA1_LOCK_NO_CHANGE | SQL_CA1_POS_POSITION | SQL_CA1_POSITIONED_DELETE | SQL_CA1_POSITIONED_UPDATE | SQL_CA1_SELECT_FOR_UPDATE; break; case SQL_STATIC_CURSOR_ATTRIBUTES2: value = SQL_CA2_READ_ONLY_CONCURRENCY | SQL_CA2_OPT_VALUES_CONCURRENCY | SQL_CA2_SENSITIVITY_UPDATES; break; case SQL_POS_OPERATIONS: value = SQL_POS_POSITION; break; case SQL_POSITIONED_STATEMENTS: value = SQL_PS_POSITIONED_DELETE | SQL_PS_POSITIONED_UPDATE | SQL_PS_SELECT_FOR_UPDATE; break; case SQL_ROW_UPDATES: cval = "Y"; break; case SQL_SCROLL_CONCURRENCY: value = SQL_SCCO_READ_ONLY | SQL_SCCO_OPT_VALUES; break; case SQL_SCROLL_OPTIONS: value = SQL_SO_FORWARD_ONLY | SQL_SO_STATIC; break; case SQL_STATIC_SENSITIVITY: value = SQL_SS_UPDATES; break; default: do_it_here = 0; break; } if ( do_it_here ) { if ( cval ) { if ( buffer_length > 2 && info_value ) { strcpy( info_value, cval ); ret = SQL_SUCCESS; } else { ret = SQL_SUCCESS_WITH_INFO; } if ( string_length ) { *string_length = 1; } } else { *((SQLINTEGER*)info_value) = value; ret = SQL_SUCCESS; } } else { ret = SQLGETINFO( cl_connection, cl_connection -> driver_dbc, info_type, info_value, buffer_length, string_length ); if ( SQL_SUCCEEDED( ret )) { if ( info_type == SQL_GETDATA_EXTENSIONS && info_value ) { *((SQLINTEGER*)info_value) |= SQL_GD_BLOCK; } } } return ret; } unixODBC-2.3.9/cur/SQLBindParam.c0000755000175000017500000000457413245017242013250 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBindParam.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLBindParam.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLBindParam( SQLHSTMT statement_handle, SQLUSMALLINT parameter_number, SQLSMALLINT value_type, SQLSMALLINT parameter_type, SQLULEN length_precision, SQLSMALLINT parameter_scale, SQLPOINTER parameter_value, SQLLEN *strlen_or_ind ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLBINDPARAM( cl_statement -> cl_connection, cl_statement -> driver_stmt, parameter_number, value_type, parameter_type, length_precision, parameter_scale, parameter_value, strlen_or_ind ); } unixODBC-2.3.9/cur/SQLColAttributes.c0000755000175000017500000000454113245017242014171 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColAttributes.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLColAttributes.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLColAttributes( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLCOLATTRIBUTES( cl_statement -> cl_connection, cl_statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } unixODBC-2.3.9/cur/SQLProcedureColumns.c0000755000175000017500000000576613245017242014710 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLProcedureColumns.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLProcedureColumns.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLProcedureColumns( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_proc_name, SQLSMALLINT cb_proc_name, SQLCHAR *sz_column_name, SQLSMALLINT cb_column_name ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLPROCEDURECOLUMNS( cl_statement -> cl_connection, cl_statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name, sz_column_name, cb_column_name ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLCloseCursor.c0000755000175000017500000000366613245017242013657 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLCloseCursor.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLCloseCursor.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLCloseCursor( SQLHSTMT statement_handle ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; /* * free up any rowset */ free_rowset( cl_statement ); return SQLCLOSECURSOR( cl_statement -> cl_connection, cl_statement -> driver_stmt ); } unixODBC-2.3.9/cur/SQLForeignKeys.c0000755000175000017500000000644413245017242013636 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLForeignKeys.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLForeignKeys.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLForeignKeys( SQLHSTMT statement_handle, SQLCHAR *szpk_catalog_name, SQLSMALLINT cbpk_catalog_name, SQLCHAR *szpk_schema_name, SQLSMALLINT cbpk_schema_name, SQLCHAR *szpk_table_name, SQLSMALLINT cbpk_table_name, SQLCHAR *szfk_catalog_name, SQLSMALLINT cbfk_catalog_name, SQLCHAR *szfk_schema_name, SQLSMALLINT cbfk_schema_name, SQLCHAR *szfk_table_name, SQLSMALLINT cbfk_table_name ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLFOREIGNKEYS( cl_statement -> cl_connection, cl_statement -> driver_stmt, szpk_catalog_name, cbpk_catalog_name, szpk_schema_name, cbpk_schema_name, szpk_table_name, cbpk_table_name, szfk_catalog_name, cbfk_catalog_name, szfk_schema_name, cbfk_schema_name, szfk_table_name, cbfk_table_name ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLGetStmtOption.c0000755000175000017500000000737413245017242014174 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetStmtOption.c,v 1.4 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetStmtOption.c,v $ * Revision 1.4 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.2 2005/10/27 17:54:49 lurcher * fix what I suspect is a typo in qt.m4 * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetStmtOption( SQLHSTMT statement_handle, SQLUSMALLINT option, SQLPOINTER value ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; switch( option ) { case SQL_CONCURRENCY: *(( SQLUINTEGER * ) value ) = cl_statement -> concurrency; break; case SQL_CURSOR_TYPE: *(( SQLUINTEGER * ) value ) = cl_statement -> cursor_type; break; case SQL_BIND_TYPE: *(( SQLUINTEGER * ) value ) = cl_statement -> row_bind_type; break; case SQL_GET_BOOKMARK: *(( SQLUINTEGER * ) value ) = cl_statement -> use_bookmarks; break; case SQL_ROWSET_SIZE: *(( SQLUINTEGER * ) value ) = cl_statement -> rowset_size; break; case SQL_SIMULATE_CURSOR: *(( SQLUINTEGER * ) value ) = cl_statement -> simulate_cursor; break; case SQL_ATTR_PARAM_BIND_OFFSET_PTR: *(( SQLPOINTER * ) value ) = cl_statement -> param_bind_offset_ptr; break; case SQL_ATTR_PARAM_BIND_TYPE: *(( SQLUINTEGER * ) value ) = cl_statement -> concurrency; break; case SQL_ATTR_ROW_BIND_OFFSET_PTR: *(( SQLPOINTER * ) value ) = cl_statement -> row_bind_offset_ptr; break; case SQL_ATTR_ROW_ARRAY_SIZE: *(( SQLUINTEGER * ) value ) = cl_statement -> rowset_array_size; break; case SQL_ATTR_ROW_STATUS_PTR: *(( SQLUSMALLINT ** ) value ) = cl_statement -> row_status_ptr; break; case SQL_ATTR_ROWS_FETCHED_PTR: *(( SQLULEN ** ) value ) = cl_statement -> rows_fetched_ptr; break; case SQL_ATTR_USE_BOOKMARKS: *(( SQLUINTEGER * ) value ) = cl_statement -> use_bookmarks; break; default: return SQLGETSTMTOPTION( cl_statement -> cl_connection, cl_statement -> driver_stmt, option, value ); } return SQL_SUCCESS; } unixODBC-2.3.9/cur/SQLMoreResults.c0000755000175000017500000000461313245017242013671 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLMoreResults.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLMoreResults.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2008/11/03 14:53:29 lurcher * Allow cursor lib to handle multiple result sets * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLMoreResults( SQLHSTMT statement_handle ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLMORERESULTS( cl_statement -> cl_connection, cl_statement -> driver_stmt ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLExecDirect.c0000755000175000017500000002076413245017242013431 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLExecDirect.c,v 1.6 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLExecDirect.c,v $ * Revision 1.6 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.4 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.3 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:33 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" /* * free the rowset info */ void free_rowset( CLHSTMT cl_statement ) { if ( cl_statement -> rowset_buffer ) { free( cl_statement -> rowset_buffer ); cl_statement -> rowset_buffer = NULL; } if ( cl_statement -> rowset_file ) { fclose( cl_statement -> rowset_file ); cl_statement -> rowset_file = NULL; } if ( cl_statement -> sql_text ) { free( cl_statement -> sql_text ); cl_statement -> sql_text = NULL; } if ( cl_statement -> column_names ) { int i; for ( i = 0; i < cl_statement -> column_count; i ++ ) { free( cl_statement -> column_names[ i ] ); } free( cl_statement -> column_names ); cl_statement -> column_names = NULL; } if ( cl_statement -> data_type ) { free( cl_statement -> data_type ); cl_statement -> data_type = NULL; } if ( cl_statement -> column_size ) { free( cl_statement -> column_size ); cl_statement -> column_size = NULL; } if ( cl_statement -> decimal_digits ) { free( cl_statement -> decimal_digits ); cl_statement -> decimal_digits = NULL; } } /* * run through the bound columns, calculating the offsets */ int calculate_buffers( CLHSTMT cl_statement, int column_count ) { CLBCOL *bcol; cl_statement -> rowset_position = CL_BEFORE_START; cl_statement -> rowset_count = 0; cl_statement -> rowset_complete = 0; cl_statement -> column_count = column_count; /* * row status value */ cl_statement -> buffer_length = sizeof( SQLUSMALLINT ); bcol = cl_statement -> bound_columns; while ( bcol ) { if ( bcol -> column_number <= column_count ) { bcol -> rs_buffer_offset = cl_statement -> buffer_length; cl_statement -> buffer_length += bcol -> bound_length; bcol -> rs_ind_offset = cl_statement -> buffer_length; cl_statement -> buffer_length += sizeof( SQLULEN ); } bcol = bcol -> next; } /* * allocate buffer */ cl_statement -> rowset_buffer = malloc( cl_statement -> buffer_length ); if ( !cl_statement -> rowset_buffer ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_HY001, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } /* * open temp file */ cl_statement -> rowset_file = tmpfile(); if ( !cl_statement -> rowset_file ) { cl_statement -> cl_connection -> dh.__post_internal_error_ex( &cl_statement -> dm_statement -> error, (SQLCHAR*)"S1000", 0, (SQLCHAR*)"General Error, Unable to create file buffer", SUBCLASS_ODBC, SUBCLASS_ODBC ); return SQL_ERROR; } return SQL_SUCCESS; } SQLRETURN get_column_names( CLHSTMT cl_statement ) { int i; char cname[ 256 ]; /* * already done ? */ if ( cl_statement -> column_names ) { return SQL_SUCCESS; } /* * get the names of all the columns */ cl_statement -> column_names = malloc( sizeof(char *) * cl_statement -> column_count ); cl_statement -> data_type = malloc( sizeof( SQLSMALLINT ) * cl_statement -> column_count ); cl_statement -> column_size = malloc( sizeof( SQLULEN ) * cl_statement -> column_count ); cl_statement -> decimal_digits = malloc( sizeof( SQLSMALLINT ) * cl_statement -> column_count ); for ( i = 1; i <= cl_statement -> column_count; i ++ ) { SQLRETURN ret; if ( !CHECK_SQLDESCRIBECOL( cl_statement -> cl_connection )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01000, "Driver does not support SQLDescribeCol", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } ret = SQLDESCRIBECOL( cl_statement -> cl_connection, cl_statement -> driver_stmt, i, cname, sizeof( cname ), NULL, &cl_statement -> data_type[ i - 1 ], &cl_statement -> column_size[ i - 1 ], &cl_statement -> decimal_digits[ i - 1 ], NULL ); if ( !SQL_SUCCEEDED( ret )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01000, "SQLDescribeCol failed in driver", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } cl_statement -> column_names[ i - 1 ] = strdup( cname ); } return SQL_SUCCESS; } SQLRETURN CLExecDirect( SQLHSTMT statement_handle, SQLCHAR *statement_text, SQLINTEGER text_length ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; /* * save the statement for later use */ if ( cl_statement -> sql_text ) { free( cl_statement -> sql_text ); } if ( text_length < 0 ) { cl_statement -> sql_text = strdup((char*) statement_text ); } else { cl_statement -> sql_text = malloc( text_length + 1 ); memcpy( cl_statement -> sql_text, statement_text, text_length ); cl_statement -> sql_text[ text_length ] = '\0'; } ret = SQLEXECDIRECT( cl_statement -> cl_connection, cl_statement -> driver_stmt, statement_text, text_length ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLGetDescField.c0000755000175000017500000000375713245017242013677 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDescField.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetDescField.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2005/09/05 09:49:48 lurcher * New QT detection macros added * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetDescField( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { return SQL_ERROR; } unixODBC-2.3.9/cur/SQLColumnPrivileges.c0000755000175000017500000000573313245017242014700 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColumnPrivileges.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLColumnPrivileges.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLColumnPrivileges( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *column_name, SQLSMALLINT name_length4 ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLCOLUMNPRIVILEGES( cl_statement -> cl_connection, cl_statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLSetDescRec.c0000755000175000017500000000415013245017242013365 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetDescRec.c,v 1.3 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetDescRec.c,v $ * Revision 1.3 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetDescRec( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT type, SQLSMALLINT subtype, SQLLEN length, SQLSMALLINT precision, SQLSMALLINT scale, SQLPOINTER data, SQLLEN *string_length, SQLLEN *indicator ) { /* * todo */ return SQL_ERROR; } unixODBC-2.3.9/cur/SQLError.c0000755000175000017500000001126013245017242012472 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLError.c,v 1.5 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLError.c,v $ * Revision 1.5 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.3 2008/01/02 15:10:33 lurcher * Fix problems trying to use the cursor lib on a non select statement * * Revision 1.2 2005/09/05 09:49:48 lurcher * New QT detection macros added * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.2 2001/03/28 14:57:22 nick * * Fix bugs in corsor lib introduced bu UNCODE and other changes * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLError( SQLHENV environment_handle, SQLHDBC connection_handle, SQLHSTMT statement_handle, SQLCHAR *sqlstate, SQLINTEGER *native_error, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ) { if ( statement_handle ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; if ( cl_statement -> driver_stmt_closed ) { return SQL_NO_DATA; } if ( CHECK_SQLERROR( cl_statement -> cl_connection )) { return SQLERROR( cl_statement -> cl_connection, SQL_NULL_HENV, SQL_NULL_HDBC, cl_statement -> driver_stmt, sqlstate, native_error, message_text, buffer_length, text_length ); } else { SQLRETURN ret; ret = SQLGETDIAGREC( cl_statement -> cl_connection, SQL_HANDLE_STMT, cl_statement -> driver_stmt, cl_statement -> error_count, sqlstate, native_error, message_text, buffer_length, text_length ); if ( SQL_SUCCEEDED( ret )) { cl_statement -> error_count ++; } else { cl_statement -> error_count = 0; } return ret; } } else if ( connection_handle ) { CLHDBC cl_connection = (CLHDBC) connection_handle; if ( CHECK_SQLERROR( cl_connection )) { return SQLERROR( cl_connection, SQL_NULL_HENV, cl_connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, native_error, message_text, buffer_length, text_length ); } else { SQLRETURN ret; ret = SQLGETDIAGREC( cl_connection, SQL_HANDLE_DBC, cl_connection -> driver_dbc, cl_connection -> error_count, sqlstate, native_error, message_text, buffer_length, text_length ); if ( SQL_SUCCEEDED( ret )) { cl_connection -> error_count ++; } else { cl_connection -> error_count = 0; } return ret; } } else if ( environment_handle ) { /* * shouldn't get here */ return SQL_NO_DATA; } return SQL_NO_DATA; } unixODBC-2.3.9/cur/SQLCopyDesc.c0000755000175000017500000000344013245017242013113 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLCopyDesc.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLCopyDesc.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLCopyDesc( SQLHDESC source_desc_handle, SQLHDESC target_desc_handle ) { /* * todo */ return SQL_ERROR; } unixODBC-2.3.9/cur/SQLGetDescRec.c0000755000175000017500000000420713245017242013354 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDescRec.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetDescRec.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2005/09/05 09:49:48 lurcher * New QT detection macros added * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetDescRec( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLCHAR *name, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLSMALLINT *type, SQLSMALLINT *sub_type, SQLINTEGER *length, SQLSMALLINT *precision, SQLSMALLINT *scale, SQLSMALLINT *nullable ) { return SQL_ERROR; } unixODBC-2.3.9/cur/SQLFetch.c0000755000175000017500000000604413245017242012436 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFetch.c,v 1.6 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLFetch.c,v $ * Revision 1.6 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2005/10/27 17:54:49 lurcher * fix what I suspect is a typo in qt.m4 * * Revision 1.4 2005/07/08 12:11:24 lurcher * * Fix a cursor lib problem (it was broken if you did metadata calls) * Alter the params to SQLParamOptions to use SQLULEN * * Revision 1.3 2003/10/06 15:43:47 lurcher * * Fix cursor lib to work with SQLFetch as well as the other fetch calls * Update README.OSX to detail building the cursor lib * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/10/03 23:05:17 ngorham * * First public outing of the cursor lib * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLFetch( SQLHSTMT statement_handle ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; if ( cl_statement -> not_from_select ) { return SQLFETCH( cl_statement -> cl_connection, cl_statement -> driver_stmt ); } if ( !cl_statement -> bound_columns ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_SL009, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } return do_fetch_scroll( cl_statement, SQL_FETCH_NEXT, 0, cl_statement -> row_status_ptr, cl_statement -> rows_fetched_ptr, 0 ); } unixODBC-2.3.9/cur/SQLColAttribute.c0000755000175000017500000001375613245017242014016 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColAttribute.c,v 1.5 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLColAttribute.c,v $ * Revision 1.5 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.3 2004/06/21 10:01:14 lurcher * * Fix a couple of 64 bit issues * * Revision 1.2 2003/12/01 16:37:17 lurcher * * Fix a bug in SQLWritePrivateProfileString * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLColAttribute ( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; /* * Catch any requests for bookmark info */ if ( field_identifier != SQL_DESC_COUNT && field_identifier != SQL_COLUMN_COUNT ) { if ( column_number == 0 ) { if ( cl_statement -> use_bookmarks ) { SQLLEN ival; switch( field_identifier ) { case SQL_DESC_AUTO_UNIQUE_VALUE: case SQL_DESC_CASE_SENSITIVE: case SQL_DESC_NULLABLE: case SQL_DESC_UPDATABLE: case SQL_COLUMN_NULLABLE: case SQL_DESC_UNSIGNED: ival = SQL_FALSE; break; case SQL_DESC_CONCISE_TYPE: ival = SQL_C_SLONG; break; case SQL_DESC_DISPLAY_SIZE: ival = 4; break; case SQL_DESC_FIXED_PREC_SCALE: case SQL_DESC_SEARCHABLE: ival = SQL_TRUE; break; case SQL_DESC_NUM_PREC_RADIX: ival = 0; break; case SQL_DESC_LENGTH: case SQL_COLUMN_LENGTH: case SQL_DESC_OCTET_LENGTH: ival = 4; break; case SQL_DESC_PRECISION: case SQL_DESC_SCALE: case SQL_COLUMN_PRECISION: case SQL_COLUMN_SCALE: ival = 0; break; case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: case SQL_COLUMN_NAME: if ( string_length ) { *string_length = 0; } if ( character_attribute ) { *((SQLCHAR*)character_attribute) = '\0'; } return SQL_SUCCESS; default: return SQLCOLATTRIBUTE( cl_statement -> cl_connection, cl_statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } if ( numeric_attribute ) { *((SQLLEN*)numeric_attribute) = ival; } return SQL_SUCCESS; } else { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_07009, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } } } return SQLCOLATTRIBUTE( cl_statement -> cl_connection, cl_statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } unixODBC-2.3.9/cur/SQLProcedures.c0000755000175000017500000000552713245017242013525 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLProcedures.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLProcedures.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLProcedures( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_proc_name, SQLSMALLINT cb_proc_name ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLPROCEDURES( cl_statement -> cl_connection, cl_statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLNativeSql.c0000755000175000017500000000433313245017242013312 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLNativeSql.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLNativeSql.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLNativeSql( SQLHDBC connection_handle, SQLCHAR *sz_sql_str_in, SQLINTEGER cb_sql_str_in, SQLCHAR *sz_sql_str, SQLINTEGER cb_sql_str_max, SQLINTEGER *pcb_sql_str ) { CLHDBC cl_connection = (CLHDBC) connection_handle; /* * the cursor lib will take a part in this */ return SQLNATIVESQL( cl_connection, cl_connection -> driver_dbc, sz_sql_str_in, cb_sql_str_in, sz_sql_str, cb_sql_str_max, pcb_sql_str ); } unixODBC-2.3.9/cur/cur.exp0000755000175000017500000000001212262474476012173 00000000000000CLConnect unixODBC-2.3.9/cur/SQLPrimaryKeys.c0000755000175000017500000000553713245017242013672 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLPrimaryKeys.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLPrimaryKeys.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/09/23 21:46:37 ngorham * * Added cursor support for metadata functions * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLPrimaryKeys( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_table_name, SQLSMALLINT cb_table_name ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret; ret = SQLPRIMARYKEYS( cl_statement -> cl_connection, cl_statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); if ( SQL_SUCCEEDED( ret )) { SQLSMALLINT column_count; ret = SQLNUMRESULTCOLS( cl_statement -> cl_connection, cl_statement -> driver_stmt, &column_count ); cl_statement -> column_count = column_count; cl_statement -> first_fetch_done = 0; cl_statement -> not_from_select = 1; if ( column_count > 0 ) { ret = get_column_names( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLAllocHandleStd.c0000755000175000017500000000370313245017242014225 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLAllocHandleStd.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLAllocHandleStd.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLAllocHandleStd( SQLSMALLINT handle_type, SQLHANDLE input_handle, SQLHANDLE *output_handle, SQLHANDLE dm_handle ) { return CLAllocHandle( handle_type, input_handle, output_handle, dm_handle ); } unixODBC-2.3.9/cur/SQLPrepare.c0000755000175000017500000000524013245017242013000 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLPrepare.c,v 1.3 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLPrepare.c,v $ * Revision 1.3 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2001/12/13 13:00:33 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLPrepare( SQLHSTMT statement_handle, SQLCHAR *statement_text, SQLINTEGER text_length ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; /* * save the statement for later use */ if ( cl_statement -> sql_text ) { free( cl_statement -> sql_text ); } if ( text_length < 0 ) { cl_statement -> sql_text = strdup((char*) statement_text ); } else { cl_statement -> sql_text = malloc( text_length + 1 ); memcpy( cl_statement -> sql_text, statement_text, text_length ); cl_statement -> sql_text[ text_length ] = '\0'; } return SQLPREPARE( cl_statement -> cl_connection, cl_statement -> driver_stmt, statement_text, text_length ); } unixODBC-2.3.9/cur/SQLDescribeCol.c0000755000175000017500000000463613245017242013570 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDescribeCol.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLDescribeCol.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLDescribeCol( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLCHAR *column_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length, SQLSMALLINT *data_type, SQLULEN *column_size, SQLSMALLINT *decimal_digits, SQLSMALLINT *nullable ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLDESCRIBECOL( cl_statement -> cl_connection, cl_statement -> driver_stmt, column_number, column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); } unixODBC-2.3.9/cur/SQLFetchScroll.c0000755000175000017500000000707613245017242013623 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFetchScroll.c,v 1.7 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLFetchScroll.c,v $ * Revision 1.7 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2007/11/29 12:00:36 lurcher * Add 64 bit type changes to SQLExtendedFetch etc * * Revision 1.5 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.4 2005/10/27 17:54:49 lurcher * fix what I suspect is a typo in qt.m4 * * Revision 1.3 2003/12/01 16:37:17 lurcher * * Fix a bug in SQLWritePrivateProfileString * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/10/03 23:05:17 ngorham * * First public outing of the cursor lib * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLFetchScroll( SQLHSTMT statement_handle, SQLSMALLINT fetch_orientation, SQLLEN fetch_offset ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; if ( !cl_statement -> bound_columns ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_SL009, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } /* * get the value from the bookmark pointer and add the offset */ if ( fetch_orientation == SQL_FETCH_BOOKMARK ) { if ( cl_statement -> fetch_bookmark_ptr ) { SQLINTEGER bm_offset = *((SQLINTEGER*)cl_statement -> fetch_bookmark_ptr); fetch_offset += bm_offset; } else { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_HY111, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } } return do_fetch_scroll( cl_statement, fetch_orientation, fetch_offset, cl_statement -> row_status_ptr, cl_statement -> rows_fetched_ptr, 0 ); } unixODBC-2.3.9/cur/Makefile.in0000664000175000017500000007165313725127175012747 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = cur ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = odbccr.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbccr_la_LIBADD = am_libodbccr_la_OBJECTS = SQLAllocHandle.lo SQLAllocHandleStd.lo \ SQLAllocStmt.lo SQLBindCol.lo SQLBindParam.lo \ SQLBindParameter.lo SQLCancel.lo SQLCloseCursor.lo \ SQLColAttribute.lo SQLColAttributes.lo SQLColumnPrivileges.lo \ SQLColumns.lo SQLConnect.lo SQLCopyDesc.lo SQLDescribeCol.lo \ SQLDescribeParam.lo SQLEndTran.lo SQLError.lo SQLExecDirect.lo \ SQLExecute.lo SQLExtendedFetch.lo SQLFetch.lo \ SQLFetchScroll.lo SQLForeignKeys.lo SQLFreeHandle.lo \ SQLFreeStmt.lo SQLGetConnectAttr.lo SQLGetConnectOption.lo \ SQLGetCursorName.lo SQLGetData.lo SQLGetDescField.lo \ SQLGetDescRec.lo SQLGetDiagRec.lo SQLGetDiagField.lo \ SQLGetInfo.lo SQLGetStmtAttr.lo SQLGetStmtOption.lo \ SQLGetTypeInfo.lo SQLMoreResults.lo SQLNativeSql.lo \ SQLNumParams.lo SQLNumResultCols.lo SQLParamData.lo \ SQLParamOptions.lo SQLPrepare.lo SQLPrimaryKeys.lo \ SQLProcedureColumns.lo SQLProcedures.lo SQLPutData.lo \ SQLRowCount.lo SQLSetConnectAttr.lo SQLSetConnectOption.lo \ SQLSetCursorName.lo SQLSetDescRec.lo SQLSetDescField.lo \ SQLSetParam.lo SQLSetPos.lo SQLSetScrollOptions.lo \ SQLSetStmtAttr.lo SQLSetStmtOption.lo SQLSpecialColumns.lo \ SQLStatistics.lo SQLTablePrivileges.lo SQLTables.lo \ SQLTransact.lo libodbccr_la_OBJECTS = $(am_libodbccr_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbccr_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libodbccr_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbccr_la_SOURCES) DIST_SOURCES = $(libodbccr_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/odbccr.pc.in \ $(top_srcdir)/depcomp $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbccr.la AM_CPPFLAGS = -I@top_srcdir@/include \ -I@top_srcdir@/DriverManager $(LTDLINCL) EXTRA_DIST = \ cursorlibrary.h \ cur.exp libodbccr_la_LDFLAGS = \ -no-undefined \ -version-info @LIB_VERSION@ \ -export-symbols @srcdir@/cur.exp -export-dynamic ../DriverManager/libodbc.la libodbccr_la_SOURCES = \ SQLAllocHandle.c \ SQLAllocHandleStd.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParam.c \ SQLBindParameter.c \ SQLCancel.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagRec.c \ SQLGetDiagField.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectAttr.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescRec.c \ SQLSetDescField.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cur/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu cur/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): odbccr.pc: $(top_builddir)/config.status $(srcdir)/odbccr.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbccr.la: $(libodbccr_la_OBJECTS) $(libodbccr_la_DEPENDENCIES) $(EXTRA_libodbccr_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbccr_la_LINK) -rpath $(libdir) $(libodbccr_la_OBJECTS) $(libodbccr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocHandleStd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindParameter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCancel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCloseCursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttributes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumnPrivileges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCopyDesc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLEndTran.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecDirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExtendedFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetchScroll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLForeignKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetCursorName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetTypeInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLMoreResults.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNativeSql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumParams.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumResultCols.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamOptions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrimaryKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedureColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedures.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPutData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRowCount.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetCursorName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetPos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetScrollOptions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSpecialColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLStatistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTablePrivileges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTransact.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/cur/SQLAllocStmt.c0000644000175000017500000000627413676601560013323 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLAllocStmt.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLAllocStmt.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/11/20 20:54:00 ngorham * * Asorted portability fixes * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLAllocStmt( SQLHDBC connection_handle, SQLHSTMT *statement_handle, SQLHANDLE dm_handle ) { CLHDBC cl_connection = (CLHDBC) connection_handle; CLHSTMT cl_statement; DMHDBC connection = cl_connection -> dm_connection; SQLRETURN ret; /* * allocate a cursor lib statement */ cl_statement = malloc( sizeof( *cl_statement )); if ( !cl_statement ) { cl_connection -> dh.dm_log_write( "CL " __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); cl_connection -> dh.__post_internal_error( &connection -> error, ERROR_HY001, NULL, connection -> environment -> requested_version ); return SQL_ERROR; } memset( cl_statement, 0, sizeof( *cl_statement )); cl_statement -> cl_connection = cl_connection; cl_statement -> dm_statement = ( DMHSTMT ) dm_handle; ret = SQLALLOCSTMT( cl_connection, cl_connection -> driver_dbc, &cl_statement -> driver_stmt, NULL ); if ( SQL_SUCCEEDED( ret )) { *statement_handle = ( SQLHSTMT ) cl_statement; } else { free( cl_statement ); } return ret; } unixODBC-2.3.9/cur/SQLSetCursorName.c0000755000175000017500000000674613245017242014150 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetCursorName.c,v 1.4 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetCursorName.c,v $ * Revision 1.4 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.2 2001/12/13 13:00:33 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetCursorName( SQLHSTMT statement_handle, SQLCHAR *cursor_name, SQLSMALLINT name_length ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret = SQL_SUCCESS; if ( name_length == SQL_NTS ) { if ( strlen((char*) cursor_name ) > MAX_CURSOR_NAME ) { memcpy( cl_statement -> cursor_name, cursor_name, MAX_CURSOR_NAME ); cl_statement -> cursor_name[ MAX_CURSOR_NAME ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } else { strcpy((char*) cl_statement -> cursor_name, (char*) cursor_name ); } } else { if ( name_length > MAX_CURSOR_NAME ) { memcpy( cl_statement -> cursor_name, cursor_name, MAX_CURSOR_NAME ); cl_statement -> cursor_name[ MAX_CURSOR_NAME ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } else { memcpy( cl_statement -> cursor_name, cursor_name, name_length ); cl_statement -> cursor_name[ name_length ] = '\0'; } } if ( ret == SQL_SUCCESS_WITH_INFO ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01004, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } return ret; } unixODBC-2.3.9/cur/SQLGetConnectOption.c0000755000175000017500000000372013245017242014625 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetConnectOption.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetConnectOption.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetConnectOption( SQLHDBC connection_handle, SQLUSMALLINT option, SQLPOINTER value ) { CLHDBC cl_connection = (CLHDBC) connection_handle; return SQLGETCONNECTOPTION( cl_connection, cl_connection -> driver_dbc, option, value ); } unixODBC-2.3.9/cur/SQLFreeStmt.c0000755000175000017500000000622013245017242013132 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFreeStmt.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLFreeStmt.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2004/07/24 17:55:38 lurcher * Sync up CVS * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/10/03 23:05:17 ngorham * * First public outing of the cursor lib * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLFreeStmt( SQLHSTMT statement_handle, SQLUSMALLINT option ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret = SQL_SUCCESS; /* * call the driver */ if ( !cl_statement -> driver_stmt_closed ) { ret = SQLFREESTMT( cl_statement -> cl_connection, cl_statement -> driver_stmt, option ); } if ( SQL_SUCCEEDED( ret )) { if ( option == SQL_DROP ) { if ( cl_statement -> fetch_statement != SQL_NULL_HSTMT ) { ret = SQLFREESTMT( cl_statement -> cl_connection, cl_statement -> fetch_statement, SQL_DROP ); cl_statement -> fetch_statement = SQL_NULL_HSTMT; } /* * free all bound columns */ free_bound_columns( cl_statement ); /* * free up any rowset */ free_rowset( cl_statement ); free( cl_statement ); } else if ( option == SQL_CLOSE ) { /* * free up any rowset */ free_rowset( cl_statement ); } else if ( option == SQL_UNBIND ) { /* * free all bound columns */ free_bound_columns( cl_statement ); } } return ret; } unixODBC-2.3.9/cur/SQLGetCursorName.c0000755000175000017500000000611613245017242014123 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetCursorName.c,v 1.4 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetCursorName.c,v $ * Revision 1.4 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.2 2001/12/13 13:00:33 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetCursorName( SQLHSTMT statement_handle, SQLCHAR *cursor_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; SQLRETURN ret = SQL_SUCCESS; if ( cursor_name ) { if ( buffer_length < strlen((char*) cl_statement -> cursor_name ) + 1 ) { memcpy( cursor_name, cl_statement -> cursor_name, buffer_length ); cursor_name[ buffer_length ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01004, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } else { strcpy((char*) cursor_name, (char*) cl_statement -> cursor_name ); } } if ( name_length ) { *name_length = strlen((char*) cl_statement -> cursor_name ); } return ret; } unixODBC-2.3.9/cur/SQLParamData.c0000755000175000017500000000373313245017242013241 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLParamData.c,v 1.3 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLParamData.c,v $ * Revision 1.3 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2004/03/15 09:23:59 lurcher * * Add SQL_NULL_DESC * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLParamData( SQLHSTMT statement_handle, SQLPOINTER *value ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLPARAMDATA( cl_statement -> cl_connection, cl_statement -> driver_stmt, value ); } unixODBC-2.3.9/cur/SQLSetConnectOption.c0000755000175000017500000000403213245017242014636 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetConnectOption.c,v 1.3 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLSetConnectOption.c,v $ * Revision 1.3 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLSetConnectOption( SQLHDBC connection_handle, SQLUSMALLINT option, SQLULEN value ) { CLHDBC cl_connection = (CLHDBC) connection_handle; return SQLSETCONNECTOPTION( cl_connection, cl_connection -> driver_dbc, option, value ); } unixODBC-2.3.9/cur/SQLGetDiagField.c0000755000175000017500000000371413245017242013656 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDiagField.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetDiagField.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetDiagField( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLSMALLINT diag_identifier, SQLPOINTER diag_info_ptr, SQLSMALLINT buffer_length, SQLSMALLINT *string_length_ptr ) { /* * todo */ return SQL_ERROR; } unixODBC-2.3.9/cur/SQLGetData.c0000755000175000017500000005440013245017242012715 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetData.c,v 1.12 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLGetData.c,v $ * Revision 1.12 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.11 2008/01/02 15:10:33 lurcher * Fix problems trying to use the cursor lib on a non select statement * * Revision 1.10 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.9 2005/07/08 12:11:24 lurcher * * Fix a cursor lib problem (it was broken if you did metadata calls) * Alter the params to SQLParamOptions to use SQLULEN * * Revision 1.8 2004/12/23 14:51:04 lurcher * Fix problem in the cursor lib with blobs * * Revision 1.7 2004/08/17 17:17:38 lurcher * * Fix problem in the cursor lib when rereading records with NULLs in * * Revision 1.6 2004/07/24 17:55:38 lurcher * Sync up CVS * * Revision 1.5 2003/12/01 16:37:17 lurcher * * Fix a bug in SQLWritePrivateProfileString * * Revision 1.4 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.3 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:33 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.2 2001/03/28 14:57:22 nick * * Fix bugs in corsor lib introduced bu UNCODE and other changes * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLGetData( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLSMALLINT target_type, SQLPOINTER target_value, SQLLEN buffer_length, SQLLEN *strlen_or_ind ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; CLHDBC cl_connection = cl_statement -> cl_connection; SQLRETURN ret; SQLCHAR sql[ 4095 ]; CLBCOL *bound_columns; int next_bind, first; if ( cl_statement -> cursor_type == SQL_CURSOR_FORWARD_ONLY ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_SL008, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } if ( cl_statement -> not_from_select ) { return SQLGETDATA( cl_connection, cl_statement -> driver_stmt, column_number, target_type, target_value, buffer_length, strlen_or_ind ); } /* * check we have what we need */ if ( !CHECK_SQLBINDPARAM( cl_connection ) && !CHECK_SQLBINDPARAMETER( cl_connection )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "Driver can not bind parameters", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } if ( !CHECK_SQLEXECDIRECT( cl_connection ) && !( CHECK_SQLPREPARE( cl_connection ) && CHECK_SQLEXECUTE( cl_connection ))) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "Driver can not prepare or execute", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } if ( !CHECK_SQLFETCH( cl_connection )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "Driver can not fetch", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } if ( !CHECK_SQLGETDATA( cl_connection )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "Driver can not getdata", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } /* * if it's not and closed resultset, and the driver * can only support one active statement, then close * the result set first */ if ( !cl_statement -> rowset_complete && cl_statement -> cl_connection -> active_statement_allowed == 1 ) { int sav_start, sav_pos; sav_start = cl_statement -> curr_rowset_start; sav_pos = cl_statement -> rowset_position; complete_rowset( cl_statement, 0 ); SQLFREESTMT( cl_connection, cl_statement -> driver_stmt, SQL_DROP ); cl_statement -> driver_stmt_closed = 1; /* * restore the position */ cl_statement -> curr_rowset_start = sav_start; cl_statement -> rowset_position = sav_pos; } /* * Are we looking for the bookmark... */ if ( column_number == 0 ) { if ( cl_statement -> use_bookmarks ) { switch( target_type ) { case SQL_C_LONG: case SQL_C_SLONG: case SQL_C_ULONG: if ( target_value ) { *((SQLINTEGER*)target_value) = cl_statement -> curr_rowset_start; } if ( strlen_or_ind ) { *strlen_or_ind = sizeof( SQLINTEGER ); } return SQL_SUCCESS; case SQL_C_NUMERIC: case SQL_C_CHAR: case SQL_C_WCHAR: case SQL_C_SSHORT: case SQL_C_SHORT: case SQL_C_USHORT: case SQL_C_FLOAT: case SQL_C_DOUBLE: case SQL_C_BIT: case SQL_C_STINYINT: case SQL_C_TINYINT: case SQL_C_UTINYINT: case SQL_C_SBIGINT: case SQL_C_UBIGINT: case SQL_C_BINARY: case SQL_C_TYPE_DATE: case SQL_C_DATE: case SQL_C_TYPE_TIME: case SQL_C_TIME: case SQL_C_TYPE_TIMESTAMP: case SQL_C_TIMESTAMP: cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1003, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } } else { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_07009, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } } /* * refresh the data */ if ( !cl_statement -> fetch_done ) { ret = SQLGETDATA( cl_connection, cl_statement -> fetch_statement, column_number, target_type, target_value, buffer_length, strlen_or_ind ); if ( !SQL_SUCCEEDED( ret ) && ret != SQL_NO_DATA ) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; int rec = 1; /* * get the error from the driver before * loseing the connection */ do { if ( CHECK_SQLERROR( cl_connection )) { ret = SQLERROR( cl_connection, SQL_NULL_HENV, SQL_NULL_HSTMT, cl_statement -> fetch_statement, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else if ( CHECK_SQLGETDIAGREC( cl_connection )) { ret = SQLGETDIAGREC( cl_connection, SQL_HANDLE_STMT, cl_statement -> fetch_statement, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else { ret = SQL_NO_DATA; } if ( ret != SQL_NO_DATA ) { cl_statement -> cl_connection -> dh.__post_internal_error_ex( &cl_statement -> dm_statement -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while ( SQL_SUCCEEDED( ret )); } if ( !SQL_SUCCEEDED( ret ) && ret != SQL_NO_DATA ) { SQLFREESTMT( cl_connection, cl_statement -> fetch_statement, SQL_DROP ); cl_statement -> fetch_statement = SQL_NULL_HSTMT; } return ret; } cl_statement -> fetch_done = 0; ret = fetch_row( cl_statement, cl_statement -> curr_rowset_start + cl_statement -> cursor_pos - 1, -1 ); if ( cl_statement -> fetch_statement != SQL_NULL_HSTMT ) { SQLFREESTMT( cl_connection, cl_statement -> fetch_statement, SQL_DROP ); cl_statement -> fetch_statement = SQL_NULL_HSTMT; } ret = SQLALLOCSTMT( cl_connection, cl_connection -> driver_dbc, &cl_statement -> fetch_statement, NULL ); if ( !SQL_SUCCEEDED( ret )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "SQLAllocStmt failed in driver", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } /* * append the cryterior to the end of the statement, binding * the comumns while we are at it */ strcpy((char*) sql, cl_statement -> sql_text ); /* * This is somewhat simplistic, but workable */ if ( strstr( (char*) sql, "WHERE" )) { strcat((char*) sql, " AND" ); } else { strcat((char*) sql, " WHERE" ); } /* * this works because the bound list is in column order */ bound_columns = cl_statement -> bound_columns; first = 1; next_bind = 0; while( bound_columns ) { char addon[ 256 ]; int col = bound_columns -> column_number; /* * Don't bind long types */ if ( cl_statement -> data_type[ col ] == SQL_LONGVARCHAR || cl_statement -> data_type[ col ] == SQL_LONGVARBINARY ) { } else { if ( bound_columns -> len_ind == -1 ) { sprintf( addon, " %s IS NULL", cl_statement -> column_names[ col - 1 ] ); if ( !first ) { strcat((char*) sql, " AND" ); } strcat((char*) sql, addon ); first = 0; } else { sprintf( addon, " %s = ?", cl_statement -> column_names[ col - 1 ] ); if ( !first ) { strcat((char*) sql, " AND" ); } strcat((char*) sql, addon ); first = 0; if ( CHECK_SQLBINDPARAMETER( cl_connection )) { ret = SQLBINDPARAMETER( cl_connection, cl_statement -> fetch_statement, next_bind + 1, SQL_PARAM_INPUT, bound_columns -> bound_type, cl_statement -> data_type[ col - 1 ], cl_statement -> column_size[ col - 1 ], cl_statement -> decimal_digits[ col - 1 ], bound_columns -> local_buffer, bound_columns -> bound_length, &bound_columns -> len_ind ); } else { ret = SQLBINDPARAM( cl_connection, cl_statement -> fetch_statement, next_bind + 1, bound_columns -> bound_type, cl_statement -> data_type[ col - 1 ], cl_statement -> column_size[ col - 1 ], cl_statement -> decimal_digits[ col - 1 ], bound_columns -> local_buffer, &bound_columns -> len_ind ); } if ( !SQL_SUCCEEDED( ret )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_SL010, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); if ( !SQL_SUCCEEDED( ret ) && ret != SQL_NO_DATA ) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; int rec = 1; /* * get the error from the driver before * loseing the stmt */ do { if ( CHECK_SQLERROR( cl_connection )) { ret = SQLERROR( cl_connection, SQL_NULL_HENV, SQL_NULL_HSTMT, cl_statement -> fetch_statement, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else if ( CHECK_SQLGETDIAGREC( cl_connection )) { ret = SQLGETDIAGREC( cl_connection, SQL_HANDLE_STMT, cl_statement -> fetch_statement, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else { ret = SQL_NO_DATA; } if ( ret != SQL_NO_DATA ) { cl_statement -> cl_connection -> dh.__post_internal_error_ex( &cl_statement -> dm_statement -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while ( SQL_SUCCEEDED( ret )); } SQLFREESTMT( cl_connection, cl_statement -> fetch_statement, SQL_DROP ); cl_statement -> fetch_statement = SQL_NULL_HSTMT; return SQL_ERROR; } next_bind ++; } } bound_columns = bound_columns -> next; } if ( CHECK_SQLEXECDIRECT( cl_connection )) { ret = SQLEXECDIRECT( cl_connection, cl_statement -> fetch_statement, sql, strlen((char*) sql )); } else { ret = SQLPREPARE( cl_connection, cl_statement -> fetch_statement, sql, strlen((char*) sql )); if ( SQL_SUCCEEDED( ret )) { ret = SQLEXECUTE( cl_connection, cl_statement -> fetch_statement ); } } if ( !SQL_SUCCEEDED( ret )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_SL004, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); if ( !SQL_SUCCEEDED( ret ) && ret != SQL_NO_DATA ) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; int rec = 1; /* * get the error from the driver before * loseing the stmt */ do { if ( CHECK_SQLERROR( cl_connection )) { ret = SQLERROR( cl_connection, SQL_NULL_HENV, SQL_NULL_HSTMT, cl_statement -> fetch_statement, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else if ( CHECK_SQLGETDIAGREC( cl_connection )) { ret = SQLGETDIAGREC( cl_connection, SQL_HANDLE_STMT, cl_statement -> fetch_statement, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else { ret = SQL_NO_DATA; } if ( ret != SQL_NO_DATA ) { cl_statement -> cl_connection -> dh.__post_internal_error_ex( &cl_statement -> dm_statement -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while ( SQL_SUCCEEDED( ret )); } SQLFREESTMT( cl_connection, cl_statement -> fetch_statement, SQL_DROP ); cl_statement -> fetch_statement = SQL_NULL_HSTMT; return SQL_ERROR; } ret = SQLFETCH( cl_connection, cl_statement -> fetch_statement ); if ( !SQL_SUCCEEDED( ret )) { if ( ret == SQL_NO_DATA ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_SL004, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); } else { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; int rec = 1; /* * get the error from the driver before * loseing the connection */ do { if ( CHECK_SQLERROR( cl_connection )) { ret = SQLERROR( cl_connection, SQL_NULL_HENV, SQL_NULL_HSTMT, cl_statement -> fetch_statement, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else if ( CHECK_SQLGETDIAGREC( cl_connection )) { ret = SQLGETDIAGREC( cl_connection, SQL_HANDLE_STMT, cl_statement -> fetch_statement, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else { ret = SQL_NO_DATA; } if ( ret != SQL_NO_DATA ) { cl_statement -> cl_connection -> dh.__post_internal_error_ex( &cl_statement -> dm_statement -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while ( SQL_SUCCEEDED( ret )); } SQLFREESTMT( cl_connection, cl_statement -> fetch_statement, SQL_DROP ); cl_statement -> fetch_statement = SQL_NULL_HSTMT; return SQL_ERROR; } ret = SQLGETDATA( cl_connection, cl_statement -> fetch_statement, column_number, target_type, target_value, buffer_length, strlen_or_ind ); if ( !SQL_SUCCEEDED( ret )) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; int rec = 1; /* * get the error from the driver before * loseing the connection */ do { if ( CHECK_SQLERROR( cl_connection )) { ret = SQLERROR( cl_connection, SQL_NULL_HENV, SQL_NULL_HSTMT, cl_statement -> fetch_statement, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else if ( CHECK_SQLGETDIAGREC( cl_connection )) { ret = SQLGETDIAGREC( cl_connection, SQL_HANDLE_STMT, cl_statement -> fetch_statement, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); } else { ret = SQL_NO_DATA; } if ( ret != SQL_NO_DATA ) { cl_statement -> cl_connection -> dh.__post_internal_error_ex( &cl_statement -> dm_statement -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while ( SQL_SUCCEEDED( ret )); } if ( !SQL_SUCCEEDED( ret )) { SQLFREESTMT( cl_connection, cl_statement -> fetch_statement, SQL_DROP ); cl_statement -> fetch_statement = SQL_NULL_HSTMT; } return ret; } unixODBC-2.3.9/cur/SQLPutData.c0000755000175000017500000000370613245017242012751 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLPutData.c,v 1.2 2009/02/18 17:59:18 lurcher Exp $ * * $Log: SQLPutData.c,v $ * Revision 1.2 2009/02/18 17:59:18 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLPutData( SQLHSTMT statement_handle, SQLPOINTER data, SQLINTEGER strlen_or_ind ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLPUTDATA( cl_statement -> cl_connection, cl_statement -> driver_stmt, data, strlen_or_ind ); } unixODBC-2.3.9/cur/SQLBindParameter.c0000755000175000017500000000472613245017242014127 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBindParameter.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLBindParameter.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLBindParameter( SQLHSTMT statement_handle, SQLUSMALLINT ipar, SQLSMALLINT f_param_type, SQLSMALLINT f_c_type, SQLSMALLINT f_sql_type, SQLULEN cb_col_def, SQLSMALLINT ib_scale, SQLPOINTER rgb_value, SQLLEN cb_value_max, SQLLEN *pcb_value ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLBINDPARAMETER( cl_statement -> cl_connection, cl_statement -> driver_stmt, ipar, f_param_type, f_c_type, f_sql_type, cb_col_def, ib_scale, rgb_value, cb_value_max, pcb_value ); } unixODBC-2.3.9/cur/SQLCancel.c0000755000175000017500000000352713245017242012575 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLCancel.c,v 1.2 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLCancel.c,v $ * Revision 1.2 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLCancel( SQLHSTMT statement_handle ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLCANCEL( cl_statement -> cl_connection, cl_statement -> driver_stmt ); } unixODBC-2.3.9/cur/SQLExtendedFetch.c0000755000175000017500000006751313245017242014127 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLExtendedFetch.c,v 1.14 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLExtendedFetch.c,v $ * Revision 1.14 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.13 2009/02/17 09:47:45 lurcher * Clear up a number of bugs * * Revision 1.12 2008/01/22 17:51:54 lurcher * Another SQLULEN mismatch * * Revision 1.11 2007/11/29 12:00:36 lurcher * Add 64 bit type changes to SQLExtendedFetch etc * * Revision 1.10 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.9 2005/10/27 17:54:49 lurcher * fix what I suspect is a typo in qt.m4 * * Revision 1.8 2005/10/21 16:49:53 lurcher * Fix a problem with the cursor lib and rowsets * * Revision 1.7 2004/07/24 17:55:38 lurcher * Sync up CVS * * Revision 1.6 2003/12/01 16:37:17 lurcher * * Fix a bug in SQLWritePrivateProfileString * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/11/25 15:37:54 lurcher * * Fix problems in the cursor lib * * Revision 1.2 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.2 2001/05/31 16:05:55 nick * * Fix problems with postgres closing local sockets * Make odbctest build with QT 3 (it doesn't work due to what I think are bugs * in QT 3) * Fix a couple of problems in the cursor lib * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.3 1999/11/20 20:54:00 ngorham * * Asorted portability fixes * * Revision 1.2 1999/10/03 23:05:17 ngorham * * First public outing of the cursor lib * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" #define ABS(x) (((x)>=0)?(x):(-(x))) #define SQL_FETCH_PART_ROWSET SQL_NO_DATA + 1 SQLRETURN fetch_row( CLHSTMT cl_statement, int row_number, int offset ) { SQLSMALLINT ret; /* * is the row in the cache ? */ if ( row_number < cl_statement -> rowset_count ) { CLBCOL *cbuf; /* * read the file buffer */ if ( fseek( cl_statement -> rowset_file, cl_statement -> buffer_length * row_number, SEEK_SET )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "General error: fseek fails", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } if ( fread( cl_statement -> rowset_buffer, cl_statement -> buffer_length, 1, cl_statement -> rowset_file ) != 1 ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "General error: Unable to read from file buffer", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } /* * extract the data * * status ptr */ memcpy( &ret, cl_statement -> rowset_buffer, sizeof( SQLUSMALLINT )); /* * columninfo */ cbuf = cl_statement -> bound_columns; while ( cbuf ) { char *buffer = NULL; char *ind_ptr = NULL; /* * copy from the file buffer */ memcpy( cbuf -> local_buffer, cl_statement -> rowset_buffer + cbuf -> rs_buffer_offset, cbuf -> bound_length ); memcpy( &cbuf -> len_ind, cl_statement -> rowset_buffer + cbuf -> rs_ind_offset, sizeof( cbuf -> len_ind )); if ( offset >= 0 ) { /* * copy to the application buffer */ if ( cl_statement -> row_bind_type ) { if ( cbuf -> bound_buffer ) { buffer = ((char*)cbuf -> bound_buffer) + cl_statement -> row_bind_type * offset; } if ( cbuf -> bound_ind ) { ind_ptr = ( char * ) cbuf -> bound_ind; ind_ptr += cl_statement -> row_bind_type * offset; } } else { if ( cbuf -> bound_buffer ) { buffer = ((char*)cbuf -> bound_buffer) + cbuf -> bound_length * offset; } if ( cbuf -> bound_ind ) { ind_ptr = ( char * ) cbuf -> bound_ind; ind_ptr += offset * sizeof( SQLULEN ); } } if ( buffer && cbuf -> len_ind >= 0 ) { if ( cbuf -> bound_type == SQL_C_CHAR ) { strcpy( buffer, cbuf -> local_buffer ); } else { memcpy( buffer, cbuf -> local_buffer, cbuf -> bound_length ); } } if ( ind_ptr ) { memcpy( ind_ptr, &cbuf -> len_ind, sizeof( cbuf -> len_ind )); } } cbuf = cbuf -> next; } return SQL_SUCCESS; } else { if ( cl_statement -> rowset_complete ) { return SQL_NO_DATA; } ret = SQLFETCH( cl_statement -> cl_connection, cl_statement -> driver_stmt ); if ( ret == SQL_NO_DATA ) { /* * at the end */ cl_statement -> rowset_complete = 1; cl_statement -> rowset_position = CL_AFTER_END; } else { CLBCOL *cbuf; /* * insert into the cache */ /* * status ptr */ memcpy( cl_statement -> rowset_buffer, &ret, sizeof( SQLUSMALLINT )); /* * columninfo */ cbuf = cl_statement -> bound_columns; while ( cbuf ) { char *buffer = NULL; char *ind_ptr = NULL; /* * copy to the file buffer */ memcpy( cl_statement -> rowset_buffer + cbuf -> rs_buffer_offset, cbuf -> local_buffer, cbuf -> bound_length ); memcpy( cl_statement -> rowset_buffer + cbuf -> rs_ind_offset, &cbuf -> len_ind, sizeof( cbuf -> len_ind )); if ( offset >= 0 ) { /* * copy to the application buffer */ if ( cl_statement -> row_bind_type ) { if ( cbuf -> bound_buffer ) { buffer = ((char*)cbuf -> bound_buffer) + cl_statement -> row_bind_type * offset; } if ( cbuf -> bound_ind ) { ind_ptr = ( char * ) cbuf -> bound_ind; ind_ptr += cl_statement -> row_bind_type * offset; } } else { if ( cbuf -> bound_buffer ) { buffer = ((char*)cbuf -> bound_buffer) + cbuf -> bound_length * offset; } if ( cbuf -> bound_ind ) { ind_ptr = ( char * ) cbuf -> bound_ind; ind_ptr += offset * sizeof( SQLULEN ); } } /* * Not quite sure if the check is valid, I think I can see where * I got it from, but not sure if it's correct * if ( buffer && cbuf -> bound_ind && *cbuf -> bound_ind >= 0 ) */ if ( buffer && cbuf -> bound_ind ) { if ( cbuf -> bound_type == SQL_C_CHAR ) { strcpy( buffer, cbuf -> local_buffer ); } else { memcpy( buffer, cbuf -> local_buffer, cbuf -> bound_length ); } } if ( ind_ptr ) { memcpy( ind_ptr, &cbuf -> len_ind, sizeof( cbuf -> len_ind )); } } cbuf = cbuf -> next; } /* * write the file buffer */ if ( fseek( cl_statement -> rowset_file, cl_statement -> buffer_length * row_number, SEEK_SET )) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "General error: fseek fails", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } if ( fwrite( cl_statement -> rowset_buffer, cl_statement -> buffer_length, 1, cl_statement -> rowset_file ) != 1 ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_S1000, "General error: Unable to write to file buffer", cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } cl_statement -> rowset_count ++; } return ret; } } /* * read the rowset until the specied row, or the end if 0 supplied */ SQLRETURN complete_rowset( CLHSTMT cl_statement, int complete_to ) { int row; SQLRETURN ret; if ( complete_to == 0 ) { row = cl_statement -> rowset_count; do { ret = fetch_row( cl_statement, row, -1 ); if ( SQL_SUCCEEDED( ret )) { row ++; } else if ( ret == SQL_NO_DATA ) { cl_statement -> rowset_complete = 1; ret = SQL_SUCCESS; break; } } while ( SQL_SUCCEEDED( ret )); } else { row = cl_statement -> rowset_count; do { ret = fetch_row( cl_statement, row, -1 ); if ( SQL_SUCCEEDED( ret )) { row ++; } else if ( ret == SQL_NO_DATA ) { cl_statement -> rowset_complete = 1; ret = SQL_SUCCESS; break; } } while ( SQL_SUCCEEDED( ret ) && row < complete_to ); } return ret; } /* * rows_in_set is the sizeof the rowset * row_offset is the row number of the first row */ static SQLRETURN fetch_rowset( CLHSTMT cl_statement, int rows_in_set, int row_offset, int *fetched_rows, SQLUSMALLINT *row_status_array, SQLULEN *rows_fetched_ptr ) { SQLRETURN ret; int row_count = 0; int row; for ( row = 0; row < rows_in_set; row ++ ) { ret = fetch_row( cl_statement, row + row_offset, row ); if ( row_status_array ) { row_status_array[ row ] = ret; } if ( SQL_SUCCEEDED( ret )) { row_count ++; } else { break; } ret = SQL_SUCCESS; } if ( ret == SQL_NO_DATA && row > 0 ) { *fetched_rows = row; if ( rows_fetched_ptr ) { *rows_fetched_ptr = row_count; } ret = SQL_FETCH_PART_ROWSET; } if ( SQL_SUCCEEDED( ret )) { *fetched_rows = row; } if ( rows_fetched_ptr ) { *rows_fetched_ptr = row_count; } return ret; } SQLRETURN do_fetch_scroll( CLHSTMT cl_statement, int fetch_orientation, SQLLEN fetch_offset, SQLUSMALLINT *row_status_ptr, SQLULEN *rows_fetched_ptr, int ext_fetch ) { SQLRETURN ret; int rows_in_set, row_offset, fetched_rows, info = 0; cl_statement -> fetch_done = 1; if ( !cl_statement -> first_fetch_done ) { if ( cl_statement -> column_count > 0 && calculate_buffers( cl_statement, cl_statement -> column_count ) == SQL_ERROR ) { /* * tidy up after a failure */ SQLFREESTMT( cl_statement -> cl_connection, cl_statement -> driver_stmt, SQL_CLOSE ); return SQL_ERROR; } cl_statement -> first_fetch_done = 1; } if ( ext_fetch ) { if ( cl_statement -> rowset_size < 1 ) rows_in_set = 1; else rows_in_set = cl_statement -> rowset_size; } else { if ( cl_statement -> rowset_array_size < 1 ) rows_in_set = 1; else rows_in_set = cl_statement -> rowset_array_size; } /* * I refuse to document all these conditions, you have to * look in the book, its just a copy of that */ switch( fetch_orientation ) { case SQL_FETCH_FIRST: cl_statement -> rowset_position = 0; row_offset = 0; cl_statement -> curr_rowset_start = cl_statement -> rowset_position; ret = fetch_rowset( cl_statement, rows_in_set, row_offset, &fetched_rows, row_status_ptr, rows_fetched_ptr ); if ( SQL_SUCCEEDED( ret )) { cl_statement -> curr_rowset_start = cl_statement -> rowset_position; cl_statement -> rowset_position += fetched_rows; } else if ( ret == SQL_FETCH_PART_ROWSET ) { ret = SQL_SUCCESS; } break; case SQL_FETCH_NEXT: if ( cl_statement -> rowset_position == CL_BEFORE_START ) { cl_statement -> rowset_position = 0; row_offset = 0; } else if ( cl_statement -> rowset_position == CL_AFTER_END ) { ret = SQL_NO_DATA; break; } else { row_offset = cl_statement -> rowset_position; } cl_statement -> cursor_pos = 1; ret = fetch_rowset( cl_statement, rows_in_set, row_offset, &fetched_rows, row_status_ptr, rows_fetched_ptr ); if ( SQL_SUCCEEDED( ret )) { cl_statement -> curr_rowset_start = cl_statement -> rowset_position; cl_statement -> rowset_position += fetched_rows; } else if ( ret == SQL_FETCH_PART_ROWSET ) { cl_statement -> rowset_position = CL_AFTER_END; ret = SQL_SUCCESS; } break; case SQL_FETCH_PRIOR: if ( cl_statement -> rowset_position == CL_BEFORE_START ) { ret = SQL_NO_DATA; break; } else if ( cl_statement -> rowset_position == CL_AFTER_END ) { if ( cl_statement -> rowset_count < rows_in_set ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01S06, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); info = 1; } else { row_offset = cl_statement -> rowset_count - rows_in_set; cl_statement -> rowset_position = row_offset; } } else if ( cl_statement -> rowset_position <= rows_in_set ) { ret = SQL_NO_DATA; cl_statement -> rowset_position = CL_BEFORE_START; break; } else if ( cl_statement -> rowset_position - rows_in_set < rows_in_set ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01S06, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); ret = SQL_SUCCESS_WITH_INFO; break; } else { row_offset = cl_statement -> rowset_position -= rows_in_set * 2; } cl_statement -> cursor_pos = 1; ret = fetch_rowset( cl_statement, rows_in_set, row_offset, &fetched_rows, row_status_ptr, rows_fetched_ptr ); if ( SQL_SUCCEEDED( ret )) { cl_statement -> curr_rowset_start = cl_statement -> rowset_position; cl_statement -> rowset_position += fetched_rows; } else if ( ret == SQL_FETCH_PART_ROWSET ) { ret = SQL_SUCCESS; } break; case SQL_FETCH_RELATIVE: if (( cl_statement -> rowset_position == CL_BEFORE_START && fetch_offset > 0 ) || ( cl_statement -> rowset_position == CL_AFTER_END && fetch_offset < 0 )) { return do_fetch_scroll( cl_statement, SQL_FETCH_ABSOLUTE, fetch_offset, row_status_ptr, rows_fetched_ptr, ext_fetch ); } else if ( cl_statement -> rowset_position == CL_BEFORE_START && fetch_offset <= 0 ) { ret = SQL_NO_DATA; cl_statement -> rowset_position = CL_BEFORE_START; break; } else if ( cl_statement -> curr_rowset_start == 0 && fetch_offset <= 0 ) { ret = SQL_NO_DATA; cl_statement -> rowset_position = CL_BEFORE_START; break; } else if ( cl_statement -> curr_rowset_start > 0 && cl_statement -> curr_rowset_start + fetch_offset < 1 && ABS( fetch_offset ) > rows_in_set ) { ret = SQL_NO_DATA; cl_statement -> rowset_position = CL_BEFORE_START; break; } else if ( cl_statement -> curr_rowset_start > 0 && cl_statement -> curr_rowset_start + fetch_offset < 1 && ABS( fetch_offset ) > rows_in_set ) { cl_statement -> rowset_position = 0; } else { /* * these conditions requires completing the rowset */ if ( !cl_statement -> rowset_complete ) { ret = complete_rowset( cl_statement, 0 ); if ( !SQL_SUCCEEDED( ret )) break; } if ( 1 <= cl_statement -> curr_rowset_start + fetch_offset && cl_statement -> curr_rowset_start + fetch_offset <= cl_statement -> rowset_count ) { cl_statement -> curr_rowset_start = cl_statement -> rowset_position = cl_statement -> curr_rowset_start + fetch_offset; } else if ( cl_statement -> curr_rowset_start + fetch_offset > cl_statement -> rowset_count ) { ret = SQL_NO_DATA; cl_statement -> rowset_position = CL_AFTER_END; break; } else if ( cl_statement -> rowset_position == CL_AFTER_END && fetch_offset >= 0 ) { ret = SQL_NO_DATA; cl_statement -> rowset_position = CL_AFTER_END; break; } } row_offset = cl_statement -> rowset_position; cl_statement -> cursor_pos = 1; ret = fetch_rowset( cl_statement, rows_in_set, row_offset, &fetched_rows, row_status_ptr, rows_fetched_ptr ); if ( SQL_SUCCEEDED( ret )) { cl_statement -> curr_rowset_start = cl_statement -> rowset_position; cl_statement -> rowset_position += fetched_rows; } else if ( ret == SQL_FETCH_PART_ROWSET ) { ret = SQL_SUCCESS; } break; /* * The code before this turns the bookmark into a absolute */ case SQL_FETCH_BOOKMARK: case SQL_FETCH_ABSOLUTE: /* * close the rowset if needed */ if ( fetch_offset < 0 && !cl_statement -> rowset_complete ) { ret = complete_rowset( cl_statement, 0 ); if ( !SQL_SUCCEEDED( ret )) break; } if ( fetch_offset < 0 && ABS( fetch_offset ) <= cl_statement -> rowset_count ) { cl_statement -> curr_rowset_start = cl_statement -> rowset_count + fetch_offset; cl_statement -> rowset_position = cl_statement -> curr_rowset_start; } else if ( fetch_offset < 0 && ABS( fetch_offset ) > cl_statement -> rowset_count && ABS( fetch_offset ) > rows_in_set ) { cl_statement -> rowset_position = CL_BEFORE_START; ret = SQL_NO_DATA; break; } else if ( fetch_offset < 0 && ABS( fetch_offset ) > cl_statement -> rowset_count && ABS( fetch_offset ) <= rows_in_set ) { cl_statement -> curr_rowset_start = 0; cl_statement -> rowset_position = cl_statement -> curr_rowset_start; cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_01S06, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); info = 1; } else if ( fetch_offset == 0 ) { cl_statement -> rowset_position = CL_BEFORE_START; ret = SQL_NO_DATA; break; } else if ( fetch_offset > cl_statement -> rowset_count ) { ret = complete_rowset( cl_statement, fetch_offset ); if ( ret == SQL_NO_DATA ) { cl_statement -> rowset_position = CL_AFTER_END; break; } else if ( !SQL_SUCCEEDED( ret )) { break; } else { cl_statement -> curr_rowset_start = fetch_offset; cl_statement -> rowset_position = cl_statement -> curr_rowset_start; } } else { cl_statement -> curr_rowset_start = fetch_offset; cl_statement -> rowset_position = cl_statement -> curr_rowset_start; } row_offset = cl_statement -> rowset_position - 1; cl_statement -> cursor_pos = 1; ret = fetch_rowset( cl_statement, rows_in_set, row_offset, &fetched_rows, row_status_ptr, rows_fetched_ptr ); if ( SQL_SUCCEEDED( ret )) { cl_statement -> curr_rowset_start = cl_statement -> rowset_position; cl_statement -> rowset_position += fetched_rows; } else if ( ret == SQL_FETCH_PART_ROWSET ) { ret = SQL_SUCCESS; } break; case SQL_FETCH_LAST: /* * close the rowset if needed */ if ( !cl_statement -> rowset_complete ) { ret = complete_rowset( cl_statement, 0 ); if ( !SQL_SUCCEEDED( ret )) break; } if ( cl_statement -> rowset_count <= rows_in_set ) { cl_statement -> curr_rowset_start = cl_statement -> rowset_position = 0; } else { cl_statement -> curr_rowset_start = cl_statement -> rowset_position = cl_statement -> rowset_count - rows_in_set; } row_offset = cl_statement -> rowset_position; cl_statement -> cursor_pos = 1; ret = fetch_rowset( cl_statement, rows_in_set, row_offset, &fetched_rows, row_status_ptr, rows_fetched_ptr ); if ( SQL_SUCCEEDED( ret )) { cl_statement -> curr_rowset_start = cl_statement -> rowset_position = CL_AFTER_END; } else if ( ret == SQL_FETCH_PART_ROWSET ) { ret = SQL_SUCCESS; } break; } if ( ret == SQL_SUCCESS && info ) ret = SQL_SUCCESS_WITH_INFO; return ret; } SQLRETURN CLExtendedFetch( SQLHSTMT statement_handle, SQLUSMALLINT f_fetch_type, SQLLEN irow, SQLULEN *pcrow, SQLUSMALLINT *rgf_row_status ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; if ( !cl_statement -> bound_columns ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_SL009, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } return do_fetch_scroll( cl_statement, f_fetch_type, irow, rgf_row_status, pcrow, 1 ); } unixODBC-2.3.9/cur/odbccr.pc.in0000664000175000017500000000041413545647551013057 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ Name: odbccr (@PACKAGE_NAME@) Description: unixODBC Cursor Library URL: http://unixodbc.org Version: @PACKAGE_VERSION@ Requires: odbc Cflags: -I${includedir} Libs: -L${libdir} -lodbccr unixODBC-2.3.9/cur/SQLBindCol.c0000755000175000017500000002063213245017242012716 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBindCol.c,v 1.6 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLBindCol.c,v $ * Revision 1.6 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.4 2005/10/21 16:49:53 lurcher * Fix a problem with the cursor lib and rowsets * * Revision 1.3 2002/11/19 18:52:28 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.2 2001/12/13 13:00:33 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.2 2001/05/31 16:05:55 nick * * Fix problems with postgres closing local sockets * Make odbctest build with QT 3 (it doesn't work due to what I think are bugs * in QT 3) * Fix a couple of problems in the cursor lib * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/10/03 23:05:17 ngorham * * First public outing of the cursor lib * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" /* * release all the bound columns */ int free_bound_columns( CLHSTMT cl_statement ) { CLBCOL *bcol; bcol = cl_statement -> bound_columns; while( bcol ) { CLBCOL *next; if ( bcol -> local_buffer ) { free( bcol -> local_buffer ); } next = bcol -> next; free( bcol ); bcol = next; } cl_statement -> bound_columns = NULL; return 0; } static int get_bound_length( int target_type, int len ) { switch( target_type ) { case SQL_C_STINYINT: case SQL_C_UTINYINT: case SQL_C_TINYINT: return 1; case SQL_C_SBIGINT: case SQL_C_UBIGINT: return 8; case SQL_C_SSHORT: case SQL_C_USHORT: case SQL_C_SHORT: return 2; case SQL_C_SLONG: case SQL_C_ULONG: case SQL_C_LONG: return 4; case SQL_C_DOUBLE: return 8; case SQL_C_FLOAT: return 4; case SQL_C_NUMERIC: return sizeof( SQL_NUMERIC_STRUCT ); case SQL_C_TYPE_DATE: case SQL_C_DATE: return sizeof( SQL_DATE_STRUCT ); case SQL_C_TYPE_TIME: case SQL_C_TIME: return sizeof( SQL_TIME_STRUCT ); case SQL_C_TYPE_TIMESTAMP: case SQL_C_TIMESTAMP: return sizeof( SQL_TIMESTAMP_STRUCT ); case SQL_C_INTERVAL_YEAR: case SQL_C_INTERVAL_MONTH: case SQL_C_INTERVAL_DAY: case SQL_C_INTERVAL_HOUR: case SQL_C_INTERVAL_MINUTE: case SQL_C_INTERVAL_SECOND: case SQL_C_INTERVAL_YEAR_TO_MONTH: case SQL_C_INTERVAL_DAY_TO_HOUR: case SQL_C_INTERVAL_DAY_TO_MINUTE: case SQL_C_INTERVAL_DAY_TO_SECOND: case SQL_C_INTERVAL_HOUR_TO_MINUTE: case SQL_C_INTERVAL_HOUR_TO_SECOND: case SQL_C_INTERVAL_MINUTE_TO_SECOND: return sizeof( SQL_INTERVAL_STRUCT ); default: return len; } } SQLRETURN CLBindCol( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLSMALLINT target_type, SQLPOINTER target_value, SQLLEN buffer_length, SQLLEN *strlen_or_ind ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; CLBCOL *bcol; int b_len; SQLRETURN ret; if ( cl_statement -> not_from_select ) { return SQLBINDCOL( cl_statement -> cl_connection, cl_statement -> driver_stmt, column_number, target_type, target_value, buffer_length, strlen_or_ind ); } /* * check in the list of bound columns for a entry */ bcol = cl_statement -> bound_columns; while ( bcol ) { if ( bcol -> column_number == column_number ) break; bcol = bcol -> next; } if ( !bcol ) { /* * do we want to bind anything */ bcol = malloc( sizeof( CLBCOL )); if ( !bcol ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_HY001, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } memset( bcol, 0, sizeof( CLBCOL )); bcol -> column_number = column_number; /* * insert into to list */ if ( cl_statement -> bound_columns ) { CLBCOL *ptr, *prev; ptr = cl_statement -> bound_columns; prev = NULL; while( ptr && ptr -> column_number < column_number ) { prev = ptr; ptr = ptr -> next; } if ( prev ) { bcol -> next = ptr; prev -> next = bcol; } else { bcol -> next = cl_statement -> bound_columns; cl_statement -> bound_columns = bcol; } } else { bcol -> next = NULL; cl_statement -> bound_columns = bcol; } } /* * setup bound info */ /* * find length */ b_len = get_bound_length( target_type, buffer_length ); if ( bcol -> local_buffer ) { free( bcol -> local_buffer ); } bcol -> local_buffer = NULL; if ( target_value && b_len > 0 ) { bcol -> local_buffer = malloc( b_len ); if ( !bcol -> local_buffer ) { cl_statement -> cl_connection -> dh.__post_internal_error( &cl_statement -> dm_statement -> error, ERROR_HY001, NULL, cl_statement -> dm_statement -> connection -> environment -> requested_version ); return SQL_ERROR; } } bcol -> bound_buffer = target_value; bcol -> bound_length = b_len; bcol -> bound_type = target_type; if ( strlen_or_ind ) { bcol -> bound_ind = strlen_or_ind; } else { bcol -> bound_ind = NULL; } /* * call the driver to bind a column, but not bookmarks */ if ( column_number > 0 ) { ret = SQLBINDCOL( cl_statement -> cl_connection, cl_statement -> driver_stmt, column_number, target_type, bcol -> local_buffer, bcol -> bound_length, &bcol -> len_ind ); } else { ret = SQL_SUCCESS; } /* * are we unbinding ? */ if ( !target_value && !strlen_or_ind ) { CLBCOL *ptr, *prev; /* * remove from the list */ ptr = cl_statement -> bound_columns; prev = NULL; while( ptr && ptr != bcol ) { prev = ptr; ptr = ptr -> next; } if ( prev ) { prev -> next = bcol -> next; } else { cl_statement -> bound_columns = bcol -> next; } free( bcol ); } return ret; } unixODBC-2.3.9/cur/Makefile.am0000644000175000017500000000342013245017300012700 00000000000000lib_LTLIBRARIES = libodbccr.la AM_CPPFLAGS = -I@top_srcdir@/include \ -I@top_srcdir@/DriverManager $(LTDLINCL) EXTRA_DIST = \ cursorlibrary.h \ cur.exp libodbccr_la_LDFLAGS = \ -no-undefined \ -version-info @LIB_VERSION@ \ -export-symbols @srcdir@/cur.exp -export-dynamic ../DriverManager/libodbc.la libodbccr_la_SOURCES = \ SQLAllocHandle.c \ SQLAllocHandleStd.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParam.c \ SQLBindParameter.c \ SQLCancel.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagRec.c \ SQLGetDiagField.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectAttr.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescRec.c \ SQLSetDescField.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c unixODBC-2.3.9/cur/SQLDescribeParam.c0000755000175000017500000000437113245017242014107 00000000000000/********************************************************************* * * unixODBC Cursor Library * * Created by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDescribeParam.c,v 1.3 2009/02/18 17:59:17 lurcher Exp $ * * $Log: SQLDescribeParam.c,v $ * Revision 1.3 2009/02/18 17:59:17 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.2 2007/11/13 15:04:57 lurcher * Fix 64 bit cursor lib issues * * Revision 1.1.1.1 2001/10/17 16:40:15 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 1999/09/19 22:22:50 ngorham * * * Added first cursor library work, read only at the moment and only works * with selects with no where clause * * **********************************************************************/ #include #include "cursorlibrary.h" SQLRETURN CLDescribeParam( SQLHSTMT statement_handle, SQLUSMALLINT ipar, SQLSMALLINT *pf_sql_type, SQLULEN *pcb_param_def, SQLSMALLINT *pib_scale, SQLSMALLINT *pf_nullable ) { CLHSTMT cl_statement = (CLHSTMT) statement_handle; return SQLDESCRIBEPARAM( cl_statement -> cl_connection, cl_statement -> driver_stmt, ipar, pf_sql_type, pcb_param_def, pib_scale, pf_nullable ); } unixODBC-2.3.9/README.INTERIX0000755000175000017500000000100012262474476012072 00000000000000Some notes on building UnixODBC on Microsoft Interix First use the modified configure and config.guess included in the Interix directory, copy them up into the main directory. Then build with the following line CFLAGS="-D_ALL_SOURCE -I/usr/local/include" CPPFLAGS="-D_ALL_SOURCE -I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure After running configure, copy libtool from the Interix directory into the build directory Thanks to the MS group for supplying this info. Thats all for now. Nick. unixODBC-2.3.9/README0000755000175000017500000000250412522170570010746 00000000000000+-------------------------------------------------------------+ | unixODBC | +-------------------------------------------------------------+ README --------------------------------------------------------------- Description: unixODBC is an Open Source ODBC sub-system and an ODBC SDK for Linux, Mac OSX, and UNIX. License: All libraries are LGPL Version 2.1 All programs are GPL Version 2.1. Parts: unixODBC includes the following; - Driver Manager - Installer Library and command line tool - Command Line Tools to help install a driver and work with SQL How To Start: Look for and read README files with extensions of interest. Then read the INSTALL file. You can also jump into the doc directory and browse information there. And do not forget the online stuff. Some documentation may be a bit out of date the vast majority of it should be ok. Config Files: The ODBC Installer Library is responsible for reading and writing the unixODBC config files. The savvy can look at; _odbcinst_SystemINI.c _odbcinst_UserINI.c In any case; you can override where unixODBC looks for its system config files by setting the ODBCSYSINI environment variable during the use of unixODBC. Resources: http://sourceforge.net/projects/unixodbc/ unixODBC-2.3.9/DRVConfig/0000775000175000017500000000000013725127521011731 500000000000000unixODBC-2.3.9/DRVConfig/MiniSQL/0000775000175000017500000000000013725127521013205 500000000000000unixODBC-2.3.9/DRVConfig/MiniSQL/odbcminiS.c0000755000175000017500000000417512262474472015215 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /********************************************** * HELP **********************************************/ static const char *szHelpHost = "blank is faster than localhost"; /********************************************** * STATIC LOOKUP VALUES **********************************************/ static const char *aHost[] = { "localhost", NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aHost ) ); memcpy( hLastProperty->aPromptData, aHost, sizeof( aHost ) ); hLastProperty->pszHelp = (char*)strdup( szHelpHost ); strncpy( hLastProperty->szName, "Host", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; strncpy( hLastProperty->szName, "ConfigFile", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); return 1; } unixODBC-2.3.9/DRVConfig/MiniSQL/README0000755000175000017500000000173612262474472014022 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. This software is a LinuxODBC component and * * may NOT be distributed seperately. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | LinuxODBC | | Driver Config for MiniSQL ODBC driver | +-------------------------------------------------------------+ Use this Driver Config when using the MiniSQL ODBC Driver. It allows ODBCConfig to prompt the user for Data Source options. ODBCConfig will read the "Setup" entry in /etc/odbcinst.ini to determine the name of the config lib to use. Peter Harvey pharvey@codebydesign.com 10.FEB.99 unixODBC-2.3.9/DRVConfig/MiniSQL/Makefile.in0000664000175000017500000005231213725127174015201 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/MiniSQL ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbcminiS_la_LIBADD = am_libodbcminiS_la_OBJECTS = odbcminiS.lo libodbcminiS_la_OBJECTS = $(am_libodbcminiS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcminiS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcminiS_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcminiS_la_SOURCES) DIST_SOURCES = $(libodbcminiS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbcminiS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcminiS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcminiS_la_SOURCES = odbcminiS.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/MiniSQL/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/MiniSQL/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcminiS.la: $(libodbcminiS_la_OBJECTS) $(libodbcminiS_la_DEPENDENCIES) $(EXTRA_libodbcminiS_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcminiS_la_LINK) -rpath $(libdir) $(libodbcminiS_la_OBJECTS) $(libodbcminiS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odbcminiS.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/MiniSQL/Makefile.am0000755000175000017500000000030312262755742015165 00000000000000lib_LTLIBRARIES = libodbcminiS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcminiS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcminiS_la_SOURCES = odbcminiS.c unixODBC-2.3.9/DRVConfig/PostgreSQL/0000775000175000017500000000000013725127521013734 500000000000000unixODBC-2.3.9/DRVConfig/PostgreSQL/odbcpsqlS.c0000755000175000017500000001722212262474471015763 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /********************************************** * HELP **********************************************/ static const char *szHelpPassword = "Your Password will be used to gain additional information from the DBMS and will not be saved anywhere."; /********************************************** * STATIC LOOKUP VALUES **********************************************/ static const char *aServer[] = { "localhost", NULL }; static const char *aPort[] = { "5432", NULL }; static const char *aProtocol[] = { "6.4", "6.3", "6.2", NULL }; static const char *aYesNo[] = { "Yes", "No", NULL }; static const char *aTrueFalse[] = { "True", "False", NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aYesNo) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof(aYesNo) ); strncpy( hLastProperty->szName, "Trace", INI_MAX_PROPERTY_NAME ); strcpy( hLastProperty->szValue, "No" ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; strncpy( hLastProperty->szName, "TraceFile", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aServer ) ); memcpy( hLastProperty->aPromptData, aServer, sizeof( aServer ) ); strncpy( hLastProperty->szName, "Servername", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "localhost", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Username", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT_PASSWORD; hLastProperty->pszHelp = (char *)strdup( szHelpPassword ); strncpy( hLastProperty->szName, "Password", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof(aPort) ); memcpy( hLastProperty->aPromptData, aPort, sizeof(aPort) ); strncpy( hLastProperty->szName, "Port", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "5432", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof(aProtocol) ); memcpy( hLastProperty->aPromptData, aProtocol, sizeof(aProtocol) ); strncpy( hLastProperty->szName, "Protocol", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "6.4", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aYesNo) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof(aYesNo) ); strncpy( hLastProperty->szName, "ReadOnly", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "No", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aYesNo) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof(aYesNo) ); strncpy( hLastProperty->szName, "RowVersioning", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "No", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aYesNo) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof(aYesNo) ); strncpy( hLastProperty->szName, "ShowSystemTables", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "No", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aYesNo) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof(aYesNo) ); strncpy( hLastProperty->szName, "ShowOidColumn", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "No", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aYesNo) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof(aYesNo) ); strncpy( hLastProperty->szName, "FakeOidIndex", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "No", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "ConnSettings", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); return 1; } unixODBC-2.3.9/DRVConfig/PostgreSQL/README0000755000175000017500000000174112262474471014544 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. This software is a LinuxODBC component and * * may NOT be distributed seperately. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | LinuxODBC | | Driver Config for PostgreSQL ODBC driver | +-------------------------------------------------------------+ Use this Driver Config when using the PostgreSQL ODBC Driver. It allows ODBCConfig to prompt the user for Data Source options. ODBCConfig will read the "Setup" entry in /etc/odbcinst.ini to determine the name of the config lib to use. Peter Harvey pharvey@codebydesign.com 02.FEB.99 unixODBC-2.3.9/DRVConfig/PostgreSQL/Makefile.in0000664000175000017500000005232313725127174015732 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/PostgreSQL ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbcpsqlS_la_LIBADD = am_libodbcpsqlS_la_OBJECTS = odbcpsqlS.lo libodbcpsqlS_la_OBJECTS = $(am_libodbcpsqlS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcpsqlS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcpsqlS_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcpsqlS_la_SOURCES) DIST_SOURCES = $(libodbcpsqlS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbcpsqlS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcpsqlS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcpsqlS_la_SOURCES = odbcpsqlS.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/PostgreSQL/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/PostgreSQL/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcpsqlS.la: $(libodbcpsqlS_la_OBJECTS) $(libodbcpsqlS_la_DEPENDENCIES) $(EXTRA_libodbcpsqlS_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcpsqlS_la_LINK) -rpath $(libdir) $(libodbcpsqlS_la_OBJECTS) $(libodbcpsqlS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odbcpsqlS.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/PostgreSQL/Makefile.am0000755000175000017500000000030312262755747015721 00000000000000lib_LTLIBRARIES = libodbcpsqlS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcpsqlS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcpsqlS_la_SOURCES = odbcpsqlS.c unixODBC-2.3.9/DRVConfig/esoob/0000775000175000017500000000000013725127521013040 500000000000000unixODBC-2.3.9/DRVConfig/esoob/Makefile.in0000664000175000017500000005217313725127174015041 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/esoob ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libesoobS_la_LIBADD = am_libesoobS_la_OBJECTS = esoobS.lo libesoobS_la_OBJECTS = $(am_libesoobS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libesoobS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libesoobS_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libesoobS_la_SOURCES) DIST_SOURCES = $(libesoobS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libesoobS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libesoobS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libesoobS_la_SOURCES = esoobS.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/esoob/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/esoob/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libesoobS.la: $(libesoobS_la_OBJECTS) $(libesoobS_la_DEPENDENCIES) $(EXTRA_libesoobS_la_DEPENDENCIES) $(AM_V_CCLD)$(libesoobS_la_LINK) -rpath $(libdir) $(libesoobS_la_OBJECTS) $(libesoobS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/esoobS.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/esoob/esoobS.c0000755000175000017500000002121212262474471014361 00000000000000/* * Copyright (c) 1999 Easysoft Ltd. All rights reserved. * * This file contains the ODBCINSTGetProperties function required by * unixODBC (http://www.unixodbc.org) to define Easysoft ODBC-ODBC Bridge * DSNs. * * $Id: esoobS.c,v 1.2 2009/02/18 17:59:08 lurcher Exp $ * * $Log: esoobS.c,v $ * Revision 1.2 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:01 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.3 2000/06/19 15:54:53 ngorham * * Added DisguiseWide attribute to esoob. * * Revision 1.2 2001/05/27 10:35:18 ngorham * * Added MetaDataBlockFetch connection attribute to esoob driver. * * Revision 1.1 2000/02/20 10:21:08 ngorham * * Setup files for Easysoft ODBC-ODBC Bridge * * Revision 1.4 2000/02/10 17:53:50 martin * Change protocol to transport. * * Revision 1.3 1999/09/06 10:58:55 martin * Add description and copyright. * * Revision 1.2 1999/09/06 10:49:55 martin * Add BlockFetchSize, MetaData_ID_Identifier and Unquote_Catalog_Fns. * * Revision 1.1 1999/09/06 09:44:37 martin * Initial revision * */ #include #include char *help_strings[] = { "Name of the server to connect to.", "Name of the network transport to use.", "Number of the port the server is listening on.", "Name of the remote DSN to connect to.", "Name of the user to log on to server box as.", "Password of the user to log on to server box as.", "Name of the remote database user.", "Password of the remote datbase user.", "Number of rows to bind in Block-Fetch-Mode.", "Remove quotes on catalog functions (Applix's AXData).", "Tell driver to treat strings as literal and treat wildcard " "characters as literals.", "Enable (1) or Disable (0) OOB's metadata blockfetchmode", "Enable (1) or Disable (0) disguise wide characters mode" }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Server", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[0]) + 1); strcpy(hLastProperty->pszHelp, help_strings[0]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Transport", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "TCP/IP", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[1]) + 1); strcpy(hLastProperty->pszHelp, help_strings[1]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Port", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "8888", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[2]) + 1); strcpy(hLastProperty->pszHelp, help_strings[2]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "TargetDSN", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[3]) + 1); strcpy(hLastProperty->pszHelp, help_strings[3]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "LogonUser", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[4]) + 1); strcpy(hLastProperty->pszHelp, help_strings[4]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "LogonAuth", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[5]) + 1); strcpy(hLastProperty->pszHelp, help_strings[5]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "TargetUser", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[6]) + 1); strcpy(hLastProperty->pszHelp, help_strings[6]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "TargetAuth", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[7]) + 1); strcpy(hLastProperty->pszHelp, help_strings[7]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "BlockFetchSize", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "0", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[8]) + 1); strcpy(hLastProperty->pszHelp, help_strings[8]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Unquote_Catalog_Fns", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "0", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[9]) + 1); strcpy(hLastProperty->pszHelp, help_strings[9]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "MetaData_ID_Identifiers", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "0", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[10]) + 1); strcpy(hLastProperty->pszHelp, help_strings[10]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "MetaDataBlockFetch", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "1", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[11]) + 1); strcpy(hLastProperty->pszHelp, help_strings[11]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "DisguiseWide", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "0", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[12]) + 1); strcpy(hLastProperty->pszHelp, help_strings[12]); return 1; } unixODBC-2.3.9/DRVConfig/esoob/Makefile.am0000755000175000017500000000026712262755753015033 00000000000000lib_LTLIBRARIES = libesoobS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libesoobS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libesoobS_la_SOURCES = esoobS.c unixODBC-2.3.9/DRVConfig/template/0000775000175000017500000000000013725127521013544 500000000000000unixODBC-2.3.9/DRVConfig/template/README0000755000175000017500000000203312262474472014350 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. This software is a LinuxODBC component and * * may NOT be distributed seperately. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | LinuxODBC | | Driver Config template | +-------------------------------------------------------------+ A Driver Config is too simple. So simple in fact that it would be pointless to create a real template. So go to a working Driver Config and check it out. I recommend starting with; 1. drvcfg1 - basics for an SQL Server type data source 2. drvcfg2 - basics for a File type data source Enjoy... Peter Harvey pharvey@codebydesign.com 25.FEB.99 unixODBC-2.3.9/DRVConfig/template/Makefile.in0000664000175000017500000003216613725127174015545 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/template ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/template/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/template/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/template/Makefile.am0000755000175000017500000000000012262474472015514 00000000000000unixODBC-2.3.9/DRVConfig/sapdb/0000775000175000017500000000000013725127521013022 500000000000000unixODBC-2.3.9/DRVConfig/sapdb/README0000755000175000017500000000233212460435544013625 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver Config for SAP DB SQL Server options | +-------------------------------------------------------------+ SAP DB awaits it's odbc.ini file in /usr/spool/sql/config/odbc.ini. That's weird enought, because it's not even FHS (that would be /var/spool/...) There are two ways you can fix this: - Edit the libsqlod.so file - make a symlink from /usr/spool/sql/config/odbc.ini to /etc/odbc.ini Also note that currently (09-Mar-2001) unixODBC crashes when you use the libsqlod from the sapdb-srv or sapdb-if RPM packages. If you use the one from the sapdb-web RPM, then it works. +-------------------------------------------------------------+ | Holger Schurig holgerschurig@gmx.de | | http://home.nikocity.de/hschurig | +-------------------------------------------------------------+ unixODBC-2.3.9/DRVConfig/sapdb/sapdb.c0000755000175000017500000000604112262474471014205 00000000000000/************************************************** * This code was created by Holger Schurig @ mn-logistik.de. * Released under LGPL 08.MAR.2001 * * Additional MaxDB ODBC properties added by * Martin Kittel , 08.05.2005 * ----------------------------------------------- **************************************************/ #include #include static const char *aHost[] = { "localhost", NULL }; static const char *aSqlModes[] = { "INTERNAL", "ORACLE", "ANSI", "DB2", NULL }; static const char *aIsoLevel[] = { "Uncommitted", "Committed", "Repeatable", "Serializable", NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "ServerNode", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "localhost", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "ServerDB", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aSqlModes ) ); memcpy( hLastProperty->aPromptData, aSqlModes, sizeof( aSqlModes ) ); strncpy( hLastProperty->szName, "SQLMode", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "INTERNAL", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aIsoLevel ) ); memcpy( hLastProperty->aPromptData, aIsoLevel, sizeof( aIsoLevel ) ); strncpy( hLastProperty->szName, "IsolationLevel", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "Committed", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; strncpy( hLastProperty->szName, "TraceFileName", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); return 1; } unixODBC-2.3.9/DRVConfig/sapdb/Makefile.in0000664000175000017500000005222413725127174015020 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/sapdb ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libsapdbS_la_LIBADD = am_libsapdbS_la_OBJECTS = sapdb.lo libsapdbS_la_OBJECTS = $(am_libsapdbS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libsapdbS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsapdbS_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libsapdbS_la_SOURCES) DIST_SOURCES = $(libsapdbS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libsapdbS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libsapdbS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libsapdbS_la_SOURCES = sapdb.c EXTRA_DIST = README all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/sapdb/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/sapdb/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libsapdbS.la: $(libsapdbS_la_OBJECTS) $(libsapdbS_la_DEPENDENCIES) $(EXTRA_libsapdbS_la_DEPENDENCIES) $(AM_V_CCLD)$(libsapdbS_la_LINK) -rpath $(libdir) $(libsapdbS_la_OBJECTS) $(libsapdbS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sapdb.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/sapdb/Makefile.am0000755000175000017500000000031212262755762015004 00000000000000lib_LTLIBRARIES = libsapdbS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libsapdbS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libsapdbS_la_SOURCES = sapdb.c EXTRA_DIST = README unixODBC-2.3.9/DRVConfig/Oracle/0000775000175000017500000000000013725127521013136 500000000000000unixODBC-2.3.9/DRVConfig/Oracle/oraodbcS.c0000755000175000017500000000762612262474471014776 00000000000000/* * This file contains the ODBCINSTGetProperties function required by * unixODBC (http://www.unixodbc.org) to define tds DSNs. * * $Log: oraodbcS.c,v $ * Revision 1.4 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2003/07/21 17:10:09 lurcher * * Start new version and add missing comma to oracle setup * * Revision 1.2 2002/12/20 11:36:46 lurcher * * Update DMEnvAttr code to allow setting in the odbcinst.ini entry * * Revision 1.1.1.1 2001/10/17 16:40:01 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 2000/08/11 12:45:38 ngorham * * Add Oracle setup * */ #include #include static const char *aYesNo[] = { "Yes", "No", NULL }; static char *help_strings[] = { "Name of the server to connect to.", "User name to connect with.", "Password of user.", "Path name of the Oracle version to use.", "Path name of the TNS files." }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "DB", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[0]) + 1); strcpy(hLastProperty->pszHelp, help_strings[0]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "USER", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[1]) + 1); strcpy(hLastProperty->pszHelp, help_strings[1]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "PASSWORD", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[2]) + 1); strcpy(hLastProperty->pszHelp, help_strings[2]); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; strncpy( hLastProperty->szName, "ORACLE_HOME", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[3]) + 1); strcpy(hLastProperty->pszHelp, help_strings[3]); /* Idea for the future: * make the nPromptType an ODBCINST_PROMPTTYPE_COMBOBOX and * present the user with aPromptData containing * the current value of the ORACLE_HOME environment variable * same for TNS_ADMIN below */ hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; strncpy( hLastProperty->szName, "TNS_ADMIN", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = malloc(strlen(help_strings[4]) + 1); strcpy(hLastProperty->pszHelp, help_strings[4]); return 1; } unixODBC-2.3.9/DRVConfig/Oracle/Makefile.in0000664000175000017500000005225313725127174015136 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/Oracle ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) liboraodbcS_la_LIBADD = am_liboraodbcS_la_OBJECTS = oraodbcS.lo liboraodbcS_la_OBJECTS = $(am_liboraodbcS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = liboraodbcS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(liboraodbcS_la_LDFLAGS) $(LDFLAGS) -o \ $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(liboraodbcS_la_SOURCES) DIST_SOURCES = $(liboraodbcS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = liboraodbcS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) liboraodbcS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module liboraodbcS_la_SOURCES = oraodbcS.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/Oracle/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/Oracle/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } liboraodbcS.la: $(liboraodbcS_la_OBJECTS) $(liboraodbcS_la_DEPENDENCIES) $(EXTRA_liboraodbcS_la_DEPENDENCIES) $(AM_V_CCLD)$(liboraodbcS_la_LINK) -rpath $(libdir) $(liboraodbcS_la_OBJECTS) $(liboraodbcS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oraodbcS.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/Oracle/Makefile.am0000755000175000017500000000027712262755766015136 00000000000000lib_LTLIBRARIES = liboraodbcS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) liboraodbcS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module liboraodbcS_la_SOURCES = oraodbcS.c unixODBC-2.3.9/DRVConfig/README0000755000175000017500000000223612262474472012542 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | DRVConfig | +-------------------------------------------------------------+ These are the setup libs for the various drivers. There are two generic ones; drvcfg1 - SQL servers (host, port etc) drvcfg2 - file based (database dir) These are typically installed into the same directory as the drivers (often /usr/local/lib) and are denoted by a simple naming convention (*S.so). The driver lib and setup lib are key to registering an ODBC driver - a task which is done by a root user. +-------------------------------------------------------------+ | Peter Harvey pharvey@codebydesign.com | | http://www.unixodbc.org | +-------------------------------------------------------------+ unixODBC-2.3.9/DRVConfig/Mimer/0000775000175000017500000000000013725127521013002 500000000000000unixODBC-2.3.9/DRVConfig/Mimer/mimerS.c0000755000175000017500000001046112262474471014331 00000000000000/* * This file contains the ODBCINSTGetProperties function. * * It is required by unixODBC (http://www.unixodbc.org) to define DSNs. * * This version is the setup for Mimer SQL (http://developer.mimer.se). * * Revision 1.1 2004/01/21 per.bengtsson@mimer.se * */ #include #include static const char *vHost[] = { "localhost", NULL }; static const char *vPort[] = { "1360", NULL }; static const char *vUser[] = { "SYSADM", NULL }; static const char *vDescr[] = { "Mimer SQL", NULL }; static const char *vYesNo[] = { "Yes", "No", NULL }; int ODBCINSTGetProperties(HODBCINSTPROPERTY hLastProperty) { /* * Database name */ hLastProperty->pNext = (HODBCINSTPROPERTY)malloc(sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset(hLastProperty, 0, sizeof(ODBCINSTPROPERTY)); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy(hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME); strncpy(hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE); hLastProperty->pszHelp = strdup("The name of the Mimer SQL database server"); /* * Host name */ hLastProperty->pNext = (HODBCINSTPROPERTY)malloc(sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset(hLastProperty, 0, sizeof(ODBCINSTPROPERTY)); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc(sizeof(vHost)); memcpy(hLastProperty->aPromptData, vHost, sizeof(vHost)); strncpy(hLastProperty->szName, "Host", INI_MAX_PROPERTY_NAME); strncpy(hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE); hLastProperty->pszHelp = strdup("Hostname or IP address of computer running the Mimer SQL database server"); /* * Port number */ hLastProperty->pNext = (HODBCINSTPROPERTY)malloc(sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset(hLastProperty, 0, sizeof(ODBCINSTPROPERTY)); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc(sizeof(vPort)); memcpy(hLastProperty->aPromptData, vPort, sizeof(vPort)); strncpy(hLastProperty->szName, "Port", INI_MAX_PROPERTY_NAME); strncpy(hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE); hLastProperty->pszHelp = strdup("Port number (default is 1360)"); /* * User name */ hLastProperty->pNext = (HODBCINSTPROPERTY)malloc(sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset(hLastProperty, 0, sizeof(ODBCINSTPROPERTY)); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc(sizeof(vUser)); memcpy(hLastProperty->aPromptData, vUser, sizeof(vUser)); strncpy(hLastProperty->szName, "User", INI_MAX_PROPERTY_NAME); strncpy(hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE); hLastProperty->pszHelp = strdup("Database user to connect as (optional)"); /* * Password */ hLastProperty->pNext = (HODBCINSTPROPERTY)malloc(sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset(hLastProperty, 0, sizeof(ODBCINSTPROPERTY)); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy(hLastProperty->szName, "Password", INI_MAX_PROPERTY_NAME); strncpy(hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE); hLastProperty->pszHelp = strdup("Password for the database user (optional)"); /* * Trace option */ hLastProperty->pNext = (HODBCINSTPROPERTY)malloc(sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset(hLastProperty, 0, sizeof(ODBCINSTPROPERTY)); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc(sizeof(vYesNo)); memcpy(hLastProperty->aPromptData, vYesNo, sizeof(vYesNo)); strncpy(hLastProperty->szName, "Trace", INI_MAX_PROPERTY_NAME); strcpy(hLastProperty->szValue, "No"); hLastProperty->pszHelp = strdup("ODBC trace feature (optional)"); /* * Trace file name */ hLastProperty->pNext = (HODBCINSTPROPERTY)malloc(sizeof(ODBCINSTPROPERTY)); hLastProperty = hLastProperty->pNext; memset(hLastProperty, 0, sizeof(ODBCINSTPROPERTY)); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; strncpy(hLastProperty->szName, "TraceFile", INI_MAX_PROPERTY_NAME); strncpy(hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE); hLastProperty->pszHelp = strdup("ODBC trace file name (used if Trace is enabled)"); return 1; } /**************************************************/ unixODBC-2.3.9/DRVConfig/Mimer/Makefile.in0000664000175000017500000005217213725127174015002 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/Mimer ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libmimerS_la_LIBADD = am_libmimerS_la_OBJECTS = mimerS.lo libmimerS_la_OBJECTS = $(am_libmimerS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libmimerS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmimerS_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmimerS_la_SOURCES) DIST_SOURCES = $(libmimerS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libmimerS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libmimerS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libmimerS_la_SOURCES = mimerS.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/Mimer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/Mimer/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmimerS.la: $(libmimerS_la_OBJECTS) $(libmimerS_la_DEPENDENCIES) $(EXTRA_libmimerS_la_DEPENDENCIES) $(AM_V_CCLD)$(libmimerS_la_LINK) -rpath $(libdir) $(libmimerS_la_OBJECTS) $(libmimerS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mimerS.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/Mimer/Makefile.am0000755000175000017500000000026612262755607014772 00000000000000lib_LTLIBRARIES = libmimerS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libmimerS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libmimerS_la_SOURCES = mimerS.c unixODBC-2.3.9/DRVConfig/MySQL/0000775000175000017500000000000013725127521012676 500000000000000unixODBC-2.3.9/DRVConfig/MySQL/README0000755000175000017500000000173412262474471013510 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. This software is a LinuxODBC component and * * may NOT be distributed seperately. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver Config for MySQL ODBC driver | +-------------------------------------------------------------+ Use this Driver Config when using the MySQL ODBC Driver. It allows ODBCConfig to prompt the user for Data Source options. ODBCConfig will read the "Setup" entry in /etc/odbcinst.ini to determine the name of the config lib to use. Peter Harvey pharvey@codebydesign.com 19.FEB.99 unixODBC-2.3.9/DRVConfig/MySQL/odbcmyS.c0000755000175000017500000001274412262474471014377 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /********************************************** * HELP **********************************************/ /********************************************** * STATIC LOOKUP VALUES **********************************************/ static const char *aHost[] = { "localhost", NULL }; static const char *aDatabase[] = { "test", "mysql", NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aHost ) ); memcpy( hLastProperty->aPromptData, aHost, sizeof( aHost ) ); strncpy( hLastProperty->szName, "Server", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "Host name or IP address of the machine running the MySQL server." ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aDatabase ) ); memcpy( hLastProperty->aPromptData, aDatabase, sizeof( aDatabase ) ); strncpy( hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "test", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "The database you want to connect to.\nYou can use test or mysql to test this DSN." ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Port", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "Port number. Leave blank to accept the default." ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Socket", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "Socket number. Leave blank to accept the default." ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Option", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "\ Add the desired option values and enter resulting number here...\n\n\ 1 The client can't handle that MyODBC returns the real width of a column.\n \ 2 The client can't handle that MySQL returns the true value of affected rows\n \ 4 Make a debug log. \ 8 Don't set any packet limit for results and parameters.\n \ 16 Don't prompt for questions even if driver would like to prompt\n \ 32 Enable or disable the dynamic cursor support. This is not allowed in MyODBC.\n \ 64 Ignore use of database name in 'database.table.column'.\n \ 128 Force use of ODBC manager cursors (experimental).\n \ 256 Disable the use of extended fetch (experimental).\n \ 512 Pad CHAR fields to full column length.\n \ 1024 SQLDescribeCol() will return fully qualified column names\n \ 2048 Use the compressed server/client protocol\n \ 4096 Tell server to ignore space after function name and before '('\n \ 8192 Connect with named pipes to a mysqld server running on NT.\n \ 16384 Change LONGLONG columns to INT columns\n \ 32768 Return 'user' as Table_qualifier and Table_owner from SQLTables\n \ 65536 Read parameters from the client and odbc groups from `my.cnf'\n \ 131072 Add some extra safety checks (should not bee needed but...)" ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Stmt", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "statement to execute upon connect" ); return 1; } unixODBC-2.3.9/DRVConfig/MySQL/Makefile.in0000664000175000017500000005222713725127174014677 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/MySQL ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbcmyS_la_LIBADD = am_libodbcmyS_la_OBJECTS = odbcmyS.lo libodbcmyS_la_OBJECTS = $(am_libodbcmyS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcmyS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libodbcmyS_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcmyS_la_SOURCES) DIST_SOURCES = $(libodbcmyS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbcmyS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcmyS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcmyS_la_SOURCES = odbcmyS.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/MySQL/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/MySQL/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcmyS.la: $(libodbcmyS_la_OBJECTS) $(libodbcmyS_la_DEPENDENCIES) $(EXTRA_libodbcmyS_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcmyS_la_LINK) -rpath $(libdir) $(libodbcmyS_la_OBJECTS) $(libodbcmyS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/odbcmyS.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/MySQL/Makefile.am0000755000175000017500000000027312262755774014671 00000000000000lib_LTLIBRARIES = libodbcmyS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcmyS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcmyS_la_SOURCES = odbcmyS.c unixODBC-2.3.9/DRVConfig/txt/0000775000175000017500000000000013725127521012550 500000000000000unixODBC-2.3.9/DRVConfig/txt/README0000755000175000017500000000170612262474471013361 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver Config for the Text File Driver | +-------------------------------------------------------------+ This is a driver setup which can be called by ODBC Config to allow the driver specific options to be set for the Text File Driver. This will allow ODBCConfig to prompt for Data Source options. +-------------------------------------------------------------+ | Peter Harvey pharvey@codebydesign.com | | http://www.unixodbc.org | +-------------------------------------------------------------+ unixODBC-2.3.9/DRVConfig/txt/drvcfg.c0000644000175000017500000000713413274316773014122 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 10.APR.01 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /********************************************** * HELP **********************************************/ /********************************************** * STATIC LOOKUP VALUES **********************************************/ static const char *aColumnSeparators[] = { "|", ",", NULL }; static const char *aYesNo[] = { "Yes", "No", NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)calloc( 1, sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Directory", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "Directory where table files can/will be found.\nLeave blank for default (~/.odbctxt)." ); hLastProperty->pNext = (HODBCINSTPROPERTY)calloc( 1, sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof( aYesNo ) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof( aYesNo ) ); strncpy( hLastProperty->szName, "ReadOnly", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "No", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "Set this to Yes if you do not want anyone changing the data." ); hLastProperty->pNext = (HODBCINSTPROPERTY)calloc( 1, sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof( aYesNo ) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof( aYesNo ) ); strncpy( hLastProperty->szName, "CaseSensitive", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "Yes", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "Yes if data is compared as case-sensitive." ); hLastProperty->pNext = (HODBCINSTPROPERTY)calloc( 1, sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof( aYesNo ) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof( aYesNo ) ); strncpy( hLastProperty->szName, "Catalog", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "No", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "Yes if you want to use a special file to describe all tables/columns.\n\nNo if column names on the first row are enough." ); hLastProperty->pNext = (HODBCINSTPROPERTY)calloc( 1, sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aColumnSeparators ) ); memcpy( hLastProperty->aPromptData, aColumnSeparators, sizeof( aColumnSeparators ) ); strncpy( hLastProperty->szName, "ColumnSeperator", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "|", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = strdup( "Column separator character used in table files.\nCANNOT EXIST IN COLUMN VALUES." ); return 1; } unixODBC-2.3.9/DRVConfig/txt/Makefile.in0000664000175000017500000005224313725127174014547 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/txt ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbctxtS_la_LIBADD = am_libodbctxtS_la_OBJECTS = drvcfg.lo libodbctxtS_la_OBJECTS = $(am_libodbctxtS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbctxtS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbctxtS_la_LDFLAGS) $(LDFLAGS) -o \ $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbctxtS_la_SOURCES) DIST_SOURCES = $(libodbctxtS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbctxtS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbctxtS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbctxtS_la_SOURCES = drvcfg.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/txt/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/txt/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbctxtS.la: $(libodbctxtS_la_OBJECTS) $(libodbctxtS_la_DEPENDENCIES) $(EXTRA_libodbctxtS_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbctxtS_la_LINK) -rpath $(libdir) $(libodbctxtS_la_OBJECTS) $(libodbctxtS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drvcfg.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/txt/Makefile.am0000755000175000017500000000027512262756000014524 00000000000000lib_LTLIBRARIES = libodbctxtS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbctxtS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbctxtS_la_SOURCES = drvcfg.c unixODBC-2.3.9/DRVConfig/drvcfg1/0000775000175000017500000000000013725127521013265 500000000000000unixODBC-2.3.9/DRVConfig/drvcfg1/drvcfg1.c0000755000175000017500000000342512262474471014716 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 18.FEB.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include static const char *aHost[] = { "localhost", NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aHost ) ); memcpy( hLastProperty->aPromptData, aHost, sizeof( aHost ) ); strncpy( hLastProperty->szName, "Host", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Port", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); return 1; } unixODBC-2.3.9/DRVConfig/drvcfg1/README0000755000175000017500000000247312262474471014100 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver Config for basic SQL Server options | +-------------------------------------------------------------+ This is an example of a driver setup which can be called by ODBC Config to allow the driver specific options to be set. This particular example is for SQL Server type setups and can be used as a substitute for drivers which serve SQL Servers but are missing a driver setup of its own. This is the Driver Config that is used when ODBC Config does not have a specific config for an installed driver. Each driver in /etc/odbcinst.ini should have a Setup entry such as; Setup = /usr/lib/libodbcminiS.so This will allow ODBCConfig to prompt for Data Source options. +-------------------------------------------------------------+ | Peter Harvey pharvey@codebydesign.com | | http://www.unixodbc.org | +-------------------------------------------------------------+ unixODBC-2.3.9/DRVConfig/drvcfg1/Makefile.in0000664000175000017500000005237213725127174015267 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/drvcfg1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbcdrvcfg1S_la_LIBADD = am_libodbcdrvcfg1S_la_OBJECTS = drvcfg1.lo libodbcdrvcfg1S_la_OBJECTS = $(am_libodbcdrvcfg1S_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcdrvcfg1S_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcdrvcfg1S_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcdrvcfg1S_la_SOURCES) DIST_SOURCES = $(libodbcdrvcfg1S_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbcdrvcfg1S.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcdrvcfg1S_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcdrvcfg1S_la_SOURCES = drvcfg1.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/drvcfg1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/drvcfg1/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcdrvcfg1S.la: $(libodbcdrvcfg1S_la_OBJECTS) $(libodbcdrvcfg1S_la_DEPENDENCIES) $(EXTRA_libodbcdrvcfg1S_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcdrvcfg1S_la_LINK) -rpath $(libdir) $(libodbcdrvcfg1S_la_OBJECTS) $(libodbcdrvcfg1S_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drvcfg1.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/drvcfg1/Makefile.am0000755000175000017500000000031212262756005015236 00000000000000lib_LTLIBRARIES = libodbcdrvcfg1S.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcdrvcfg1S_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcdrvcfg1S_la_SOURCES = drvcfg1.c unixODBC-2.3.9/DRVConfig/oplodbc/0000775000175000017500000000000013725127521013353 500000000000000unixODBC-2.3.9/DRVConfig/oplodbc/README0000755000175000017500000000146012262474471014161 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. This software is a LinuxODBC component and * * may NOT be distributed seperately. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | LinuxODBC | | Driver Config for OpenLinks ODBC driver | +-------------------------------------------------------------+ Use this Driver Config when using the OpenLink ODBC Driver. Peter Harvey pharvey@codebydesign.com 25.FEB.99 unixODBC-2.3.9/DRVConfig/oplodbc/oplodbc.c0000755000175000017500000001612612262474471015074 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /********************************************** * HELP **********************************************/ static const char *szHelpDatabase = "Databases on Server. I can try to present a list if Host, Login ID and Password are given."; static const char *szHelpPassword = "Your Password will be used to gain additional information from the DBMS and will not be saved anywhere."; /********************************************** * STATIC LOOKUP VALUES **********************************************/ static const char *aHost[] = { "localhost", NULL }; static const char *aServerType[] = { "DB2", "Informix 5", "Informix 6", "Informix 7", "Ingres 6", "Odbc", "OpenIngres 1", "OpenIngres 2", "Oracle 6", "Oracle 7", "Oracle 8", "Postgres 95", "Progress 63C", "Progress 63E", "Progress 63F", "Progress 72D", "Progress 73A", "Progress 73C", "Progress 73D", "Progress 73E", "Progress 81A", "Progress 82A", "Progress 82C", "Progress 83A", "Progress 90A", "Proxy", "Solid", "Sybase 4", "Sybase 10", "Sybase 11", "SQLServer", "Unify", "Velocis", "Virtuoso", NULL }; static const char *aProtocol[] = { "TCP/IP", NULL }; static const char *aYesNo[] = { "Yes", "No", NULL }; static const char *aTrueFalse[] = { "True", "False", NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "ServerOptions", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Options", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; hLastProperty->pszHelp = malloc( strlen(szHelpDatabase)+1 ); strcpy( hLastProperty->pszHelp, szHelpDatabase ); strncpy( hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aHost ) ); memcpy( hLastProperty->aPromptData, aHost, sizeof( aHost ) ); strncpy( hLastProperty->szName, "Host", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "UserName", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT_PASSWORD; hLastProperty->pszHelp = malloc( strlen(szHelpPassword)+1 ); strcpy( hLastProperty->pszHelp, szHelpPassword ); strncpy( hLastProperty->szName, "Password", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof(aServerType) ); memcpy( hLastProperty->aPromptData, aServerType, sizeof(aServerType) ); strncpy( hLastProperty->szName, "ServerType", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof(aProtocol) ); memcpy( hLastProperty->aPromptData, aProtocol, sizeof(aProtocol) ); strncpy( hLastProperty->szName, "Protocol", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "LastUser", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aYesNo) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof(aYesNo) ); strncpy( hLastProperty->szName, "ReadOnly", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aTrueFalse) ); memcpy( hLastProperty->aPromptData, aTrueFalse, sizeof(aTrueFalse) ); strncpy( hLastProperty->szName, "NoLoginBox", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "FetchBufferSize", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); return 1; } unixODBC-2.3.9/DRVConfig/oplodbc/Makefile.in0000664000175000017500000005226213725127174015353 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/oplodbc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) liboplodbcS_la_LIBADD = am_liboplodbcS_la_OBJECTS = oplodbc.lo liboplodbcS_la_OBJECTS = $(am_liboplodbcS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = liboplodbcS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(liboplodbcS_la_LDFLAGS) $(LDFLAGS) -o \ $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(liboplodbcS_la_SOURCES) DIST_SOURCES = $(liboplodbcS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = liboplodbcS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) liboplodbcS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module liboplodbcS_la_SOURCES = oplodbc.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/oplodbc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/oplodbc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } liboplodbcS.la: $(liboplodbcS_la_OBJECTS) $(liboplodbcS_la_DEPENDENCIES) $(EXTRA_liboplodbcS_la_DEPENDENCIES) $(AM_V_CCLD)$(liboplodbcS_la_LINK) -rpath $(libdir) $(liboplodbcS_la_OBJECTS) $(liboplodbcS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oplodbc.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/oplodbc/Makefile.am0000755000175000017500000000027612262756013015334 00000000000000lib_LTLIBRARIES = liboplodbcS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) liboplodbcS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module liboplodbcS_la_SOURCES = oplodbc.c unixODBC-2.3.9/DRVConfig/tds/0000775000175000017500000000000013725127521012523 500000000000000unixODBC-2.3.9/DRVConfig/tds/Makefile.in0000664000175000017500000005211313725127174014516 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/tds ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libtdsS_la_LIBADD = am_libtdsS_la_OBJECTS = tdsS.lo libtdsS_la_OBJECTS = $(am_libtdsS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libtdsS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libtdsS_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtdsS_la_SOURCES) DIST_SOURCES = $(libtdsS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libtdsS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libtdsS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libtdsS_la_SOURCES = tdsS.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/tds/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/tds/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libtdsS.la: $(libtdsS_la_OBJECTS) $(libtdsS_la_DEPENDENCIES) $(EXTRA_libtdsS_la_DEPENDENCIES) $(AM_V_CCLD)$(libtdsS_la_LINK) -rpath $(libdir) $(libtdsS_la_OBJECTS) $(libtdsS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tdsS.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/tds/Makefile.am0000755000175000017500000000025712262756020014501 00000000000000lib_LTLIBRARIES = libtdsS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libtdsS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libtdsS_la_SOURCES = tdsS.c unixODBC-2.3.9/DRVConfig/tds/tdsS.c0000755000175000017500000000661612262474471013542 00000000000000/* * This file contains the ODBCINSTGetProperties function required by * unixODBC (http://www.unixodbc.org) to define tds DSNs. * * This may be used for the FreeTDS driver or some other driver so * be careful about removing any properties. - PAH * * $Log: tdsS.c,v $ * Revision 1.4 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2003/11/13 15:12:53 lurcher * * small change to ODBCConfig to have the password field in the driver * properties hide the password * Make both # and ; comments in ini files * * Revision 1.2 2002/02/22 17:27:20 peteralexharvey * - * * Revision 1.1.1.1 2001/10/17 16:40:01 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.1 2000/07/09 22:17:52 ngorham * * Added tds setup lib * */ #include #include static const char *aYesNo[] = { "Yes", "No", NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Servername", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = (char*)strdup( "Name of server to connect to. This should\nmatch the name used in the interfaces\nor freetds.conf file." ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = (char*)strdup( "Default database" ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "UID", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = (char*)strdup( "User ID" ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT_PASSWORD; strncpy( hLastProperty->szName, "PWD", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = (char*)strdup( "Password" ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; strncpy( hLastProperty->szName, "Port", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "4100", INI_MAX_PROPERTY_VALUE ); hLastProperty->pszHelp = (char*)strdup( "Port to connect to (some drivers do not use)" ); return 1; } unixODBC-2.3.9/DRVConfig/drvcfg2/0000775000175000017500000000000013725127521013266 500000000000000unixODBC-2.3.9/DRVConfig/drvcfg2/README0000755000175000017500000000253312262474471014076 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver Config for basic file options | +-------------------------------------------------------------+ This is an example of a driver setup which can be called by ODBC Config to allow the driver specific options to be set. This particular example is for File Based data sources. Each driver in /etc/odbcinst.ini should have a Setup entry such as; Setup = /usr/lib/libodbcminiS.so This will allow ODBCConfig to prompt for Data Source options. +-------------------------------------------------------------+ | Peter Harvey | | pharvey@codebydesign.com | | http://www.genix.net/unixODBC | | 10.APR.99 | +-------------------------------------------------------------+ unixODBC-2.3.9/DRVConfig/drvcfg2/ChangeLog0000755000175000017500000000012112262474471014757 000000000000001999-04-10 Peter Harvey * All: Created ChangeLog unixODBC-2.3.9/DRVConfig/drvcfg2/drvcfg2.c0000755000175000017500000000212412262474471014713 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 18.FEB.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /********************************************** * HELP **********************************************/ /********************************************** * STATIC LOOKUP VALUES **********************************************/ int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; strncpy( hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); return 1; } unixODBC-2.3.9/DRVConfig/drvcfg2/Makefile.in0000664000175000017500000005240413725127174015264 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/drvcfg2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbcdrvcfg2S_la_LIBADD = am_libodbcdrvcfg2S_la_OBJECTS = drvcfg2.lo libodbcdrvcfg2S_la_OBJECTS = $(am_libodbcdrvcfg2S_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcdrvcfg2S_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcdrvcfg2S_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcdrvcfg2S_la_SOURCES) DIST_SOURCES = $(libodbcdrvcfg2S_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs ChangeLog README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbcdrvcfg2S.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcdrvcfg2S_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcdrvcfg2S_la_SOURCES = drvcfg2.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/drvcfg2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/drvcfg2/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcdrvcfg2S.la: $(libodbcdrvcfg2S_la_OBJECTS) $(libodbcdrvcfg2S_la_DEPENDENCIES) $(EXTRA_libodbcdrvcfg2S_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcdrvcfg2S_la_LINK) -rpath $(libdir) $(libodbcdrvcfg2S_la_OBJECTS) $(libodbcdrvcfg2S_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drvcfg2.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/drvcfg2/Makefile.am0000755000175000017500000000031212262756024015240 00000000000000lib_LTLIBRARIES = libodbcdrvcfg2S.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcdrvcfg2S_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcdrvcfg2S_la_SOURCES = drvcfg2.c unixODBC-2.3.9/DRVConfig/Makefile.in0000664000175000017500000004740313725127174013732 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = drvcfg1 drvcfg2 PostgreSQL MiniSQL MySQL nn esoob \ oplodbc template tds txt Oracle sapdb Mimer am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @DRIVERC_TRUE@SUBDIRS = \ @DRIVERC_TRUE@ drvcfg1 \ @DRIVERC_TRUE@ drvcfg2 \ @DRIVERC_TRUE@ PostgreSQL \ @DRIVERC_TRUE@ MiniSQL \ @DRIVERC_TRUE@ MySQL \ @DRIVERC_TRUE@ nn \ @DRIVERC_TRUE@ esoob \ @DRIVERC_TRUE@ oplodbc \ @DRIVERC_TRUE@ template \ @DRIVERC_TRUE@ tds \ @DRIVERC_TRUE@ txt \ @DRIVERC_TRUE@ Oracle \ @DRIVERC_TRUE@ sapdb \ @DRIVERC_TRUE@ Mimer all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/nn/0000775000175000017500000000000013725127521012344 500000000000000unixODBC-2.3.9/DRVConfig/nn/README0000755000175000017500000000210012262474472013143 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver Config for the Internet News Server (NN) driver | +-------------------------------------------------------------+ This is a driver setup which can be called by ODBC Config to allow the driver specific options to be set for the internet News Server (NN) ODBC driver. Each driver in /etc/odbcinst.ini should have a Setup entry such as; Setup = /usr/lib/libodbcnnS.so This will allow ODBCConfig to prompt for Data Source options. +-------------------------------------------------------------+ | Peter Harvey pharvey@codebydesign.com | | http://www.genix.net/unixODBC | +-------------------------------------------------------------+ unixODBC-2.3.9/DRVConfig/nn/drvcfg.c0000755000175000017500000000212512262474472013711 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 13.MAY.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include static const char *aServer[] = { "localhost", /* put some public news servers here */ NULL }; int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) { hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; hLastProperty->aPromptData = malloc( sizeof( aServer ) ); memcpy( hLastProperty->aPromptData, aServer, sizeof( aServer ) ); strncpy( hLastProperty->szName, "Server", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); return 1; } unixODBC-2.3.9/DRVConfig/nn/Makefile.in0000664000175000017500000005221313725127174014340 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DRVConfig/nn ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbcnnS_la_LIBADD = am_libodbcnnS_la_OBJECTS = drvcfg.lo libodbcnnS_la_OBJECTS = $(am_libodbcnnS_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcnnS_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libodbcnnS_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcnnS_la_SOURCES) DIST_SOURCES = $(libodbcnnS_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbcnnS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcnnS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcnnS_la_SOURCES = drvcfg.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DRVConfig/nn/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DRVConfig/nn/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcnnS.la: $(libodbcnnS_la_OBJECTS) $(libodbcnnS_la_DEPENDENCIES) $(EXTRA_libodbcnnS_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcnnS_la_LINK) -rpath $(libdir) $(libodbcnnS_la_OBJECTS) $(libodbcnnS_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drvcfg.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DRVConfig/nn/Makefile.am0000755000175000017500000000027212262756030014320 00000000000000lib_LTLIBRARIES = libodbcnnS.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcnnS_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module libodbcnnS_la_SOURCES = drvcfg.c unixODBC-2.3.9/DRVConfig/Makefile.am0000755000175000017500000000024513273035514013705 00000000000000if DRIVERC SUBDIRS = \ drvcfg1 \ drvcfg2 \ PostgreSQL \ MiniSQL \ MySQL \ nn \ esoob \ oplodbc \ template \ tds \ txt \ Oracle \ sapdb \ Mimer endif unixODBC-2.3.9/vmsbuild.com0000755000175000017500000002265312262474476012437 00000000000000$! vmsbuild.com -- DCL procedure to build unixODBC on OpenVMS $! $ say := "write sys$OUTPUT" $ whoami = f$parse(f$environment("PROCEDURE"),,,,"NO_CONCEAL") $ cwd = f$parse(whoami,,,"DEVICE") + f$parse(whoami,,,"DIRECTORY") - ".][000000]" - "][" - ".]" - "]" + "]" $ set default 'cwd' $! $ basedir = cwd - "]" $ define/translation=concealed ODBCSRC "''basedir'.]" $! $ if p1 .eqs. "" then $goto ERR_NOPARAMS $! $ includes = "ODBCSRC:[include],ODBCSRC:[extras],""/ODBCSRC/libltdl""" $! /first_include requires CC 6.4 or later but avoids impossibly long /define qualifier $ CFLAGS="/names=as_is/prefix=all/include=(" + includes + ")/first_include=(ODBCSRC:[include]vmsconfig.h) $ LFLAGS="/nodebug/notrace" $! $ if p2 .eqs. "DEBUG" $ then $ CFLAGS = CFLAGS + "/noopt/debug" $ LFLAGS = LFLAGS + "/debug/trace" $ endif $! $ if p1 .eqs. "CLEAN" $ then $ set default 'cwd' $ d = f$parse(whoami,,,"DEVICE") + f$parse(whoami,,,"DIRECTORY") - ".][000000]" - "][" - ".]" - "]" + "]" $ say "Removing all object files and listings" $ delete/noconfirm [...]*.obj;*, *.lis;* $ say "Removing all object libraries and linker maps" $ delete/noconfirm [...]*.olb;*, *.map;* $ goto all_done $ endif $! $ if p1 .eqs. "COMPILE" .or. p1 .eqs. "ALL" $ then $ say "Compiling unixODBC" $ if f$search("ODBCSRC:[vms]libodbcinst.olb") .eqs. "" then library/create ODBCSRC:[vms]libodbcinst.olb $ if f$search("ODBCSRC:[vms]libodbc.olb") .eqs. "" then library/create ODBCSRC:[vms]libodbc.olb $ if f$search("ODBCSRC:[vms]libodbcpsql.olb") .eqs. "" then library/create ODBCSRC:[vms]libodbcpsql.olb $ call create_vmsconfig_h $ call compile "ODBCSRC:[extras]" "*.c" "ODBCSRC:[vms]libodbcinst.olb" "ODBCSRC:[vms]libodbc.olb" $ call compile "ODBCSRC:[ini]" "*.c" "ODBCSRC:[vms]libodbcinst.olb" "ODBCSRC:[vms]libodbc.olb" $ call compile "ODBCSRC:[log]" "*.c" "ODBCSRC:[vms]libodbcinst.olb" $ call compile "ODBCSRC:[lst]" "*.c" "ODBCSRC:[vms]libodbcinst.olb" "ODBCSRC:[vms]libodbc.olb" $ call compile "ODBCSRC:[odbcinst]" "*.c" "ODBCSRC:[vms]libodbcinst.olb" $ call compile "ODBCSRC:[drivermanager]" "*.c" "ODBCSRC:[vms]libodbc.olb" $ call compile "ODBCSRC:[exe]" "*.c" $ if f$getdvi("ODBCSRC:", "ACPTYPE") .eqs. "F11V5" $ then $ set process/parse=extended $ call compile "ODBCSRC:[Drivers.Postgre7^.1]" "*.c" "ODBCSRC:[vms]libodbcpsql.olb" $ else $ call compile "ODBCSRC:[Drivers.Postgre7_1]" "*.c" "ODBCSRC:[vms]libodbcpsql.olb" $ endif $ set default 'cwd' $! $ endif $! $ if f$trnlnm("ODBC_LIBDIR").eqs."" $ then $ if f$search("ODBCSRC:[000000]odbclib.dir") .eqs. "" $ then $ create/directory/log ODBCSRC:[odbclib] $ endif $ libdir = f$parse("ODBCSRC:[odbclib]",,,,"NO_CONCEAL") -".][000000"-"]["-"].;"+"]" $ define/process ODBC_LIBDIR 'libdir' $ say "Defining ODBC_LIBDIR as """ + f$trnlnm("ODBC_LIBDIR") + """ $ else $ if f$search("ODBC_LIBDIR") .eqs. "" $ then $ create/directory/log ODBC_LIBDIR $ endif $ endif $! $! Build Shared objects $! $ if p1 .eqs. "LINK" .or. p1 .eqs. "ALL" $ then $ set default ODBCSRC:[vms] $! $ say "Linking libodbcinst.exe" $ link 'LFLAGS' libodbcinst.olb/library,odbcinst_axp.opt/opt/share=libodbcinst.exe $! $ say "Linking libodbc.exe" $ link 'LFLAGS' libodbc.olb/library,odbc_axp.opt/opt/share=libodbc.exe $! $! The following kludge brought to you by the fact that on ODS-5 disks the C compiler $! may create module names in upper or mixed case depending on how the archive was $! unpacked. Try lower case and if it's not there, assume uppper case. $! $ module = "psqlodbc" $ module_exists == 0 $ call check_module "''module'" "libodbcpsql.olb" $ if .not. module_exists then module = f$edit(module,"UPCASE") $! $ say "Linking libodbcpsql.exe" $ link 'LFLAGS' libodbcpsql.olb/library/include="''module'",odbc2_axp.opt/opt/share=libodbcpsql.exe $! $ set default ODBCSRC:[exe] $ say "Linking isql.exe, dltest.exe and odbc-config.exe" $ link 'LFLAGS' isql.OBJ,SYS$INPUT/OPT ODBCSRC:[vms]libodbc.exe/SHARE $ eod $! $ link 'LFLAGS' dltest.OBJ,ODBCSRC:[vms]libodbcinst.olb/library $ link 'LFLAGS' odbc-config.OBJ $ endif $! $ if p1 .eqs. "INSTALL" .or. p1 .eqs. "ALL" $ then $! $ copy/log ODBCSRC:[vms]libodbc*.exe ODBC_LIBDIR: $ copy/log ODBCSRC:[vms]odbc_setup.com ODBC_LIBDIR: $ copy/log ODBCSRC:[exe]isql.exe ODBC_LIBDIR: $ copy/log ODBCSRC:[exe]dltest.exe ODBC_LIBDIR: $ copy/log ODBCSRC:[exe]odbc-config.exe ODBC_LIBDIR: $! $! check for odbc.ini and odbcinst.ini in ODBC_LIBDIR $! $ file = f$search ("ODBC_LIBDIR:odbc.ini") $ if file .eqs. "" $ then $ say "Creating ODBC_LIBDIR:odbc.ini" $ create ODBC_LIBDIR:odbc.ini $ endif $! $ file = f$search ("ODBC_LIBDIR:odbcinst.ini") $ if file .eqs. "" $ then $ say "Creating ODBC_LIBDIR:odbcinst.ini" $ create ODBC_LIBDIR:odbcinst.ini $ endif $! $ set file ODBC_LIBDIR:*.*/protection=(w:re) $ endif $! $ all_done: $ set default 'cwd' $ exit (1) $! $ ERR_NOPARAMS: $ say " " $ say "The correct calling sequence is: " $ say " " $ say "$ @vmsbuild p1 [p2] $ say " " $ say "Where p1 is : " $ say " " $ say " ALL : COMPILE LINK, and INSTALL steps." $ say " CLEAN : Remove all objects and object libraries." $ say " COMPILE : Compile all source and produce object libraries" $ say " LINK : Create shareable images" $ say " INSTALL : Copy shareable images to ODBC_LIBDIR:" $ say " " $ say "and DEBUG may optionally be specified for p2 when p1 is COMPILE, LINK, or ALL" $ say " " $ exit 44 $! $! compile subroutine will compile all p2 source files $! and place the resulting object files in libraries $! specified as p3 and/or p4 $! $ compile : subroutine $ set default 'p1' $ loop: $ file = f$search ("''p2'",1) $ if file .eqs. "" then goto complete $ filename = f$parse (file,,,"name") $ if f$edit(filename,"UPCASE") .eqs. "INIOS2PROFILE" then goto loop $ object = F$SEARCH ("''filename'.OBJ;*",2) $ if object .eqs. "" $ then $ say "cc" + CFLAGS + " ''filename'.c" $ on warning then continue $ cc 'CFLAGS' 'filename' $! keep module names upper case to avoid insanity on ODS-5 volumes $ if p3 .nes. "" then library/replace/log 'p3' 'f$edit(filename,"UPCASE")' $ if p4 .nes. "" then library/replace/log 'p4' 'f$edit(filename,"UPCASE")' $ endif $ goto loop $ complete: $ set default 'cwd' $ exit $ endsubroutine ! compile $ $! $ create_vmsconfig_h : subroutine $! $ SEARCH/KEY=(POS:2,SIZE:8) ODBCSRC:[000000]CONFIGURE. "VERSION="/EXACT/OUTPUT=version.tmp $ open/read version version.tmp $ read version versionline $ close version $ delete/noconfirm/nolog version.tmp;* $ versionstring = f$element(1, "=", f$edit(versionline, "COLLAPSE")) $! $ if f$search("ODBCSRC:[include]vmsconfig.h") .nes. "" then delete/noconfirm/nolog ODBCSRC:[include]vmsconfig.h;* $ open/write vmsconfig ODBCSRC:[include]vmsconfig.h $ write vmsconfig "/* auto-generated definitions for VMS port */ $ write vmsconfig "#define UNIXODBC" $ write vmsconfig "#define HAVE_PWD_H 1" $ write vmsconfig "#if __VMS_VER >= 70000000" $ write vmsconfig "#define HAVE_STRCASECMP" $ write vmsconfig "#define HAVE_STRNCASECMP" $ write vmsconfig "#define HAVE_STDARG_H" $ write vmsconfig "#define HAVE_STDLIB_H" $ write vmsconfig "#define HAVE_STRING_H" $ write vmsconfig "#define HAVE_STRINGS_H" $ write vmsconfig "#define HAVE_DTIME" $ write vmsconfig "#define HAVE_SYS_TIME_H" $ write vmsconfig "#define HAVE_GETTIMEOFDAY" $ write vmsconfig "#define HAVE_UNISTD_H" $ write vmsconfig "#endif" $ write vmsconfig "#define SIZEOF_LONG_INT 4" $ write vmsconfig "#define UNIXODBC_SOURCE" $ write vmsconfig "#define readonly __readonly" $ write vmsconfig "#define DEFLIB_PATH ""ODBC_LIBDIR:[LIB]""" $ write vmsconfig "#define SYSTEM_LIB_PATH ""ODBC_LIBDIR:[LIB]""" $ write vmsconfig "#define SHLIBEXT "".exe""" $ write vmsconfig "#define VERSION ""''versionstring'""" $ write vmsconfig "#define PREFIX ""ODBC_LIBDIR:""" $ write vmsconfig "#define EXEC_PREFIX ""ODBC_LIBDIR:[BIN]""" $ write vmsconfig "#define BIN_PREFIX ""ODBC_LIBDIR:[BIN]""" $ write vmsconfig "#define INCLUDE_PREFIX ""ODBC_LIBDIR:[INCLUDE]""" $ write vmsconfig "#define LIB_PREFIX ""ODBC_LIBDIR:[ETC]""" $ write vmsconfig "#define SYSTEM_FILE_PATH ""ODBC_LIBDIR:[ETC]""" $ write vmsconfig "char* getvmsenv (char* symbol);" $ close vmsconfig $! $ if f$search("ODBCSRC:[include]unixodbc_conf.h") .nes. "" then delete/noconfirm/nolog ODBCSRC:[include]unixodbc_conf.h;* $ open/write unixodbcconfig ODBCSRC:[include]unixodbc_conf.h $ write unixodbcconfig "/* auto-generated definitions for VMS port */ $ write unixodbcconfig "#ifndef HAVE_PWD_H" $ write unixodbcconfig " #define HAVE_PWD_H" $ write unixodbcconfig "#endif" $ write unixodbcconfig "#ifndef SIZEOF_LONG_INT" $ write unixodbcconfig " #define SIZEOF_LONG_INT 8" $ write unixodbcconfig "#endif" $ close unixodbcconfig $ if f$search("ODBCSRC:[include]config.h") .nes. "" then delete/noconfirm/nolog ODBCSRC:[include]config.h;* $ open/write config_h ODBCSRC:[include]config.h $ write config_h "/* The real stuff is in vmsconfig.h */ $ close config_h $ exit $ endsubroutine ! create_vmsconfig_h $! $ check_module : subroutine $! Check for presence of a particular module in an object library. $! p1: module name, p2: object library $ set noon $ define/user_mode sys$output nl: $ define/user_mode sys$error nl: $ library/list/only="''p1'" 'p2' $ if .not. $status $ then $! probably LBR$_KEYNOTFND; defer other errors until link time $ module_exists == 0 $ else $ module_exists == 1 $ endif $ set on $ exit $ endsubroutine ! check_module unixODBC-2.3.9/configure.ac0000664000175000017500000004243013725127156012365 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([unixODBC], [2.3.9], nick@unixodbc.org, [unixODBC]) AM_INIT_AUTOMAKE dnl Checks for programs. AC_PROG_AWK AC_PROG_YACC AC_PROG_CPP AC_PROG_CC AM_PROG_LEX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_CONFIG_MACRO_DIR([m4]) AC_DISABLE_STATIC dnl Check if we want to worry about threads AC_ARG_ENABLE( threads, [ --enable-threads build with thread support [default=yes]], [ case "${enableval}" in yes) thread=true ;; no) thread=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-thread) ;; esac],[thread=true]) AC_ARG_ENABLE( gnuthreads, [ --enable-gnuthreads build with gnu threads support [default=no]], [ case "${enableval}" in yes) gnuthread=true ;; no) gnuthread=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-gnuthread) ;; esac],[gnuthread=false]) AC_ARG_ENABLE( readline, [ --enable-readline build with readline support [default=yes]], [ case "${enableval}" in yes) readline=true ;; no) readline=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-readline) ;; esac],[readline=true]) AC_ARG_ENABLE( editline, [ --enable-editline build with editline support [default=no]], [ case "${enableval}" in yes) editline=true ;; no) editline=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-editline) ;; esac],[editline=false]) AC_ARG_ENABLE( inicaching, [ --enable-inicaching build with ini file caching support [default=yes]], [ case "${enableval}" in yes) inicaching=true ;; no) inicaching=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-inicaching) ;; esac],[inicaching=true]) dnl Check if we want to build the drivers AC_ARG_ENABLE( drivers, [ --enable-drivers build included drivers [default=no]], [ case "${enableval}" in yes) drivers=true ;; no) drivers=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-drivers) ;; esac],[drivers=false]) dnl Check if we want to build the driver config AC_ARG_ENABLE( driverc, [ --enable-driver-conf build included driver config libs [default=no]], [ case "${enableval}" in yes) driverc=true ;; no) driverc=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-driver-conf) ;; esac],[driverc=false]) AC_ARG_ENABLE( fastvalidate, [ --enable-fastvalidate use relaxed handle checking in the DM [default=no]], [ case "${enableval}" in yes) fastvalidate=true ;; no) fastvalidate=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-fastvalidate) ;; esac],[fastvalidate=false]) AC_ARG_ENABLE( iconv, [ --enable-iconv build with iconv support [default=yes]], [ case "${enableval}" in yes) iconv=true ;; no) iconv=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-iconv) ;; esac],[iconv=true]) dnl Check for sys/sem.h AC_CHECK_HEADERS(sys/sem.h, semh=true, semh=false) AC_ARG_ENABLE( stats, [ --enable-stats build with statistic gathering support [default=no]], [ case "${enableval}" in yes) if test "x$semh" = "xfalse"; then AC_MSG_ERROR(stats enabled but required header was not found) fi stats=true ;; no) stats=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-stats) ;; esac],[stats=false]) stats_ftok_name="odbc.ini" AC_ARG_WITH(stats_ftok_name, [ --with-stats-ftok-name=filename Filename to get IPC ID for stats gathering [default=odbc.ini]], stats_ftok_name="$withval" ) STATS_FTOK_NAME="$stats_ftok_name" AC_SUBST(STATS_FTOK_NAME) AC_DEFINE_UNQUOTED([STATS_FTOK_NAME],"$STATS_FTOK_NAME",[Filename to use for ftok]) AC_ARG_ENABLE( setlibversion, [ --enable-setlibversion build with VERS set in libraries [default=no]], [ case "${enableval}" in yes) setlibversion=true ;; no) setlibversion=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-setlibversion) ;; esac],[setlibversion=false]) AC_ARG_ENABLE( handlemap, [ --enable-handlemap driver manager can map driver handles called back from broken drivers [default=no]], [ case "${enableval}" in yes) handlemap=true ;; no) handlemap=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-handlemap) ;; esac],[handlemap=false]) AC_ARG_ENABLE( stricterror, [ --enable-stricterror error conform to the MS spec, the unixODBC prefix is removed for driver errors [default=yes]], [ case "${enableval}" in yes) stricterror=true ;; no) stricterror=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-stricterror) ;; esac],[stricterror=true]) AC_ARG_ENABLE( gui, [ --enable-gui only included for backwards compatibility, gui now in its own project, see ChangeLog], [ case "${enableval}" in *) ;; esac]) dnl Enable building of the convenience library dnl and set LIBLTDL accordingly INCLTDL="" LIBLTDL="" AC_LIBTOOL_WIN32_DLL dnl AC_PROG_LIBTOOL dnl AC_CONFIG_MACRO_DIR([libltdl/m4]) dnl LT_CONFIG_LTDL_DIR([libltdl]) dnl LTDL_INIT LT_CONFIG_LTDL_DIR([libltdl]) LT_INIT([dlopen]) LTDL_INIT([convenience]) dnl Substitute INCLTDL and LIBLTDL in the Makefiles AC_SUBST(LTDLINCL) AC_SUBST(LIBLTDL) #dnl Find shared lib extension #AC_MSG_CHECKING(for shared lib extension) #SHLIBEXT="$shrext_cmds" #AC_MSG_RESULT($shrext_cmds) #AC_SUBST(SHLIBEXT) dnl Find shared lib extension AC_MSG_CHECKING(for shared lib extension) eval "SHLIBEXT=$shrext_cmds" AC_MSG_RESULT($SHLIBEXT) AC_SUBST(SHLIBEXT,$SHLIBEXT) AC_DEFINE_UNQUOTED([SHLIBEXT], "$shrext_cmds", [Shared lib extension]) AC_DEFINE_DIR([DEFLIB_PATH], [libdir], [Lib directory]) AC_DEFINE_DIR([LIB_PREFIX], [libdir], [Lib directory]) AC_DEFINE_DIR([SYSTEM_FILE_PATH], [sysconfdir], [System file path]) AC_DEFINE_DIR([SYSTEM_LIB_PATH], [libdir], [Lib path]) AC_DEFINE_DIR([PREFIX], [prefix], [Install prefix]) AC_DEFINE_DIR([EXEC_PREFIX], [exec_prefix], [Install exec_prefix]) AC_DEFINE_DIR([BIN_PREFIX], [bindir], [Install bindir]) AC_DEFINE_DIR([INCLUDE_PREFIX], [includedir], [Install includedir]) AC_DEFINE([UNIXODBC], [], [Flag that we are not using another DM]) if test "x$iconv" = "xtrue"; then AM_ICONV iconv_char_enc="auto-search" AC_ARG_WITH(iconv_char_enc, [ --with-iconv-char-enc=enc Encoding to use as ASCII [default=auto-search] ], iconv_char_enc="$withval" ) ICONV_CHAR_ENCODING="$iconv_char_enc" iconv_ucode_enc="auto-search" AC_ARG_WITH(iconv_ucode_enc, [ --with-iconv-ucode-enc=enc Encoding to use as UNICODE [default=auto-search] ], iconv_ucode_enc="$withval" ) ICONV_CHAR_ENCODING="" ICONV_UNICODE_ENCODING="" if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING( for encoding to use for CHAR representations ); ICONV_CHAR_ENCODING="$iconv_char_enc" AC_MSG_RESULT( $iconv_char_enc ); AC_MSG_CHECKING( for encoding to use for UNICODE representations ); ICONV_UNICODE_ENCODING="$iconv_ucode_enc" AC_MSG_RESULT( $iconv_ucode_enc ); fi AC_SUBST(ICONV_CHAR_ENCODING) AC_SUBST(ICONV_UNICODE_ENCODING) AC_DEFINE_UNQUOTED([UNICODE_ENCODING],"$ICONV_UNICODE_ENCODING",[Encoding to use for UNICODE]) AC_DEFINE_UNQUOTED([ASCII_ENCODING],"$ICONV_CHAR_ENCODING",[Encoding to use for CHAR]) AC_ARG_ENABLE( iconvperdriver, [ --enable-iconvperdriver build with iconv support per driver [default=no]], [ case "${enableval}" in yes) iconvperdriver=true ;; no) iconvperdriver=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-iconvperdriver) ;; esac],[iconvperdriver=false]) AC_MSG_CHECKING( Are we using per driver iconv ) if test "x$iconvperdriver" = "xtrue"; then AC_DEFINE([ENABLE_DRIVER_ICONV],[],[Using perdriver iconv]) AC_MSG_RESULT( yes ); else AC_MSG_RESULT( no ); fi fi dnl Checks for libraries. AC_CHECK_LIB(crypt, crypt, [ AC_DEFINE([HAVE_LIBCRYPT], [], [Add -lcrypt to lib list]) LIBADD_CRYPT="-lcrypt" ]) AC_SUBST(LIBADD_CRYPT) AC_CHECK_LIB(m, pow, [ LIBADD_POW="-lm" ], ) AC_SUBST(LIBADD_POW) have_editline="no" if test "x$editline" = "xtrue"; then AC_CHECK_LIB_NOC(edit, readline, [ READLINE=-ledit have_editline="yes" ], [ dnl try with -lcurses AC_CHECK_LIB_NOC(edit, readline, [ READLINE="-ledit -lcurses" have_editline="yes" ], [ ], -lcurses ) ]) if test "x$have_editline" = "xyes"; then AC_CHECK_HEADERS(editline/readline.h, [AC_DEFINE([HAVE_EDITLINE], [1], [Add editline support])]) readline=false fi fi have_readline="no" if test "x$readline" = "xtrue"; then AC_CHECK_LIB_NOC(readline, readline, [ READLINE=-lreadline have_readline="yes" ], [ dnl try with -lcurses AC_CHECK_LIB_NOC(readline, readline, [ READLINE="-lreadline -lcurses" have_readline="yes" ], [ ], -lcurses ) ]) if test "x$have_readline" = "xyes"; then AC_CHECK_HEADERS(readline/history.h, [AC_DEFINE([HAVE_READLINE], [1], [Add readline support])]) fi fi AC_SUBST(READLINE) AC_MSG_CHECKING( Are we using ini caching ) if test "x$inicaching" = "xtrue"; then AC_DEFINE([ENABLE_INI_CACHING],[],[Using ini cacheing]) AC_MSG_RESULT( yes ); else AC_MSG_RESULT( no ); fi dnl Are we using flex if test "x$drivers" = "xtrue"; then AC_MSG_CHECKING( Are we using flex ) if test "x$LEX" = "xflex"; then LFLAGS="$LFLAGS -i" AC_MSG_RESULT( yes ); AC_CHECK_LIB(c, scandir, [AC_DEFINE([HAVE_SCANDIR], [1], [Use the scandir lib])] ) else AC_MSG_RESULT( no - text driver disabled ); fi AM_CONDITIONAL(HAVE_FLEX, test "x$LEX" = "xflex" ) AC_SUBST(LFLAGS) else AM_CONDITIONAL(HAVE_FLEX, test "xabc" = "xdef" ) fi case $host_os in *qnx* ) qnx="true" AC_DEFINE([QNX_LIBLTDL],[],[Using QNX]) ;; esac dnl check how time() can be used AC_HEADER_TIME AC_CHECK_HEADERS(sys/time.h) AC_CHECK_SIZEOF(long, 4) AC_MSG_CHECKING([if platform is 64 bit]) if test "$ac_cv_sizeof_long" = "8"; then AC_MSG_RESULT( Yes ); AC_DEFINE([PLATFORM64],[],[Platform is 64 bit]) else AC_MSG_RESULT( No ); fi AC_CHECK_LONG_LONG AC_CHECK_SIZEOF([long int]) AC_CHECK_TYPES([ptrdiff_t]) AC_CHECK_FUNCS( strcasecmp strncasecmp vsnprintf strtol atoll strtoll endpwent gettimeofday ftime time stricmp strnicmp getuid getpwuid nl_langinfo ) AM_LANGINFO_CODESET LIBADD_DL= AC_SUBST(LIBADD_DL) THREADLIB="" if test "x$thread" = "xtrue"; then if test "x$gnuthread" = "xtrue"; then AC_CHECK_PTH( 1.3.0 ) CPPFLAGS="$CPPFLAGS $PTH_CPPFLAGS" CFLAGS="$CFLAGS $PTH_CFLAGS" LDFLAGS="$LDFLAGS $PTH_LDFLAGS" THREADLIB="$PTH_LIBS" AC_DEFINE([HAVE_LIBPTH], [1], [Use the -lpth thread library]) else gotthread="no"; AC_MSG_CHECKING( if os is AIX ) case $host_os in "aix"*) raw_threads="no"; AC_MSG_RESULT( yes - disable check for libthread ); ;; *) raw_threads="yes"; AC_MSG_RESULT( no - enable check for libthread ); ;; esac if test "x$raw_threads" = "xyes"; then AC_CHECK_LIB_NOC(thread, mutex_lock, [ AC_DEFINE([HAVE_LIBTHREAD], [1], [Use the -lthread threading lib]) dnl Check if the compiler will build with -mt as a option, this is a solaris thing AC_CHECK_COMP_OPT(mt) gotthread="yes"; THREADLIB="-lthread" ]) fi if test "x$gotthread" = "xno"; then AC_CHECK_LIBPT_NOC(pthread, pthread_mutex_lock, [ AC_DEFINE([HAVE_LIBPTHREAD], [1], [Use -lpthread threading lib]) gotthread="yes"; THREADLIB="-lpthread" if test "x$ac_cv_prog_gcc" = "xyes"; then dnl Check if the compiler will build with -pthread as a option AC_CHECK_COMP_OPT(pthread) else dnl Check if the compiler will build with -mt as a option AC_CHECK_COMP_OPT(mt) fi ]) fi if test "x$gotthread" = "xno"; then AC_CHECK_LIBPT_NOC(c, pthread_mutex_lock, [ AC_DEFINE(HAVE_LIBPTHREAD,1) gotthread="yes"; THREADLIB="" if test "x$ac_cv_prog_gcc" = "xyes"; then dnl Check if the compiler will build with -pthread as a option AC_CHECK_COMP_OPT(pthread) else dnl Check if the compiler will build with -mt as a option AC_CHECK_COMP_OPT(mt) fi ]) fi if test "x$gotthread" = "xno"; then if test "x$ac_cv_prog_gcc" = "xyes"; then dnl This is for freebsd that needs -lpthread before it finds the lib AC_CHECK_COMP_OPT(pthread) AC_CHECK_LIBPT_NOC(c, pthread_mutex_lock, [ AC_DEFINE(HAVE_LIBPTHREAD,1) THREADLIB="-pthread -lc_r" gotthread="yes"; ]) fi fi dnl Check for AIX if test "x$gotthread" = "xno"; then SAVECFLAGS="$CFLAGS" CFLAGS="$CFLAGS -D_THREAD_SAFE -D_ALL_SOURCE -D_LONG_LONG" AC_CHECK_LIBPT_NOC(pthread, pthread_mutex_lock, [ AC_DEFINE(HAVE_LIBPTHREAD,1) gotthread="yes"; THREADLIB="-lpthread" ]) CFLAGS="$SAVECFLAGS" AC_DEFINE([_THREAD_SAFE],[],[Build flag for AIX]) AC_DEFINE([_ALL_SOURCE],[],[Build flag for AIX]) AC_DEFINE([_LONG_LONG],[],[Build flag for AIX]) fi if test "x$gotthread" = "xyes"; then dnl do not add a -lc because of this save_LIBS=$LIBS AC_CHECK_LIB(c, localtime_r, [AC_DEFINE([HAVE_LOCALTIME_R], [1], [Use rentrant version of localtime] )]) LIBS=$save_LIBS fi fi fi case $host_os in "darwin"*) stats="false" macosx="yes" AC_DEFINE([OSXHEADER],[],[Using OSX]) ;; sysv5Open*) if test "x$THREADLIB" = "x"; then LIBS="$LIBS $THREADLIB" else LIBS="$LIBS -Kthread" fi ;; *) LIBS="$LIBS $THREADLIB" ;; esac if test "x$stats" = "xtrue"; then AC_CHECK_FUNCS( ftok semget shmget semop snprintf,[],[stats=false]) fi if test "x$stats" = "xtrue"; then AC_CHECK_SEMUNDOO AC_DEFINE([COLLECT_STATS], [], [Use a semaphore to allow ODBCConfig to display running counts]) fi AC_ARG_WITH(msql-lib, [ --with-msql-lib=DIR where the root of MiniSQL libs are installed ], msql_libraries="$withval" ) AC_ARG_WITH(msql-include, [ --with-msql-include=DIR where the MiniSQL headers are installed ], msql_headers="$withval" ) AC_SUBST(msql_libraries) AC_SUBST(msql_headers) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(malloc.h unistd.h pwd.h crypt.h limits.h synch.h strings.h string.h locale.h sys/malloc.h sys/types.h sys/sem.h stdarg.h varargs.h sys/time.h sys/timeb.h time.h langinfo.h stddef.h ) INCLUDES="$INCLUDES $USER_INCLUDES"; dnl only build the mSQL code if the headers are in place AC_CHECK_HEADERS(msql.h,[msql=true], [ msql=false; for ac_dir in $kde_extra_includes $msql_headers; do AC_CHECK_HEADERS( $ac_dir/msql.h, [ msql=true; INCLUDES="$INCLUDES $USER_INCLUDES -I$ac_dir"; ]) done ]) dnl AC_SUBST(all_includes) dnl AC_SUBST(all_libraries) AM_CONDITIONAL(MSQL, test "x$msql" = "xtrue" ) AM_CONDITIONAL(DRIVERS, test "x$drivers" = "xtrue" ) AM_CONDITIONAL(DRIVERC, test "x$driverc" = "xtrue" ) AM_CONDITIONAL(QNX, test "x$qnx" = "xtrue" ) AM_CONDITIONAL(WITHLT, test "x$use_builtin_libtool" = "xyes" ) dnl This blows up due to what I think is a bug in automake 1.6.3 dnl AC_SUBST(INCLUDES) if test "x$fastvalidate" = "xtrue"; then AC_DEFINE([FAST_HANDLE_VALIDATE], [], [Disable the precise but slow checking of the validity of handles]) fi if test "x$handlemap" = "xtrue"; then AC_DEFINE([WITH_HANDLE_REDIRECT],[],[Work with IBM drivers that use 32 bit handles on 64 bit platforms]) fi if test "x$stricterror" = "xtrue"; then AC_DEFINE([STRICT_ODBC_ERROR],[],[don't include unixODBC prefix in driver error messages]) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM AC_TYPE_UID_T AC_HEADER_DIRENT dnl Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_VPRINTF AC_CHECK_FUNCS( putenv socket strdup strstr setenv setlocale strchr ) dnl This is the unixODBC source tree AC_DEFINE([UNIXODBC_SOURCE],[],[We are building inside the unixODBC source tree]) LIB_VERSION="2:0:0" AC_SUBST(LIB_VERSION) AC_CONFIG_HEADERS(config.h) AC_CONFIG_HEADERS(unixodbc_conf.h) AC_CONFIG_FILES([ Makefile extras/Makefile log/Makefile lst/Makefile ini/Makefile odbcinst/Makefile odbcinst/odbcinst.pc cur/Makefile cur/odbccr.pc DriverManager/Makefile DriverManager/odbc.pc exe/Makefile DRVConfig/Makefile DRVConfig/drvcfg1/Makefile DRVConfig/drvcfg2/Makefile DRVConfig/PostgreSQL/Makefile DRVConfig/MiniSQL/Makefile DRVConfig/MySQL/Makefile DRVConfig/nn/Makefile DRVConfig/esoob/Makefile DRVConfig/oplodbc/Makefile DRVConfig/template/Makefile DRVConfig/tds/Makefile DRVConfig/txt/Makefile DRVConfig/Oracle/Makefile DRVConfig/sapdb/Makefile DRVConfig/Mimer/Makefile Drivers/Makefile Drivers/Postgre7.1/Makefile Drivers/nn/Makefile Drivers/template/Makefile Drivers/MiniSQL/Makefile include/Makefile man/Makefile doc/Makefile doc/AdministratorManual/Makefile doc/ProgrammerManual/Makefile doc/ProgrammerManual/Tutorial/Makefile doc/UserManual/Makefile doc/lst/Makefile samples/Makefile ]) AC_OUTPUT dnl Attempt to add version information to libraries generated by libtool AC_MSG_CHECKING( are we setting library version ) if test "x$setlibversion" = "xtrue"; then AC_MSG_RESULT( yes ); sed '/archive_expsym_cmds=/s/{ global/VERS_3.52 {global/' < libtool > libtool.tmp; mv libtool.tmp libtool else AC_MSG_RESULT( no ); fi unixODBC-2.3.9/ylwrap0000755000175000017500000001407412262474476011351 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2007-11-22.22 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007 Free Software Foundation, Inc. # # Written by Tom Tromey . # # 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., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: unixODBC-2.3.9/extras/0000775000175000017500000000000013725127520011455 500000000000000unixODBC-2.3.9/extras/strcasecmp.c0000755000175000017500000000202012262474475013711 00000000000000#include #include #include #ifndef HAVE_STRCASECMP int strcasecmp( const char *s1, const char * s2 ) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; if (p1 == p2) return 0; do { c1 = tolower(*p1++); c2 = tolower(*p2++); if (c1 == '\0') break; } while (c1 == c2); return c1 - c2; } #endif #ifndef HAVE_STRNCASECMP int strncasecmp (const char *s1, const char *s2, int n ) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; if (p1 == p2) return 0; do { c1 = tolower(*p1++); c2 = tolower(*p2++); if (c1 == '\0') break; n --; } while (c1 == c2 && n > 0 ); if ( n == 0 ) return 0; return c1 - c2; } #endif void ___extra_func_to_mollify_linker( void ) { } unixODBC-2.3.9/extras/snprintf.c0000644000175000017500000004217013217434321013402 00000000000000/* * Copyright Patrick Powell 1995 * This code is based on code written by Patrick Powell (papowell@astart.com) * It may be used for any purpose as long as this notice remains intact * on all source code distributions */ /************************************************************** * Original: * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 * A bombproof version of doprnt (dopr) included. * Sigh. This sort of thing is always nasty do deal with. Note that * the version here does not include floating point... * * snprintf() is used instead of sprintf() as it does limit checks * for string length. This covers a nasty loophole. * * The other functions are there to prevent NULL pointers from * causing nast effects. * * More Recently: * Brandon Long 9/15/96 for mutt 0.43 * This was ugly. It is still ugly. I opted out of floating point * numbers, but the formatter understands just about everything * from the normal C string format, at least as far as I can tell from * the Solaris 2.5 printf(3S) man page. * * Brandon Long 10/22/97 for mutt 0.87.1 * Ok, added some minimal floating point support, which means this * probably requires libm on most operating systems. Don't yet * support the exponent (e,E) and sigfig (g,G). Also, fmtint() * was pretty badly broken, it just wasn't being exercised in ways * which showed it, so that's been fixed. Also, formated the code * to mutt conventions, and removed dead code left over from the * original. Also, there is now a builtin-test, just compile with: * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm * and run snprintf for results. * * Thomas Roessler 01/27/98 for mutt 0.89i * The PGP code was using unsigned hexadecimal formats. * Unfortunately, unsigned formats simply didn't work. * * Michael Elkins 03/05/98 for mutt 0.90.8 * The original code assumed that both snprintf() and vsnprintf() were * missing. Some systems only have snprintf() but not vsnprintf(), so * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF. * * Andrew Tridgell (tridge@samba.org) Oct 1998 * fixed handling of %.0f * added test for HAVE_LONG_DOUBLE * * Eric Sharkey Dec 2003 * fixed handling of floating point numbers less than 0.1 * * Eric Sharkey Mar 2005 * fixed return value to conform to C99 standard * **************************************************************/ /* XXX Hmm... Perhaps autoconf this up again? */ #include #define HAVE_LONG_DOUBLE #ifdef HAVE_STDDEF_H #include #endif #include #include #ifdef HAVE_SYS_TYPES_H #include #endif #include "uodbc_extras.h" /* varargs declarations: */ #if defined(HAVE_STDARG_H) # include # define VA_LOCAL_DECL va_list ap # define VA_START(f) va_start(ap, f) # define VA_SHIFT(v,t) ; /* no-op for ANSI */ # define VA_END va_end(ap) #else # if defined(HAVE_VARARGS_H) # define VA_LOCAL_DECL va_list ap # define VA_START(f) va_start(ap) /* f is ignored! */ # define VA_SHIFT(v,t) v = va_arg(ap,t) # define VA_END va_end(ap) # else /*XX ** NO VARARGS ** XX*/ # error No variable argument support # endif #endif #ifdef HAVE_LONG_DOUBLE #define LDOUBLE long double #else #define LDOUBLE double #endif /*int snprintf (char *str, size_t count, const char *fmt, ...);*/ /*int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);*/ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args); static void fmtstr (char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, int min, int max); static void fmtint (char *buffer, size_t *currlen, size_t maxlen, long value, int base, int min, int max, int flags); static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int min, int max, int flags); static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c ); /* * dopr(): poor man's version of doprintf */ /* format read states */ #define DP_S_DEFAULT 0 #define DP_S_FLAGS 1 #define DP_S_MIN 2 #define DP_S_DOT 3 #define DP_S_MAX 4 #define DP_S_MOD 5 #define DP_S_CONV 6 #define DP_S_DONE 7 /* format flags - Bits */ #define DP_F_MINUS (1 << 0) #define DP_F_PLUS (1 << 1) #define DP_F_SPACE (1 << 2) #define DP_F_NUM (1 << 3) #define DP_F_ZERO (1 << 4) #define DP_F_UP (1 << 5) #define DP_F_UNSIGNED (1 << 6) /* Conversion Flags */ #define DP_C_SHORT 1 #define DP_C_LONG 2 #define DP_C_LDOUBLE 3 #define char_to_int(p) (p - '0') #define MAX(p,q) ((p >= q) ? p : q) static int dopr (char *buffer, size_t maxlen, const char *format, va_list args) { char ch; long value; LDOUBLE fvalue; char *strvalue; int min; int max; int state; int flags; int cflags; size_t currlen; state = DP_S_DEFAULT; currlen = flags = cflags = min = 0; max = -1; ch = *format++; while (state != DP_S_DONE) { if ((ch == '\0') || (currlen >= maxlen)) state = DP_S_DONE; switch(state) { case DP_S_DEFAULT: if (ch == '%') state = DP_S_FLAGS; else dopr_outch (buffer, &currlen, maxlen, ch); ch = *format++; break; case DP_S_FLAGS: switch (ch) { case '-': flags |= DP_F_MINUS; ch = *format++; break; case '+': flags |= DP_F_PLUS; ch = *format++; break; case ' ': flags |= DP_F_SPACE; ch = *format++; break; case '#': flags |= DP_F_NUM; ch = *format++; break; case '0': flags |= DP_F_ZERO; ch = *format++; break; default: state = DP_S_MIN; break; } break; case DP_S_MIN: if (isdigit((unsigned char)ch)) { min = 10*min + char_to_int (ch); ch = *format++; } else if (ch == '*') { min = va_arg (args, int); ch = *format++; state = DP_S_DOT; } else state = DP_S_DOT; break; case DP_S_DOT: if (ch == '.') { state = DP_S_MAX; ch = *format++; } else state = DP_S_MOD; break; case DP_S_MAX: if (isdigit((unsigned char)ch)) { if (max < 0) max = 0; max = 10*max + char_to_int (ch); ch = *format++; } else if (ch == '*') { max = va_arg (args, int); ch = *format++; state = DP_S_MOD; } else state = DP_S_MOD; break; case DP_S_MOD: /* Currently, we don't support Long Long, bummer */ switch (ch) { case 'h': cflags = DP_C_SHORT; ch = *format++; break; case 'l': cflags = DP_C_LONG; ch = *format++; break; case 'L': cflags = DP_C_LDOUBLE; ch = *format++; break; default: break; } state = DP_S_CONV; break; case DP_S_CONV: switch (ch) { case 'd': case 'i': if (cflags == DP_C_SHORT) /* value = va_arg (args, short int); */ value = va_arg (args, int); else if (cflags == DP_C_LONG) value = va_arg (args, long int); else value = va_arg (args, int); fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); break; case 'o': flags |= DP_F_UNSIGNED; if (cflags == DP_C_SHORT) /* value = va_arg (args, unsigned short int); */ value = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = (long)va_arg (args, unsigned long int); else value = (long)va_arg (args, unsigned int); fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags); break; case 'u': flags |= DP_F_UNSIGNED; if (cflags == DP_C_SHORT) /* value = va_arg (args, unsigned short int); */ value = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = (long)va_arg (args, unsigned long int); else value = (long)va_arg (args, unsigned int); fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); break; case 'X': flags |= DP_F_UP; case 'x': flags |= DP_F_UNSIGNED; if (cflags == DP_C_SHORT) /* value = va_arg (args, unsigned short int); */ value = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = (long)va_arg (args, unsigned long int); else value = (long)va_arg (args, unsigned int); fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags); break; case 'f': if (cflags == DP_C_LDOUBLE) fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); /* um, floating point? */ fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); break; case 'E': flags |= DP_F_UP; case 'e': if (cflags == DP_C_LDOUBLE) fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); break; case 'G': flags |= DP_F_UP; case 'g': if (cflags == DP_C_LDOUBLE) fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); break; case 'c': dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); break; case 's': strvalue = va_arg (args, char *); if (max < 0) max = maxlen; /* ie, no max */ fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); break; case 'p': strvalue = (char*) va_arg (args, void *); #ifdef HAVE_PTRDIFF_T fmtint (buffer, &currlen, maxlen, (ptrdiff_t) strvalue, 16, min, max, flags); #else fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); #endif break; case 'n': if (cflags == DP_C_SHORT) { short int *num; num = va_arg (args, short int *); *num = currlen; } else if (cflags == DP_C_LONG) { long int *num; num = va_arg (args, long int *); *num = (long int)currlen; } else { int *num; num = va_arg (args, int *); *num = currlen; } break; case '%': dopr_outch (buffer, &currlen, maxlen, ch); break; case 'w': /* not supported yet, treat as next char */ ch = *format++; break; default: /* Unknown, skip */ break; } ch = *format++; state = DP_S_DEFAULT; flags = cflags = min = 0; max = -1; break; case DP_S_DONE: break; default: /* hmm? */ break; /* some picky compilers need this */ } } if (currlen < maxlen - 1) buffer[currlen] = '\0'; else buffer[maxlen - 1] = '\0'; return currlen; } static void fmtstr (char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, int min, int max) { int padlen, strln; /* amount to pad */ int cnt = 0; if (value == 0) { value = ""; } for (strln = 0; value[strln]; ++strln); /* strlen */ padlen = min - strln; if (padlen < 0) padlen = 0; if (flags & DP_F_MINUS) padlen = -padlen; /* Left Justify */ while ((padlen > 0) && (cnt < max)) { dopr_outch (buffer, currlen, maxlen, ' '); --padlen; ++cnt; } while (*value && (cnt < max)) { dopr_outch (buffer, currlen, maxlen, *value++); ++cnt; } while ((padlen < 0) && (cnt < max)) { dopr_outch (buffer, currlen, maxlen, ' '); ++padlen; ++cnt; } } /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ static void fmtint (char *buffer, size_t *currlen, size_t maxlen, long value, int base, int min, int max, int flags) { int signvalue = 0; unsigned long uvalue; char convert[20]; int place = 0; int spadlen = 0; /* amount to space pad */ int zpadlen = 0; /* amount to zero pad */ int caps = 0; if (max < 0) max = 0; uvalue = value; if(!(flags & DP_F_UNSIGNED)) { if( value < 0 ) { signvalue = '-'; uvalue = -value; } else if (flags & DP_F_PLUS) /* Do a sign (+/i) */ signvalue = '+'; else if (flags & DP_F_SPACE) signvalue = ' '; } if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ do { convert[place++] = (caps? "0123456789ABCDEF":"0123456789abcdef") [uvalue % (unsigned)base ]; uvalue = (uvalue / (unsigned)base ); } while(uvalue && (place < 20)); if (place == 20) place--; convert[place] = 0; zpadlen = max - place; spadlen = min - MAX (max, place) - (signvalue ? 1 : 0); if (zpadlen < 0) zpadlen = 0; if (spadlen < 0) spadlen = 0; if (flags & DP_F_ZERO) { zpadlen = MAX(zpadlen, spadlen); spadlen = 0; } if (flags & DP_F_MINUS) spadlen = -spadlen; /* Left Justifty */ #ifdef DEBUG_SNPRINTF printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n", zpadlen, spadlen, min, max, place); #endif /* Spaces */ while (spadlen > 0) { dopr_outch (buffer, currlen, maxlen, ' '); --spadlen; } /* Sign */ if (signvalue) dopr_outch (buffer, currlen, maxlen, signvalue); /* Zeros */ if (zpadlen > 0) { while (zpadlen > 0) { dopr_outch (buffer, currlen, maxlen, '0'); --zpadlen; } } /* Digits */ while (place > 0) dopr_outch (buffer, currlen, maxlen, convert[--place]); /* Left Justified spaces */ while (spadlen < 0) { dopr_outch (buffer, currlen, maxlen, ' '); ++spadlen; } } static LDOUBLE abs_val (LDOUBLE value) { LDOUBLE result = value; if (value < 0) result = -value; return result; } static LDOUBLE local_pow10 (int exponent) { LDOUBLE result = 1; while (exponent) { result *= 10; exponent--; } return result; } static long int_round (LDOUBLE value) { long intpart; intpart = (long)value; value = value - intpart; if (value >= 0.5) intpart++; return intpart; } static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int min, int max, int flags) { int signvalue = 0; LDOUBLE ufvalue; char iconvert[20]; char fconvert[20]; int iplace = 0; int fplace = 0; int padlen = 0; /* amount to pad */ int zpadlen = 0; int caps = 0; long intpart; long fracpart; /* * AIX manpage says the default is 0, but Solaris says the default * is 6, and sprintf on AIX defaults to 6 */ if (max < 0) max = 6; ufvalue = abs_val (fvalue); if (fvalue < 0) signvalue = '-'; else if (flags & DP_F_PLUS) /* Do a sign (+/i) */ signvalue = '+'; else if (flags & DP_F_SPACE) signvalue = ' '; #if 0 if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ #endif intpart = (long)ufvalue; /* * Sorry, we only support 9 digits past the decimal because of our * conversion method */ if (max > 9) max = 9; /* We "cheat" by converting the fractional part to integer by * multiplying by a factor of 10 */ fracpart = int_round ((local_pow10 (max)) * (ufvalue - intpart)); if (fracpart >= local_pow10 (max)) { intpart++; fracpart -= local_pow10 (max); } #ifdef DEBUG_SNPRINTF printf("fmtfp: %g %d.%d min=%d max=%d\n", (double)fvalue, intpart, fracpart, min, max); #endif /* Convert integer part */ do { iconvert[iplace++] = (caps? "0123456789ABCDEF":"0123456789abcdef")[intpart % 10]; intpart = (intpart / 10); } while(intpart && (iplace < 20)); if (iplace == 20) iplace--; iconvert[iplace] = 0; /* Convert fractional part */ do { fconvert[fplace++] = (caps? "0123456789ABCDEF":"0123456789abcdef")[fracpart % 10]; fracpart = (fracpart / 10); } while(fplace < max); if (fplace == 20) fplace--; fconvert[fplace] = 0; /* -1 for decimal point, another -1 if we are printing a sign */ padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); zpadlen = max - fplace; if (zpadlen < 0) zpadlen = 0; if (padlen < 0) padlen = 0; if (flags & DP_F_MINUS) padlen = -padlen; /* Left Justifty */ if ((flags & DP_F_ZERO) && (padlen > 0)) { if (signvalue) { dopr_outch (buffer, currlen, maxlen, signvalue); --padlen; signvalue = 0; } while (padlen > 0) { dopr_outch (buffer, currlen, maxlen, '0'); --padlen; } } while (padlen > 0) { dopr_outch (buffer, currlen, maxlen, ' '); --padlen; } if (signvalue) dopr_outch (buffer, currlen, maxlen, signvalue); while (iplace > 0) dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); #ifdef DEBUG_SNPRINTF printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); #endif /* * Decimal point. This should probably use locale to find the correct * char to print out. */ if (max > 0) { dopr_outch (buffer, currlen, maxlen, '.'); while (fplace > 0) dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); } while (zpadlen > 0) { dopr_outch (buffer, currlen, maxlen, '0'); --zpadlen; } while (padlen < 0) { dopr_outch (buffer, currlen, maxlen, ' '); ++padlen; } } static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c) { if (*currlen < maxlen) buffer[(*currlen)] = c; (*currlen)++; } int uodbc_vsnprintf (char *str, size_t count, const char *fmt, va_list args) { int l; str[0] = 0; l=dopr(str, count, fmt, args); return l; } #ifdef HAVE_STDARGS int uodbc_snprintf (char *str,size_t count,const char *fmt,...) #else int uodbc_snprintf (va_alist) va_dcl #endif { int l; #ifndef HAVE_STDARGS char *str; size_t count; char *fmt; #endif VA_LOCAL_DECL; VA_START (fmt); VA_SHIFT (str, char *); VA_SHIFT (count, size_t ); VA_SHIFT (fmt, char *); l=uodbc_vsnprintf(str, count, fmt, ap); VA_END; return l; } unixODBC-2.3.9/extras/vms.c0000755000175000017500000002671312262474475012371 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int error_status = SS$_NORMAL; static char error_buffer[256]; static char getenv_buffer[256]; typedef struct { struct dsc$descriptor_s fnmdes; struct dsc$descriptor_s imgdes; struct dsc$descriptor_s symdes; char filename[NAM$C_MAXRSS]; } vms_dl; int vms_dlsym (vms_dl *, void **, int); void * lt_dlsym (void *, const char *); int lt_dlinit (void) { return 0; } char translate_buffer[NAM$C_MAXRSS+1]; int to_vms_callback(char *name, int type) { strcpy(translate_buffer, name); return 1; } void * lt_dlopen (const char *filename) { /* * Locates and validates a shareable image. If the caller supplies a * path as part of the image name, that's where we look. Note that this * includes cases where the image name is a logical name pointing to a full * file spec including path. If there is no path, we look at wherever the * logical name LTDL_LIBRARY_PATH points (if it exists); it'd normally be a * search list logical defined in lt_dladdsearchdir, so it could point to a * number of places. As a last resort we look in SYS$SHARE. */ vms_dl *dh; int status; struct FAB imgfab; struct NAM imgnam; char defimg[NAM$C_MAXRSS+1]; char *defpath; char local_fspec[NAM$C_MAXRSS+1]; if (filename == NULL) { error_status = SS$_UNSUPPORTED; return NULL; } strcpy(local_fspec, filename); /* * The driver manager will handle a hard-coded path from a .ini file, but * only if it's an absolute path in unix syntax. To make those acceptable * to lib$find_image_symbol, we have to convert to VMS syntax. N.B. Because * of the static buffer, this is not thread-safe, but copying immediately to * local storage should limit the damage. */ if (filename[0] == '/') { int num_translated = decc$to_vms(local_fspec, to_vms_callback, 0, 1); if (num_translated == 1) strcpy(local_fspec, translate_buffer); } dh = (vms_dl *)malloc (sizeof (vms_dl)); memset( dh, 0, sizeof(vms_dl) ); if (dh == NULL) { error_status = SS$_INSFMEM; return NULL; } imgfab = cc$rms_fab; imgfab.fab$l_fna = local_fspec; imgfab.fab$b_fns = (int) strlen (local_fspec); imgfab.fab$w_ifi = 0; /* If the logical name LTDL_LIBRARY_PATH does not exist, we'll depend * on the image name being a logical name or on the image residing in * SYS$SHARE. */ if ( getvmsenv("LTDL_LIBRARY_PATH") == NULL ) { strcpy( defimg, ".EXE" ); } else { strcpy( defimg, "LTDL_LIBRARY_PATH:.EXE" ); } imgfab.fab$l_dna = defimg; imgfab.fab$b_dns = strlen(defimg); imgfab.fab$l_fop = FAB$M_NAM; imgfab.fab$l_nam = &imgnam; imgnam = cc$rms_nam; imgnam.nam$l_esa = dh->filename; imgnam.nam$b_ess = NAM$C_MAXRSS; status = sys$parse (&imgfab); if (!($VMS_STATUS_SUCCESS(status))) { /* No luck with LTDL_LIBRARY_PATH; try SYS$SHARE */ strcpy( defimg, "SYS$SHARE:.EXE" ); imgfab.fab$b_dns = strlen(defimg); status = sys$parse (&imgfab); if (!($VMS_STATUS_SUCCESS(status))) { error_status = status; return NULL; } } dh->fnmdes.dsc$b_dtype = DSC$K_DTYPE_T; dh->fnmdes.dsc$b_class = DSC$K_CLASS_S; dh->fnmdes.dsc$a_pointer = imgnam.nam$l_name; dh->fnmdes.dsc$w_length = imgnam.nam$b_name; dh->imgdes.dsc$b_dtype = DSC$K_DTYPE_T; dh->imgdes.dsc$b_class = DSC$K_CLASS_S; dh->imgdes.dsc$a_pointer = dh->filename; dh->imgdes.dsc$w_length = imgnam.nam$b_esl; /* ** Attempt to load a symbol at this stage to ** validate that the shared file can be loaded */ lt_dlsym (dh, "Fake_Symbol_Name"); if (!((error_status ^ LIB$_KEYNOTFOU) & ~7)) error_status = SS$_NORMAL; if (!($VMS_STATUS_SUCCESS(error_status))) { free (dh); return NULL; } return dh; } int lt_dlclose (void *handle) { free (handle); return 0; } void * lt_dlsym (void *handle, const char *name) { vms_dl *dh; void *ptr; int status, flags; dh = (vms_dl *)handle; if (!dh) return NULL; dh->symdes.dsc$b_dtype = DSC$K_DTYPE_T; dh->symdes.dsc$b_class = DSC$K_CLASS_S; dh->symdes.dsc$a_pointer = (char *) name; dh->symdes.dsc$w_length = strlen (name); /* firstly attempt with flags set to 0 case insensitive */ flags = 0; status = vms_dlsym (dh, &ptr, flags); if (!($VMS_STATUS_SUCCESS(status))) { /* ** Try again with mixed case flag set */ flags = LIB$M_FIS_MIXEDCASE; status = vms_dlsym (dh, &ptr, flags); if (!($VMS_STATUS_SUCCESS(status))) { error_status = status; return NULL; } } return ptr; } int vms_dlsym ( vms_dl *dh, void **ptr, int flags) { LIB$ESTABLISH (LIB$SIG_TO_RET); return LIB$FIND_IMAGE_SYMBOL (&dh->fnmdes, &dh->symdes, ptr, &dh->imgdes, flags); } const char *lt_dlerror (void) { struct dsc$descriptor desc; short outlen; int status; if (($VMS_STATUS_SUCCESS(error_status))) return NULL; desc.dsc$b_dtype = DSC$K_DTYPE_T; desc.dsc$b_class = DSC$K_CLASS_S; desc.dsc$a_pointer = error_buffer; desc.dsc$w_length = sizeof (error_buffer); status = sys$getmsg (error_status, &outlen, &desc, 15, 0); if ($VMS_STATUS_SUCCESS(status)) error_buffer[outlen] = '\0'; else sprintf (error_buffer, "OpenVMS exit status %8X", error_status); error_status = SS$_NORMAL; return (error_buffer); } struct itemlist3 { unsigned short buflen; unsigned short item; void *buf; unsigned short *retlen; }; int lt_dladdsearchdir (const char *search_dir) { /* * Adds a path to the list of paths where lt_dlopen will look for shareable images. * We do this via a user-mode search list logical, adding one more item to the end of * the list whenever called. */ $DESCRIPTOR(lib_path_d, "LTDL_LIBRARY_PATH"); $DESCRIPTOR( proc_table_d, "LNM$PROCESS_TABLE" ); unsigned int status = 0; unsigned char accmode = 0, lnm_exists = 1; int index = 0, max_index = 0; struct itemlist3 trnlnmlst[4] = {{sizeof(accmode), LNM$_ACMODE, &accmode, 0}, {sizeof(max_index), LNM$_MAX_INDEX, &max_index, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}; struct itemlist3 *crelnmlst; struct eqvarray { char eqvname[256]; }; struct eqvarray *eqvlist; /* First just check to see whether the logical name exists and how many equivalence * names there are. */ status = SYS$TRNLNM ( NULL, &proc_table_d, &lib_path_d, NULL, trnlnmlst); /* If the logical name doesn't exist or exists at a privilege mode or table I * can't even look at, then I'll want to proceed with creating my user-mode logical. */ if ( status == SS$_NOLOGNAM || status == SS$_NOPRIV ) { status = SS$_NORMAL; lnm_exists = 0; /* skip further translation attempts */ max_index = 0; } if (!$VMS_STATUS_SUCCESS(status)) { error_status = status; return -1; } /* Also skip further translation if the first translation exists in any mode other * than user mode; we want to stick user mode logicals in front of these. */ if ( accmode != PSL$C_USER ) { lnm_exists = 0; max_index = 0; } /* Allocate an item list for logical name creation and an array of equivalence * name buffers. */ crelnmlst = (struct itemlist3 *) malloc( sizeof(struct itemlist3) * (max_index + 3) ); if (crelnmlst == NULL) { error_status = SS$_INSFMEM; return -1; } eqvlist = (struct eqvarray *) malloc( sizeof(struct eqvarray) * (max_index + 2) ); if (eqvlist == NULL) { error_status = SS$_INSFMEM; return -1; } trnlnmlst[1].buflen = sizeof(index); trnlnmlst[1].item = LNM$_INDEX; trnlnmlst[1].buf = &index; trnlnmlst[1].retlen = NULL; trnlnmlst[2].buflen = sizeof(eqvlist[0].eqvname); trnlnmlst[2].item = LNM$_STRING; /* The loops iterates over the search list index, getting the translation * for each index and storing it in the item list for re-creation. */ for (index = 0; index <= max_index && lnm_exists; index++ ) { /* Wire the input buffer for translation to the output buffer for creation */ trnlnmlst[2].buf = &eqvlist[index].eqvname; crelnmlst[index].buf = &eqvlist[index].eqvname; trnlnmlst[2].retlen = &crelnmlst[index].buflen; status = SYS$TRNLNM ( NULL, &proc_table_d, &lib_path_d, NULL, trnlnmlst); if (!$VMS_STATUS_SUCCESS(status)) { error_status = status; free(crelnmlst); free(eqvlist); return -1; } /* If we come across a non-user-mode translation, back up and get out * because we don't want to recreate those in user mode. */ if ( accmode != PSL$C_USER ) { index--; break; } crelnmlst[index].item = LNM$_STRING; crelnmlst[index].retlen = NULL; } /* At this point we have captured all the existing translations (if * any) and stored them in the item list for re-creation of the logical * name. All that's left is to add the new item to the end of the list * and terminate the list. */ crelnmlst[index].buflen = strlen(search_dir); crelnmlst[index].item = LNM$_STRING; crelnmlst[index].buf = (char *) search_dir; crelnmlst[index].retlen = NULL; crelnmlst[index+1].buflen = 0; crelnmlst[index+1].item = 0; crelnmlst[index+1].buf = NULL; crelnmlst[index+1].retlen = NULL; accmode = PSL$C_USER; status = SYS$CRELNM( NULL, &proc_table_d, &lib_path_d, &accmode, crelnmlst ); if (!$VMS_STATUS_SUCCESS(status)) { error_status = status; free(crelnmlst); free(eqvlist); return -1; } free(crelnmlst); free(eqvlist); error_status = SS$_NORMAL; return 0; } char * getvmsenv (char *symbol) { int status; unsigned short cbvalue; $DESCRIPTOR (logicalnametable, "LNM$FILE_DEV"); struct dsc$descriptor_s logicalname; struct itemlist3 itemlist[2]; logicalname.dsc$w_length = strlen (symbol); logicalname.dsc$b_dtype = DSC$K_DTYPE_T; logicalname.dsc$b_class = DSC$K_CLASS_S; logicalname.dsc$a_pointer = symbol; itemlist[0].buflen = sizeof (getenv_buffer) -1; itemlist[0].item = LNM$_STRING; itemlist[0].buf = getenv_buffer; itemlist[0].retlen = &cbvalue; itemlist[1].buflen = 0; itemlist[1].item = 0; itemlist[1].buf = 0; itemlist[1].retlen = 0; status = SYS$TRNLNM (0, &logicalnametable, &logicalname, 0, itemlist); if (!($VMS_STATUS_SUCCESS(status))) return NULL; if (cbvalue > 0) { getenv_buffer[cbvalue] = '\0'; return getenv_buffer; } return NULL; } unixODBC-2.3.9/extras/Makefile.in0000664000175000017500000004570513725127175013463 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = extras ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libodbcextraslc_la_LIBADD = am_libodbcextraslc_la_OBJECTS = strcasecmp.lo snprintf.lo libodbcextraslc_la_OBJECTS = $(am_libodbcextraslc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcextraslc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcextraslc_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcextraslc_la_SOURCES) DIST_SOURCES = $(libodbcextraslc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libodbcextraslc.la AM_CPPFLAGS = -I@top_srcdir@/include EXTRA_DIST = vms.c libodbcextraslc_la_SOURCES = \ strcasecmp.c \ snprintf.c libodbcextraslc_la_LDFLAGS = -no-undefined all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu extras/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu extras/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcextraslc.la: $(libodbcextraslc_la_OBJECTS) $(libodbcextraslc_la_DEPENDENCIES) $(EXTRA_libodbcextraslc_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcextraslc_la_LINK) $(libodbcextraslc_la_OBJECTS) $(libodbcextraslc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/extras/Makefile.am0000755000175000017500000000032112262756036013433 00000000000000noinst_LTLIBRARIES = libodbcextraslc.la AM_CPPFLAGS = -I@top_srcdir@/include EXTRA_DIST = vms.c libodbcextraslc_la_SOURCES = \ strcasecmp.c \ snprintf.c libodbcextraslc_la_LDFLAGS = -no-undefined unixODBC-2.3.9/unixodbc_conf.h.in0000664000175000017500000003066513725127175013505 00000000000000/* unixodbc_conf.h.in. Generated from configure.ac by autoheader. */ /* Encoding to use for CHAR */ #undef ASCII_ENCODING /* Install bindir */ #undef BIN_PREFIX /* Use a semaphore to allow ODBCConfig to display running counts */ #undef COLLECT_STATS /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Lib directory */ #undef DEFLIB_PATH /* Using perdriver iconv */ #undef ENABLE_DRIVER_ICONV /* Using ini cacheing */ #undef ENABLE_INI_CACHING /* Install exec_prefix */ #undef EXEC_PREFIX /* Disable the precise but slow checking of the validity of handles */ #undef FAST_HANDLE_VALIDATE /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the `atoll' function. */ #undef HAVE_ATOLL /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Add editline support */ #undef HAVE_EDITLINE /* Define to 1 if you have the header file. */ #undef HAVE_EDITLINE_READLINE_H /* Define to 1 if you have the `endpwent' function. */ #undef HAVE_ENDPWENT /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME /* Define to 1 if you have the `ftok' function. */ #undef HAVE_FTOK /* Define to 1 if you have the `getpwuid' function. */ #undef HAVE_GETPWUID /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Add -lcrypt to lib list */ #undef HAVE_LIBCRYPT /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Use the -lpth thread library */ #undef HAVE_LIBPTH /* Use -lpthread threading lib */ #undef HAVE_LIBPTHREAD /* Use the -lthread threading lib */ #undef HAVE_LIBTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Use rentrant version of localtime */ #undef HAVE_LOCALTIME_R /* Define if you have long long */ #undef HAVE_LONG_LONG /* Define this if a modern libltdl is already installed */ #undef HAVE_LTDL /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_MSQL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if the system has the type `ptrdiff_t'. */ #undef HAVE_PTRDIFF_T /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Add readline support */ #undef HAVE_READLINE /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Use the scandir lib */ #undef HAVE_SCANDIR /* Define to 1 if you have the `semget' function. */ #undef HAVE_SEMGET /* Define to 1 if you have the `semop' function. */ #undef HAVE_SEMOP /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the `shmget' function. */ #undef HAVE_SHMGET /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `stricmp' function. */ #undef HAVE_STRICMP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strnicmp' function. */ #undef HAVE_STRNICMP /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the header file. */ #undef HAVE_SYNCH_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MALLOC_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SEM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `time' function. */ #undef HAVE_TIME /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Install includedir */ #undef INCLUDE_PREFIX /* Lib directory */ #undef LIB_PREFIX /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Define to the shared archive member specification, say "(shr.o)". */ #undef LT_SHARED_LIB_MEMBER /* Define if you need semundo union */ #undef NEED_SEMUNDO_UNION /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Using OSX */ #undef OSXHEADER /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Platform is 64 bit */ #undef PLATFORM64 /* Install prefix */ #undef PREFIX /* Using QNX */ #undef QNX_LIBLTDL /* Shared lib extension */ #undef SHLIBEXT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long int', as computed by sizeof. */ #undef SIZEOF_LONG_INT /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Filename to use for ftok */ #undef STATS_FTOK_NAME /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* don't include unixODBC prefix in driver error messages */ #undef STRICT_ODBC_ERROR /* System file path */ #undef SYSTEM_FILE_PATH /* Lib path */ #undef SYSTEM_LIB_PATH /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Encoding to use for UNICODE */ #undef UNICODE_ENCODING /* Flag that we are not using another DM */ #undef UNIXODBC /* Version number of package */ #undef VERSION /* Work with IBM drivers that use 32 bit handles on 64 bit platforms */ #undef WITH_HANDLE_REDIRECT /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Build flag for AIX */ #undef _ALL_SOURCE /* Build flag for AIX */ #undef _LONG_LONG /* Build flag for AIX */ #undef _THREAD_SAFE /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to a type to use for 'error_t' if it is not otherwise available. */ #undef error_t /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t unixODBC-2.3.9/ltmain.sh0000644000175000017500000117077113725127167011732 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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 3 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, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -stdlib=* select c++ std lib with clang -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: unixODBC-2.3.9/configure0000775000175000017500000221360113725127176012012 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for unixODBC 2.3.9. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and nick@unixodbc.org $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" lt_ltdl_dir='libltdl' SHELL=${CONFIG_SHELL-/bin/sh} lt_dlopen_dir=$lt_ltdl_dir test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='unixODBC' PACKAGE_TARNAME='unixODBC' PACKAGE_VERSION='2.3.9' PACKAGE_STRING='unixODBC 2.3.9' PACKAGE_BUGREPORT='nick@unixodbc.org' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" enable_option_checking=no ac_subst_vars='ltdl_LTLIBOBJS ltdl_LIBOBJS am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LIB_VERSION ALLOCA WITHLT_FALSE WITHLT_TRUE QNX_FALSE QNX_TRUE DRIVERC_FALSE DRIVERC_TRUE DRIVERS_FALSE DRIVERS_TRUE MSQL_FALSE MSQL_TRUE msql_headers msql_libraries PTH_LIBS PTH_LDFLAGS PTH_CFLAGS PTH_CPPFLAGS LFLAGS HAVE_FLEX_FALSE HAVE_FLEX_TRUE READLINE LIBADD_POW LIBADD_CRYPT ICONV_UNICODE_ENCODING ICONV_CHAR_ENCODING LIBICONV INCLUDE_PREFIX BIN_PREFIX EXEC_PREFIX PREFIX SYSTEM_LIB_PATH SYSTEM_FILE_PATH LIB_PREFIX DEFLIB_PATH SHLIBEXT LTDLOPEN LT_CONFIG_H subdirs CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE LT_ARGZ_H sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS INCLTDL LTDLINCL LTDLDEPS LIBLTDL LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL OBJDUMP DLLTOOL AS host_os host_vendor host_cpu host build_os build_vendor build_cpu build STATS_FTOK_NAME EGREP GREP LN_S LEXLIB LEX_OUTPUT_ROOT LEX CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC YFLAGS YACC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_static enable_threads enable_gnuthreads enable_readline enable_editline enable_inicaching enable_drivers enable_driverc enable_fastvalidate enable_iconv enable_stats with_stats_ftok_name enable_setlibversion enable_handlemap enable_stricterror enable_gui enable_shared with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_included_ltdl with_ltdl_include with_ltdl_lib enable_ltdl_install with_libiconv_prefix with_iconv_char_enc with_iconv_ucode_enc enable_iconvperdriver with_pth with_pth_test with_msql_lib with_msql_include ' ac_precious_vars='build_alias host_alias target_alias YACC YFLAGS CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP LT_SYS_LIBRARY_PATH' ac_subdirs_all='libltdl' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures unixODBC 2.3.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/unixODBC] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of unixODBC 2.3.9:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-static[=PKGS] build static libraries [default=no] --enable-threads build with thread support default=yes --enable-gnuthreads build with gnu threads support default=no --enable-readline build with readline support default=yes --enable-editline build with editline support default=no --enable-inicaching build with ini file caching support default=yes --enable-drivers build included drivers default=no --enable-driver-conf build included driver config libs default=no --enable-fastvalidate use relaxed handle checking in the DM default=no --enable-iconv build with iconv support default=yes --enable-stats build with statistic gathering support default=no --enable-setlibversion build with VERS set in libraries default=no --enable-handlemap driver manager can map driver handles called back from broken drivers default=no --enable-stricterror error conform to the MS spec, the unixODBC prefix is removed for driver errors default=yes --enable-gui only included for backwards compatibility, gui now in its own project, see ChangeLog --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl --enable-iconvperdriver build with iconv support per driver default=no Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-stats-ftok-name=filename Filename to get IPC ID for stats gathering default=odbc.ini --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-included-ltdl use the GNU ltdl sources included here --with-ltdl-include=DIR use the ltdl headers installed in DIR --with-ltdl-lib=DIR use the libltdl.la installed in DIR --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib --with-iconv-char-enc=enc Encoding to use as ASCII default=auto-search --with-iconv-ucode-enc=enc Encoding to use as UNICODE default=auto-search --with-pth=ARG Build with GNU Pth Library (default=yes) --with-pth-test Perform GNU Pth Sanity Test (default=yes) --with-msql-lib=DIR where the root of MiniSQL libs are installed --with-msql-include=DIR where the MiniSQL headers are installed Some influential environment variables: YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF unixODBC configure 2.3.9 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------- ## ## Report this to nick@unixodbc.org ## ## -------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by unixODBC $as_me 2.3.9, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='unixODBC' VERSION='2.3.9' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=no fi # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then : enableval=$enable_threads; case "${enableval}" in yes) thread=true ;; no) thread=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-thread" "$LINENO" 5 ;; esac else thread=true fi # Check whether --enable-gnuthreads was given. if test "${enable_gnuthreads+set}" = set; then : enableval=$enable_gnuthreads; case "${enableval}" in yes) gnuthread=true ;; no) gnuthread=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-gnuthread" "$LINENO" 5 ;; esac else gnuthread=false fi # Check whether --enable-readline was given. if test "${enable_readline+set}" = set; then : enableval=$enable_readline; case "${enableval}" in yes) readline=true ;; no) readline=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-readline" "$LINENO" 5 ;; esac else readline=true fi # Check whether --enable-editline was given. if test "${enable_editline+set}" = set; then : enableval=$enable_editline; case "${enableval}" in yes) editline=true ;; no) editline=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-editline" "$LINENO" 5 ;; esac else editline=false fi # Check whether --enable-inicaching was given. if test "${enable_inicaching+set}" = set; then : enableval=$enable_inicaching; case "${enableval}" in yes) inicaching=true ;; no) inicaching=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-inicaching" "$LINENO" 5 ;; esac else inicaching=true fi # Check whether --enable-drivers was given. if test "${enable_drivers+set}" = set; then : enableval=$enable_drivers; case "${enableval}" in yes) drivers=true ;; no) drivers=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-drivers" "$LINENO" 5 ;; esac else drivers=false fi # Check whether --enable-driverc was given. if test "${enable_driverc+set}" = set; then : enableval=$enable_driverc; case "${enableval}" in yes) driverc=true ;; no) driverc=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-driver-conf" "$LINENO" 5 ;; esac else driverc=false fi # Check whether --enable-fastvalidate was given. if test "${enable_fastvalidate+set}" = set; then : enableval=$enable_fastvalidate; case "${enableval}" in yes) fastvalidate=true ;; no) fastvalidate=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-fastvalidate" "$LINENO" 5 ;; esac else fastvalidate=false fi # Check whether --enable-iconv was given. if test "${enable_iconv+set}" = set; then : enableval=$enable_iconv; case "${enableval}" in yes) iconv=true ;; no) iconv=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-iconv" "$LINENO" 5 ;; esac else iconv=true fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/sem.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/sem.h" "ac_cv_header_sys_sem_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sem_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SEM_H 1 _ACEOF semh=true else semh=false fi done # Check whether --enable-stats was given. if test "${enable_stats+set}" = set; then : enableval=$enable_stats; case "${enableval}" in yes) if test "x$semh" = "xfalse"; then as_fn_error $? "stats enabled but required header was not found" "$LINENO" 5 fi stats=true ;; no) stats=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-stats" "$LINENO" 5 ;; esac else stats=false fi stats_ftok_name="odbc.ini" # Check whether --with-stats_ftok_name was given. if test "${with_stats_ftok_name+set}" = set; then : withval=$with_stats_ftok_name; stats_ftok_name="$withval" fi STATS_FTOK_NAME="$stats_ftok_name" cat >>confdefs.h <<_ACEOF #define STATS_FTOK_NAME "$STATS_FTOK_NAME" _ACEOF # Check whether --enable-setlibversion was given. if test "${enable_setlibversion+set}" = set; then : enableval=$enable_setlibversion; case "${enableval}" in yes) setlibversion=true ;; no) setlibversion=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-setlibversion" "$LINENO" 5 ;; esac else setlibversion=false fi # Check whether --enable-handlemap was given. if test "${enable_handlemap+set}" = set; then : enableval=$enable_handlemap; case "${enableval}" in yes) handlemap=true ;; no) handlemap=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-handlemap" "$LINENO" 5 ;; esac else handlemap=false fi # Check whether --enable-stricterror was given. if test "${enable_stricterror+set}" = set; then : enableval=$enable_stricterror; case "${enableval}" in yes) stricterror=true ;; no) stricterror=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-stricterror" "$LINENO" 5 ;; esac else stricterror=true fi # Check whether --enable-gui was given. if test "${enable_gui+set}" = set; then : enableval=$enable_gui; case "${enableval}" in *) ;; esac fi INCLTDL="" LIBLTDL="" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=yes # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking what extension is used for runtime loadable modules" >&5 $as_echo_n "checking what extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi if test -n "$shared_archive_member_spec"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_LIB_MEMBER "($shared_archive_member_spec.o)" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking what variable specifies run-time module search path" >&5 $as_echo_n "checking what variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var=$shlibpath_var fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path=$dir else sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required"; then LIBADD_DLOPEN=-ldl fi libltdl_cv_lib_dl_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" then lt_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS=$lt_save_LIBS fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD=-ldld fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" LIBS=$lt_dlload_save_LIBS ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test yes = "$lt_cv_sys_symbol_underscore"; then if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown dlsym_uscore_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" libname=conftmod # stay within 8.3 filename limits! cat >$libname.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } _LT_EOF # ltfn_module_cmds module_cmds # Execute tilde-delimited MODULE_CMDS with environment primed for # $module_cmds or $archive_cmds type content. ltfn_module_cmds () {( # subshell avoids polluting parent global environment module_cmds_save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$module_cmds_save_ifs libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. major=; versuffix=; verstring=; deplibs= ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= eval $cmd done IFS=$module_cmds_save_ifs )} # Compile a loadable module using libtool macro expansion results. $CC $pic_flag -c $libname.$ac_ext ltfn_module_cmds "${module_cmds:-$archive_cmds}" # Try to fetch fnord with dlsym(). libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 cat >conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifndef RTLD_GLOBAL # ifdef DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # else # define RTLD_GLOBAL 0 # endif #endif #ifndef RTLD_NOW # ifdef DL_NOW # define RTLD_NOW DL_NOW # else # define RTLD_NOW 0 # endif #endif int main () { void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); int status = $libltdl_dlunknown; if (handle) { if (dlsym (handle, "fnord")) status = $libltdl_dlnouscore; else { if (dlsym (handle, "_fnord")) status = $libltdl_dluscore; else puts (dlerror ()); } dlclose (handle); } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null libltdl_status=$? case x$libltdl_status in x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; x*) libltdl_cv_need_uscore=unknown ;; esac fi rm -rf conftest* $libname* LIBS=$dlsym_uscore_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test yes = "$libltdl_cv_need_uscore"; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this 'case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; bitrig*) lt_cv_sys_dlopen_deplibs=yes ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say 'no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to 'yes'. Without it, it would be 'no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say 'yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test yes != "$lt_cv_sys_dlopen_deplibs"; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi LT_ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else LT_ARGZ_H=lt__argz.h; _LT_LIBOBJS="$_LT_LIBOBJS lt__argz.$ac_objext" fi done if test -z "$LT_ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test yes = "$lt_cv_sys_argz_works"; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else LT_ARGZ_H=lt__argz.h _LT_LIBOBJS="$_LT_LIBOBJS lt__argz.$ac_objext" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test yes = "$libltdl_cv_preloaded_symbols"; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Set options # Check whether --with-included_ltdl was given. if test "${with_included_ltdl+set}" = set; then : withval=$with_included_ltdl; fi if test yes != "$with_included_ltdl"; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default " if test "x$ac_cv_header_ltdl_h" = xyes; then : ac_fn_c_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default #include " if test "x$ac_cv_have_decl_lt_dlinterface_register" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5 $as_echo_n "checking for lt_dladvise_preload in -lltdl... " >&6; } if ${ac_cv_lib_ltdl_lt_dladvise_preload+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lt_dladvise_preload (); int main () { return lt_dladvise_preload (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ltdl_lt_dladvise_preload=yes else ac_cv_lib_ltdl_lt_dladvise_preload=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dladvise_preload" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; } if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = xyes; then : with_included_ltdl=no else with_included_ltdl=yes fi else with_included_ltdl=yes fi else with_included_ltdl=yes fi fi # Check whether --with-ltdl_include was given. if test "${with_ltdl_include+set}" = set; then : withval=$with_ltdl_include; fi if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else as_fn_error $? "invalid ltdl include directory: '$with_ltdl_include'" "$LINENO" 5 fi else with_ltdl_include=no fi # Check whether --with-ltdl_lib was given. if test "${with_ltdl_lib+set}" = set; then : withval=$with_ltdl_lib; fi if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else as_fn_error $? "invalid ltdl library directory: '$with_ltdl_lib'" "$LINENO" 5 fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) case $enable_ltdl_convenience in no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='$(top_build_prefix)'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" # For backwards non-gettext consistent compatibility... INCLTDL=$LTDLINCL ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. $as_echo "#define HAVE_LTDL 1" >>confdefs.h LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) as_fn_error $? "'--with-ltdl-include' and '--with-ltdl-lib' options must be used together" "$LINENO" 5 ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL=-I$with_ltdl_include ;; esac INCLTDL=$LTDLINCL # Report our decision... { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5 $as_echo_n "checking where to find libltdl headers... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5 $as_echo "$LTDLINCL" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5 $as_echo_n "checking where to find libltdl library... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5 $as_echo "$LIBLTDL" >&6; } # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,$enable_ltdl_install,$enable_ltdl_convenience in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test no != "${enable_ltdl_install-no}"; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test no != "${enable_ltdl_convenience-no}"; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi subdirs="$subdirs libltdl" # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in closedir opendir readdir do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext" fi done for ac_func in strlcat strlcpy do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext" fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" # Only expand once: #dnl Find shared lib extension #AC_MSG_CHECKING(for shared lib extension) #SHLIBEXT="$shrext_cmds" #AC_MSG_RESULT($shrext_cmds) #AC_SUBST(SHLIBEXT) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared lib extension" >&5 $as_echo_n "checking for shared lib extension... " >&6; } eval "SHLIBEXT=$shrext_cmds" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHLIBEXT" >&5 $as_echo "$SHLIBEXT" >&6; } SHLIBEXT=$SHLIBEXT cat >>confdefs.h <<_ACEOF #define SHLIBEXT "$shrext_cmds" _ACEOF prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$libdir\"" eval ac_define_dir="\"$ac_define_dir\"" DEFLIB_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define DEFLIB_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$libdir\"" eval ac_define_dir="\"$ac_define_dir\"" LIB_PREFIX="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define LIB_PREFIX "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$sysconfdir\"" eval ac_define_dir="\"$ac_define_dir\"" SYSTEM_FILE_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define SYSTEM_FILE_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$libdir\"" eval ac_define_dir="\"$ac_define_dir\"" SYSTEM_LIB_PATH="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define SYSTEM_LIB_PATH "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$prefix\"" eval ac_define_dir="\"$ac_define_dir\"" PREFIX="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define PREFIX "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$exec_prefix\"" eval ac_define_dir="\"$ac_define_dir\"" EXEC_PREFIX="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define EXEC_PREFIX "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$bindir\"" eval ac_define_dir="\"$ac_define_dir\"" BIN_PREFIX="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define BIN_PREFIX "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$includedir\"" eval ac_define_dir="\"$ac_define_dir\"" INCLUDE_PREFIX="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define INCLUDE_PREFIX "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE $as_echo "#define UNIXODBC /**/" >>confdefs.h if test "x$iconv" = "xtrue"; then # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if ${am_cv_proto_iconv+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_cv_proto_iconv_arg1="" else am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- }$am_cv_proto_iconv" >&5 $as_echo "${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi LIBICONV= if test "$am_cv_lib_iconv" = yes; then LIBICONV="-liconv" fi iconv_char_enc="auto-search" # Check whether --with-iconv_char_enc was given. if test "${with_iconv_char_enc+set}" = set; then : withval=$with_iconv_char_enc; iconv_char_enc="$withval" fi ICONV_CHAR_ENCODING="$iconv_char_enc" iconv_ucode_enc="auto-search" # Check whether --with-iconv_ucode_enc was given. if test "${with_iconv_ucode_enc+set}" = set; then : withval=$with_iconv_ucode_enc; iconv_ucode_enc="$withval" fi ICONV_CHAR_ENCODING="" ICONV_UNICODE_ENCODING="" if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for encoding to use for CHAR representations " >&5 $as_echo_n "checking for encoding to use for CHAR representations ... " >&6; }; ICONV_CHAR_ENCODING="$iconv_char_enc" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $iconv_char_enc " >&5 $as_echo "$iconv_char_enc " >&6; }; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for encoding to use for UNICODE representations " >&5 $as_echo_n "checking for encoding to use for UNICODE representations ... " >&6; }; ICONV_UNICODE_ENCODING="$iconv_ucode_enc" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $iconv_ucode_enc " >&5 $as_echo "$iconv_ucode_enc " >&6; }; fi cat >>confdefs.h <<_ACEOF #define UNICODE_ENCODING "$ICONV_UNICODE_ENCODING" _ACEOF cat >>confdefs.h <<_ACEOF #define ASCII_ENCODING "$ICONV_CHAR_ENCODING" _ACEOF # Check whether --enable-iconvperdriver was given. if test "${enable_iconvperdriver+set}" = set; then : enableval=$enable_iconvperdriver; case "${enableval}" in yes) iconvperdriver=true ;; no) iconvperdriver=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-iconvperdriver" "$LINENO" 5 ;; esac else iconvperdriver=false fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Are we using per driver iconv " >&5 $as_echo_n "checking Are we using per driver iconv ... " >&6; } if test "x$iconvperdriver" = "xtrue"; then $as_echo "#define ENABLE_DRIVER_ICONV /**/" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes " >&5 $as_echo "yes " >&6; }; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no " >&5 $as_echo "no " >&6; }; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 $as_echo_n "checking for crypt in -lcrypt... " >&6; } if ${ac_cv_lib_crypt_crypt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char crypt (); int main () { return crypt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypt_crypt=yes else ac_cv_lib_crypt_crypt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 $as_echo "$ac_cv_lib_crypt_crypt" >&6; } if test "x$ac_cv_lib_crypt_crypt" = xyes; then : $as_echo "#define HAVE_LIBCRYPT /**/" >>confdefs.h LIBADD_CRYPT="-lcrypt" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if ${ac_cv_lib_m_pow+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes; then : LIBADD_POW="-lm" fi have_editline="no" if test "x$editline" = "xtrue"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -ledit " >&5 $as_echo_n "checking for readline in -ledit ... " >&6; } ac_save_LIBS="$LIBS" LIBS="-ledit $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline(); int main () { readline() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } READLINE=-ledit have_editline="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -ledit -lcurses " >&5 $as_echo_n "checking for readline in -ledit -lcurses ... " >&6; } ac_save_LIBS="$LIBS" LIBS="-ledit -lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline(); int main () { readline() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } READLINE="-ledit -lcurses" have_editline="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$have_editline" = "xyes"; then for ac_header in editline/readline.h do : ac_fn_c_check_header_mongrel "$LINENO" "editline/readline.h" "ac_cv_header_editline_readline_h" "$ac_includes_default" if test "x$ac_cv_header_editline_readline_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EDITLINE_READLINE_H 1 _ACEOF $as_echo "#define HAVE_EDITLINE 1" >>confdefs.h fi done readline=false fi fi have_readline="no" if test "x$readline" = "xtrue"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline " >&5 $as_echo_n "checking for readline in -lreadline ... " >&6; } ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline(); int main () { readline() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } READLINE=-lreadline have_readline="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline -lcurses " >&5 $as_echo_n "checking for readline in -lreadline -lcurses ... " >&6; } ac_save_LIBS="$LIBS" LIBS="-lreadline -lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline(); int main () { readline() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } READLINE="-lreadline -lcurses" have_readline="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$have_readline" = "xyes"; then for ac_header in readline/history.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" if test "x$ac_cv_header_readline_history_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_HISTORY_H 1 _ACEOF $as_echo "#define HAVE_READLINE 1" >>confdefs.h fi done fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Are we using ini caching " >&5 $as_echo_n "checking Are we using ini caching ... " >&6; } if test "x$inicaching" = "xtrue"; then $as_echo "#define ENABLE_INI_CACHING /**/" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes " >&5 $as_echo "yes " >&6; }; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no " >&5 $as_echo "no " >&6; }; fi if test "x$drivers" = "xtrue"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Are we using flex " >&5 $as_echo_n "checking Are we using flex ... " >&6; } if test "x$LEX" = "xflex"; then LFLAGS="$LFLAGS -i" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes " >&5 $as_echo "yes " >&6; }; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for scandir in -lc" >&5 $as_echo_n "checking for scandir in -lc... " >&6; } if ${ac_cv_lib_c_scandir+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char scandir (); int main () { return scandir (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_scandir=yes else ac_cv_lib_c_scandir=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_scandir" >&5 $as_echo "$ac_cv_lib_c_scandir" >&6; } if test "x$ac_cv_lib_c_scandir" = xyes; then : $as_echo "#define HAVE_SCANDIR 1" >>confdefs.h fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - text driver disabled " >&5 $as_echo "no - text driver disabled " >&6; }; fi if test "x$LEX" = "xflex" ; then HAVE_FLEX_TRUE= HAVE_FLEX_FALSE='#' else HAVE_FLEX_TRUE='#' HAVE_FLEX_FALSE= fi else if test "xabc" = "xdef" ; then HAVE_FLEX_TRUE= HAVE_FLEX_FALSE='#' else HAVE_FLEX_TRUE='#' HAVE_FLEX_FALSE= fi fi case $host_os in *qnx* ) qnx="true" $as_echo "#define QNX_LIBLTDL /**/" >>confdefs.h ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF fi done # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking if platform is 64 bit" >&5 $as_echo_n "checking if platform is 64 bit... " >&6; } if test "$ac_cv_sizeof_long" = "8"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Yes " >&5 $as_echo "Yes " >&6; }; $as_echo "#define PLATFORM64 /**/" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: No " >&5 $as_echo "No " >&6; }; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long" >&5 $as_echo_n "checking for long long... " >&6; } if ${ac_cv_type_long_long+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { long long x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_long_long=yes else ac_cv_type_long_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long" >&5 $as_echo "$ac_cv_type_long_long" >&6; } if eval "test \"`echo $ac_cv_type_long_long`\" = yes"; then $as_echo "#define HAVE_LONG_LONG 1" >>confdefs.h fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5 $as_echo_n "checking size of long int... " >&6; } if ${ac_cv_sizeof_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int" "$ac_includes_default"; then : else if test "$ac_cv_type_long_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5 $as_echo "$ac_cv_sizeof_long_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_INT $ac_cv_sizeof_long_int _ACEOF ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" if test "x$ac_cv_type_ptrdiff_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTRDIFF_T 1 _ACEOF fi for ac_func in strcasecmp strncasecmp vsnprintf strtol atoll strtoll endpwent gettimeofday ftime time stricmp strnicmp getuid getpwuid nl_langinfo do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 $as_echo_n "checking for nl_langinfo and CODESET... " >&6; } if ${am_cv_langinfo_codeset+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char* cs = nl_langinfo(CODESET); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_langinfo_codeset=yes else am_cv_langinfo_codeset=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 $as_echo "$am_cv_langinfo_codeset" >&6; } if test $am_cv_langinfo_codeset = yes; then $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h fi LIBADD_DL= THREADLIB="" if test "x$thread" = "xtrue"; then if test "x$gnuthread" = "xtrue"; then PTH_CPPFLAGS='' PTH_CFLAGS='' PTH_LDFLAGS='' PTH_LIBS='' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU Pth" >&5 $as_echo_n "checking for GNU Pth... " >&6; } if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo " " >&6; } fi # Check whether --with-pth was given. if test "${with_pth+set}" = set; then : withval=$with_pth; else with_pth="yes" fi # Check whether --with-pth-test was given. if test "${with_pth_test+set}" = set; then : withval=$with_pth_test; else with_pth_test="yes" fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: + Command Line Options:" >&5 $as_echo " + Command Line Options:" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o --with-pth=$with_pth" >&5 $as_echo " o --with-pth=$with_pth" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o --with-pth-test=$with_pth_test" >&5 $as_echo " o --with-pth-test=$with_pth_test" >&6; } fi if test ".$with_pth" != .no; then _pth_subdir=no _pth_subdir_opts='' case "$with_pth" in subdir:* ) _pth_subdir=yes _pth_subdir_opts=`echo $with_pth | sed -e 's/^subdir:[^ ]*[ ]*//'` with_pth=`echo $with_pth | sed -e 's/^subdir:\([^ ]*\).*$/\1/'` ;; esac _pth_version="" _pth_location="" _pth_type="" _pth_cppflags="" _pth_cflags="" _pth_ldflags="" _pth_libs="" if test ".$with_pth" = .yes; then # via config script in $PATH _pth_version=`(pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` if test ".$_pth_version" != .; then _pth_location=`pth-config --prefix` _pth_type='installed' _pth_cppflags=`pth-config --cflags` _pth_cflags=`pth-config --cflags` _pth_ldflags=`pth-config --ldflags` _pth_libs=`pth-config --libs` fi elif test -d "$with_pth"; then with_pth=`echo $with_pth | sed -e 's;/*$;;'` _pth_found=no # via locally included source tree if test ".$_pth_subdir" = .yes; then _pth_location="$with_pth" _pth_type='local' _pth_cppflags="-I$with_pth" _pth_cflags="-I$with_pth" if test -f "$with_pth/ltconfig"; then _pth_ldflags="-L$with_pth/.libs" else _pth_ldflags="-L$with_pth" fi _pth_libs="-lpth" _pth_version=`grep '^const char PTH_Hello' $with_pth/pth_vers.c |\ sed -e 's;^.*Version[ ]*\([0-9]*\.[0-9]*[.ab][0-9]*\)[ ].*$;\1;'` _pth_found=yes ac_configure_args="$ac_configure_args --enable-subdir $_pth_subdir_opts" with_pth_test=no fi # via config script under a specified directory # (a standard installation, but not a source tree) if test ".$_pth_found" = .no; then for _dir in $with_pth/bin $with_pth; do if test -f "$_dir/pth-config"; then test -f "$_dir/pth-config.in" && continue # pth-config in source tree! _pth_version=`($_dir/pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` if test ".$_pth_version" != .; then _pth_location=`$_dir/pth-config --prefix` _pth_type="installed" _pth_cppflags=`$_dir/pth-config --cflags` _pth_cflags=`$_dir/pth-config --cflags` _pth_ldflags=`$_dir/pth-config --ldflags` _pth_libs=`$_dir/pth-config --libs` _pth_found=yes break fi fi done fi # in any subarea under a specified directory # (either a special installation or a Pth source tree) if test ".$_pth_found" = .no; then _pth_found=0 for _file in x `find $with_pth -name "pth.h" -type f -print`; do test .$_file = .x && continue _dir=`echo $_file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` _pth_version=`($_dir/pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` if test ".$_pth_version" = .; then _pth_version=`grep '^#define PTH_VERSION_STR' $_file |\ sed -e 's;^#define[ ]*PTH_VERSION_STR[ ]*"\([0-9]*\.[0-9]*[.ab][0-9]*\)[ ].*$;\1;'` fi _pth_cppflags="-I$_dir" _pth_cflags="-I$_dir" _pth_found=`expr $_pth_found + 1` done for _file in x `find $with_pth -name "libpth.[aso]" -type f -print`; do test .$_file = .x && continue _dir=`echo $_file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` _pth_ldflags="-L$_dir" _pth_libs="-lpth" _pth_found=`expr $_pth_found + 1` done if test ".$_pth_found" = .2; then _pth_location="$with_pth" _pth_type="uninstalled" else _pth_version='' fi fi fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: + Determined Location:" >&5 $as_echo " + Determined Location:" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o path: $_pth_location" >&5 $as_echo " o path: $_pth_location" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o type: $_pth_type" >&5 $as_echo " o type: $_pth_type" >&6; } fi if test ".$_pth_version" = .; then if test ".$with_pth" != .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: *FAILED*" >&5 $as_echo "*FAILED*" >&6; } echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Unable to locate GNU Pth under $with_pth. Please specify the correct path to either a GNU Pth installation tree (use --with-pth=DIR if you used --prefix=DIR for installing GNU Pth in the past) or to a GNU Pth source tree (use --with-pth=DIR if DIR is a path to a pth-X.Y.Z/ directory; but make sure the package is already built, i.e., the "configure; make" step was already performed there). EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: *FAILED*" >&5 $as_echo "*FAILED*" >&6; } echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Unable to locate GNU Pth in any system-wide location (see \$PATH). Please specify the correct path to either a GNU Pth installation tree (use --with-pth=DIR if you used --prefix=DIR for installing GNU Pth in the past) or to a GNU Pth source tree (use --with-pth=DIR if DIR is a path to a pth-X.Y.Z/ directory; but make sure the package is already built, i.e., the "configure; make" step was already performed there). EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi fi _req_version="1.3.0 " for _var in _pth_version _req_version; do eval "_val=\"\$${_var}\"" _major=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\1/'` _minor=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\2/'` _rtype=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\3/'` _micro=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\4/'` case $_rtype in "a" ) _rtype=0 ;; "b" ) _rtype=1 ;; "." ) _rtype=2 ;; esac _hex=`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, rtype, micro); }' \ "major=$_major" "minor=$_minor" "rtype=$_rtype" "micro=$_micro"` eval "${_var}_hex=\"\$_hex\"" done if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: + Determined Versions:" >&5 $as_echo " + Determined Versions:" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o existing: $_pth_version -> 0x$_pth_version_hex" >&5 $as_echo " o existing: $_pth_version -> 0x$_pth_version_hex" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o required: $_req_version -> 0x$_req_version_hex" >&5 $as_echo " o required: $_req_version -> 0x$_req_version_hex" >&6; } fi _ok=0 if test ".$_pth_version_hex" != .; then if test ".$_req_version_hex" != .; then if test $_pth_version_hex -ge $_req_version_hex; then _ok=1 fi fi fi if test ".$_ok" = .0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: *FAILED*" >&5 $as_echo "*FAILED*" >&6; } echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found Pth version $_pth_version, but required at least version $_req_version. Upgrade Pth under $_pth_location to $_req_version or higher first, please. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi if test ".$with_pth_test" = .yes; then _ac_save_CPPFLAGS="$CPPFLAGS" _ac_save_CFLAGS="$CFLAGS" _ac_save_LDFLAGS="$LDFLAGS" _ac_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $_pth_cppflags" CFLAGS="$CFLAGS $_pth_cflags" LDFLAGS="$LDFLAGS $_pth_ldflags" LIBS="$LIBS $_pth_libs" if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: + Test Build Environment:" >&5 $as_echo " + Test Build Environment:" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o CPPFLAGS=\"$CPPFLAGS\"" >&5 $as_echo " o CPPFLAGS=\"$CPPFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o CFLAGS=\"$CFLAGS\"" >&5 $as_echo " o CFLAGS=\"$CFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o LDFLAGS=\"$LDFLAGS\"" >&5 $as_echo " o LDFLAGS=\"$LDFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o LIBS=\"$LIBS\"" >&5 $as_echo " o LIBS=\"$LIBS\"" >&6; } fi cross_compile=no if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: + Performing Sanity Checks:" >&5 $as_echo " + Performing Sanity Checks:" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o pre-processor test" >&5 $as_echo " o pre-processor test" >&6; } fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : _ok=yes else _ok=no fi rm -f conftest.err conftest.i conftest.$ac_ext if test ".$_ok" != .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: *FAILED*" >&5 $as_echo "*FAILED*" >&6; } echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity pre-processor check. This means the GNU Pth header pth.h was not found. We used the following build environment: >> CPP="$CPP" >> CPPFLAGS="$CPPFLAGS" See config.log for possibly more details. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o link check" >&5 $as_echo " o link check" >&6; } fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int main(int argc, char *argv) { FILE *fp; if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "hmm"); fclose(fp); pth_init(); pth_kill(); if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "yes"); fclose(fp); exit(0); } ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : _ok=yes else _ok=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test ".$_ok" != .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: *FAILED*" >&5 $as_echo "*FAILED*" >&6; } echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity linker check. This means the GNU Pth library libpth.a was not found. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o run-time check" >&5 $as_echo " o run-time check" >&6; } fi if test "$cross_compiling" = yes; then : _ok=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main(int argc, char *argv) { FILE *fp; if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "hmm"); fclose(fp); pth_init(); pth_kill(); if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "yes"); fclose(fp); exit(0); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : _ok=`cat conftestval` else _ok=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test ".$_ok" != .yes; then if test ".$_ok" = .no; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: *FAILED*" >&5 $as_echo "*FAILED*" >&6; } echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity execution check. This usually means that the GNU Pth shared library libpth.so is present but \$LD_LIBRARY_PATH is incomplete to execute a Pth test. In this case either disable this test via --without-pth-test, or extend \$LD_LIBRARY_PATH, or build GNU Pth as a static library only via its --disable-shared Autoconf option. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: *FAILED*" >&5 $as_echo "*FAILED*" >&6; } echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity run-time check. This usually means that the GNU Pth library failed to work and possibly caused a core dump in the test program. In this case it is strongly recommended that you re-install GNU Pth and this time make sure that it really passes its "make test" procedure. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi fi _extendvars="yes" if test ".$_extendvars" != .yes; then CPPFLAGS="$_ac_save_CPPFLAGS" CFLAGS="$_ac_save_CFLAGS" LDFLAGS="$_ac_save_LDFLAGS" LIBS="$_ac_save_LIBS" fi else _extendvars="yes" if test ".$_extendvars" = .yes; then if test ".$_pth_subdir" = .yes; then CPPFLAGS="$CPPFLAGS $_pth_cppflags" CFLAGS="$CFLAGS $_pth_cflags" LDFLAGS="$LDFLAGS $_pth_ldflags" LIBS="$LIBS $_pth_libs" fi fi fi PTH_CPPFLAGS="$_pth_cppflags" PTH_CFLAGS="$_pth_cflags" PTH_LDFLAGS="$_pth_ldflags" PTH_LIBS="$_pth_libs" if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: + Final Results:" >&5 $as_echo " + Final Results:" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"" >&5 $as_echo " o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o PTH_CFLAGS=\"$PTH_CFLAGS\"" >&5 $as_echo " o PTH_CFLAGS=\"$PTH_CFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o PTH_LDFLAGS=\"$PTH_LDFLAGS\"" >&5 $as_echo " o PTH_LDFLAGS=\"$PTH_LDFLAGS\"" >&6; } fi if test ".$verbose" = .yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: o PTH_LIBS=\"$PTH_LIBS\"" >&5 $as_echo " o PTH_LIBS=\"$PTH_LIBS\"" >&6; } fi fi if test ".$with_pth" != .no; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: version $_pth_version, $_pth_type under $_pth_location" >&5 $as_echo "version $_pth_version, $_pth_type under $_pth_location" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : fi CPPFLAGS="$CPPFLAGS $PTH_CPPFLAGS" CFLAGS="$CFLAGS $PTH_CFLAGS" LDFLAGS="$LDFLAGS $PTH_LDFLAGS" THREADLIB="$PTH_LIBS" $as_echo "#define HAVE_LIBPTH 1" >>confdefs.h else gotthread="no"; { $as_echo "$as_me:${as_lineno-$LINENO}: checking if os is AIX " >&5 $as_echo_n "checking if os is AIX ... " >&6; } case $host_os in "aix"*) raw_threads="no"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - disable check for libthread " >&5 $as_echo "yes - disable check for libthread " >&6; }; ;; *) raw_threads="yes"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - enable check for libthread " >&5 $as_echo "no - enable check for libthread " >&6; }; ;; esac if test "x$raw_threads" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mutex_lock in -lthread " >&5 $as_echo_n "checking for mutex_lock in -lthread ... " >&6; } ac_save_LIBS="$LIBS" LIBS="-lthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mutex_lock(); int main () { mutex_lock() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBTHREAD 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -mt" >&5 $as_echo_n "checking if compiler accepts -mt... " >&6; } echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -mt -c conftest.c 2>&1`"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$CFLAGS -mt" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* gotthread="yes"; THREADLIB="-lthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$gotthread" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_lock in -lpthread... " >&6; } ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif #include int main () { pthread_mutex_lock(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h gotthread="yes"; THREADLIB="-lpthread" if test "x$ac_cv_c_compiler_gnu" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -pthread" >&5 $as_echo_n "checking if compiler accepts -pthread... " >&6; } echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$CFLAGS -pthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* else { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -mt" >&5 $as_echo_n "checking if compiler accepts -mt... " >&6; } echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -mt -c conftest.c 2>&1`"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$CFLAGS -mt" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$gotthread" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lc" >&5 $as_echo_n "checking for pthread_mutex_lock in -lc... " >&6; } ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif #include int main () { pthread_mutex_lock(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h gotthread="yes"; THREADLIB="" if test "x$ac_cv_c_compiler_gnu" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -pthread" >&5 $as_echo_n "checking if compiler accepts -pthread... " >&6; } echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$CFLAGS -pthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* else { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -mt" >&5 $as_echo_n "checking if compiler accepts -mt... " >&6; } echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -mt -c conftest.c 2>&1`"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$CFLAGS -mt" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$gotthread" = "xno"; then if test "x$ac_cv_c_compiler_gnu" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -pthread" >&5 $as_echo_n "checking if compiler accepts -pthread... " >&6; } echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } CFLAGS="$CFLAGS -pthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lc" >&5 $as_echo_n "checking for pthread_mutex_lock in -lc... " >&6; } ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif #include int main () { pthread_mutex_lock(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h THREADLIB="-pthread -lc_r" gotthread="yes"; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test "x$gotthread" = "xno"; then SAVECFLAGS="$CFLAGS" CFLAGS="$CFLAGS -D_THREAD_SAFE -D_ALL_SOURCE -D_LONG_LONG" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5 $as_echo_n "checking for pthread_mutex_lock in -lpthread... " >&6; } ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif #include int main () { pthread_mutex_lock(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "ac_cv_lib_$ac_lib_var=yes" else eval "ac_cv_lib_$ac_lib_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h gotthread="yes"; THREADLIB="-lpthread" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi CFLAGS="$SAVECFLAGS" $as_echo "#define _THREAD_SAFE /**/" >>confdefs.h $as_echo "#define _ALL_SOURCE /**/" >>confdefs.h $as_echo "#define _LONG_LONG /**/" >>confdefs.h fi if test "x$gotthread" = "xyes"; then save_LIBS=$LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for localtime_r in -lc" >&5 $as_echo_n "checking for localtime_r in -lc... " >&6; } if ${ac_cv_lib_c_localtime_r+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char localtime_r (); int main () { return localtime_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_localtime_r=yes else ac_cv_lib_c_localtime_r=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_localtime_r" >&5 $as_echo "$ac_cv_lib_c_localtime_r" >&6; } if test "x$ac_cv_lib_c_localtime_r" = xyes; then : $as_echo "#define HAVE_LOCALTIME_R 1" >>confdefs.h fi LIBS=$save_LIBS fi fi fi case $host_os in "darwin"*) stats="false" macosx="yes" $as_echo "#define OSXHEADER /**/" >>confdefs.h ;; sysv5Open*) if test "x$THREADLIB" = "x"; then LIBS="$LIBS $THREADLIB" else LIBS="$LIBS -Kthread" fi ;; *) LIBS="$LIBS $THREADLIB" ;; esac if test "x$stats" = "xtrue"; then for ac_func in ftok semget shmget semop snprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else stats=false fi done fi if test "x$stats" = "xtrue"; then ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for semundo union" >&5 $as_echo_n "checking for semundo union... " >&6; } if ${ac_cv_semundo_union+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { union semun semctl_arg; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_semundo_union=no else ac_cv_semundo_union=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_semundo_union" >&5 $as_echo "$ac_cv_semundo_union" >&6; } if eval "test \"`echo $ac_cv_semundo_union`\" = yes"; then $as_echo "#define NEED_SEMUNDO_UNION 1" >>confdefs.h fi $as_echo "#define COLLECT_STATS /**/" >>confdefs.h fi # Check whether --with-msql-lib was given. if test "${with_msql_lib+set}" = set; then : withval=$with_msql_lib; msql_libraries="$withval" fi # Check whether --with-msql-include was given. if test "${with_msql_include+set}" = set; then : withval=$with_msql_include; msql_headers="$withval" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in malloc.h unistd.h pwd.h crypt.h limits.h synch.h strings.h string.h locale.h sys/malloc.h sys/types.h sys/sem.h stdarg.h varargs.h sys/time.h sys/timeb.h time.h langinfo.h stddef.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done INCLUDES="$INCLUDES $USER_INCLUDES"; for ac_header in msql.h do : ac_fn_c_check_header_mongrel "$LINENO" "msql.h" "ac_cv_header_msql_h" "$ac_includes_default" if test "x$ac_cv_header_msql_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MSQL_H 1 _ACEOF msql=true else msql=false; for ac_dir in $kde_extra_includes $msql_headers; do for ac_header in $ac_dir/msql.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF msql=true; INCLUDES="$INCLUDES $USER_INCLUDES -I$ac_dir"; fi done done fi done if test "x$msql" = "xtrue" ; then MSQL_TRUE= MSQL_FALSE='#' else MSQL_TRUE='#' MSQL_FALSE= fi if test "x$drivers" = "xtrue" ; then DRIVERS_TRUE= DRIVERS_FALSE='#' else DRIVERS_TRUE='#' DRIVERS_FALSE= fi if test "x$driverc" = "xtrue" ; then DRIVERC_TRUE= DRIVERC_FALSE='#' else DRIVERC_TRUE='#' DRIVERC_FALSE= fi if test "x$qnx" = "xtrue" ; then QNX_TRUE= QNX_FALSE='#' else QNX_TRUE='#' QNX_FALSE= fi if test "x$use_builtin_libtool" = "xyes" ; then WITHLT_TRUE= WITHLT_FALSE='#' else WITHLT_TRUE='#' WITHLT_FALSE= fi if test "x$fastvalidate" = "xtrue"; then $as_echo "#define FAST_HANDLE_VALIDATE /**/" >>confdefs.h fi if test "x$handlemap" = "xtrue"; then $as_echo "#define WITH_HANDLE_REDIRECT /**/" >>confdefs.h fi if test "x$stricterror" = "xtrue"; then $as_echo "#define STRICT_ODBC_ERROR /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ void *alloca (size_t); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction (int *addr, int depth) { int dir, dummy = 0; if (! addr) addr = &dummy; *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; dir = depth ? find_stack_direction (addr, depth - 1) : 0; return dir + dummy; } int main (int argc, char **argv) { return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in putenv socket strdup strstr setenv setlocale strchr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done $as_echo "#define UNIXODBC_SOURCE /**/" >>confdefs.h LIB_VERSION="2:0:0" ac_config_headers="$ac_config_headers config.h" ac_config_headers="$ac_config_headers unixodbc_conf.h" ac_config_files="$ac_config_files Makefile extras/Makefile log/Makefile lst/Makefile ini/Makefile odbcinst/Makefile odbcinst/odbcinst.pc cur/Makefile cur/odbccr.pc DriverManager/Makefile DriverManager/odbc.pc exe/Makefile DRVConfig/Makefile DRVConfig/drvcfg1/Makefile DRVConfig/drvcfg2/Makefile DRVConfig/PostgreSQL/Makefile DRVConfig/MiniSQL/Makefile DRVConfig/MySQL/Makefile DRVConfig/nn/Makefile DRVConfig/esoob/Makefile DRVConfig/oplodbc/Makefile DRVConfig/template/Makefile DRVConfig/tds/Makefile DRVConfig/txt/Makefile DRVConfig/Oracle/Makefile DRVConfig/sapdb/Makefile DRVConfig/Mimer/Makefile Drivers/Makefile Drivers/Postgre7.1/Makefile Drivers/nn/Makefile Drivers/template/Makefile Drivers/MiniSQL/Makefile include/Makefile man/Makefile doc/Makefile doc/AdministratorManual/Makefile doc/ProgrammerManual/Makefile doc/ProgrammerManual/Tutorial/Makefile doc/UserManual/Makefile doc/lst/Makefile samples/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=config.h _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi ltdl_LIBOBJS=$_ltdl_libobjs ltdl_LTLIBOBJS=$_ltdl_ltlibobjs if test -z "${HAVE_FLEX_TRUE}" && test -z "${HAVE_FLEX_FALSE}"; then as_fn_error $? "conditional \"HAVE_FLEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_FLEX_TRUE}" && test -z "${HAVE_FLEX_FALSE}"; then as_fn_error $? "conditional \"HAVE_FLEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MSQL_TRUE}" && test -z "${MSQL_FALSE}"; then as_fn_error $? "conditional \"MSQL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DRIVERS_TRUE}" && test -z "${DRIVERS_FALSE}"; then as_fn_error $? "conditional \"DRIVERS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DRIVERC_TRUE}" && test -z "${DRIVERC_FALSE}"; then as_fn_error $? "conditional \"DRIVERC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${QNX_TRUE}" && test -z "${QNX_FALSE}"; then as_fn_error $? "conditional \"QNX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITHLT_TRUE}" && test -z "${WITHLT_FALSE}"; then as_fn_error $? "conditional \"WITHLT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by unixODBC $as_me 2.3.9, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ unixODBC config.status 2.3.9 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "unixodbc_conf.h") CONFIG_HEADERS="$CONFIG_HEADERS unixodbc_conf.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "extras/Makefile") CONFIG_FILES="$CONFIG_FILES extras/Makefile" ;; "log/Makefile") CONFIG_FILES="$CONFIG_FILES log/Makefile" ;; "lst/Makefile") CONFIG_FILES="$CONFIG_FILES lst/Makefile" ;; "ini/Makefile") CONFIG_FILES="$CONFIG_FILES ini/Makefile" ;; "odbcinst/Makefile") CONFIG_FILES="$CONFIG_FILES odbcinst/Makefile" ;; "odbcinst/odbcinst.pc") CONFIG_FILES="$CONFIG_FILES odbcinst/odbcinst.pc" ;; "cur/Makefile") CONFIG_FILES="$CONFIG_FILES cur/Makefile" ;; "cur/odbccr.pc") CONFIG_FILES="$CONFIG_FILES cur/odbccr.pc" ;; "DriverManager/Makefile") CONFIG_FILES="$CONFIG_FILES DriverManager/Makefile" ;; "DriverManager/odbc.pc") CONFIG_FILES="$CONFIG_FILES DriverManager/odbc.pc" ;; "exe/Makefile") CONFIG_FILES="$CONFIG_FILES exe/Makefile" ;; "DRVConfig/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/Makefile" ;; "DRVConfig/drvcfg1/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/drvcfg1/Makefile" ;; "DRVConfig/drvcfg2/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/drvcfg2/Makefile" ;; "DRVConfig/PostgreSQL/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/PostgreSQL/Makefile" ;; "DRVConfig/MiniSQL/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/MiniSQL/Makefile" ;; "DRVConfig/MySQL/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/MySQL/Makefile" ;; "DRVConfig/nn/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/nn/Makefile" ;; "DRVConfig/esoob/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/esoob/Makefile" ;; "DRVConfig/oplodbc/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/oplodbc/Makefile" ;; "DRVConfig/template/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/template/Makefile" ;; "DRVConfig/tds/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/tds/Makefile" ;; "DRVConfig/txt/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/txt/Makefile" ;; "DRVConfig/Oracle/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/Oracle/Makefile" ;; "DRVConfig/sapdb/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/sapdb/Makefile" ;; "DRVConfig/Mimer/Makefile") CONFIG_FILES="$CONFIG_FILES DRVConfig/Mimer/Makefile" ;; "Drivers/Makefile") CONFIG_FILES="$CONFIG_FILES Drivers/Makefile" ;; "Drivers/Postgre7.1/Makefile") CONFIG_FILES="$CONFIG_FILES Drivers/Postgre7.1/Makefile" ;; "Drivers/nn/Makefile") CONFIG_FILES="$CONFIG_FILES Drivers/nn/Makefile" ;; "Drivers/template/Makefile") CONFIG_FILES="$CONFIG_FILES Drivers/template/Makefile" ;; "Drivers/MiniSQL/Makefile") CONFIG_FILES="$CONFIG_FILES Drivers/MiniSQL/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/AdministratorManual/Makefile") CONFIG_FILES="$CONFIG_FILES doc/AdministratorManual/Makefile" ;; "doc/ProgrammerManual/Makefile") CONFIG_FILES="$CONFIG_FILES doc/ProgrammerManual/Makefile" ;; "doc/ProgrammerManual/Tutorial/Makefile") CONFIG_FILES="$CONFIG_FILES doc/ProgrammerManual/Tutorial/Makefile" ;; "doc/UserManual/Makefile") CONFIG_FILES="$CONFIG_FILES doc/UserManual/Makefile" ;; "doc/lst/Makefile") CONFIG_FILES="$CONFIG_FILES doc/lst/Makefile" ;; "samples/Makefile") CONFIG_FILES="$CONFIG_FILES samples/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . # The names of the tagged configurations supported by this script. available_tags='' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. build_old_libs=$enable_static # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | --c=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 $as_echo "$ac_msg" >&6 as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking are we setting library version " >&5 $as_echo_n "checking are we setting library version ... " >&6; } if test "x$setlibversion" = "xtrue"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes " >&5 $as_echo "yes " >&6; }; sed '/archive_expsym_cmds=/s/{ global/VERS_3.52 {global/' < libtool > libtool.tmp; mv libtool.tmp libtool else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no " >&5 $as_echo "no " >&6; }; fi unixODBC-2.3.9/odbcinst/0000775000175000017500000000000013725127520011754 500000000000000unixODBC-2.3.9/odbcinst/ODBCINSTSetProperty.c0000664000175000017500000000456413724126772015506 00000000000000/************************************************** * ODBCINSTSetProperty * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include int ODBCINSTSetProperty( HODBCINSTPROPERTY hFirstProperty, char *pszProperty, char *pszValue ) { char szError[LOG_MSG_MAX+1]; HODBCINSTPROPERTY hCurProperty; /* SANITY CHECKS */ if ( hFirstProperty == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Invalid property list handle" ); return ODBCINST_ERROR; } if ( pszProperty == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Invalid Property Name" ); return ODBCINST_ERROR; } if ( pszValue == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Invalid Value buffer" ); return ODBCINST_ERROR; } /* FIND pszProperty */ for ( hCurProperty = hFirstProperty; hCurProperty != NULL; hCurProperty = hCurProperty->pNext ) { if ( strcasecmp( pszProperty, hCurProperty->szName ) == 0 ) { /* CHANGE IT */ strncpy( hCurProperty->szValue, pszValue, INI_MAX_PROPERTY_VALUE ); return ODBCINST_SUCCESS; } } sprintf( szError, "Could not find property (%s)", pszProperty ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_WARNING, ODBC_ERROR_GENERAL_ERR, szError ); return ODBCINST_ERROR; } int ODBCINSTAddProperty( HODBCINSTPROPERTY hFirstProperty, char *pszProperty, char *pszValue ) { HODBCINSTPROPERTY hNew; hNew = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); memset(hNew, 0, sizeof(ODBCINSTPROPERTY)); hNew->nPromptType = ODBCINST_PROMPTTYPE_HIDDEN; hNew->pNext = NULL; hNew->bRefresh = 0; hNew->hDLL = hFirstProperty->hDLL; hNew->pWidget = NULL; hNew->pszHelp = NULL; hNew->aPromptData = NULL; strcpy(hNew->szName, pszProperty ); strcpy( hNew->szValue, pszValue ); /* * add to end of list */ while ( hFirstProperty -> pNext ) { hFirstProperty = hFirstProperty -> pNext; } hNew -> pNext = NULL; hFirstProperty -> pNext = hNew; return 0; } unixODBC-2.3.9/odbcinst/ODBCINSTValidateProperties.c0000664000175000017500000000112713724126772017004 00000000000000/************************************************** * ODBCINSTValidateProperties * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include int ODBCINSTValidateProperties( HODBCINSTPROPERTY hFirstProperty, HODBCINSTPROPERTY hBadProperty, char *pszMessage ) { return ODBCINST_SUCCESS; } unixODBC-2.3.9/odbcinst/_logging.c0000664000175000017500000001133613724130750013627 00000000000000/********************************************************************* * * Written by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: _logging.c,v 1.5 2009/02/18 17:59:27 lurcher Exp $ * * $Log: _logging.c,v $ * Revision 1.5 2009/02/18 17:59:27 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2008/05/12 13:07:21 lurcher * Push a couple of small changes back into CVS, ready for new release * * Revision 1.3 2008/02/15 15:47:12 lurcher * Add thread protection around ini caching * * Revision 1.2 2007/11/27 17:52:57 peteralexharvey * - changes made during QT4 implementation * * Revision 1.1.1.1 2001/10/17 16:40:30 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:53 nick * Imported Sources * * Revision 1.1 1999/07/15 06:23:39 ngorham * * Added functions to remove the need for _init and _fini * * *********************************************************************/ #include #include #include #ifdef HAVE_LIBPTH #include static pth_mutex_t mutex_log = PTH_MUTEX_INIT; static int pth_init_called = 0; static int local_mutex_entry( void ) { if ( !pth_init_called ) { pth_init(); pth_init_called = 1; } return pth_mutex_acquire( &mutex_log, 0, NULL ); } static int local_mutex_exit( void ) { return pth_mutex_release( &mutex_log ); } #elif HAVE_LIBPTHREAD #include static pthread_mutex_t mutex_log = PTHREAD_MUTEX_INITIALIZER; static int local_mutex_entry( void ) { return pthread_mutex_lock( &mutex_log ); } static int local_mutex_exit( void ) { return pthread_mutex_unlock( &mutex_log ); } #elif HAVE_LIBTHREAD #include static mutex_t mutex_log; static int local_mutex_entry( void ) { return mutex_lock( &mutex_log ); } static int local_mutex_exit( void ) { return mutex_unlock( &mutex_log ); } #else #define local_mutex_entry() #define local_mutex_exit() #endif /* * I don't like these statics but not sure what else we can do... * * Indeed, access to these statics was in fact not thread safe ! * So they are now protected by mutex_log... */ static HLOG hODBCINSTLog = NULL; static int log_tried = 0; int inst_logPushMsg( char *pszModule, char *pszFunctionName, int nLine, int nSeverity, int nCode, char *pszMessage ) { int ret = LOG_ERROR; local_mutex_entry(); if ( !log_tried ) { long nMaxMessages = 10; /* \todo ODBC spec says 8 max. We would make it 0 (unlimited) but at the moment logPeekMsg would be slow if many messages. Revisit when opt is made to log storage. */ log_tried = 1; if ( logOpen( &hODBCINSTLog, "odbcinst", NULL, nMaxMessages ) != LOG_SUCCESS ) { hODBCINSTLog = NULL; } else { logOn( hODBCINSTLog, 1 ); } } if ( hODBCINSTLog ) { ret = logPushMsg( hODBCINSTLog, pszModule, pszFunctionName, nLine, nSeverity, nCode, pszMessage ); } local_mutex_exit(); return ret; } /*! * \brief Get a reference to a message in the log. * * The caller (SQLInstallerError) could call logPeekMsg directly * but we would have to extern hODBCINSTLog and I have not given * any thought to that at this time. * * \param nMsg * \param phMsg * * \return int */ int inst_logPeekMsg( long nMsg, HLOGMSG *phMsg ) { int ret = LOG_NO_DATA; local_mutex_entry(); if ( hODBCINSTLog ) ret = logPeekMsg( hODBCINSTLog, nMsg, phMsg ); local_mutex_exit(); return ret; } int inst_logClear( void ) { int ret = LOG_ERROR; local_mutex_entry(); if ( hODBCINSTLog ) ret = logClear( hODBCINSTLog ); local_mutex_exit(); return ret; } unixODBC-2.3.9/odbcinst/_odbcinst_GetEntries.c0000664000175000017500000000251513724126772016147 00000000000000/**************************************************** * _odbcinst_GetEntries * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include int _odbcinst_GetEntries( HINI hIni, LPCSTR pszSection, LPSTR pRetBuffer, int nRetBuffer, int *pnBufPos ) { char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char *ptr; *pnBufPos = 0; *pRetBuffer = '\0'; ptr = pRetBuffer; iniObjectSeek( hIni, (char *)pszSection ); /* COLLECT ALL ENTRIES FOR THE GIVEN SECTION */ for( iniPropertyFirst( hIni ); iniPropertyEOL( hIni ) != TRUE; iniPropertyNext( hIni )) { iniProperty( hIni, szPropertyName ); if ( *pnBufPos + 1 + strlen( szPropertyName ) >= nRetBuffer ) { break; } else { strcpy( ptr, szPropertyName ); ptr += strlen( ptr ) + 1; (*pnBufPos) += strlen( szPropertyName ) + 1; } } /* * Add final NULL */ if ( *pnBufPos == 0 ) { ptr ++; } *ptr = '\0'; return (*pnBufPos); } unixODBC-2.3.9/odbcinst/SQLRemoveTranslator.c0000755000175000017500000000127112262474476015743 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLRemoveTranslator( LPCSTR pszTranslator, LPDWORD pnUsageCount ) { inst_logClear(); return FALSE; } BOOL INSTAPI SQLRemoveTranslatorW(LPCWSTR lpszTranslator, LPDWORD lpdwUsageCount) { inst_logClear(); return FALSE; } unixODBC-2.3.9/odbcinst/SQLValidDSN.c0000755000175000017500000000312712262474476014042 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include #define SQL_MAX_DSN_LENGTH 32 BOOL SQLValidDSN( LPCSTR pszDSN ) { inst_logClear(); if ( pszDSN == NULL ) return FALSE; if ( strlen( pszDSN ) < 1 || strlen( pszDSN ) > SQL_MAX_DSN_LENGTH ) return FALSE; if ( strstr( pszDSN, "[" ) != NULL ) return FALSE; if ( strstr( pszDSN, "]" ) != NULL ) return FALSE; if ( strstr( pszDSN, "{" ) != NULL ) return FALSE; if ( strstr( pszDSN, "}" ) != NULL ) return FALSE; if ( strstr( pszDSN, "(" ) != NULL ) return FALSE; if ( strstr( pszDSN, ")" ) != NULL ) return FALSE; if ( strstr( pszDSN, "," ) != NULL ) return FALSE; if ( strstr( pszDSN, ";" ) != NULL ) return FALSE; if ( strstr( pszDSN, "?" ) != NULL ) return FALSE; if ( strstr( pszDSN, "*" ) != NULL ) return FALSE; if ( strstr( pszDSN, "=" ) != NULL ) return FALSE; if ( strstr( pszDSN, "!" ) != NULL ) return FALSE; if ( strstr( pszDSN, "@" ) != NULL ) return FALSE; if ( strstr( pszDSN, "\\" ) != NULL ) return FALSE; return TRUE; } BOOL INSTAPI SQLValidDSNW(LPCWSTR lpszDSN) { char *dsn; BOOL ret; inst_logClear(); dsn = _single_string_alloc_and_copy( lpszDSN ); ret = SQLValidDSN( dsn ); free( dsn ); return ret; } unixODBC-2.3.9/odbcinst/SQLInstallDriverManager.c0000755000175000017500000000306212460421174016474 00000000000000/************************************************* * SQLInstallDriverManager * * I return the default dir for core components.. but * thats it. * This may differ slightly from the spec. * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLInstallDriverManager( LPSTR pszPath, WORD nPathMax, WORD *pnPathOut ) { char szIniName[ INI_MAX_OBJECT_NAME + 1 ]; char b1[ ODBC_FILENAME_MAX + 1 ]; inst_logClear(); /* SANITY CHECKS */ if ( pszPath == NULL || nPathMax < 2 ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return 0; } sprintf( szIniName, "%s", odbcinst_system_file_path( b1 ) ); /* DO SOMETHING */ strncpy( pszPath, szIniName, nPathMax ); if ( pnPathOut != NULL ) *pnPathOut = strlen( pszPath ); return TRUE; } BOOL INSTAPI SQLInstallDriverManagerW (LPWSTR lpszPath, WORD cbPathMax, WORD * pcbPathOut) { char *path; BOOL ret; inst_logClear(); path = calloc( cbPathMax, 1 ); ret = SQLInstallDriverManager( path, cbPathMax, pcbPathOut ); if ( ret ) { _single_string_copy_to_wide( lpszPath, path, cbPathMax ); } free( path ); return ret; } unixODBC-2.3.9/odbcinst/SQLInstallTranslatorEx.c0000755000175000017500000000211512262474476016407 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLInstallTranslatorEx( LPCSTR pszTranslator, LPCSTR pszPathIn, LPSTR pszPathOut, WORD nPathOutMax, WORD *pnPathOut, WORD nRequest, LPDWORD pnUsageCount ) { inst_logClear(); return FALSE; } BOOL INSTAPI SQLInstallTranslatorExW(LPCWSTR lpszTranslator, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount) { inst_logClear(); return FALSE; } unixODBC-2.3.9/odbcinst/README0000755000175000017500000000301612262474476012567 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | ODBCINST lib (libodbcinst.so) | +-------------------------------------------------------------+ This share library supports ODBC Install/Setup and Config options. It is modelled after MS'isms and should, therefore, allow for an easy transition from MS'isms to other platforms (ie Linux). A complicating factor for unixODBC is that the GUI may not be present - or if it is - it may be any number of types (X, KDE, GNOME etc). So the GUI bits of odbcinst must be plugable. This library handles this. See SQLManageDataSources() and the unixODBC-GUI-Qt project. This lib also has a command line tool called odbcinst. +-------------------------------------------------------------+ | Peter Harvey | | pharvey@codebydesign.com | | http://www.unixodbc.org | | 10.APR.99 | +-------------------------------------------------------------+ unixODBC-2.3.9/odbcinst/SQLWriteFileDSN.c0000644000175000017500000000630313224646421014657 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLWriteFileDSN( LPCSTR pszFileName, LPCSTR pszAppName, LPCSTR pszKeyName, LPCSTR pszString ) { HINI hIni; char szFileName[ODBC_FILENAME_MAX+1]; if ( pszFileName[0] == '/' ) { strncpy( szFileName, pszFileName, sizeof(szFileName) - 5 ); } else { char szPath[ODBC_FILENAME_MAX+1]; *szPath = '\0'; _odbcinst_FileINI( szPath ); snprintf( szFileName, sizeof(szFileName) - 5, "%s/%s", szPath, pszFileName ); } if ( strlen( szFileName ) < 4 || strcmp( szFileName + strlen( szFileName ) - 4, ".dsn" )) { strcat( szFileName, ".dsn" ); } #ifdef __OS2__ if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE, 0L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_PATH, "" ); return FALSE; } /* delete section */ if ( pszString == NULL && pszKeyName == NULL ) { if ( iniObjectSeek( hIni, (char *)pszAppName ) == INI_SUCCESS ) { iniObjectDelete( hIni ); } } /* delete entry */ else if ( pszString == NULL ) { if ( iniPropertySeek( hIni, (char *)pszAppName, (char *)pszKeyName, "" ) == INI_SUCCESS ) { iniPropertyDelete( hIni ); } } else { /* add section */ if ( iniObjectSeek( hIni, (char *)pszAppName ) != INI_SUCCESS ) { iniObjectInsert( hIni, (char *)pszAppName ); } /* update entry */ if ( iniPropertySeek( hIni, (char *)pszAppName, (char *)pszKeyName, "" ) == INI_SUCCESS ) { iniObjectSeek( hIni, (char *)pszAppName ); iniPropertyUpdate( hIni, (char *)pszKeyName, (char *)pszString ); } /* add entry */ else { iniObjectSeek( hIni, (char *)pszAppName ); iniPropertyInsert( hIni, (char *)pszKeyName, (char *)pszString ); } } if ( iniCommit( hIni ) != INI_SUCCESS ) { iniClose( hIni ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } iniClose( hIni ); return TRUE; } BOOL INSTAPI SQLWriteFileDSNW(LPCWSTR lpszFileName, LPCWSTR lpszAppName, LPCWSTR lpszKeyName, LPCWSTR lpszString) { BOOL ret; char *file; char *app; char *key; char *str; file = lpszFileName ? _single_string_alloc_and_copy( lpszFileName ) : (char*)NULL; app = lpszAppName ? _single_string_alloc_and_copy( lpszAppName ) : (char*)NULL; key = lpszKeyName ? _single_string_alloc_and_copy( lpszKeyName ) : (char*)NULL; str = lpszString ? _single_string_alloc_and_copy( lpszString ) : (char*)NULL; ret = SQLWriteFileDSN( file, app, key, str ); if ( file ) free( file ); if ( app ) free( app ); if ( key ) free( key ); if ( str ) free( str ); return ret; } unixODBC-2.3.9/odbcinst/SQLConfigDataSource.c0000664000175000017500000001544513724126772015620 00000000000000/************************************************** * SQLConfigDataSource * * Determine the DriverSetup file name and then try to pass * the work along to its ConfigDSN(). * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include static BOOL SQLConfigDataSourceWide( HWND hWnd, WORD nRequest, LPCSTR pszDriver, /* USER FRIENDLY NAME (not file name) */ LPCSTR pszAttributes, LPCWSTR pszDriverW, LPCWSTR pszAttributesW ) { BOOL (*pFunc)( HWND, WORD, LPCSTR, LPCSTR ); BOOL (*pFuncW)( HWND, WORD, LPCWSTR, LPCWSTR ); BOOL nReturn; void *hDLL = FALSE; HINI hIni; char szDriverSetup[INI_MAX_PROPERTY_VALUE+1]; char szIniName[ ODBC_FILENAME_MAX * 2 + 3 ]; char b1[ ODBC_FILENAME_MAX + 1 ], b2[ ODBC_FILENAME_MAX + 1 ]; /* SANITY CHECKS */ if ( pszDriver == NULL || pszAttributes == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } if ( pszDriver[0] == '\0' ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } switch ( nRequest ) { case ODBC_ADD_DSN: case ODBC_CONFIG_DSN: case ODBC_REMOVE_DSN: case ODBC_ADD_SYS_DSN: case ODBC_CONFIG_SYS_DSN: case ODBC_REMOVE_SYS_DSN: case ODBC_REMOVE_DEFAULT_DSN: break; default: inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_REQUEST_TYPE, "" ); return FALSE; } #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #else sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #endif /* OK */ #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } /* * initialize libtool */ lt_dlinit(); #ifdef PLATFORM64 if ( iniPropertySeek( hIni, (char *)pszDriver, "Setup64", "" ) == INI_SUCCESS || iniPropertySeek( hIni, (char *)pszDriver, "Setup", "" ) == INI_SUCCESS ) #else if ( iniPropertySeek( hIni, (char *)pszDriver, "Setup", "" ) == INI_SUCCESS ) #endif { iniValue( hIni, szDriverSetup ); iniClose( hIni ); if ( szDriverSetup[ 0 ] == '\0' ) { char szError[ 512 ]; sprintf( szError, "Could not find Setup property for (%.400s) in system information", pszDriver ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, szError ); __set_config_mode( ODBC_BOTH_DSN ); return FALSE; } nReturn = FALSE; if ( (hDLL = lt_dlopen( szDriverSetup )) ) { pFunc = (BOOL (*)(HWND, WORD, LPCSTR, LPCSTR )) lt_dlsym( hDLL, "ConfigDSN" ); pFuncW = (BOOL (*)(HWND, WORD, LPCWSTR, LPCWSTR )) lt_dlsym( hDLL, "ConfigDSNW" ); if ( pFunc ) { /* * set the mode */ switch ( nRequest ) { case ODBC_ADD_DSN: case ODBC_CONFIG_DSN: case ODBC_REMOVE_DSN: case ODBC_REMOVE_DEFAULT_DSN: __set_config_mode( ODBC_USER_DSN ); break; case ODBC_ADD_SYS_DSN: __set_config_mode( ODBC_SYSTEM_DSN ); nRequest = ODBC_ADD_DSN; break; case ODBC_CONFIG_SYS_DSN: __set_config_mode( ODBC_SYSTEM_DSN ); nRequest = ODBC_CONFIG_DSN; break; case ODBC_REMOVE_SYS_DSN: __set_config_mode( ODBC_SYSTEM_DSN ); nRequest = ODBC_REMOVE_DSN; break; } nReturn = pFunc( hWnd, nRequest, pszDriver, pszAttributes ); } else if ( pFuncW ) { /* * set the mode */ switch ( nRequest ) { case ODBC_ADD_DSN: case ODBC_CONFIG_DSN: case ODBC_REMOVE_DSN: case ODBC_REMOVE_DEFAULT_DSN: __set_config_mode( ODBC_USER_DSN ); break; case ODBC_ADD_SYS_DSN: __set_config_mode( ODBC_SYSTEM_DSN ); nRequest = ODBC_ADD_DSN; break; case ODBC_CONFIG_SYS_DSN: __set_config_mode( ODBC_SYSTEM_DSN ); nRequest = ODBC_CONFIG_DSN; break; case ODBC_REMOVE_SYS_DSN: __set_config_mode( ODBC_SYSTEM_DSN ); nRequest = ODBC_REMOVE_DSN; break; } nReturn = pFuncW( hWnd, nRequest, pszDriverW, pszAttributesW ); } else { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); } } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); __set_config_mode( ODBC_BOTH_DSN ); return nReturn; } inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); iniClose( hIni ); __set_config_mode( ODBC_BOTH_DSN ); return FALSE; } BOOL INSTAPI SQLConfigDataSourceW (HWND hwndParent, WORD fRequest, LPCWSTR lpszDriver, LPCWSTR lpszAttributes) { char *drv, *attr; BOOL ret; inst_logClear(); drv = _single_string_alloc_and_copy( lpszDriver ); attr = _multi_string_alloc_and_copy( lpszAttributes ); ret = SQLConfigDataSourceWide( hwndParent, fRequest, drv, attr, lpszDriver, lpszAttributes ); free( drv ); free( attr ); return ret; } BOOL INSTAPI SQLConfigDataSource (HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPCSTR lpszAttributes) { SQLWCHAR *drv, *attr; BOOL ret; inst_logClear(); drv = _single_string_alloc_and_expand( lpszDriver ); attr = _multi_string_alloc_and_expand( lpszAttributes ); ret = SQLConfigDataSourceWide( hwndParent, fRequest, lpszDriver, lpszAttributes, drv, attr ); free( drv ); free( attr ); return ret; } unixODBC-2.3.9/odbcinst/SQLWritePrivateProfileString.c0000644000175000017500000001024413261363730017554 00000000000000/************************************************** * SQLWritePrivateProfileString * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include extern void __clear_ini_cache( void ); BOOL SQLWritePrivateProfileString( LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszString, LPCSTR pszFileName ) { HINI hIni; char szFileName[ODBC_FILENAME_MAX+1]; inst_logClear(); /* SANITY CHECKS */ if ( pszSection == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } if ( pszSection[0] == '\0' ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } if ( pszFileName == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } /***************************************************** * SOME MS CODE (ie some drivers) MAY USE THIS FUNCTION TO WRITE ODBCINST INFO SO... *****************************************************/ if ( strstr( pszFileName, "odbcinst" ) || strstr( pszFileName, "ODBCINST" ) ) return _SQLWriteInstalledDrivers( pszSection, pszEntry, pszString ); if ( pszFileName[0] == '/' ) { strcpy( szFileName, pszFileName ); } else { if ( !*pszFileName || _odbcinst_ConfigModeINI( szFileName ) == FALSE ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } } #ifdef __OS2__ if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } /* delete section */ if ( pszEntry == NULL ) { if ( iniObjectSeek( hIni, (char *)pszSection ) == INI_SUCCESS ) iniObjectDelete( hIni ); } /* delete entry */ else if ( pszString == NULL ) { if ( iniPropertySeek( hIni, (char *)pszSection, (char *)pszEntry, "" ) == INI_SUCCESS ) { iniPropertyDelete( hIni ); } } else { /* add section */ if ( iniObjectSeek( hIni, (char *)pszSection ) != INI_SUCCESS ) iniObjectInsert( hIni, (char *)pszSection ); /* update entry */ if ( iniPropertySeek( hIni, (char *)pszSection, (char *)pszEntry, "" ) == INI_SUCCESS ) { iniObjectSeek( hIni, (char *)pszSection ); /* * Get the correct property to update */ iniPropertySeek( hIni, (char *)pszSection, (char *)pszEntry, "" ); iniPropertyUpdate( hIni, (char *)pszEntry, (char *)pszString ); } /* add entry */ else { iniObjectSeek( hIni, (char *)pszSection ); iniPropertyInsert( hIni, (char *)pszEntry, (char *)pszString ); } } if ( iniCommit( hIni ) != INI_SUCCESS ) { iniClose( hIni ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } iniClose( hIni ); __clear_ini_cache(); return TRUE; } BOOL INSTAPI SQLWritePrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry, LPCWSTR lpszString, LPCWSTR lpszFilename) { char *sect; char *entry; char *string; char *file; BOOL ret; sect = lpszSection ? _single_string_alloc_and_copy( lpszSection ) : (char*)NULL; entry = lpszEntry ? _single_string_alloc_and_copy( lpszEntry ) : (char*)NULL; string = lpszString ? _single_string_alloc_and_copy( lpszString ) : (char*)NULL; file = lpszFilename ? _single_string_alloc_and_copy( lpszFilename ) : (char*)NULL; ret = SQLWritePrivateProfileString( sect, entry, string, file ); if ( sect ) free( sect ); if ( entry ) free( entry ); if ( string ) free( string ); if ( file ) free( file ); return ret; } unixODBC-2.3.9/odbcinst/_odbcinst_ConfigModeINI.c0000664000175000017500000000236413724126772016452 00000000000000/******************************************************* * _odbcinst_ConfigModeINI * * Get first valid INI file name. If we can open it for read then we assume its valid. * 1. ODBC_SYSTEM_DSN * - /etc/odbc.ini * 2. ODBC_USER_DSN * - ODBCINI * - ~/.odbc.ini * - /home/.odbc.ini * 3. ODBC_BOTH_DSN * - ODBC_USER_DSN * - ODBC_SYSTEM_DSN * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL _odbcinst_ConfigModeINI( char *pszFileName ) { UWORD nConfigMode = __get_config_mode(); pszFileName[0] = '\0'; switch ( nConfigMode ) { case ODBC_SYSTEM_DSN: if ( !_odbcinst_SystemINI( pszFileName, TRUE ) ) return FALSE; break; case ODBC_USER_DSN: if ( !_odbcinst_UserINI( pszFileName, TRUE ) ) return FALSE; break; case ODBC_BOTH_DSN: if ( !_odbcinst_UserINI( pszFileName, TRUE ) ) { if ( !_odbcinst_SystemINI( pszFileName, TRUE ) ) return FALSE; } break; default: return FALSE; } return TRUE; } unixODBC-2.3.9/odbcinst/_SQLDriverConnectPrompt.c0000644000175000017500000001077213676604656016552 00000000000000#include #include BOOL _SQLDriverConnectPrompt( HWND hwnd, SQLCHAR *dsn, SQLSMALLINT len_dsn ) { HODBCINSTWND hODBCInstWnd = (HODBCINSTWND)hwnd; char szName[FILENAME_MAX]; char szNameAndExtension[FILENAME_MAX]; char szPathAndName[FILENAME_MAX]; void * hDLL; BOOL (*pODBCDriverConnectPrompt)(HWND, SQLCHAR *, SQLSMALLINT ); BOOL ret; /* initialize libtool */ if ( lt_dlinit() ) { return FALSE; } /* get plugin name */ if ( hODBCInstWnd ) { _appendUIPluginExtension( szNameAndExtension, _getUIPluginName( szName, hODBCInstWnd->szUI ) ); } else { _appendUIPluginExtension( szNameAndExtension, _getUIPluginName( szName, NULL ) ); } /* lets try loading the plugin using an implicit path */ hDLL = lt_dlopen( szNameAndExtension ); if ( hDLL ) { /* change the name, as it avoids it finding it in the calling lib */ pODBCDriverConnectPrompt = (BOOL (*)( HWND, SQLCHAR *, SQLSMALLINT ))lt_dlsym( hDLL, "ODBCDriverConnectPrompt" ); if ( pODBCDriverConnectPrompt ) { if ( hODBCInstWnd ) { ret = pODBCDriverConnectPrompt(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn ); } else { ret = pODBCDriverConnectPrompt( NULL, dsn, len_dsn ); } } else { ret = FALSE; } lt_dlclose( hDLL ); return ret; } else { /* try with explicit path */ _prependUIPluginPath( szPathAndName, szNameAndExtension ); hDLL = lt_dlopen( szPathAndName ); if ( hDLL ) { /* change the name, as it avoids linker finding it in the calling lib */ pODBCDriverConnectPrompt = (BOOL (*)(HWND, SQLCHAR *, SQLSMALLINT ))lt_dlsym( hDLL, "ODBCDriverConnectPrompt" ); if ( pODBCDriverConnectPrompt ) { if ( hODBCInstWnd ) { ret = pODBCDriverConnectPrompt(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn ); } else { ret = pODBCDriverConnectPrompt( NULL, dsn, len_dsn ); } } else { ret = FALSE; } lt_dlclose( hDLL ); return ret; } } return FALSE; } BOOL _SQLDriverConnectPromptW( HWND hwnd, SQLWCHAR *dsn, SQLSMALLINT len_dsn ) { HODBCINSTWND hODBCInstWnd = (HODBCINSTWND)hwnd; char szName[FILENAME_MAX]; char szNameAndExtension[FILENAME_MAX]; char szPathAndName[FILENAME_MAX]; void * hDLL; BOOL (*pODBCDriverConnectPromptW)(HWND, SQLWCHAR *, SQLSMALLINT ); BOOL ret; /* initialize libtool */ if ( lt_dlinit() ) { return FALSE; } /* get plugin name */ if ( hODBCInstWnd ) { _appendUIPluginExtension( szNameAndExtension, _getUIPluginName( szName, hODBCInstWnd->szUI ) ); } else { _appendUIPluginExtension( szNameAndExtension, _getUIPluginName( szName, NULL ) ); } /* lets try loading the plugin using an implicit path */ hDLL = lt_dlopen( szNameAndExtension ); if ( hDLL ) { /* change the name, as it avoids it finding it in the calling lib */ pODBCDriverConnectPromptW = (BOOL (*)( HWND, SQLWCHAR *, SQLSMALLINT ))lt_dlsym( hDLL, "ODBCDriverConnectPromptW" ); if ( pODBCDriverConnectPromptW ) { if ( hODBCInstWnd ) { ret = pODBCDriverConnectPromptW(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn ); } else { ret = pODBCDriverConnectPromptW( NULL, dsn, len_dsn ); } } else { ret = FALSE; } lt_dlclose( hDLL ); return ret; } else { /* try with explicit path */ _prependUIPluginPath( szPathAndName, szNameAndExtension ); hDLL = lt_dlopen( szPathAndName ); if ( hDLL ) { /* change the name, as it avoids linker finding it in the calling lib */ pODBCDriverConnectPromptW = (BOOL (*)(HWND, SQLWCHAR *, SQLSMALLINT ))lt_dlsym( hDLL, "ODBCDriverConnectPromptW" ); if ( pODBCDriverConnectPromptW ) { if ( hODBCInstWnd ) { ret = pODBCDriverConnectPromptW(( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), dsn, len_dsn ); } else { ret = pODBCDriverConnectPromptW( NULL, dsn, len_dsn ); } } else { ret = FALSE; } lt_dlclose( hDLL ); return ret; } } return FALSE; } unixODBC-2.3.9/odbcinst/SQLRemoveDriver.c0000755000175000017500000000651312460421312015026 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLRemoveDriver( LPCSTR pszDriver, BOOL nRemoveDSN, LPDWORD pnUsageCount ) { HINI hODBCInstIni; char szValue[INI_MAX_PROPERTY_VALUE+1]; char szIniName[ ODBC_FILENAME_MAX * 2 + 1 ]; char b1[ ODBC_FILENAME_MAX + 1 ], b2[ ODBC_FILENAME_MAX + 1 ]; inst_logClear(); /* SANITY CHECKS */ if ( pszDriver == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_NAME, "" ); return FALSE; } if ( pszDriver[0] == '\0' ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_NAME, "" ); return FALSE; } if ( nRemoveDSN != TRUE && nRemoveDSN != FALSE ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } (*pnUsageCount) = 0; #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #else sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #endif /* PROCESS ODBC INST INI FILE */ #ifdef __OS2__ if ( iniOpen( &hODBCInstIni, szIniName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hODBCInstIni, szIniName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return FALSE; } /* LETS GET ITS FILE USAGE VALUE (if any) */ if ( iniPropertySeek( hODBCInstIni, (char *)pszDriver, "UsageCount", "" ) == INI_SUCCESS ) { iniValue( hODBCInstIni, szValue ); (*pnUsageCount) = atoi( szValue ); } /* DOES THE OBJECT ALREADY EXIST? (also ensures that we have correct current object) */ if ( iniObjectSeek( hODBCInstIni, (char *)pszDriver ) == INI_SUCCESS ) { if ( (*pnUsageCount) == 0 ) (*pnUsageCount) = 1; (*pnUsageCount)--; if ( (*pnUsageCount) == 0 ) { iniObjectDelete( hODBCInstIni ); if ( nRemoveDSN ) { /*********************************** * TO DO ***********************************/ } } else { if ( iniPropertySeek( hODBCInstIni, (char *)pszDriver, "UsageCount", "" ) == INI_SUCCESS ) { sprintf( szValue, "%ld", (long int)(*pnUsageCount) ); iniPropertyUpdate( hODBCInstIni, "UsageCount", szValue ); } else { iniPropertyInsert( hODBCInstIni, "UsageCount", szValue ); } } if ( iniCommit( hODBCInstIni ) != INI_SUCCESS ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); iniClose( hODBCInstIni ); return FALSE; } } iniClose( hODBCInstIni ); return TRUE; } BOOL INSTAPI SQLRemoveDriverW(LPCWSTR lpszDriver, BOOL fRemoveDSN, LPDWORD lpdwUsageCount) { BOOL ret; char *drv = _single_string_alloc_and_copy( lpszDriver ); inst_logClear(); ret = SQLRemoveDriver( drv, fRemoveDSN, lpdwUsageCount ); free( drv ); return ret; } unixODBC-2.3.9/odbcinst/SQLRemoveDriverManager.c0000755000175000017500000000126012262474476016336 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLRemoveDriverManager( LPDWORD pnUsageCount ) { inst_logClear(); if ( pnUsageCount == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } *pnUsageCount = 1; return TRUE; } unixODBC-2.3.9/odbcinst/_odbcinst_UserINI.c0000664000175000017500000000573713724126772015365 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #ifdef HAVE_PWD_H #include #endif #include #ifdef VMS BOOL _odbcinst_UserINI( char *pszFileName, BOOL bVerify ) { FILE *hFile; char *szEnv_INIUSER = getvmsenv("ODBCINI"); struct passwd *pPasswd = NULL; char *pHomeDir = NULL; pszFileName[0] = '\0'; if ( szEnv_INIUSER ) { strncpy( pszFileName, szEnv_INIUSER, ODBC_FILENAME_MAX ); } else { sprintf( pszFileName, "SYS$LOGIN:ODBC.INI" ); } if ( bVerify ) { hFile = uo_fopen( pszFileName, "r" ); if ( hFile ) uo_fclose( hFile ); else return FALSE; } return TRUE; } #else BOOL _odbcinst_UserINI( char *pszFileName, BOOL bVerify ) { FILE *hFile; char *szEnv_INIUSER = getenv("ODBCINI"); #ifdef HAVE_GETUID uid_t nUserID = getuid(); #else uid_t nUserID = 0; #endif struct passwd *pPasswd = NULL; char *pHomeDir = NULL; pHomeDir = "/home"; #ifdef HAVE_GETPWUID pPasswd = (struct passwd *)getpwuid(nUserID); #endif pszFileName[0] = '\0'; #ifdef HAVE_PWD_H if ( pPasswd != NULL ) if ( ( char *)pPasswd->pw_dir != NULL ) pHomeDir = pPasswd->pw_dir; #else pHomeDir = getenv("HOME"); #endif if ( szEnv_INIUSER ) { strncpy( pszFileName, szEnv_INIUSER, ODBC_FILENAME_MAX ); } if ( pszFileName[0] == '\0' ) { sprintf( pszFileName, "%s%s", pHomeDir, "/.odbc.ini" ); } #ifdef DHAVE_ENDPWENT /* * close the password file */ endpwent(); #endif if ( bVerify ) { /* * create it of it doesn't exist */ hFile = uo_fopen( pszFileName, "a" ); if ( hFile ) uo_fclose( hFile ); else return FALSE; } return TRUE; } #endif BOOL _odbcinst_FileINI( char *pszPath ) { char b1[ ODBC_FILENAME_MAX + 1 ]; /* we need a viable buffer (with space for FILENAME_MAX chars)... */ if ( !pszPath ) return FALSE; /* system configured to use a special location... */ *pszPath = '\0'; SQLGetPrivateProfileString( "ODBC", "FileDSNPath", "", pszPath, FILENAME_MAX - 2, "odbcinst.ini" ); if ( *pszPath ) return TRUE; /* default location... */ sprintf( pszPath, "%s/ODBCDataSources", odbcinst_system_file_path( b1 )); return TRUE; } unixODBC-2.3.9/odbcinst/SQLManageDataSources.c0000644000175000017500000001456313676604117015764 00000000000000/************************************************** * SQLManageDataSources * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /*! * \brief Get the short name of the UI plugin. * * The short name is the file name without path or file extension. * * We silently prepend "lib" here as well. * * \param pszName Place to put short name. Should be FILENAME_MAX bytes. * \param pszUI Our generic window handle. * * \return char* pszName returned for convenience. */ char *_getUIPluginName( char *pszName, char *pszUI ) { *pszName = '\0'; /* is it being provided by caller? */ if ( pszUI && *pszUI ) { sprintf( pszName, "lib%s", pszUI ); return pszName; } /* is it being provided by env var? */ { char *pEnvVar = getenv( "ODBCINSTUI" ); if ( pEnvVar ) { sprintf( pszName, "lib%s", pEnvVar ); return pszName; } } /* is it being provided by odbcinst.ini? */ { char sz[FILENAME_MAX]; *sz='\0'; SQLGetPrivateProfileString( "ODBC", "ODBCINSTUI", "", sz, FILENAME_MAX, "odbcinst.ini" ); if ( *sz ) { sprintf( pszName, "lib%s", sz ); return pszName; } } /* default to qt4 */ strcpy( pszName, ODBCINSTPLUGIN ); return pszName; } /*! * \brief Append the file extension used by the OS for plugins. * * We use SHLIBEXT which is picked up at configure/build time. * * \param pszNameAndExtension Output. Needs to be FILENAME_MAX bytes. * \param pszName Input. * * \return char* pszNameAndExtension returned for convenience. */ char *_appendUIPluginExtension( char *pszNameAndExtension, char *pszName ) { if ( strlen( SHLIBEXT ) > 0 ) sprintf( pszNameAndExtension, "%s%s", pszName, SHLIBEXT ); else sprintf( pszNameAndExtension, "%s.so", pszName ); return pszName; } /*! * \brief Prepends the path used for the plugins. * * We use DEFLIB_PATH and if it is not available... * path may not get prepended. * * \param pszPathAndName Output. Needs to be FILENAME_MAX bytes. * \param pszName Input. * * \return char* pszPathAndName is returned for convenience. */ char *_prependUIPluginPath( char *pszPathAndName, char *pszName ) { if ( strlen( DEFLIB_PATH ) > 0 ) sprintf( pszPathAndName, "%s/%s", DEFLIB_PATH, pszName ); else sprintf( pszPathAndName, "%s", pszName ); return pszPathAndName; } /*! * \brief UI to manage most ODBC system information. * * This calls into the UI plugin library to do our work for us. The caller can provide * the name (base name) of the library or let us determine which library to use. * See \sa _getUIPluginName for details on how the choice is made. * * \param hWnd Input. Parent window handle. This is HWND as per the ODBC * specification but in unixODBC we use a generic window * handle. Caller must cast a HODBCINSTWND to HWND at call. * * \return BOOL * * \sa ODBCINSTWND */ BOOL SQLManageDataSources( HWND hWnd ) { HODBCINSTWND hODBCInstWnd = (HODBCINSTWND)hWnd; char szName[FILENAME_MAX]; char szNameAndExtension[FILENAME_MAX]; char szPathAndName[FILENAME_MAX]; void * hDLL; BOOL (*pSQLManageDataSources)(HWND); inst_logClear(); /* ODBC specification states that hWnd is mandatory. */ if ( !hWnd ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_HWND, "No hWnd" ); return FALSE; } /* initialize libtool */ if ( lt_dlinit() ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "lt_dlinit() failed" ); return FALSE; } /* get plugin name */ _appendUIPluginExtension( szNameAndExtension, _getUIPluginName( szName, hODBCInstWnd->szUI ) ); /* lets try loading the plugin using an implicit path */ hDLL = lt_dlopen( szNameAndExtension ); if ( hDLL ) { /* change the name (SQLManageDataSources to ODBCManageDataSources) to prevent us from calling ourself */ pSQLManageDataSources = (BOOL (*)(HWND))lt_dlsym( hDLL, "ODBCManageDataSources" ); if ( pSQLManageDataSources ) { BOOL ret; ret = pSQLManageDataSources( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ) ); lt_dlclose( hDLL ); return ret; } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() ); lt_dlclose( hDLL ); } else { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_WARNING, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() ); /* try with explicit path */ _prependUIPluginPath( szPathAndName, szNameAndExtension ); hDLL = lt_dlopen( szPathAndName ); if ( hDLL ) { /* change the name (SQLManageDataSources to ODBCManageDataSources) to prevent us from calling ourself */ /* its only safe to use hWnd if szUI was specified by the caller */ pSQLManageDataSources = (BOOL (*)(HWND))lt_dlsym( hDLL, "ODBCManageDataSources" ); if ( pSQLManageDataSources ) { BOOL ret; ret = pSQLManageDataSources( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ) ); lt_dlclose( hDLL ); return ret; } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() ); lt_dlclose( hDLL ); } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() ); } /* report failure to caller */ inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Failed to load/use a UI plugin." ); return FALSE; } unixODBC-2.3.9/odbcinst/SQLConfigDriver.c0000664000175000017500000001462713724126772015022 00000000000000/************************************************** * SQLConfigDriver * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include static BOOL SQLConfigDriverWide( HWND hWnd, WORD nRequest, LPCSTR pszDriver, LPCSTR pszArgs, LPSTR pszMsg, WORD nMsgMax, WORD *pnMsgOut, LPCWSTR pszDriverW, LPCWSTR pszArgsW, LPWSTR pszMsgW, int *iswide ) { void *hDLL; BOOL (*pConfigDriver)( HWND, WORD, LPCSTR, LPCSTR, LPCSTR, WORD, WORD * ); BOOL (*pConfigDriverW)( HWND, WORD, LPCWSTR, LPCWSTR, LPCWSTR, WORD, WORD * ); char szDriverSetup[ODBC_FILENAME_MAX+1]; HINI hIni; char szIniName[ ODBC_FILENAME_MAX * 2 + 1 ]; char b1[ ODBC_FILENAME_MAX + 1 ], b2[ ODBC_FILENAME_MAX + 1 ]; *iswide = 0; /* SANITY CHECKS */ if ( pszDriver == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_NAME, "" ); return FALSE; } if ( nRequest > ODBC_CONFIG_DRIVER ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_REQUEST_TYPE, "" ); return FALSE; } /* OK */ #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); #else sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); #endif /* lets get driver setup file name from odbcinst.ini */ #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_NAME, "" ); return FALSE; } #ifdef PLATFORM64 if ( iniPropertySeek( hIni, (char *)pszDriver, "Setup64", "" ) == INI_SUCCESS || iniPropertySeek( hIni, (char *)pszDriver, "Setup", "" ) == INI_SUCCESS ) #else if ( iniPropertySeek( hIni, (char *)pszDriver, "Setup", "" ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_NAME, "" ); iniClose( hIni ); return FALSE; } iniValue( hIni, szDriverSetup ); iniClose( hIni ); /* * initialize libtool */ lt_dlinit(); /* process request */ switch ( nRequest ) { case ODBC_CONFIG_DRIVER: /* WHAT OPTIONS CAN WE EXPECT IN pszArgs?? * Sounds like just connection pooling options * In anycase, the spec says handle this in the * odbcinst so we probably want to make some calls here... * How common are Driver config options (not DSN options) anyway? * - Peter */ break; case ODBC_INSTALL_DRIVER: case ODBC_REMOVE_DRIVER: default : /* DRIVER SEPCIFIC are default; HANDLE AS PER INSTALL & REMOVE */ /* errors in here are ignored, according to the spec; perhaps I should ret error and let app ignore? */ if ( (hDLL = lt_dlopen( szDriverSetup )) ) { pConfigDriver = (BOOL (*)(HWND, WORD, LPCSTR, LPCSTR, LPCSTR, WORD, WORD * )) lt_dlsym( hDLL, "ConfigDriver" ); pConfigDriverW = (BOOL (*)(HWND, WORD, LPCWSTR, LPCWSTR, LPCWSTR, WORD, WORD * )) lt_dlsym( hDLL, "ConfigDriverW" ); /* if ( lt_dlerror() == NULL ) */ if ( pConfigDriver ) pConfigDriver( hWnd, nRequest, pszDriver, pszArgs, pszMsg, nMsgMax, pnMsgOut); else if ( pConfigDriverW ) { pConfigDriverW( hWnd, nRequest, pszDriverW, pszArgsW, pszMsgW, nMsgMax, pnMsgOut); *iswide = 1; } else { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); } lt_dlclose( hDLL ); } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); } return TRUE; } BOOL INSTAPI SQLConfigDriver(HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPCSTR lpszArgs, LPSTR lpszMsg, WORD cbMsgMax, WORD *pcbMsgOut) { SQLWCHAR *drv; SQLWCHAR *args; SQLWCHAR *msg; BOOL ret; WORD len; int iswide; inst_logClear(); drv = lpszDriver ? _single_string_alloc_and_expand( lpszDriver ) : (SQLWCHAR*)NULL; args = lpszArgs ? _multi_string_alloc_and_expand( lpszArgs ) : (SQLWCHAR*)NULL; if ( lpszMsg ) { if ( cbMsgMax > 0 ) { msg = calloc( cbMsgMax + 1, sizeof( SQLWCHAR )); } else { msg = NULL; } } else { msg = NULL; } ret = SQLConfigDriverWide( hwndParent, fRequest, lpszDriver, lpszArgs, lpszMsg, cbMsgMax, &len, drv, args, msg, &iswide ); if ( drv ) free( drv ); if ( args ) free( args ); if ( iswide ) { if ( ret && msg ) { _single_copy_from_wide((SQLCHAR*) lpszMsg, msg, len + 1 ); } } else { /* * the output is already in the right buffer */ } if ( msg ) free( msg ); if ( pcbMsgOut ) *pcbMsgOut = len; return ret; } BOOL INSTAPI SQLConfigDriverW(HWND hwndParent, WORD fRequest, LPCWSTR lpszDriver, LPCWSTR lpszArgs, LPWSTR lpszMsg, WORD cbMsgMax, WORD *pcbMsgOut) { char *drv; char *args; char *msg; BOOL ret; WORD len; int iswide; inst_logClear(); drv = lpszDriver ? _single_string_alloc_and_copy( lpszDriver ) : (char*)NULL; args = lpszArgs ? _multi_string_alloc_and_copy( lpszArgs ) : (char*)NULL; if ( lpszMsg ) { if ( cbMsgMax > 0 ) { msg = calloc( cbMsgMax + 1, 1 ); } else { msg = NULL; } } else { msg = NULL; } ret = SQLConfigDriverWide( hwndParent, fRequest, drv, args, msg, cbMsgMax, &len, lpszDriver, lpszArgs, lpszMsg, &iswide ); if ( drv ) free( drv ); if ( args ) free( args ); if ( iswide ) { /* * the output is already in the right buffer */ } else { if ( ret && msg ) { _single_copy_to_wide( lpszMsg, msg, len + 1 ); } } if ( msg ) free( msg ); if ( pcbMsgOut ) *pcbMsgOut = len; return ret; } unixODBC-2.3.9/odbcinst/SQLGetPrivateProfileString.c0000644000175000017500000004352213364073074017211 00000000000000/**************************************************** * SQLGetPrivateProfileString * * Mostly used with odbc.ini files but can be used for odbcinst.ini * * IF pszFileName[0] == '/' THEN * use pszFileName * ELSE * use _odbcinst_ConfigModeINI() to get the complete file name for the current mode. * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include #include #ifdef ENABLE_INI_CACHING #ifdef HAVE_LIBPTH #include static pth_mutex_t mutex_ini = PTH_MUTEX_INIT; static int pth_init_called = 0; static int mutex_entry( pth_mutex_t *mutex ) { if ( !pth_init_called ) { pth_init(); pth_init_called = 1; } return pth_mutex_acquire( mutex, 0, NULL ); } static int mutex_exit( pth_mutex_t *mutex ) { return pth_mutex_release( mutex ); } #elif HAVE_LIBPTHREAD #include static pthread_mutex_t mutex_ini = PTHREAD_MUTEX_INITIALIZER; static int mutex_entry( pthread_mutex_t *mutex ) { return pthread_mutex_lock( mutex ); } static int mutex_exit( pthread_mutex_t *mutex ) { return pthread_mutex_unlock( mutex ); } #elif HAVE_LIBTHREAD #include static mutex_t mutex_ini; static int mutex_entry( mutex_t *mutex ) { return mutex_lock( mutex ); } static int mutex_exit( mutex_t *mutex ) { return mutex_unlock( mutex ); } #else #define mutex_entry(x) #define mutex_exit(x) #endif static struct ini_cache *ini_cache_head = NULL; static int _check_ini_cache( int *ret, LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPSTR pRetBuffer, int nRetBuffer, LPCSTR pszFileName ) { struct ini_cache *ini_cache = ini_cache_head, *prev = NULL; UWORD config_mode; long tstamp = time( NULL ); if ( pszSection == NULL || pszEntry == NULL ) { return 0; } config_mode = __get_config_mode(); /* * look for expired entries, remove one each call */ for ( prev = NULL, ini_cache = ini_cache_head; ini_cache; ini_cache = ini_cache -> next ) { if ( ini_cache -> timestamp < tstamp ) { if ( prev ) { prev -> next = ini_cache -> next; } else { ini_cache_head = ini_cache -> next; } if ( ini_cache -> fname ) free( ini_cache -> fname ); if ( ini_cache -> section ) free( ini_cache -> section ); if ( ini_cache -> entry ) free( ini_cache -> entry ); if ( ini_cache -> value ) free( ini_cache -> value ); if ( ini_cache -> default_value ) free( ini_cache -> default_value ); free( ini_cache ); break; } prev = ini_cache; } for ( ini_cache = ini_cache_head; ini_cache; ini_cache = ini_cache -> next ) { if ( !pszFileName && ini_cache -> fname ) continue; if ( pszFileName && !ini_cache -> fname ) continue; if ( pszFileName && ini_cache -> fname && strcmp( pszFileName, ini_cache -> fname )) continue; if ( ini_cache -> config_mode != config_mode ) continue; if ( !pszSection && ini_cache -> section ) continue; if ( pszSection && !ini_cache -> section ) continue; if ( pszSection && ini_cache -> section && strcmp( pszSection, ini_cache -> section )) continue; if ( !pszEntry && ini_cache -> entry ) continue; if ( pszEntry && !ini_cache -> entry ) continue; if ( pszEntry && ini_cache -> entry && strcmp( pszEntry, ini_cache -> entry )) continue; if ( !pszDefault && ini_cache -> default_value ) continue; if ( pszDefault && !ini_cache -> default_value ) continue; if ( pszDefault && ini_cache -> default_value && strcmp( pszDefault, ini_cache -> default_value )) continue; if ( !pRetBuffer && ini_cache -> value ) continue; if ( pRetBuffer && !ini_cache -> value ) continue; if ( nRetBuffer < ini_cache -> buffer_size ) continue; if ( pRetBuffer ) { if ( ini_cache -> value ) { if ( nRetBuffer < strlen( ini_cache -> value )) { strncpy( pRetBuffer, ini_cache -> value, nRetBuffer ); pRetBuffer[ nRetBuffer - 1 ] = '\0'; } else { strcpy( pRetBuffer, ini_cache -> value ); } } *ret = ini_cache -> ret_value; return 1; } } return 0; } static void _save_ini_cache( int ret, LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPSTR pRetBuffer, int nRetBuffer, LPCSTR pszFileName ) { struct ini_cache *ini_cache; UWORD config_mode; long tstamp = time( NULL ) + 20; /* expiry every 20 seconds */ ini_cache = calloc( sizeof( struct ini_cache ), 1 ); if ( !ini_cache ) { return; } if ( pszFileName ) ini_cache -> fname = strdup( pszFileName ); if ( pszSection ) ini_cache -> section = strdup( pszSection ); if ( pszEntry ) ini_cache -> entry = strdup( pszEntry ); if ( pRetBuffer && ret >= 0 ) ini_cache -> value = strdup( pRetBuffer ); if ( pszDefault ) ini_cache -> default_value = strdup( pszDefault ); ini_cache -> buffer_size = nRetBuffer; ini_cache -> ret_value = ret; config_mode = __get_config_mode(); ini_cache -> config_mode = config_mode; ini_cache -> timestamp = tstamp; ini_cache -> next = ini_cache_head; ini_cache_head = ini_cache; } static void _clear_ini_cache( void ) { struct ini_cache *ini_cache = ini_cache_head; while (( ini_cache = ini_cache_head ) != NULL ) { ini_cache_head = ini_cache -> next; if ( ini_cache -> fname ) free( ini_cache -> fname ); if ( ini_cache -> section ) free( ini_cache -> section ); if ( ini_cache -> entry ) free( ini_cache -> entry ); if ( ini_cache -> value ) free( ini_cache -> value ); if ( ini_cache -> default_value ) free( ini_cache -> default_value ); free( ini_cache ); } } /* * wrappers to provide thread safety */ static int check_ini_cache( int *ret, LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPSTR pRetBuffer, int nRetBuffer, LPCSTR pszFileName ) { int rval; mutex_entry( &mutex_ini ); rval = _check_ini_cache( ret, pszSection, pszEntry, pszDefault, pRetBuffer, nRetBuffer, pszFileName ); mutex_exit( &mutex_ini ); return rval; } static void save_ini_cache( int ret, LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPSTR pRetBuffer, int nRetBuffer, LPCSTR pszFileName ) { int cval; mutex_entry( &mutex_ini ); /* * check its not been inserted since the last check */ if ( !_check_ini_cache( &cval, pszSection, pszEntry, pszDefault, pRetBuffer, nRetBuffer, pszFileName )) { _save_ini_cache( ret, pszSection, pszEntry, pszDefault, pRetBuffer, nRetBuffer, pszFileName ); } mutex_exit( &mutex_ini ); } void __clear_ini_cache( void ) { mutex_entry( &mutex_ini ); _clear_ini_cache(); mutex_exit( &mutex_ini ); } #else static int check_ini_cache( int *ret, LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPSTR pRetBuffer, int nRetBuffer, LPCSTR pszFileName ) { return 0; } static void save_ini_cache( int ret, LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPSTR pRetBuffer, int nRetBuffer, LPCSTR pszFileName ) { } void __clear_ini_cache( void ) { } #endif int SQLGetPrivateProfileString( LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPSTR pRetBuffer, int nRetBuffer, LPCSTR pszFileName ) { HINI hIni; int nBufPos = 0; char szValue[INI_MAX_PROPERTY_VALUE+1]; char szFileName[ODBC_FILENAME_MAX+1]; UWORD nConfigMode; int ini_done = 0; int ret; inst_logClear(); if ( check_ini_cache( &ret, pszSection, pszEntry, pszDefault, pRetBuffer, nRetBuffer, pszFileName )) { return ret; } /* SANITY CHECKS */ if ( pRetBuffer == NULL || nRetBuffer < 2 ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return -1; } if ( pszSection != NULL && pszEntry != NULL && pszDefault == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "need default value - try empty string" ); return -1; } *pRetBuffer = '\0'; /***************************************************** * SOME MS CODE (ie some drivers) MAY USE THIS FUNCTION TO GET ODBCINST INFO SO... *****************************************************/ if ( pszFileName != NULL ) { if ( strstr( pszFileName, "odbcinst" ) || strstr( pszFileName, "ODBCINST" ) ) { ret = _SQLGetInstalledDrivers( pszSection, pszEntry, pszDefault, pRetBuffer, nRetBuffer ); if ( ret == -1 ) { /* try to use any default provided */ if ( pRetBuffer && nRetBuffer > 0 ) { if ( pszDefault ) { strncpy( pRetBuffer, pszDefault, nRetBuffer ); pRetBuffer[ nRetBuffer - 1 ] = '\0'; } } } else { save_ini_cache( ret, pszSection, pszEntry, pszDefault, pRetBuffer, nRetBuffer, pszFileName ); } return ret; } else if ( !*pszFileName ) { return 0; /* Asking for empty filename returns nothing, not even default */ } } /***************************************************** * GATHER ALL RELEVANT DSN INFORMATION INTO AN hIni *****************************************************/ if ( pszFileName != 0 && pszFileName[0] == '/' ) { #ifdef __OS2__ if ( iniOpen( &hIni, (char*)pszFileName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, (char*)pszFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return -1; } } else { nConfigMode = __get_config_mode(); nBufPos = 0; szFileName[0] = '\0'; switch ( nConfigMode ) { case ODBC_BOTH_DSN: if ( _odbcinst_UserINI( szFileName, TRUE )) { #ifdef __OS2__ if ( iniOpen( &hIni, (char*) szFileName, "#;", '[', ']', '=', TRUE, 1L ) == INI_SUCCESS ) #else if ( iniOpen( &hIni, (char*) szFileName, "#;", '[', ']', '=', TRUE ) == INI_SUCCESS ) #endif { ini_done = 1; } } _odbcinst_SystemINI( szFileName, TRUE ); if ( !ini_done ) { #ifdef __OS2__ if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return -1; } } else { iniAppend( hIni, szFileName ); } break; case ODBC_USER_DSN: _odbcinst_UserINI( szFileName, TRUE ); #ifdef __OS2__ if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return -1; } break; case ODBC_SYSTEM_DSN: _odbcinst_SystemINI( szFileName, TRUE ); #ifdef __OS2__ if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return -1; } break; default: inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Invalid Config Mode" ); return -1; } } /***************************************************** * EXTRACT SECTIONS *****************************************************/ if ( pszSection == NULL ) { _odbcinst_GetSections( hIni, pRetBuffer, nRetBuffer, &nBufPos ); if (nBufPos > 0) ret = _multi_string_length(pRetBuffer); else ret = 0; /* Indicate not found */ } /***************************************************** * EXTRACT ENTRIES *****************************************************/ else if ( pszEntry == NULL ) { _odbcinst_GetEntries( hIni, pszSection, pRetBuffer, nRetBuffer, &nBufPos ); if (nBufPos > 0) ret = _multi_string_length(pRetBuffer); else ret = 0; /* Indicate not found */ } /***************************************************** * EXTRACT AN ENTRY *****************************************************/ else { if ( pszSection == NULL || pszEntry == NULL || pszDefault == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return -1; } /* TRY TO GET THE ONE ITEM MATCHING Section & Entry */ if ( iniPropertySeek( hIni, (char *)pszSection, (char *)pszEntry, "" ) != INI_SUCCESS ) { /* * (NG) this seems to be ignoring the length of pRetBuffer !!! */ /* strncpy( pRetBuffer, pszDefault, INI_MAX_PROPERTY_VALUE ); */ if ( pRetBuffer && nRetBuffer > 0 && pszDefault ) { strncpy( pRetBuffer, pszDefault, nRetBuffer ); pRetBuffer[ nRetBuffer - 1 ] = '\0'; } } else { iniValue( hIni, szValue ); if ( pRetBuffer ) { strncpy( pRetBuffer, szValue, nRetBuffer ); pRetBuffer[ nRetBuffer - 1 ] = '\0'; } nBufPos = strlen( szValue ); } ret = strlen( pRetBuffer ); } iniClose( hIni ); save_ini_cache( ret, pszSection, pszEntry, pszDefault, pRetBuffer, nRetBuffer, pszFileName ); return ret; } int INSTAPI SQLGetPrivateProfileStringW( LPCWSTR lpszSection, LPCWSTR lpszEntry, LPCWSTR lpszDefault, LPWSTR lpszRetBuffer, int cbRetBuffer, LPCWSTR lpszFilename) { int ret; char *sect; char *entry; char *def; char *buf; char *name; inst_logClear(); sect = lpszSection ? _single_string_alloc_and_copy( lpszSection ) : (char*)NULL; entry = lpszEntry ? _single_string_alloc_and_copy( lpszEntry ) : (char*)NULL; def = lpszDefault ? _single_string_alloc_and_copy( lpszDefault ) : (char*)NULL; name = lpszFilename ? _single_string_alloc_and_copy( lpszFilename ) : (char*)NULL; if ( lpszRetBuffer ) { if ( cbRetBuffer > 0 ) { buf = calloc( cbRetBuffer + 1, 1 ); } else { buf = NULL; } } else { buf = NULL; } ret = SQLGetPrivateProfileString( sect, entry, def, buf, cbRetBuffer, name ); if ( sect ) free( sect ); if ( entry ) free( entry ); if ( def ) free( def ); if ( name ) free( name ); if ( ret > 0 ) { if ( buf && lpszRetBuffer ) { if ( !lpszSection || !lpszEntry ) _multi_string_copy_to_wide( lpszRetBuffer, buf, ret ); else _single_copy_to_wide( lpszRetBuffer, buf, ret ); } } if ( buf ) { free( buf ); } return ret; } unixODBC-2.3.9/odbcinst/SQLGetTranslator.c0000755000175000017500000000223612262474476015227 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLGetTranslator( HWND hWnd, LPSTR pszName, WORD nNameMax, WORD *pnNameOut, LPSTR pszPath, WORD nPathMax, WORD *pnPathOut, DWORD *pnOption ) { inst_logClear(); return FALSE; } BOOL INSTAPI SQLGetTranslatorW (HWND hwnd, LPWSTR lpszName, WORD cbNameMax, WORD *pcbNameOut, LPWSTR lpszPath, WORD cbPathMax, WORD *pcbPathOut, DWORD *pvOption) { inst_logClear(); return FALSE; } unixODBC-2.3.9/odbcinst/SQLInstallerError.c0000755000175000017500000001476513723652323015407 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /*! * \brief Standard installer error. */ typedef struct tODBCINSTErrorMsg { int nCode; /*!< error code */ char * szMsg; /*!< error text */ } ODBCINSTErrorMsg; /*! * \brief A lookup for all standard installer (odbcinst) error codes and * corresponding message text. * * An odd thing that we do here is that we assume the values of error codes * (ODBC_ERROR_GENERAL_ERR, ODBC_ERROR_INVALID_BUFF_LEN, etc) are in the same * sequence we have layed out here... ascending order starting at 1. We then * can index into here using the standard error code and get the standard error * text. This is why we have 0,"Filler" in here. */ static ODBCINSTErrorMsg aODBCINSTErrorMsgs[] = { { 0, "Filler" }, { ODBC_ERROR_GENERAL_ERR, "General installer error" }, { ODBC_ERROR_INVALID_BUFF_LEN, "Invalid buffer length" }, { ODBC_ERROR_INVALID_HWND, "Invalid window handle" }, { ODBC_ERROR_INVALID_STR, "Invalid string" }, { ODBC_ERROR_INVALID_REQUEST_TYPE, "Invalid type of request" }, { ODBC_ERROR_COMPONENT_NOT_FOUND, "Unable to find component name" }, { ODBC_ERROR_INVALID_NAME, "Invalid driver or translator name" }, { ODBC_ERROR_INVALID_KEYWORD_VALUE, "Invalid keyword-value pairs" }, { ODBC_ERROR_INVALID_DSN, "Invalid DSN" }, { ODBC_ERROR_INVALID_INF, "Invalid INF" }, { ODBC_ERROR_REQUEST_FAILED, "General error request failed" }, { ODBC_ERROR_INVALID_PATH, "Invalid install path" }, { ODBC_ERROR_LOAD_LIB_FAILED, "Could not load the driver or translator setup library" }, { ODBC_ERROR_INVALID_PARAM_SEQUENCE, "Invalid parameter sequence" }, { ODBC_ERROR_INVALID_LOG_FILE, "Invalid log file" }, { ODBC_ERROR_USER_CANCELED, "User canceled operation" }, { ODBC_ERROR_USAGE_UPDATE_FAILED, "Could not increment or decrement the component usage count" }, { ODBC_ERROR_CREATE_DSN_FAILED, "Could not create the requested DSN" }, { ODBC_ERROR_WRITING_SYSINFO_FAILED, "Error writing sysinfo" }, { ODBC_ERROR_REMOVE_DSN_FAILED, "Removing DSN failed" }, { ODBC_ERROR_OUT_OF_MEM, "Out of memory" }, { ODBC_ERROR_OUTPUT_STRING_TRUNCATED, "String right truncated" } }; /*! * \brief Returns error information from odbcinst. * * All calls to odbcinst, except SQLInstallerError and SQLPostInstallerError, may * post/log messages. An application checks the return value of a call and then * calls SQLInstallerError, as needed, to get any error information. * * All calls to odbcinst, except SQLInstallerError and SQLPostInstallerError, will * start by clearing out existing messages. * * \param nError Input. Messages are enumerated starting with 1 as the oldest. The * ODBC specification states that there are a max 8 messages stored at * any time but unixODBC may provide more than that. * \param pnErrorCode Output. The odbcinst error code as per the ODBC specification. * \param pszErrorMsg Output. The error text. In general this is the error text from * the ODBC specification but unixODBC may provide an alternate, more * meaningfull text. * \param nErrorMsgMax Input. Max chars which can be returned in pszErrorMsg. * \param pnErrorMsg Output. strlen of error text available to be returned. * * \return RETCODE * \retval SQL_NO_DATA No data to be returned for nError. * \retval SQL_ERROR Something went wrong - most likley bad args in call. * \retval SQL_SUCCESS_WITH_INFO Text was truncated. * \retval SQL_SUCCESS Error information was returned. * * \sa SQLPostInstallerError * ODBCINSTErrorMsg */ RETCODE SQLInstallerError( WORD nError, DWORD *pnErrorCode, LPSTR pszErrorMsg, WORD nErrorMsgMax, WORD *pnErrorMsg ) { HLOGMSG hLogMsg = NULL; WORD nErrorMsg = 0; char * pszText = NULL; /* these are mandatory so... */ if ( pnErrorCode == NULL || pszErrorMsg == NULL ) return SQL_ERROR; /* this is optional so... */ if ( !pnErrorMsg ) pnErrorMsg = &nErrorMsg; /* get our message */ if ( inst_logPeekMsg( nError, &hLogMsg ) != LOG_SUCCESS ) return SQL_NO_DATA; /* return code */ *pnErrorCode = hLogMsg->nCode; /* any custom message has precedence over the standard messages since its probably more meaningfull */ if ( *(hLogMsg->pszMessage) ) pszText = hLogMsg->pszMessage; else pszText = aODBCINSTErrorMsgs[hLogMsg->nCode].szMsg; /* how many chars in error text? */ *pnErrorMsg = strlen( pszText ); /* are we going to have to truncate the text due to lack of buffer space? */ if ( *pnErrorMsg > nErrorMsgMax ) { strncpy( pszErrorMsg, pszText, nErrorMsgMax ); pszErrorMsg[ nErrorMsgMax ] = '\0'; return SQL_SUCCESS_WITH_INFO; } /* success without further complications :) */ strcpy( pszErrorMsg, pszText ); return SQL_SUCCESS; } /*! * \brief A wide char version of SQLInstallerError. * * \sa SQLInstallerError */ SQLRETURN INSTAPI SQLInstallerErrorW(WORD iError, DWORD *pfErrorCode, LPWSTR lpszErrorMsg, WORD cbErrorMsgMax, WORD *pcbErrorMsg) { char *msg; SQLRETURN ret; WORD len; if ( lpszErrorMsg ) { if ( cbErrorMsgMax > 0 ) { msg = calloc( cbErrorMsgMax + 1, 1 ); } else { msg = NULL; } } else { msg = NULL; } ret = SQLInstallerError( iError, pfErrorCode, msg, cbErrorMsgMax, &len ); if ( ret == SQL_SUCCESS ) { if ( pcbErrorMsg ) *pcbErrorMsg = len; if ( msg && lpszErrorMsg ) { _single_copy_to_wide( lpszErrorMsg, msg, len + 1 ); } } else if ( ret == SQL_SUCCESS_WITH_INFO ) { if ( pcbErrorMsg ) *pcbErrorMsg = len; if ( msg && lpszErrorMsg ) { _single_copy_to_wide( lpszErrorMsg, msg, cbErrorMsgMax ); } } if ( msg ) { free( msg ); } return ret; } unixODBC-2.3.9/odbcinst/odbcinst.pc.in0000664000175000017500000000044713545647573014456 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ Name: odbcinst (@PACKAGE_NAME@) Description: unixODBC Configuration Library URL: http://unixodbc.org Version: @PACKAGE_VERSION@ Cflags: -I${includedir} Libs: -L${libdir} -lodbcinst Libs.private: @LIBLTDL@ @LIBS@ unixODBC-2.3.9/odbcinst/odbcinst.exp0000644000175000017500000000263413260654445014227 00000000000000SQLInstallODBC SQLManageDataSources SQLCreateDataSource SQLGetTranslator SQLInstallDriver SQLInstallDriverManager SQLGetInstalledDrivers SQLGetAvailableDrivers SQLConfigDataSource SQLRemoveDefaultDataSource SQLWriteDSNToIni SQLRemoveDSNFromIni SQLValidDSN SQLWritePrivateProfileString SQLGetPrivateProfileString SQLRemoveDriverManager SQLInstallTranslator SQLRemoveTranslator SQLRemoveDriver SQLConfigDriver SQLInstallerError SQLPostInstallerError SQLWriteFileDSN SQLReadFileDSN SQLInstallDriverEx SQLInstallTranslatorEx SQLGetConfigMode SQLSetConfigMode SQLInstallODBCW SQLCreateDataSourceW SQLGetTranslatorW SQLInstallDriverW SQLInstallDriverManagerW SQLGetInstalledDriversW SQLGetAvailableDriversW SQLConfigDataSourceW SQLWriteDSNToIniW SQLRemoveDSNFromIniW SQLValidDSNW SQLWritePrivateProfileStringW SQLGetPrivateProfileStringW SQLInstallTranslatorW SQLRemoveTranslatorW SQLRemoveDriverW SQLConfigDriverW SQLInstallerErrorW SQLPostInstallerErrorW SQLReadFileDSNW SQLWriteFileDSNW SQLInstallDriverExW SQLInstallTranslatorExW ODBCINSTConstructProperties ODBCINSTSetProperty ODBCINSTDestructProperties ODBCINSTAddProperty ODBCINSTValidateProperty ODBCINSTValidateProperties odbcinst_system_file_path odbcinst_system_file_name odbcinst_user_file_path odbcinst_user_file_name _odbcinst_SystemINI _odbcinst_UserINI _odbcinst_FileINI _SQLDriverConnectPrompt _SQLDriverConnectPromptW inst_logPushMsg unixODBC-2.3.9/odbcinst/_SQLWriteInstalledDrivers.c0000755000175000017500000000554612460421427017061 00000000000000/************************************************** * _SQLWriteInstalledDrivers * * Added to allow ODBC Config programs and the iODBC * driver manager to access system information without * having to worry about where it is... just like accessing * Data Source information. So no surprise... its just * like SQLWritePrivateProfileString()! ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL _SQLWriteInstalledDrivers( LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszString ) { HINI hIni; char szIniName[ ODBC_FILENAME_MAX * 2 + 1 ]; char b1[ ODBC_FILENAME_MAX + 1 ], b2[ ODBC_FILENAME_MAX + 1 ]; /* SANITY CHECKS */ if ( pszSection == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } if ( pszSection[0] == '\0' ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } /* OK */ #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #else sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #endif #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } /* delete section */ if ( pszEntry == NULL ) { if ( iniObjectSeek( hIni, (char *)pszSection ) == INI_SUCCESS ) iniObjectDelete( hIni ); } /* delete entry */ else if ( pszString == NULL ) { if ( iniPropertySeek( hIni, (char *)pszSection, (char *)pszEntry, "" ) == INI_SUCCESS ) iniPropertyDelete( hIni ); } else { /* add section */ if ( iniObjectSeek( hIni, (char *)pszSection ) != INI_SUCCESS ) { iniObjectInsert( hIni, (char *)pszSection ); } /* update entry */ if ( iniPropertySeek( hIni, (char *)pszSection, (char *)pszEntry, "" ) == INI_SUCCESS ) { /* iniObjectSeek( hIni, (char *)pszSection ); */ iniPropertyUpdate( hIni, (char *)pszEntry, (char *)pszString ); } /* add entry */ else { iniObjectSeek( hIni, (char *)pszSection ); iniPropertyInsert( hIni, (char *)pszEntry, (char *)pszString ); } } if ( iniCommit( hIni ) != INI_SUCCESS ) { iniClose( hIni ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } iniClose( hIni ); return TRUE; } unixODBC-2.3.9/odbcinst/SQLReadFileDSN.c0000644000175000017500000001711113676604312014443 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include static void GetEntries( HINI hIni, LPCSTR pszSection, LPSTR pRetBuffer, int nRetBuffer ) { char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char szValueName[INI_MAX_PROPERTY_NAME+1]; /* COLLECT ALL ENTRIES FOR THE GIVEN SECTION */ iniObjectSeek( hIni, (char *)pszSection ); iniPropertyFirst( hIni ); *pRetBuffer = '\0'; while ( iniPropertyEOL( hIni ) != TRUE ) { iniProperty( hIni, szPropertyName ); iniValue( hIni, szValueName ); if ( strlen( pRetBuffer ) + strlen( szPropertyName ) < nRetBuffer ) { strcat( pRetBuffer, szPropertyName ); if ( strlen( pRetBuffer ) + 1 < nRetBuffer ) { strcat( pRetBuffer, "=" ); if ( strlen( pRetBuffer ) + strlen( szValueName ) < nRetBuffer ) { strcat( pRetBuffer, szValueName ); if ( strlen( pRetBuffer ) + 1 < nRetBuffer ) { strcat( pRetBuffer, ";" ); } } } } iniPropertyNext( hIni ); } } static void GetSections( HINI hIni, LPSTR pRetBuffer, int nRetBuffer ) { char szObjectName[INI_MAX_OBJECT_NAME+1]; *pRetBuffer = '\0'; /* JUST COLLECT SECTION NAMES */ iniObjectFirst( hIni ); while ( iniObjectEOL( hIni ) != TRUE ) { iniObject( hIni, szObjectName ); if ( strcasecmp( szObjectName, "ODBC Data Sources" ) != 0 ) { if ( strlen( pRetBuffer ) + strlen( szObjectName ) + 1 < nRetBuffer ) { strcat( pRetBuffer, szObjectName ); strcat( pRetBuffer, ";" ); } } iniObjectNext( hIni ); } } BOOL SQLReadFileDSN( LPCSTR pszFileName, LPCSTR pszAppName, LPCSTR pszKeyName, LPSTR pszString, WORD nString, WORD *pnString ) { HINI hIni; char szValue[INI_MAX_PROPERTY_VALUE+1]; char szFileName[ODBC_FILENAME_MAX+1]; inst_logClear(); /* SANITY CHECKS */ if ( pszString == NULL || nString < 1 ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_BUFF_LEN, "" ); return FALSE; } if ( pszFileName == NULL && pszAppName == NULL && pszKeyName == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } if ( pszAppName == NULL && pszKeyName != NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_REQUEST_TYPE, "" ); return FALSE; } if ( pszFileName && strlen( pszFileName ) > ODBC_FILENAME_MAX ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_PATH, "" ); return FALSE; } *pszString = '\0'; /***************************************************** * GATHER ALL RELEVANT DSN INFORMATION INTO AN hIni *****************************************************/ if ( pszFileName && pszFileName[0] == '/' ) { strcpy( szFileName, pszFileName ); if ( strlen( szFileName ) < 4 || strcmp( szFileName + strlen( szFileName ) - 4, ".dsn" )) { strcat( szFileName, ".dsn" ); } /* on OS/2 the file DSN is a text file */ #ifdef __OS2__ if ( iniOpen( &hIni, (char*)szFileName, "#;", '[', ']', '=', TRUE, 0L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, (char*)szFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_PATH, "" ); return FALSE; } } else if ( pszFileName ) { char szPath[ODBC_FILENAME_MAX+1]; *szPath = '\0'; _odbcinst_FileINI( szPath ); sprintf( szFileName, "%s/%s", szPath, pszFileName ); if ( strlen( szFileName ) < 4 || strcmp( szFileName + strlen( szFileName ) - 4, ".dsn" )) { strcat( szFileName, ".dsn" ); } /* on OS/2 the file DSN is a text file */ #ifdef __OS2__ if ( iniOpen( &hIni, (char*) szFileName, "#;", '[', ']', '=', TRUE, 0L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, (char*) szFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_PATH, "" ); return FALSE; } } if ( pszAppName == NULL && pszKeyName == NULL ) { GetSections( hIni, pszString, nString ); } else if ( pszAppName != NULL && pszKeyName == NULL ) { GetEntries( hIni, pszAppName, pszString, nString ); } else { /* TRY TO GET THE ONE ITEM MATCHING Section & Entry */ if ( iniPropertySeek( hIni, (char *)pszAppName, (char *)pszKeyName, "" ) != INI_SUCCESS ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); if ( pszFileName ) { iniClose( hIni ); } return FALSE; } else { iniValue( hIni, szValue ); strncpy( pszString, szValue, nString ); pszString[ nString - 1 ] = '\0'; } } if ( pszFileName ) { iniClose( hIni ); } if ( pnString ) { *pnString = strlen( pszString ); } return TRUE; } BOOL INSTAPI SQLReadFileDSNW(LPCWSTR lpszFileName, LPCWSTR lpszAppName, LPCWSTR lpszKeyName, LPWSTR lpszString, WORD cbString, WORD *pcbString) { char *file; char *app; char *key; char *str; WORD len; BOOL ret; inst_logClear(); file = lpszFileName ? _single_string_alloc_and_copy( lpszFileName ) : (char*)NULL; app = lpszAppName ? _single_string_alloc_and_copy( lpszAppName ) : (char*)NULL; key = lpszKeyName ? _single_string_alloc_and_copy( lpszKeyName ) : (char*)NULL; if ( lpszString ) { if ( cbString > 0 ) { str = calloc( cbString + 1, 1 ); } else { str = NULL; } } else { str = NULL; } ret = SQLReadFileDSN( file, app, key, str, cbString, &len ); if ( ret ) { if ( str && lpszString ) { _single_copy_to_wide( lpszString, str, len + 1 ); } } if ( file ) free( file ); if ( app ) free( app ); if ( key ) free( key ); if ( str ) free( str ); if ( pcbString ) *pcbString = len; return ret; } unixODBC-2.3.9/odbcinst/ODBCINSTValidateProperty.c0000664000175000017500000000110413724126772016467 00000000000000/************************************************** * ODBCINSTValidateProperty * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include int ODBCINSTValidateProperty( HODBCINSTPROPERTY hFirstProperty, char *pszProperty, char *pszMessage ) { return ODBCINST_SUCCESS; } unixODBC-2.3.9/odbcinst/_odbcinst_GetSections.c0000664000175000017500000000262613724126772016330 00000000000000/**************************************************** * _odbcinst_GetSections * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include int _odbcinst_GetSections( HINI hIni, LPSTR pRetBuffer, int nRetBuffer, int *pnBufPos /* SET TO 0 IF RESULT DATA IS EMPTY */ ) { char szObjectName[INI_MAX_OBJECT_NAME+1]; char *ptr; *pnBufPos = 0; *pRetBuffer = '\0'; ptr = pRetBuffer; /* JUST COLLECT SECTION NAMES */ for( iniObjectFirst( hIni ); iniObjectEOL( hIni ) != TRUE; iniObjectNext( hIni )) { iniObject( hIni, szObjectName ); if ( strcasecmp( szObjectName, "ODBC Data Sources" ) == 0 ) { continue; } else if ( *pnBufPos + 1 + strlen( szObjectName ) >= nRetBuffer ) { break; } else { strcpy( ptr, szObjectName ); ptr += strlen( ptr ) + 1; (*pnBufPos) += strlen( szObjectName ) + 1; } } /* * Add final NULL */ if ( *pnBufPos == 0 ) { ptr ++; } *ptr = '\0'; return (*pnBufPos); } unixODBC-2.3.9/odbcinst/SQLInstallDriverEx.c0000644000175000017500000001603213124703200015463 00000000000000/************************************************* * SQLInstallDriverEx * * pnUsageCount UsageCount is incremented and decremented * only in this lib. This is done whenever * a request is made to install or remove * a driver. * This differs slightly from the MS spec. * see UsageCount entries in odbcinst.ini * * pszPathOut This lacks some smarts. I will pass pszPathIn * back here or, if pszPathIn=NULL, I will default * to /usr/lib * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLInstallDriverEx( LPCSTR pszDriver, LPCSTR pszPathIn, LPSTR pszPathOut, WORD nPathOutMax, WORD *pnPathOut, WORD nRequest, LPDWORD pnUsageCount ) { HINI hIni; char szObjectName[INI_MAX_OBJECT_NAME+1]; char szNameValue[INI_MAX_PROPERTY_NAME+INI_MAX_PROPERTY_VALUE+3]; char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char szValue[INI_MAX_PROPERTY_VALUE+1]; char szIniName[ ODBC_FILENAME_MAX * 2 + 1 ]; BOOL bInsertUsageCount; int nElement; int nUsageCount = 0; /* SHOULD GET THIS FROM SOMEWHERE ? */ char b1[ ODBC_FILENAME_MAX + 1 ], b2[ ODBC_FILENAME_MAX + 1 ]; inst_logClear(); /* SANITY CHECKS */ if ( pszDriver == NULL || pszPathOut == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } if ( nRequest != ODBC_INSTALL_INQUIRY && nRequest != ODBC_INSTALL_COMPLETE ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_REQUEST_TYPE, "" ); return FALSE; } memset( pszPathOut, '\0', nPathOutMax ); if ( pszPathIn ) { #ifdef VMS snprintf( szIniName, sizeof(szIniName), "%s:%s", pszPathIn, odbcinst_system_file_name( b2 ) ); #else snprintf( szIniName, sizeof(szIniName), "%s/%s", pszPathIn, odbcinst_system_file_name( b2 ) ); #endif } else { #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #else sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #endif } /* PROCESS ODBC INST INI FILE */ #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return FALSE; } if ( iniElement( (char *)pszDriver, '\0', '\0', 0, szObjectName, INI_MAX_OBJECT_NAME ) != INI_SUCCESS ) { iniClose( hIni ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_KEYWORD_VALUE, "" ); return FALSE; } /* LETS GET ITS FILE USAGE VALUE (if any) */ if ( iniPropertySeek( hIni, szObjectName, "UsageCount", "" ) == INI_SUCCESS ) { iniValue( hIni, szValue ); nUsageCount = atoi( szValue ); } /* DOES THE OBJECT ALREADY EXIST? (also ensures that we have correct current object) */ if ( iniObjectSeek( hIni, szObjectName ) == INI_SUCCESS ) { if ( nUsageCount == 0 ) nUsageCount = 1; if ( nRequest == ODBC_INSTALL_COMPLETE ) { iniObjectDelete( hIni ); } } /* LETS ADD THE SECTION AND ENTRY */ nUsageCount++; if ( nRequest == ODBC_INSTALL_COMPLETE ) { bInsertUsageCount = TRUE; iniObjectInsert( hIni, szObjectName ); for ( nElement=1; iniElement( (char *)pszDriver, '\0', '\0', nElement, szNameValue, INI_MAX_PROPERTY_NAME+INI_MAX_PROPERTY_VALUE+3 ) == INI_SUCCESS; nElement++ ) { iniElement( szNameValue, '=', '\0', 0, szPropertyName, INI_MAX_PROPERTY_NAME ); iniElementEOL( szNameValue, '=', '\0', 1, szValue, INI_MAX_PROPERTY_VALUE ); if ( szPropertyName[0] != '\0' ) { /* OVERRIDE ANY USAGE COUNT CHANGES */ if ( strcasecmp( szPropertyName, "UsageCount" ) == 0 ) { bInsertUsageCount = FALSE; sprintf( szValue, "%d", nUsageCount ); } iniPropertyInsert( hIni, szPropertyName, szValue ); } else { iniClose( hIni ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_KEYWORD_VALUE, "" ); return FALSE; } } /* for */ if ( bInsertUsageCount ) { /* LETS INSERT USAGE COUNT */ sprintf( szValue, "%d", nUsageCount ); iniPropertyInsert( hIni, "UsageCount", szValue ); } if ( iniCommit( hIni ) != INI_SUCCESS ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_PATH, "" ); iniClose( hIni ); return FALSE; } } iniClose( hIni ); /* OK, SO WHATS LEFT? */ if ( pszPathIn == NULL ) { if ( pszPathOut ) { if ( strlen( odbcinst_system_file_path( b1 )) < nPathOutMax ) { strcpy( pszPathOut, odbcinst_system_file_path( b1 )); } else { strncpy( pszPathOut, odbcinst_system_file_path( b1 ), nPathOutMax ); pszPathOut[ nPathOutMax - 1 ] = '\0'; } } } else { if ( pszPathOut ) { if ( strlen( pszPathIn ) < nPathOutMax ) { strcpy( pszPathOut, pszPathIn ); } else { strncpy( pszPathOut, pszPathIn, nPathOutMax ); pszPathOut[ nPathOutMax - 1 ] = '\0'; } } } if ( pnPathOut != NULL ) { if ( pszPathIn == NULL ) { *pnPathOut = strlen( odbcinst_system_file_path( b1 )); } else { *pnPathOut = strlen( pszPathIn ); } } if ( pnUsageCount != NULL ) { *pnUsageCount = nUsageCount; } return TRUE; } BOOL INSTAPI SQLInstallDriverExW(LPCWSTR lpszDriver, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount) { char *drv; char *pth; char *pout; WORD len; BOOL ret; inst_logClear(); drv = lpszDriver ? _multi_string_alloc_and_copy( lpszDriver ) : (char*)NULL; pth = lpszPathIn ? _single_string_alloc_and_copy( lpszPathIn ) : (char*)NULL; if ( lpszPathOut ) { if ( cbPathOutMax > 0 ) { pout = calloc( cbPathOutMax + 1, 1 ); } else { pout = NULL; } } else { pout = NULL; } ret = SQLInstallDriverEx( drv, pth, pout, cbPathOutMax, &len, fRequest, lpdwUsageCount ); if ( ret ) { if ( pout && lpszPathOut ) { _single_copy_to_wide( lpszPathOut, pout, len + 1 ); } } if ( pcbPathOut ) { *pcbPathOut = len; } if ( drv ) free( drv ); if ( pth ) free( pth ); if ( pout ) free( pout ); return ret; } unixODBC-2.3.9/odbcinst/SQLGetConfigMode.c0000755000175000017500000000116612262474476015111 00000000000000/************************************************** * SQLGetConfigMode * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com * Nick Gorham - nick@lurcher.org **************************************************/ #include #include #include BOOL SQLGetConfigMode( UWORD *pnConfigMode ) { inst_logClear(); *pnConfigMode = __get_config_mode(); return TRUE; } unixODBC-2.3.9/odbcinst/Makefile.in0000664000175000017500000007514513725127175013763 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = odbcinst ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = odbcinst.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sysconfdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = am_libodbcinst_la_OBJECTS = ODBCINSTConstructProperties.lo \ ODBCINSTDestructProperties.lo ODBCINSTSetProperty.lo \ ODBCINSTValidateProperties.lo ODBCINSTValidateProperty.lo \ SQLConfigDataSource.lo SQLConfigDriver.lo \ SQLCreateDataSource.lo SQLGetAvailableDrivers.lo \ SQLGetConfigMode.lo SQLGetInstalledDrivers.lo \ SQLGetPrivateProfileString.lo SQLGetTranslator.lo \ SQLInstallDriverEx.lo SQLInstallDriverManager.lo \ SQLInstallTranslatorEx.lo SQLInstallerError.lo \ SQLManageDataSources.lo SQLPostInstallerError.lo \ SQLReadFileDSN.lo SQLRemoveDSNFromIni.lo SQLRemoveDriver.lo \ SQLRemoveDriverManager.lo SQLRemoveTranslator.lo \ SQLSetConfigMode.lo SQLValidDSN.lo SQLWriteDSNToIni.lo \ SQLWriteFileDSN.lo SQLWritePrivateProfileString.lo \ SQLInstallODBC.lo _logging.lo _odbcinst_ConfigModeINI.lo \ _odbcinst_UserINI.lo _odbcinst_SystemINI.lo \ _odbcinst_GetSections.lo _odbcinst_GetEntries.lo \ _SQLGetInstalledDrivers.lo _SQLWriteInstalledDrivers.lo \ _SQLDriverConnectPrompt.lo libodbcinst_la_OBJECTS = $(am_libodbcinst_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcinst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcinst_la_LDFLAGS) $(LDFLAGS) -o \ $@ libodbcinstlc_la_LIBADD = am_libodbcinstlc_la_OBJECTS = ODBCINSTConstructProperties.lo \ ODBCINSTDestructProperties.lo ODBCINSTSetProperty.lo \ ODBCINSTValidateProperties.lo ODBCINSTValidateProperty.lo \ SQLConfigDataSource.lo SQLConfigDriver.lo \ SQLCreateDataSource.lo SQLGetAvailableDrivers.lo \ SQLGetConfigMode.lo SQLGetInstalledDrivers.lo \ SQLGetPrivateProfileString.lo SQLGetTranslator.lo \ SQLInstallDriverEx.lo SQLInstallDriverManager.lo \ SQLInstallTranslatorEx.lo SQLInstallerError.lo \ SQLManageDataSources.lo SQLPostInstallerError.lo \ SQLReadFileDSN.lo SQLRemoveDSNFromIni.lo SQLRemoveDriver.lo \ SQLRemoveDriverManager.lo SQLRemoveTranslator.lo \ SQLSetConfigMode.lo SQLValidDSN.lo SQLWriteDSNToIni.lo \ SQLWriteFileDSN.lo SQLWritePrivateProfileString.lo _logging.lo \ _odbcinst_ConfigModeINI.lo _odbcinst_UserINI.lo \ _odbcinst_SystemINI.lo _odbcinst_GetSections.lo \ _odbcinst_GetEntries.lo _SQLGetInstalledDrivers.lo \ _SQLWriteInstalledDrivers.lo _SQLDriverConnectPrompt.lo libodbcinstlc_la_OBJECTS = $(am_libodbcinstlc_la_OBJECTS) libodbcinstlc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcinstlc_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcinst_la_SOURCES) $(libodbcinstlc_la_SOURCES) DIST_SOURCES = $(libodbcinst_la_SOURCES) $(libodbcinstlc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(sysconf_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/odbcinst.pc.in \ $(top_srcdir)/depcomp $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbcinst.la AM_CPPFLAGS = -I@top_srcdir@/include \ $(LTDLINCL) EXTRA_DIST = \ odbcinst.exp libodbcinst_la_LDFLAGS = \ -no-undefined \ -version-info @LIB_VERSION@ \ -export-dynamic \ -export-symbols @srcdir@/odbcinst.exp libodbcinst_la_LIBADD = \ ../ini/libinilc.la \ ../log/libloglc.la \ ../lst/liblstlc.la \ $(LIBLTDL) libodbcinst_la_DEPENDENCIES = \ ../log/libloglc.la \ ../ini/libinilc.la \ ../lst/liblstlc.la \ $(LTDLDEPS) sysconf_DATA = libodbcinst_la_SOURCES = \ ODBCINSTConstructProperties.c \ ODBCINSTDestructProperties.c \ ODBCINSTSetProperty.c \ ODBCINSTValidateProperties.c \ ODBCINSTValidateProperty.c \ SQLConfigDataSource.c \ SQLConfigDriver.c \ SQLCreateDataSource.c \ SQLGetAvailableDrivers.c \ SQLGetConfigMode.c \ SQLGetInstalledDrivers.c \ SQLGetPrivateProfileString.c \ SQLGetTranslator.c \ SQLInstallDriverEx.c \ SQLInstallDriverManager.c \ SQLInstallTranslatorEx.c \ SQLInstallerError.c \ SQLManageDataSources.c \ SQLPostInstallerError.c \ SQLReadFileDSN.c \ SQLRemoveDSNFromIni.c \ SQLRemoveDriver.c \ SQLRemoveDriverManager.c \ SQLRemoveTranslator.c \ SQLSetConfigMode.c \ SQLValidDSN.c \ SQLWriteDSNToIni.c \ SQLWriteFileDSN.c \ SQLWritePrivateProfileString.c \ SQLInstallODBC.c \ _logging.c \ _odbcinst_ConfigModeINI.c \ _odbcinst_UserINI.c \ _odbcinst_SystemINI.c \ _odbcinst_GetSections.c \ _odbcinst_GetEntries.c \ _SQLGetInstalledDrivers.c \ _SQLWriteInstalledDrivers.c \ _SQLDriverConnectPrompt.c libodbcinstlc_la_LDFLAGS = noinst_LTLIBRARIES = libodbcinstlc.la libodbcinstlc_la_SOURCES = \ ODBCINSTConstructProperties.c \ ODBCINSTDestructProperties.c \ ODBCINSTSetProperty.c \ ODBCINSTValidateProperties.c \ ODBCINSTValidateProperty.c \ SQLConfigDataSource.c \ SQLConfigDriver.c \ SQLCreateDataSource.c \ SQLGetAvailableDrivers.c \ SQLGetConfigMode.c \ SQLGetInstalledDrivers.c \ SQLGetPrivateProfileString.c \ SQLGetTranslator.c \ SQLInstallDriverEx.c \ SQLInstallDriverManager.c \ SQLInstallTranslatorEx.c \ SQLInstallerError.c \ SQLManageDataSources.c \ SQLPostInstallerError.c \ SQLReadFileDSN.c \ SQLRemoveDSNFromIni.c \ SQLRemoveDriver.c \ SQLRemoveDriverManager.c \ SQLRemoveTranslator.c \ SQLSetConfigMode.c \ SQLValidDSN.c \ SQLWriteDSNToIni.c \ SQLWriteFileDSN.c \ SQLWritePrivateProfileString.c \ _logging.c \ _odbcinst_ConfigModeINI.c \ _odbcinst_UserINI.c \ _odbcinst_SystemINI.c \ _odbcinst_GetSections.c \ _odbcinst_GetEntries.c \ _SQLGetInstalledDrivers.c \ _SQLWriteInstalledDrivers.c \ _SQLDriverConnectPrompt.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu odbcinst/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu odbcinst/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): odbcinst.pc: $(top_builddir)/config.status $(srcdir)/odbcinst.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcinst.la: $(libodbcinst_la_OBJECTS) $(libodbcinst_la_DEPENDENCIES) $(EXTRA_libodbcinst_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcinst_la_LINK) -rpath $(libdir) $(libodbcinst_la_OBJECTS) $(libodbcinst_la_LIBADD) $(LIBS) libodbcinstlc.la: $(libodbcinstlc_la_OBJECTS) $(libodbcinstlc_la_DEPENDENCIES) $(EXTRA_libodbcinstlc_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcinstlc_la_LINK) $(libodbcinstlc_la_OBJECTS) $(libodbcinstlc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODBCINSTConstructProperties.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODBCINSTDestructProperties.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODBCINSTSetProperty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODBCINSTValidateProperties.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODBCINSTValidateProperty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLConfigDataSource.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLConfigDriver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCreateDataSource.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetAvailableDrivers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConfigMode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetInstalledDrivers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetPrivateProfileString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetTranslator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLInstallDriverEx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLInstallDriverManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLInstallODBC.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLInstallTranslatorEx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLInstallerError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLManageDataSources.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPostInstallerError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLReadFileDSN.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRemoveDSNFromIni.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRemoveDriver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRemoveDriverManager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRemoveTranslator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConfigMode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLValidDSN.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLWriteDSNToIni.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLWriteFileDSN.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLWritePrivateProfileString.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_SQLDriverConnectPrompt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_SQLGetInstalledDrivers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_SQLWriteInstalledDrivers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_logging.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_odbcinst_ConfigModeINI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_odbcinst_GetEntries.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_odbcinst_GetSections.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_odbcinst_SystemINI.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_odbcinst_UserINI.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-sysconfDATA install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-sysconfDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip install-sysconfDATA installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-sysconfDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/odbcinst/ODBCINSTDestructProperties.c0000664000175000017500000000272313724126772017053 00000000000000/************************************************** * ODBCINSTDestructProperties * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include int ODBCINSTDestructProperties( HODBCINSTPROPERTY *hFirstProperty ) { HODBCINSTPROPERTY hNextProperty; HODBCINSTPROPERTY hCurProperty; /* SANITY CHECKS */ if ( (*hFirstProperty) == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Invalid property list handle" ); return ODBCINST_ERROR; } /* FREE MEMORY */ for ( hCurProperty = (*hFirstProperty); hCurProperty != NULL; hCurProperty = hNextProperty ) { hNextProperty = hCurProperty->pNext; /* FREE ANY PROMPT DATA (ie pick list options and such) */ if ( hCurProperty->aPromptData != NULL ) free( hCurProperty->aPromptData ); /* 1st PROPERTY HAS HANDLE TO DriverSetup DLL; LETS LET THE O/S KNOW WE ARE DONE WITH IT */ if ( hCurProperty == (*hFirstProperty) && hCurProperty->hDLL != NULL ) lt_dlclose( hCurProperty->hDLL ); /* FREE OTHER STUFF */ if ( hCurProperty->pszHelp != NULL ) free( hCurProperty->pszHelp ); free( hCurProperty ); } (*hFirstProperty) = NULL; return ODBCINST_SUCCESS; } unixODBC-2.3.9/odbcinst/SQLCreateDataSource.c0000664000175000017500000002162413724126772015612 00000000000000/************************************************** * SQLCreateDataSource * * This is a 100% UI so simply pass it on to odbcinst's UI * shadow share. * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /* * Take a wide string consisting of null terminated sections, and copy to a ASCII version */ char* _multi_string_alloc_and_copy( LPCWSTR in ) { char *chr; int len = 0; if ( !in ) { return NULL; } while ( in[ len ] != 0 || in[ len + 1 ] != 0 ) { len ++; } chr = malloc( len + 2 ); len = 0; while ( in[ len ] != 0 || in[ len + 1 ] != 0 ) { chr[ len ] = 0xFF & in[ len ]; len ++; } chr[ len ++ ] = '\0'; chr[ len ++ ] = '\0'; return chr; } char* _single_string_alloc_and_copy( LPCWSTR in ) { char *chr; int len = 0; if ( !in ) { return NULL; } while ( in[ len ] != 0 ) { len ++; } chr = malloc( len + 1 ); len = 0; while ( in[ len ] != 0 ) { chr[ len ] = 0xFF & in[ len ]; len ++; } chr[ len ++ ] = '\0'; return chr; } SQLWCHAR* _multi_string_alloc_and_expand( LPCSTR in ) { SQLWCHAR *chr; int len = 0; if ( !in ) { return NULL; } while ( in[ len ] != 0 || in[ len + 1 ] != 0 ) { len ++; } chr = malloc(sizeof( SQLWCHAR ) * ( len + 2 )); len = 0; while ( in[ len ] != 0 || in[ len + 1 ] != 0 ) { chr[ len ] = in[ len ]; len ++; } chr[ len ++ ] = 0; chr[ len ++ ] = 0; return chr; } SQLWCHAR* _single_string_alloc_and_expand( LPCSTR in ) { SQLWCHAR *chr; int len = 0; if ( !in ) { return NULL; } while ( in[ len ] != 0 ) { len ++; } chr = malloc( sizeof( SQLWCHAR ) * ( len + 1 )); len = 0; while ( in[ len ] != 0 ) { chr[ len ] = in[ len ]; len ++; } chr[ len ++ ] = 0; return chr; } void _single_string_copy_to_wide( SQLWCHAR *out, LPCSTR in, int len ) { while ( len > 0 && *in ) { *out = *in; out++; in++; len --; } *out = 0; } void _single_copy_to_wide( SQLWCHAR *out, LPCSTR in, int len ) { while ( len >= 0 ) { *out = *in; out++; in++; len --; } } void _single_copy_from_wide( SQLCHAR *out, LPCWSTR in, int len ) { while ( len >= 0 ) { *out = *in; out++; in++; len --; } } void _multi_string_copy_to_wide( SQLWCHAR *out, LPCSTR in, int len ) { while ( len > 0 && ( in[ 0 ] || in[ 1 ] )) { *out = *in; out++; in++; len --; } *out++ = 0; *out++ = 0; } int _multi_string_length( LPCSTR in ) { LPCSTR ch; if ( !in ) return 0; for ( ch = in ; !(*ch == 0 && *(ch + 1) == 0) ; ch ++ ); /* The convention seems to be to exclude the very last '\0' character from * the count, so that is what we do here. */ return ch - in + 1; } /*! * \brief Invokes a UI (a wizard) to walk User through creating a DSN. * * \param hWnd Input. Parent window handle. This is HWND as per the ODBC * specification but in unixODBC we use a generic window * handle. Caller must cast a HODBCINSTWND to HWND at call. * \param pszDS Input. Data Source Name. This can be a NULL pointer. * * \return BOOL * * \sa ODBCINSTWND */ BOOL SQLCreateDataSource( HWND hWnd, LPCSTR pszDS ) { HODBCINSTWND hODBCInstWnd = (HODBCINSTWND)hWnd; char szName[FILENAME_MAX]; char szNameAndExtension[FILENAME_MAX]; char szPathAndName[FILENAME_MAX]; void * hDLL; BOOL (*pSQLCreateDataSource)(HWND, LPCSTR); inst_logClear(); /* ODBC specification states that hWnd is mandatory. */ if ( !hWnd ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_HWND, "" ); return FALSE; } /* initialize libtool */ if ( lt_dlinit() ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "lt_dlinit() failed" ); return FALSE; } /* get plugin name */ _appendUIPluginExtension( szNameAndExtension, _getUIPluginName( szName, hODBCInstWnd->szUI ) ); /* lets try loading the plugin using an implicit path */ hDLL = lt_dlopen( szNameAndExtension ); if ( hDLL ) { /* change the name, as it avoids it finding it in the calling lib */ pSQLCreateDataSource = (BOOL (*)(HWND, LPCSTR))lt_dlsym( hDLL, "ODBCCreateDataSource" ); if ( pSQLCreateDataSource ) { BOOL ret; ret = pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), pszDS ); lt_dlclose( hDLL ); return ret; } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() ); lt_dlclose( hDLL ); } else { /* try with explicit path */ _prependUIPluginPath( szPathAndName, szNameAndExtension ); hDLL = lt_dlopen( szPathAndName ); if ( hDLL ) { /* change the name, as it avoids linker finding it in the calling lib */ pSQLCreateDataSource = (BOOL (*)(HWND,LPCSTR))lt_dlsym( hDLL, "ODBCCreateDataSource" ); if ( pSQLCreateDataSource ) { BOOL ret; ret = pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), pszDS ); lt_dlclose( hDLL ); return ret; } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() ); lt_dlclose( hDLL ); } } /* report failure to caller */ inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } /*! * \brief A wide char version of \sa SQLCreateDataSource. * * \sa SQLCreateDataSource */ BOOL INSTAPI SQLCreateDataSourceW( HWND hwndParent, LPCWSTR lpszDSN ) { HODBCINSTWND hODBCInstWnd = (HODBCINSTWND)hwndParent; char szName[FILENAME_MAX]; char szNameAndExtension[FILENAME_MAX]; char szPathAndName[FILENAME_MAX]; void * hDLL; BOOL (*pSQLCreateDataSource)(HWND, LPCWSTR); inst_logClear(); /* ODBC specification states that hWnd is mandatory. */ if ( !hwndParent ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_HWND, "" ); return FALSE; } /* initialize libtool */ if ( lt_dlinit() ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "lt_dlinit() failed" ); return FALSE; } /* get plugin name */ _appendUIPluginExtension( szNameAndExtension, _getUIPluginName( szName, hODBCInstWnd->szUI ) ); /* lets try loading the plugin using an implicit path */ hDLL = lt_dlopen( szNameAndExtension ); if ( hDLL ) { /* change the name, as it avoids it finding it in the calling lib */ pSQLCreateDataSource = (BOOL (*)(HWND, LPCWSTR))lt_dlsym( hDLL, "ODBCCreateDataSourceW" ); if ( pSQLCreateDataSource ) { BOOL ret; ret = pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), lpszDSN ); lt_dlclose( hDLL ); return ret; } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() ); lt_dlclose( hDLL ); } else { /* try with explicit path */ _prependUIPluginPath( szPathAndName, szNameAndExtension ); hDLL = lt_dlopen( szPathAndName ); if ( hDLL ) { /* change the name, as it avoids linker finding it in the calling lib */ pSQLCreateDataSource = (BOOL (*)(HWND,LPCWSTR))lt_dlsym( hDLL, "ODBCCreateDataSourceW" ); if ( pSQLCreateDataSource ) { BOOL ret; ret = pSQLCreateDataSource( ( *(hODBCInstWnd->szUI) ? hODBCInstWnd->hWnd : NULL ), lpszDSN ); lt_dlclose( hDLL ); return ret; } else inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, (char*)lt_dlerror() ); lt_dlclose( hDLL ); } } /* report failure to caller */ inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } unixODBC-2.3.9/odbcinst/SQLInstallODBC.c0000755000175000017500000000424512262474476014476 00000000000000/************************************************* * SQLInstallODBC * * Just provide stub for ODBC 2 installer functions * **************************************************/ #include #include BOOL INSTAPI SQLInstallODBC(HWND hwndParent, LPCSTR lpszInfFile, LPCSTR lpszSrcPath, LPCSTR lpszDrivers) { return FALSE; } BOOL INSTAPI SQLInstallDriver (LPCSTR lpszInfFile, LPCSTR lpszDriver, LPSTR lpszPath, WORD cbPathMax, WORD * pcbPathOut) { return FALSE; } BOOL INSTAPI SQLInstallTranslator( LPCSTR lpszInfFile, LPCSTR pszTranslator, LPCSTR pszPathIn, LPSTR pszPathOut, WORD nPathOutMax, WORD *pnPathOut, WORD nRequest, LPDWORD pnUsageCount ) { inst_logClear(); return FALSE; } BOOL INSTAPI SQLRemoveDefaultDataSource( void ) { inst_logClear(); return SQLConfigDataSource (NULL, ODBC_REMOVE_DEFAULT_DSN, NULL, NULL); } BOOL INSTAPI SQLInstallDriverW (LPCWSTR lpszInfFile, LPCWSTR lpszDriver, LPWSTR lpszPath, WORD cbPathMax, WORD * pcbPathOut) { return FALSE; } BOOL INSTAPI SQLInstallODBCW (HWND hwndParent, LPCWSTR lpszInfFile, LPCWSTR lpszSrcPath, LPCWSTR lpszDrivers) { return FALSE; } BOOL INSTAPI SQLInstallTranslatorW(LPCWSTR lpszInfFile, LPCWSTR lpszTranslator, LPCWSTR lpszPathIn, LPWSTR lpszPathOut, WORD cbPathOutMax, WORD *pcbPathOut, WORD fRequest, LPDWORD lpdwUsageCount) { inst_logClear(); return FALSE; } unixODBC-2.3.9/odbcinst/SQLGetAvailableDrivers.c0000755000175000017500000000167712262474476016325 00000000000000/************************************************** * SQLGetAvailableDrivers * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLGetAvailableDrivers( LPCSTR pszInfFile, LPSTR pszBuf, WORD nBufMax, WORD *pnBufOut) { return SQLGetInstalledDrivers( pszBuf, nBufMax, pnBufOut ); } BOOL INSTAPI SQLGetAvailableDriversW (LPCWSTR lpszInfFile, LPWSTR lpszBuf, WORD cbBufMax, WORD * pcbBufOut) { return SQLGetInstalledDriversW( lpszBuf, cbBufMax, pcbBufOut ); } unixODBC-2.3.9/odbcinst/ODBCINSTConstructProperties.c0000664000175000017500000002257413724126772017250 00000000000000/************************************************** * ODBCINSTConstructProperties * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include /* static const char *aYesNo[] = { "Yes", "No", NULL }; */ /*! * \brief Builds a property list for pszDriver. * * Adds common DSN properties (Name,Driver,Description) and then asks the * drivers setup to load any additional properties. * * This is used to support editing DSN properties without forcing the driver * developer to create a UI for the many different UI implementations. The * driver developer can just implement ODBCINSTGetProperties. This function * can then call ODBCINSTGetProperties to get properties. The code that calls * this function can then display the properties in the UI in use. * * \param pszDriver Friendly driver name. * \param hFirstProperty Place to store the properties list. The properties (including * some of the elements within each HODBCINSTPROPERTY may * need to be freed using \sa ODBCINSTDestructProperties. * * \return int * \retval ODBCINST_ERROR Called failed. No memory was allocated at hFirstProperty. The * likely reasons for this; \li failed to lookup setup library name * \li failed to load setup library \li failed to find * ODBCINSTGetProperties symbol in setup library * \retval ODBCINST_SUCCESS Success! Do not forget to call ODBCINSTDestructProperties to * free memory used by the properties when you are done. * * \sa ODBCINSTDestructProperties */ int ODBCINSTConstructProperties( char *pszDriver, HODBCINSTPROPERTY *hFirstProperty ) { char szError[LOG_MSG_MAX+1]; char szDriverSetup[ODBC_FILENAME_MAX+1]; HINI hIni; int (*pODBCINSTGetProperties)( HODBCINSTPROPERTY ); void *hDLL = NULL; HODBCINSTPROPERTY hLastProperty; char szSectionName[INI_MAX_OBJECT_NAME+1]; char szIniName[ ODBC_FILENAME_MAX * 2 + 1 ]; char b1[ ODBC_FILENAME_MAX + 1 ], b2[ ODBC_FILENAME_MAX + 1 ]; /* SANITY CHECKS */ if ( pszDriver == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Need a driver name. Make it the friendly name." ); return ODBCINST_ERROR; } #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); #else sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); #endif /* GET DRIVER SETUP FILE NAME FOR GIVEN DRIVER */ #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Could not open odbcinst.ini" ); return ODBCINST_ERROR; } #ifdef PLATFORM64 /* ASSUME USER FRIENDLY NAME FOR STARTERS */ if ( iniPropertySeek( hIni, pszDriver, "Setup64", "" ) == INI_SUCCESS ) { } else if ( iniPropertySeek( hIni, pszDriver, "Setup", "" ) == INI_SUCCESS ) { } else { /* NOT USER FRIENDLY NAME I GUESS SO ASSUME DRIVER FILE NAME */ if ( iniPropertySeek( hIni, "", "Driver64", pszDriver ) == INI_SUCCESS ) { iniObject( hIni, szSectionName ); if ( iniPropertySeek( hIni, szSectionName, "Setup64", "" ) != INI_SUCCESS ) { sprintf( szError, "Could not find Setup property for (%s) in system information", pszDriver ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, szError ); iniClose( hIni ); return ODBCINST_ERROR; } } else if ( iniPropertySeek( hIni, "", "Driver", pszDriver ) == INI_SUCCESS ) { iniObject( hIni, szSectionName ); if ( iniPropertySeek( hIni, szSectionName, "Setup", "" ) != INI_SUCCESS ) { sprintf( szError, "Could not find Setup property for (%s) in system information", pszDriver ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, szError ); iniClose( hIni ); return ODBCINST_ERROR; } } else { sprintf( szError, "Could not find driver (%s) in system information", pszDriver ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, szError ); iniClose( hIni ); return ODBCINST_ERROR; } } #else /* ASSUME USER FRIENDLY NAME FOR STARTERS */ if ( iniPropertySeek( hIni, pszDriver, "Setup", "" ) != INI_SUCCESS ) { /* NOT USER FRIENDLY NAME I GUESS SO ASSUME DRIVER FILE NAME */ if ( iniPropertySeek( hIni, "", "Driver", pszDriver ) != INI_SUCCESS ) { sprintf( szError, "Could not find driver (%s) in system information", pszDriver ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, szError ); iniClose( hIni ); return ODBCINST_ERROR; } else { iniObject( hIni, szSectionName ); if ( iniPropertySeek( hIni, szSectionName, "Setup", "" ) != INI_SUCCESS ) { sprintf( szError, "Could not find Setup property for (%s) in system information", pszDriver ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, szError ); iniClose( hIni ); return ODBCINST_ERROR; } } } #endif iniValue( hIni, szDriverSetup ); iniClose( hIni ); if ( szDriverSetup[ 0 ] == '\0' ) { sprintf( szError, "Could not find Setup property for (%s) in system information", pszDriver ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, szError ); return ODBCINST_ERROR; } /* * initialize libtool */ lt_dlinit(); /* TRY GET FUNC FROM DRIVER SETUP */ if ( !(hDLL = lt_dlopen( szDriverSetup )) ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Could not load library" ); return ODBCINST_ERROR; } pODBCINSTGetProperties = (int(*)(struct tODBCINSTPROPERTY*)) lt_dlsym( hDLL, "ODBCINSTGetProperties" ); /* PAH - This can be true even when we found the symbol. if ( lt_dlerror() != NULL ) */ if ( pODBCINSTGetProperties == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "Could not find ODBCINSTGetProperties()" ); return ODBCINST_ERROR; } /* MANDATORY PROPERTIES */ (*hFirstProperty) = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); memset( (*hFirstProperty), 0, sizeof(ODBCINSTPROPERTY) ); (*hFirstProperty)->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; (*hFirstProperty)->pNext = NULL; (*hFirstProperty)->bRefresh = 0; (*hFirstProperty)->hDLL = hDLL; (*hFirstProperty)->pWidget = NULL; (*hFirstProperty)->pszHelp = NULL; (*hFirstProperty)->aPromptData = NULL; strncpy( (*hFirstProperty)->szName, "Name", INI_MAX_PROPERTY_NAME ); strcpy( (*hFirstProperty)->szValue, "" ); hLastProperty = (*hFirstProperty); (*hFirstProperty)->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = (*hFirstProperty)->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_TEXTEDIT; hLastProperty->pNext = NULL; hLastProperty->bRefresh = 0; hLastProperty->hDLL = hDLL; hLastProperty->pWidget = NULL; (*hFirstProperty)->pszHelp = NULL; (*hFirstProperty)->aPromptData = NULL; strncpy( hLastProperty->szName, "Description", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, pszDriver, INI_MAX_PROPERTY_VALUE ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LABEL; hLastProperty->pNext = NULL; hLastProperty->bRefresh = 0; hLastProperty->hDLL = hDLL; hLastProperty->pWidget = NULL; (*hFirstProperty)->pszHelp = NULL; (*hFirstProperty)->aPromptData = NULL; strncpy( hLastProperty->szName, "Driver", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, pszDriver, INI_MAX_PROPERTY_VALUE ); /* hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_LISTBOX; hLastProperty->aPromptData = malloc( sizeof(aYesNo) ); memcpy( hLastProperty->aPromptData, aYesNo, sizeof(aYesNo) ); strncpy( hLastProperty->szName, "Trace", INI_MAX_PROPERTY_NAME ); strcpy( hLastProperty->szValue, "No" ); hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); hLastProperty = hLastProperty->pNext; memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; strncpy( hLastProperty->szName, "TraceFile", INI_MAX_PROPERTY_NAME ); strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); */ /* APPEND OTHERS */ pODBCINSTGetProperties( hLastProperty ); lt_dlclose( hDLL ); return ODBCINST_SUCCESS; } unixODBC-2.3.9/odbcinst/SQLSetConfigMode.c0000755000175000017500000000247512262474476015131 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com * Nick Gorham - nick@lurcher.org **************************************************/ #include #include #include /* * This avoids all sorts of problems with using putenv, we need to check * that drivers can see this as well though.... */ static int __config_mode = ODBC_BOTH_DSN; void __set_config_mode( int mode ) { __config_mode = mode; } int __get_config_mode( void ) { char *p; /* * if the environment var is set then it overrides the flag */ p = getenv( "ODBCSEARCH" ); if ( p ) { if ( strcmp( p, "ODBC_SYSTEM_DSN" ) == 0 ) { __config_mode = ODBC_SYSTEM_DSN; } else if ( strcmp( p, "ODBC_USER_DSN" ) == 0 ) { __config_mode = ODBC_USER_DSN; } else if ( strcmp( p, "ODBC_BOTH_DSN" ) == 0 ) { __config_mode = ODBC_BOTH_DSN; } } return __config_mode; } BOOL SQLSetConfigMode( UWORD nConfigMode ) { inst_logClear(); __set_config_mode( nConfigMode ); return TRUE; } unixODBC-2.3.9/odbcinst/SQLPostInstallerError.c0000755000175000017500000000237112262474476016253 00000000000000/********************************************** * SQLPostInstallerError * * Drivers can call me to let me know there was a * problem. This can be retreived by the app using * SQLInstallerError. * * Does not currently use szErrorMsg due to extreme * limitations of logging here. This should be corrected. * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include RETCODE SQLPostInstallerError( DWORD nErrorCode, LPCSTR szErrorMsg ) { if ( nErrorCode > ODBC_ERROR_OUTPUT_STRING_TRUNCATED ) return SQL_ERROR; inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, nErrorCode, (char *)szErrorMsg ); return SQL_SUCCESS; } SQLRETURN INSTAPI SQLPostInstallerErrorW(DWORD dwErrorCode, LPCWSTR lpszErrorMsg) { char *msg = lpszErrorMsg ? _single_string_alloc_and_copy( lpszErrorMsg ) : (char*)NULL; SQLRETURN ret; ret = SQLPostInstallerError( dwErrorCode, msg ); if ( msg ) free( msg ); return ret; } unixODBC-2.3.9/odbcinst/SQLRemoveDSNFromIni.c0000755000175000017500000000374412262474476015531 00000000000000/******************************************** * SQLRemoveDSNFromIni * * Use the current Config Mode to determine the * odbc.ini we will use. * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLRemoveDSNFromIni(LPCSTR pszDSN ) { HINI hIni; char szINIFileName[ODBC_FILENAME_MAX+1]; inst_logClear(); /* SANITY CHECKS */ if ( pszDSN == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_DSN, "" ); return FALSE; } if ( pszDSN[0] == '\0' ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_DSN, "" ); return FALSE; } /* GET ODBC INI FILE NAME */ if ( _odbcinst_ConfigModeINI( szINIFileName ) == FALSE ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return FALSE; } #ifdef __OS2__ if ( iniOpen( &hIni, szINIFileName, "#;", '[', ']', '=', FALSE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szINIFileName, "#;", '[', ']', '=', FALSE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return FALSE; } if ( iniObjectSeek( hIni, (char *)pszDSN ) == INI_SUCCESS ) { iniObjectDelete( hIni ); if ( iniCommit( hIni ) != INI_SUCCESS ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); iniClose( hIni ); return FALSE; } } iniClose( hIni ); return TRUE; } BOOL INSTAPI SQLRemoveDSNFromIniW(LPCWSTR lpszDSN) { char *dsn; BOOL ret; inst_logClear(); dsn = _single_string_alloc_and_copy( lpszDSN ); ret = SQLRemoveDSNFromIni( dsn ); free( dsn ); return ret; } unixODBC-2.3.9/odbcinst/Makefile.am0000755000175000017500000000506012262756042013734 00000000000000lib_LTLIBRARIES = libodbcinst.la AM_CPPFLAGS = -I@top_srcdir@/include \ $(LTDLINCL) EXTRA_DIST = \ odbcinst.exp libodbcinst_la_LDFLAGS = \ -no-undefined \ -version-info @LIB_VERSION@ \ -export-dynamic \ -export-symbols @srcdir@/odbcinst.exp libodbcinst_la_LIBADD = \ ../ini/libinilc.la \ ../log/libloglc.la \ ../lst/liblstlc.la \ $(LIBLTDL) libodbcinst_la_DEPENDENCIES = \ ../log/libloglc.la \ ../ini/libinilc.la \ ../lst/liblstlc.la \ $(LTDLDEPS) sysconf_DATA= libodbcinst_la_SOURCES = \ ODBCINSTConstructProperties.c \ ODBCINSTDestructProperties.c \ ODBCINSTSetProperty.c \ ODBCINSTValidateProperties.c \ ODBCINSTValidateProperty.c \ SQLConfigDataSource.c \ SQLConfigDriver.c \ SQLCreateDataSource.c \ SQLGetAvailableDrivers.c \ SQLGetConfigMode.c \ SQLGetInstalledDrivers.c \ SQLGetPrivateProfileString.c \ SQLGetTranslator.c \ SQLInstallDriverEx.c \ SQLInstallDriverManager.c \ SQLInstallTranslatorEx.c \ SQLInstallerError.c \ SQLManageDataSources.c \ SQLPostInstallerError.c \ SQLReadFileDSN.c \ SQLRemoveDSNFromIni.c \ SQLRemoveDriver.c \ SQLRemoveDriverManager.c \ SQLRemoveTranslator.c \ SQLSetConfigMode.c \ SQLValidDSN.c \ SQLWriteDSNToIni.c \ SQLWriteFileDSN.c \ SQLWritePrivateProfileString.c \ SQLInstallODBC.c \ _logging.c \ _odbcinst_ConfigModeINI.c \ _odbcinst_UserINI.c \ _odbcinst_SystemINI.c \ _odbcinst_GetSections.c \ _odbcinst_GetEntries.c \ _SQLGetInstalledDrivers.c \ _SQLWriteInstalledDrivers.c \ _SQLDriverConnectPrompt.c libodbcinstlc_la_LDFLAGS = noinst_LTLIBRARIES = libodbcinstlc.la libodbcinstlc_la_SOURCES = \ ODBCINSTConstructProperties.c \ ODBCINSTDestructProperties.c \ ODBCINSTSetProperty.c \ ODBCINSTValidateProperties.c \ ODBCINSTValidateProperty.c \ SQLConfigDataSource.c \ SQLConfigDriver.c \ SQLCreateDataSource.c \ SQLGetAvailableDrivers.c \ SQLGetConfigMode.c \ SQLGetInstalledDrivers.c \ SQLGetPrivateProfileString.c \ SQLGetTranslator.c \ SQLInstallDriverEx.c \ SQLInstallDriverManager.c \ SQLInstallTranslatorEx.c \ SQLInstallerError.c \ SQLManageDataSources.c \ SQLPostInstallerError.c \ SQLReadFileDSN.c \ SQLRemoveDSNFromIni.c \ SQLRemoveDriver.c \ SQLRemoveDriverManager.c \ SQLRemoveTranslator.c \ SQLSetConfigMode.c \ SQLValidDSN.c \ SQLWriteDSNToIni.c \ SQLWriteFileDSN.c \ SQLWritePrivateProfileString.c \ _logging.c \ _odbcinst_ConfigModeINI.c \ _odbcinst_UserINI.c \ _odbcinst_SystemINI.c \ _odbcinst_GetSections.c \ _odbcinst_GetEntries.c \ _SQLGetInstalledDrivers.c \ _SQLWriteInstalledDrivers.c \ _SQLDriverConnectPrompt.c unixODBC-2.3.9/odbcinst/SQLWriteDSNToIni.c0000644000175000017500000000524113023505736015022 00000000000000/************************************************** * SQLWriteDSNToIni * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include extern void __clear_ini_cache( void ); BOOL SQLWriteDSNToIni( LPCSTR pszDSN, LPCSTR pszDriver ) { HINI hIni; char szFileName[ODBC_FILENAME_MAX+1]; SQLRemoveDSNFromIni( pszDSN ); /* SANITY CHECKS */ if ( pszDSN == NULL ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } if ( pszDSN[0] == '\0' ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return FALSE; } if ( (strcasecmp( pszDSN, "DEFAULT" ) != 0 ) && (pszDriver == NULL ) ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_NAME, "" ); return FALSE; } if ( (strcasecmp( pszDSN, "DEFAULT" ) != 0 ) && (pszDriver[0] == '\0') ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_NAME, "" ); return FALSE; } if ( SQLValidDSN( pszDSN ) == FALSE ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_INVALID_DSN, "" ); return FALSE; } /* OK */ if ( _odbcinst_ConfigModeINI( szFileName ) == FALSE ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } #ifdef __OS2__ if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szFileName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } iniObjectInsert( hIni, (char *)pszDSN ); if ( pszDriver != NULL ) { iniPropertyInsert( hIni, "Driver", (char *)pszDriver ); } if ( iniCommit( hIni ) != INI_SUCCESS ) { iniClose( hIni ); inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_REQUEST_FAILED, "" ); return FALSE; } iniClose( hIni ); __clear_ini_cache(); return TRUE; } BOOL INSTAPI SQLWriteDSNToIniW (LPCWSTR lpszDSN, LPCWSTR lpszDriver) { char *drv, *dsn; BOOL ret; dsn = _single_string_alloc_and_copy( lpszDSN ); drv = _single_string_alloc_and_copy( lpszDriver ); ret = SQLWriteDSNToIni( dsn, drv ); free( dsn ); free( drv ); return ret; } unixODBC-2.3.9/odbcinst/SQLGetInstalledDrivers.c0000644000175000017500000000453213127416114016334 00000000000000/************************************************** * SQLGetInstalledDrivers * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include BOOL SQLGetInstalledDrivers( LPSTR pszBuf, WORD nBufMax, WORD *pnBufOut ) { HINI hIni; WORD nBufPos = 0; WORD nToCopySize = 0; char szObjectName[INI_MAX_OBJECT_NAME+1]; char szIniName[ ODBC_FILENAME_MAX * 2 + 1 ]; char b1[ ODBC_FILENAME_MAX + 1 ], b2[ ODBC_FILENAME_MAX + 1 ]; inst_logClear(); #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #else sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 ) ); #endif #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', TRUE ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return FALSE; } memset( pszBuf, '\0', nBufMax ); iniObjectFirst( hIni ); while ( iniObjectEOL( hIni ) == FALSE ) { iniObject( hIni, szObjectName ); if ( strcmp( szObjectName, "ODBC" ) == 0 ) { iniObjectNext( hIni ); continue; } if ( (strlen( szObjectName )+1) > (nBufMax - nBufPos) ) { nToCopySize = nBufMax - nBufPos; strncpy( &(pszBuf[nBufPos]), szObjectName, nToCopySize ); nBufPos = nBufMax; break; } else { strcpy( &(pszBuf[nBufPos]), szObjectName ); nBufPos += strlen( szObjectName )+1; } iniObjectNext( hIni ); } iniClose( hIni ); if ( pnBufOut ) *pnBufOut = nBufPos; return TRUE; } BOOL INSTAPI SQLGetInstalledDriversW (LPWSTR lpszBuf, WORD cbBufMax, WORD * pcbBufOut) { char *path; BOOL ret; inst_logClear(); path = calloc( cbBufMax, 1 ); ret = SQLGetInstalledDrivers( path, cbBufMax, pcbBufOut ); if ( ret ) { _multi_string_copy_to_wide( lpszBuf, path, cbBufMax ); } free( path ); return ret; } unixODBC-2.3.9/odbcinst/_odbcinst_SystemINI.c0000664000175000017500000000771413724126772015730 00000000000000/************************************************** * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include #include /* * Add the historic ODBCINI value, mainly for applix. */ #ifdef VMS char *odbcinst_system_file_path( char *buffer ) { char *path; if (( path = getvmsenv( "ODBCSYSINI" ))) { strcpy( buffer, path ); return buffer; } #ifdef SYSTEM_FILE_PATH else { return SYSTEM_FILE_PATH; } #else else { return "ODBC_LIBDIR:"; } #endif } char *odbcinst_system_file_name( char *buffer ) { char *path; if (( path = getvmsenv( "ODBCINSTINI" ))) { strcpy( buffer, path ); return path; } else { return "ODBCINST.INI"; } } char *odbcinst_user_file_path( char *buffer ) { return "ODBC_LIBDIR:"; } char *odbcinst_user_file_name( char *buffer ) { return "ODBCINST.INI"; } BOOL _odbcinst_SystemINI( char *pszFileName, BOOL bVerify ) { FILE *hFile; char b1[ ODBC_FILENAME_MAX + 1 ]; sprintf( pszFileName, "%s:odbc.ini", odbcinst_system_file_path( b1 )); if ( bVerify ) { hFile = uo_fopen( pszFileName, "r" ); if ( hFile ) uo_fclose( hFile ); else return FALSE; } return TRUE; } #else char *odbcinst_system_file_name( char *buffer ) { char *path; static char save_path[ ODBC_FILENAME_MAX + 1 ]; static int saved = 0; if ( saved ) { return save_path; } if (( path = getenv( "ODBCINSTINI" ))) { strncpy( buffer, path, ODBC_FILENAME_MAX ); strncpy( save_path, buffer, ODBC_FILENAME_MAX ); saved = 1; return buffer; } else { strcpy( save_path, "odbcinst.ini" ); saved = 1; return "odbcinst.ini"; } } char *odbcinst_system_file_path( char *buffer ) { char *path; static char save_path[ ODBC_FILENAME_MAX + 1 ]; static int saved = 0; if ( saved ) { return save_path; } if (( path = getenv( "ODBCSYSINI" ))) { strncpy( buffer, path, ODBC_FILENAME_MAX ); strncpy( save_path, buffer, ODBC_FILENAME_MAX ); saved = 1; return buffer; } #ifdef SYSTEM_FILE_PATH else { strcpy( save_path, SYSTEM_FILE_PATH ); saved = 1; return SYSTEM_FILE_PATH; } #else else { strcpy( save_path, "/etc" ); saved = 1; return "/etc"; } #endif } char *odbcinst_user_file_name( char *buffer ) { return ".odbcinst.ini"; } char *odbcinst_user_file_path( char *buffer ) { char *path; static char save_path[ ODBC_FILENAME_MAX + 1 ]; static int saved = 0; if ( saved ) { return save_path; } if (( path = getenv( "HOME" ))) { strncpy( buffer, path, ODBC_FILENAME_MAX ); strncpy( save_path, buffer, ODBC_FILENAME_MAX ); saved = 1; return buffer; } else { return "/home"; } } BOOL _odbcinst_SystemINI( char *pszFileName, BOOL bVerify ) { FILE *hFile; char b1[ ODBC_FILENAME_MAX + 1 ]; sprintf( pszFileName, "%s/odbc.ini", odbcinst_system_file_path( b1 )); if ( bVerify ) { /* try opening for read */ hFile = uo_fopen( pszFileName, "r" ); if ( hFile ) { uo_fclose( hFile ); } else { if ( ( !hFile ) && ( errno != ENFILE ) && ( errno != EMFILE ) && ( errno != ENOMEM ) && ( errno != EACCES ) && ( errno != EFBIG ) && ( errno != EINTR ) && ( errno != ENOSPC ) && ( errno != EOVERFLOW ) && ( errno != EWOULDBLOCK )) { return FALSE; } /* does not exist so try creating it */ hFile = uo_fopen( pszFileName, "w" ); if ( hFile ) uo_fclose( hFile ); else return FALSE; } } return TRUE; } #endif unixODBC-2.3.9/odbcinst/_SQLGetInstalledDrivers.c0000755000175000017500000001242612460420221016470 00000000000000/************************************************** * _SQLGetInstalledDrivers * * Added to allow ODBC Config programs and the ODBC * driver manager to access system information without * having to worry about where it is... just like accessing * Data Source information. So no surprise... its just * like SQLGetPrivateProfileString()! * * see SQLGetPrivateProfileString to see how this is called. * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 28.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include int _SQLGetInstalledDrivers( LPCSTR pszSection, LPCSTR pszEntry, LPCSTR pszDefault, LPCSTR pRetBuffer, int nRetBuffer ) { HINI hIni; int nBufPos = 0; int nStrToCopy; char szObjectName[INI_MAX_OBJECT_NAME+1]; char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char szValue[INI_MAX_PROPERTY_VALUE+1]; char szIniName[ ODBC_FILENAME_MAX * 2 + 3 ]; char *ptr; char b1[ ODBC_FILENAME_MAX + 1 ], b2[ ODBC_FILENAME_MAX + 1 ]; /* SANITY CHECKS */ if ( pRetBuffer == NULL || nRetBuffer < 2 ) { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); return -1; } /* * first try in the system odbcinst.ini */ #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); #else sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); #endif /* PROCESS ODBC INI FILE */ #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', 1, 1L ) != INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', 1 ) != INI_SUCCESS ) #endif { inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_COMPONENT_NOT_FOUND, "" ); return -1; } /* * now try the user odbcinst.ini if it exists */ #ifdef VMS sprintf( szIniName, "%s:%s", odbcinst_user_file_path( b1 ), odbcinst_user_file_name( b2 )); #else sprintf( szIniName, "%s/%s", odbcinst_user_file_path( b1 ), odbcinst_user_file_name( b2 )); #endif /* PROCESS .ODBCINST INI FILE */ iniAppend( hIni, szIniName ); nBufPos = 0; if ( pszSection == NULL ) { ptr = (char*) pRetBuffer; *ptr = '\0'; /* JUST COLLECT SECTION NAMES */ for( iniObjectFirst( hIni ); iniObjectEOL( hIni ) != TRUE; iniObjectNext( hIni )) { iniObject( hIni, szObjectName ); if ( strcasecmp( szObjectName, "ODBC" ) == 0 ) { continue; } else if ( nBufPos + 1 + strlen( szObjectName ) >= nRetBuffer ) { break; } else { strcpy( ptr, szObjectName ); ptr += strlen( ptr ) + 1; nBufPos += strlen( szObjectName ) + 1; } } /* * Add final NULL */ if ( nBufPos == 0 ) { ptr ++; } *ptr = '\0'; } else if ( pszEntry == NULL ) { ptr = (char*) pRetBuffer; *ptr = '\0'; iniObjectSeek( hIni, (char *)pszSection ); /* COLLECT ALL ENTRIES FOR THE GIVEN SECTION */ for( iniPropertyFirst( hIni ); iniPropertyEOL( hIni ) != TRUE; iniPropertyNext( hIni )) { iniProperty( hIni, szPropertyName ); if ( nBufPos + 1 + strlen( szPropertyName ) >= nRetBuffer ) { break; } else { strcpy( ptr, szPropertyName ); ptr += strlen( ptr ) + 1; nBufPos += strlen( szPropertyName ) + 1; } } /* * Add final NULL */ if ( nBufPos == 0 ) { ptr ++; } } else { /* TRY TO GET THE ONE ITEM MATCHING Section & Entry */ if ( iniPropertySeek( hIni, (char *)pszSection, (char *)pszEntry, "" ) != INI_SUCCESS ) { /* try to use any default provided */ if ( pRetBuffer && nRetBuffer > 0 ) { if ( pszDefault ) { strncpy( (char *)pRetBuffer, pszDefault, nRetBuffer ); ((char*)pRetBuffer)[ nRetBuffer - 1 ] = '\0'; } } } else { iniValue( hIni, szValue ); nStrToCopy = strlen( szValue ) + 1; /* factor NULL terminator for string */ if ( nBufPos + nStrToCopy + 1 > nRetBuffer ) /* factor NULL terminator for buffer */ nStrToCopy = nRetBuffer - nBufPos - 2; strncpy( (char *)&(pRetBuffer[nBufPos]), szValue, nStrToCopy ); nBufPos += nStrToCopy; /* * length doesn't include NULL */ nBufPos--; } } /* CLOSE */ iniClose( hIni ); return nBufPos; } unixODBC-2.3.9/Drivers/0000775000175000017500000000000013725127521011566 500000000000000unixODBC-2.3.9/Drivers/MiniSQL/0000775000175000017500000000000013725127521013042 500000000000000unixODBC-2.3.9/Drivers/MiniSQL/SQLColumns.c0000755000175000017500000001570312262474476015146 00000000000000/******************************************************************** * SQLColumns * * This is something of a mess. Part of the problem here is that msqlListFields * are returned as mSQL 'column headers'... we want them to be returned as a * row for each. So we have to turn the results on their side . * * Another problem is that msqlListFields will also return indexs. So we have * to make sure that these are not included here. * * The end result is more code than what would usually be found here. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" enum nSQLColumns { TABLE_CAT = 1, TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_SIZE, BUFFER_LENGTH, DECIMAL_DIGITS, NUM_PREC_RADIX, NULLABLE, REMARKS, COLUMN_DEF, SQL_DATA_TYPE, SQL_DATETIME_SUB, CHAR_OCTET_LENGTH, ORDINAL_POSITION, IS_NULLABLE, COL_MAX }; m_field aSQLColumns[] = { "", "", 0, 0, 0, "TABLE_CAT", "sys", CHAR_TYPE, 50, 0, "TABLE_SCHEM", "sys", CHAR_TYPE, 50, 0, "TABLE_NAME", "sys", CHAR_TYPE, 50, 0, "COLUMN_NAME", "sys", CHAR_TYPE, 50, 0, "DATA_TYPE", "sys", INT_TYPE, 3, 0, "TYPE_NAME", "sys", CHAR_TYPE, 50, 0, "COLUMN_SIZE", "sys", INT_TYPE, 3, 0, "BUFFER_LENGTH", "sys", INT_TYPE, 3, 0, "DECIMAL_DIGITS", "sys", INT_TYPE, 3, 0, "NUM_PREC_RADIX", "sys", INT_TYPE, 3, 0, "NULLABLE", "sys", INT_TYPE, 3, 0, "REMARKS", "sys", CHAR_TYPE, 50, 0, "COLUMN_DEF", "sys", CHAR_TYPE, 50, 0, "SQL_DATA_TYPE", "sys", INT_TYPE, 3, 0, "SQL_DATETIME_SUB", "sys", INT_TYPE, 3, 0, "CHAR_OCTET_LENGTH","sys", INT_TYPE, 3, 0, "ORDINAL_POSITION", "sys", CHAR_TYPE, 50, 0, "IS_NULLABLE", "sys", CHAR_TYPE, 50, 0 }; SQLRETURN SQLColumns( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength, SQLCHAR *szColumnName, SQLSMALLINT nColumnNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; m_result *pResults; /* mSQL DATA */ m_field *pField; /* mSQL field */ COLUMNHDR *pColumnHeader; int nColumn; long nCols; long nRow; long nCurRow; char szBuffer[101]; int nIndexColumns = 0; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( szTableName == NULL || szTableName[0] == '\0' ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Must supply a valid table name" ); return SQL_ERROR; } /************************** * close any existing result **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); if ( hStmt->pszQuery != NULL ) free( hStmt->pszQuery ); hStmt->pszQuery = NULL; /************************ * generate a result set listing columns (these will be our rows) ************************/ pResults = msqlListFields( ((HDRVDBC)hStmt->hDbc)->hDbcExtras->hServer, szTableName ); if ( pResults == NULL ) { sprintf( hStmt->szSqlMsg, "SQL_ERROR Query failed. %s", msqlErrMsg ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } /************************ * how many columns are indexs? ************************/ nIndexColumns = 0; while ( pField = msqlFetchField( pResults ) ) { if ( pField->type == IDX_TYPE) nIndexColumns++; } msqlFieldSeek( pResults, 0 ); /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ hStmt->hStmtExtras->nCols = COL_MAX-1; hStmt->hStmtExtras->nRows = msqlNumFields( pResults ) - nIndexColumns; hStmt->hStmtExtras->nRow = 0; hStmt->hStmtExtras->aResults = malloc( sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1) ); memset( hStmt->hStmtExtras->aResults, 0, sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1) ); if ( hStmt->hStmtExtras->aResults == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Not enough memory. (malloc failed)" ); hStmt->hStmtExtras->nRows = 0; hStmt->hStmtExtras->nCols = 0; msqlFreeResult( pResults ); return SQL_ERROR; } /************************** * gather column header information (save col 0 for bookmarks) **************************/ for ( nColumn = 1; nColumn < COL_MAX; nColumn++ ) { (hStmt->hStmtExtras->aResults)[nColumn] = malloc( sizeof(COLUMNHDR) ); pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nColumn]; memset( pColumnHeader, 0, sizeof(COLUMNHDR) ); _NativeToSQLColumnHeader( pColumnHeader, &(aSQLColumns[nColumn]) ); } /************************ * gather data (save col 0 for bookmarks and factor out index columns) ************************/ nCols = hStmt->hStmtExtras->nCols; hStmt->hStmtExtras->nRow = 0; for ( nCurRow = 1; nCurRow <= msqlNumFields( pResults ); nCurRow++ ) { pField = msqlFetchField( pResults ); if ( pField->type != IDX_TYPE) { hStmt->hStmtExtras->nRow++; nRow = hStmt->hStmtExtras->nRow; for ( nColumn = 1; nColumn < COL_MAX; nColumn++ ) { switch ( nColumn ) { case TABLE_NAME: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char*)strdup( szTableName ); break; case COLUMN_NAME: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char*)strdup( pField->name ); break; case TYPE_NAME: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char*)strdup( msqlTypeNames[pField->type] ); break; case COLUMN_SIZE: sprintf( szBuffer, "%d", pField->length ); (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char*)strdup( szBuffer ); break; case NULLABLE: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char *)strdup( IS_NOT_NULL( pField->flags ) ? "0" : "1" ); break; default: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = NULL; } /* switch nColumn */ } /* for nColumn */ } /* if */ } /* for nRow */ hStmt->hStmtExtras->nRow = 0; /************************** * free the snapshot **************************/ msqlFreeResult( pResults ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/_sqlFreeEnv.c0000755000175000017500000000271312375373647015357 00000000000000/********************************************************************** * sqlFreeEnv * * Do not try to Free Env if there are Dbcs... return an error. Let the * Driver Manager do a recursive clean up if it wants. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN sqlFreeEnv( SQLHENV hDrvEnv ) { HDRVENV hEnv = (HDRVENV)hDrvEnv; /* SANITY CHECKS */ if( hEnv == SQL_NULL_HENV ) return SQL_INVALID_HANDLE; sprintf( hEnv->szSqlMsg, "hEnv = $%08lX", hEnv ); logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hEnv->szSqlMsg ); if ( hEnv->hFirstDbc != NULL ) { logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR There are allocated Connections" ); return SQL_ERROR; } /************ * !!! ADD CODE TO FREE DRIVER SPECIFIC MEMORY (hidden in hEnvExtras) HERE !!! ************/ free( hEnv->hEnvExtras ); logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); logClose( hEnv->hLog ); free( hEnv ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLNumResultCols.c0000755000175000017500000000255312262474476016304 00000000000000/********************************************************************** * SQLNumResultCols * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLNumResultCols( SQLHSTMT hDrvStmt, SQLSMALLINT *pnColumnCount ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( hStmt->hStmtExtras->nRows < 0 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } /******************** * get number of columns in result set ********************/ *pnColumnCount = hStmt->hStmtExtras->nCols; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetStmtAttr.c0000755000175000017500000000253512262474476015763 00000000000000/********************************************************************** * SQLSetStmtAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetStmtAttr( SQLHSTMT hDrvStmt, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetConnectAttr.c0000755000175000017500000000265112262474476016410 00000000000000/********************************************************************** * SQLGetConnectAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetConnectAttr( SQLHDBC hDrvDbc, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetPos.c0000755000175000017500000000361312262474476014740 00000000000000/******************************************************************** * SQLSetPos * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetPos( SQLHSTMT hDrvStmt, SQLUSMALLINT nRow, SQLUSMALLINT nOperation, SQLUSMALLINT nLockType ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /* OK */ switch ( nOperation ) { case SQL_POSITION: break; case SQL_REFRESH: break; case SQL_UPDATE: break; case SQL_DELETE: break; default: sprintf( hStmt->szSqlMsg, "SQL_ERROR Invalid nOperation=%d", nOperation ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } switch ( nLockType ) { case SQL_LOCK_NO_CHANGE: break; case SQL_LOCK_EXCLUSIVE: break; case SQL_LOCK_UNLOCK: break; default: sprintf( hStmt->szSqlMsg, "SQL_ERROR Invalid nLockType=%d", nLockType ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetTypeInfo.c0000755000175000017500000000226112262474476015716 00000000000000/********************************************************************** * SQLGetTypeInfo * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetTypeInfo( SQLHSTMT hDrvStmt, SQLSMALLINT nSqlType ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLAllocHandle.c0000755000175000017500000000204412262474476015666 00000000000000/********************************************************************** * SQLAllocHandle * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLAllocHandle( SQLSMALLINT nHandleType, SQLHANDLE nInputHandle, SQLHANDLE *pnOutputHandle ) { switch ( nHandleType ) { case SQL_HANDLE_ENV: return _AllocEnv( (SQLHENV *)pnOutputHandle ); case SQL_HANDLE_DBC: return _AllocConnect( (SQLHENV)nInputHandle, (SQLHDBC *)pnOutputHandle ); case SQL_HANDLE_STMT: return _AllocStmt( (SQLHDBC)nInputHandle, (SQLHSTMT *)pnOutputHandle ); case SQL_HANDLE_DESC: break; default: return SQL_ERROR; break; } return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_Prepare.c0000755000175000017500000000327712262474476014706 00000000000000/********************************************************************** * SQLPrepare * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _Prepare( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStr, SQLINTEGER nSqlStrLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( szSqlStr == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No SQL to process" ); return SQL_ERROR; } if ( hStmt->pszQuery != NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Statement already in use." ); return SQL_ERROR; } /* allocate and copy statement to buffer (process escape sequences and parameter tokens as required) */ hStmt->pszQuery = (char *)strdup( szSqlStr ); if ( NULL == hStmt->pszQuery ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Memory allocation error" ); return SQL_ERROR; } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetScrollOptions.c0000755000175000017500000000237312262474476017013 00000000000000/******************************************************************** * SQLSetScrollOptions (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetScrollOptions( SQLHSTMT hDrvStmt, UWORD fConcurrency, SDWORD crowKeyset, UWORD crowRowset ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_FreeResults.c0000755000175000017500000000340612262474476015545 00000000000000/************************************************** * _FreeResults * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _FreeResults( HSTMTEXTRAS hStmt ) { COLUMNHDR *pColumnHeader; int nCurColumn; if ( hStmt == NULL ) return SQL_ERROR; if ( hStmt->aResults == NULL ) return SQL_SUCCESS; /* COLUMN HDRS (col=0 is not used) */ for ( nCurColumn = 1; nCurColumn <= hStmt->nCols; nCurColumn++ ) { pColumnHeader = (COLUMNHDR*)(hStmt->aResults)[nCurColumn]; free( pColumnHeader->pszSQL_DESC_BASE_COLUMN_NAME ); free( pColumnHeader->pszSQL_DESC_BASE_TABLE_NAME ); free( pColumnHeader->pszSQL_DESC_CATALOG_NAME ); free( pColumnHeader->pszSQL_DESC_LABEL ); free( pColumnHeader->pszSQL_DESC_LITERAL_PREFIX ); free( pColumnHeader->pszSQL_DESC_LITERAL_SUFFIX ); free( pColumnHeader->pszSQL_DESC_LOCAL_TYPE_NAME ); free( pColumnHeader->pszSQL_DESC_NAME ); free( pColumnHeader->pszSQL_DESC_SCHEMA_NAME ); free( pColumnHeader->pszSQL_DESC_TABLE_NAME ); free( pColumnHeader->pszSQL_DESC_TYPE_NAME ); free( (hStmt->aResults)[nCurColumn] ); } /* RESULT DATA (col=0 is bookmark) */ for ( hStmt->nRow = 1; hStmt->nRow <= hStmt->nRows; hStmt->nRow++ ) { for ( nCurColumn = 1; nCurColumn <= hStmt->nCols; nCurColumn++ ) { free( (hStmt->aResults)[hStmt->nRow*hStmt->nCols+nCurColumn] ); } } free( hStmt->aResults ); hStmt->aResults = NULL; hStmt->nCols = 0; hStmt->nRows = 0; hStmt->nRow = 0; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/_NativeToSQLColumnHeader.c0000755000175000017500000000725412262474476017707 00000000000000/************************************************** * _NativeToSQLColumnHeader * * We want to make the driver code as general as possible. This isolates * the translation from the native client to the SQL format for column * header information. ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _NativeToSQLColumnHeader( COLUMNHDR *pColumnHeader, void *pNativeColumnHeader ) { m_field *pField = (m_field*)pNativeColumnHeader; char szBuffer[501]; if ( !pNativeColumnHeader ) return SQL_ERROR; if ( !pColumnHeader ) return SQL_ERROR; /* IS AUTO INCREMENT COL? */ pColumnHeader->bSQL_DESC_AUTO_UNIQUE_VALUE = 0; /* empty string if N/A */ pColumnHeader->pszSQL_DESC_BASE_COLUMN_NAME = (char*)strdup( pField->name ); /* empty string if N/A */ pColumnHeader->pszSQL_DESC_BASE_TABLE_NAME = pField->table ? (char*)strdup( pField->table ) : (char*)strdup( "" ); /* IS CASE SENSITIVE COLUMN? */ pColumnHeader->bSQL_DESC_CASE_SENSITIVE = 0; /* empty string if N/A */ pColumnHeader->pszSQL_DESC_CATALOG_NAME = (char*)strdup( "" ); /* ie SQL_CHAR, SQL_TYPE_TIME... */ pColumnHeader->nSQL_DESC_CONCISE_TYPE = _NativeToSQLType( pField ); /* max digits required to display */ pColumnHeader->nSQL_DESC_DISPLAY_SIZE = pField->length; /* has data source specific precision? */ pColumnHeader->bSQL_DESC_FIXED_PREC_SCALE = 0; /* display label, col name or empty string */ pColumnHeader->pszSQL_DESC_LABEL = (char*)strdup( pField->name ); /* strlen or bin size */ pColumnHeader->nSQL_DESC_LENGTH = _NativeTypeLength( pField ); /* empty string if N/A */ pColumnHeader->pszSQL_DESC_LITERAL_PREFIX = (char*)strdup( "" ); /* empty string if N/A */ pColumnHeader->pszSQL_DESC_LITERAL_SUFFIX = (char*)strdup( "" ); /* empty string if N/A */ pColumnHeader->pszSQL_DESC_LOCAL_TYPE_NAME = (char*)strdup( "" ); /* col alias, col name or empty string */ pColumnHeader->pszSQL_DESC_NAME = (char*)strdup( pField->name ); /* SQL_NULLABLE, _NO_NULLS or _UNKNOWN */ pColumnHeader->nSQL_DESC_NULLABLE = IS_NOT_NULL( pField->flags ) ? SQL_NO_NULLS : SQL_NULLABLE; /* 2, 10, or if N/A... 0 */ pColumnHeader->nSQL_DESC_NUM_PREC_RADIX = 0; /* max size */ pColumnHeader->nSQL_DESC_OCTET_LENGTH = pField->length; /* */ pColumnHeader->nSQL_DESC_PRECISION = _NativeTypePrecision( pField ); /* */ pColumnHeader->nSQL_DESC_SCALE = 4; /* empty string if N/A */ pColumnHeader->pszSQL_DESC_SCHEMA_NAME = (char*)strdup( "" ); /* can be in a filter ie SQL_PRED_NONE... */ pColumnHeader->nSQL_DESC_SEARCHABLE = SQL_PRED_SEARCHABLE; /* empty string if N/A */ pColumnHeader->pszSQL_DESC_TABLE_NAME = pField->table ? (char*)strdup( pField->table ) : (char*)strdup( "" ); /* SQL data type ie SQL_CHAR, SQL_INTEGER.. */ pColumnHeader->nSQL_DESC_TYPE = _NativeToSQLType( pField ); /* DBMS data type ie VARCHAR, MONEY... */ pColumnHeader->pszSQL_DESC_TYPE_NAME = (char*)strdup( _NativeTypeDesc( szBuffer, pField->type ) ); /* qualifier for SQL_DESC_NAME ie SQL_NAMED */ pColumnHeader->nSQL_DESC_UNNAMED = SQL_NAMED; /* if signed FALSE else TRUE */ pColumnHeader->bSQL_DESC_UNSIGNED = 0; /* ie SQL_ATTR_READONLY, SQL_ATTR_WRITE... */ pColumnHeader->nSQL_DESC_UPDATABLE = SQL_ATTR_READONLY; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetParam.c0000755000175000017500000000317412262474476015241 00000000000000/******************************************************************** * SQLSetParam (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetParam( SQLHSTMT hDrvStmt, UWORD nPar, SWORD nType, SWORD nSqlType, UDWORD nColDef, SWORD nScale, PTR pValue, SDWORD *pnValue ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( NULL == hStmt->pszQuery ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No prepared statement to work with" ); return SQL_ERROR; } /****************** * 1. Your param storage is in hStmt->hStmtExtras * so you will have to code for it. Do it here. ******************/ /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSpecialColumns.c0000755000175000017500000001211612262474476016442 00000000000000/******************************************************************** * SQLSpecialColumns * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" enum nSQLSpecialColumns { COLUMN_NAME = 1, COL_MAX }; m_field aSQLSpecialColumns[] = { "", "", 0, 0, 0, "COLUMN_NAME", "sys", CHAR_TYPE, 50, 0 }; /* THIS IS CORRECT... SQLRETURN SQLSpecialColumns( SQLHSTMT hDrvStmt, SQLSMALLINT nColumnType, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength, SQLSMALLINT nScope, SQLSMALLINT nNullable ) THIS WORKS... */ SQLRETURN SQLSpecialColumns( SQLHSTMT hDrvStmt, UWORD nColumnType, UCHAR *szCatalogName, SWORD nCatalogNameLength, UCHAR *szSchemaName, SWORD nSchemaNameLength, UCHAR *szTableName, SWORD nTableNameLength, UWORD nScope, UWORD nNullable ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; int nColumn; long nCols; long nRow; long nCurRow; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; if ( !szTableName ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /* validate nColumnType */ switch ( nColumnType ) { case SQL_BEST_ROWID: break; case SQL_ROWVER: default: logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } /* validate nScope */ switch ( nScope ) { case SQL_SCOPE_CURROW: case SQL_SCOPE_TRANSACTION: case SQL_SCOPE_SESSION: break; default: logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } /* validate nNullable */ switch ( nNullable ) { case SQL_NO_NULLS: case SQL_NULLABLE: break; default: logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } /* only one scenario supported: nColumnType=SQL_BEST_ROWID and nScope=ignored nNullable=ignored */ /************************** * close any existing result **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); if ( hStmt->pszQuery != NULL ) free( hStmt->pszQuery ); hStmt->pszQuery = NULL; /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ hStmt->hStmtExtras->nCols = COL_MAX-1; hStmt->hStmtExtras->nRows = 1; hStmt->hStmtExtras->nRow = 0; hStmt->hStmtExtras->aResults = malloc( sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1) ); memset( hStmt->hStmtExtras->aResults, 0, sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1) ); if ( hStmt->hStmtExtras->aResults == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Not enough memory. (malloc failed)" ); hStmt->hStmtExtras->nRows = 0; hStmt->hStmtExtras->nCols = 0; return SQL_ERROR; } /************************** * gather column header information (save col 0 for bookmarks) **************************/ for ( nColumn = 1; nColumn < COL_MAX; nColumn++ ) { (hStmt->hStmtExtras->aResults)[nColumn] = malloc( sizeof(COLUMNHDR) ); pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nColumn]; memset( pColumnHeader, 0, sizeof(COLUMNHDR) ); _NativeToSQLColumnHeader( pColumnHeader, &(aSQLSpecialColumns[nColumn]) ); } /************************ * gather data (save col 0 for bookmarks and factor out index columns) ************************/ nCols = hStmt->hStmtExtras->nCols; hStmt->hStmtExtras->nRow = 0; nCurRow = 1; hStmt->hStmtExtras->nRow++; nRow = hStmt->hStmtExtras->nRow; for ( nColumn = 1; nColumn < COL_MAX; nColumn++ ) { switch ( nColumn ) { case COLUMN_NAME: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char*)strdup( "_rowid" ); break; default: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = NULL; } /* switch nColumn */ } /* for nColumn */ hStmt->hStmtExtras->nRow = 0; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLTablePrivileges.c0000755000175000017500000000261112262474476016601 00000000000000/******************************************************************** * SQLTablePrivileges * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLTablePrivileges( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_NativeToSQLType.c0000755000175000017500000000177112262474476016260 00000000000000/************************************************** * _NativeToSQLType * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" int _NativeToSQLType( void *pNativeColumnHeader ) { m_field *pField = (m_field*)pNativeColumnHeader; switch ( pField->type ) { case MONEY_TYPE: return SQL_REAL; case INT_TYPE: return SQL_INTEGER; case UINT_TYPE: return SQL_INTEGER; case TIME_TYPE: return SQL_CHAR; case DATE_TYPE: return SQL_CHAR; case REAL_TYPE: return SQL_REAL; case CHAR_TYPE: return SQL_CHAR; case TEXT_TYPE: return SQL_CHAR; case IDENT_TYPE: return SQL_CHAR; default: return SQL_UNKNOWN_TYPE; } return SQL_CHAR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLExecute.c0000755000175000017500000000116512262474476015125 00000000000000/********************************************************************** * SQLExecute * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLExecute( SQLHSTMT hDrvStmt ) { return _Execute( hDrvStmt ); } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetDescField.c0000755000175000017500000000163112262474476016017 00000000000000/********************************************************************** * SQLSetDescField * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetDescField( SQLHDESC DescriptorHandle, SQLSMALLINT RecordNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_AllocEnv.c0000755000175000017500000000270612262474476015007 00000000000000/********************************************************************** * _AllocEnv * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _AllocEnv( SQLHENV *phDrvEnv ) { HDRVENV *phEnv = (HDRVENV*)phDrvEnv; /* SANITY CHECKS */ if( NULL == phEnv ) return SQL_INVALID_HANDLE; /* OK */ /* allocate environment */ *phEnv = malloc( sizeof(DRVENV) ); if( SQL_NULL_HENV == *phEnv ) { *phEnv = SQL_NULL_HENV; return SQL_ERROR; } /* initialise environment */ memset( *phEnv, 0, sizeof(DRVENV) ); (*phEnv)->hFirstDbc = NULL; (*phEnv)->hLastDbc = NULL; (*phEnv)->hLog = NULL; /* start logging */ if ( !logOpen( &(*phEnv)->hLog, SQL_DRIVER_NAME, NULL, 50 ) ) (*phEnv)->hLog = NULL; logOn( (*phEnv)->hLog, 1 ); /* ALLOCATE AND INIT DRIVER SPECIFIC STORAGE */ (*phEnv)->hEnvExtras = malloc(sizeof(ENVEXTRAS)); (*phEnv)->hEnvExtras->nDummy = -1; logPushMsg( (*phEnv)->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLNumParams.c0000755000175000017500000000225512262474476015427 00000000000000/********************************************************************** * SQLNumParams * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLNumParams( SQLHSTMT hDrvStmt, SQLSMALLINT *pnParamCount ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetStmtAttr.c0000755000175000017500000000260712262474476015747 00000000000000/********************************************************************** * SQLGetStmtAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetStmtAttr( SQLHSTMT hDrvStmt, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLEndTran.c0000755000175000017500000000141612262474476015055 00000000000000/********************************************************************** * SQLEndTran * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLEndTran( SQLSMALLINT nHandleType, SQLHANDLE nHandle, SQLSMALLINT nCompletionType ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetEnvAttr.c0000755000175000017500000000152112262474476015556 00000000000000/********************************************************************** * SQLSetEnvAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetEnvAttr( SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLConnect.c0000755000175000017500000001132512262474476015113 00000000000000/********************************************************************** * SQLConnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLConnect( SQLHDBC hDrvDbc, SQLCHAR *szDataSource, SQLSMALLINT nDataSourceLength, SQLCHAR *szUID, SQLSMALLINT nUIDLength, SQLCHAR *szPWD, SQLSMALLINT nPWDLength ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; char szDATABASE[INI_MAX_PROPERTY_VALUE+1]; char szCONFIGFILE[INI_MAX_PROPERTY_VALUE+1]; char szHOST[INI_MAX_PROPERTY_VALUE+1]; /* SANITY CHECKS */ if( SQL_NULL_HDBC == hDbc ) return SQL_INVALID_HANDLE; sprintf( hDbc->szSqlMsg, "hDbc=$%08lX szDataSource=(%s)", hDbc, szDataSource ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); if( hDbc->bConnected == 1 ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Already connected" ); return SQL_ERROR; } if ( strlen( szDataSource ) > ODBC_FILENAME_MAX+INI_MAX_OBJECT_NAME ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Given Data Source is too long. I consider it suspect." ); return SQL_ERROR; } /******************** * gather and use any required DSN properties * - CONFIGFILE - for msqlLoadConfigFile() (has precedence over other properties) * - DATABASE * - HOST (localhost assumed if not supplied) ********************/ szDATABASE[0] = '\0'; szHOST[0] = '\0'; szCONFIGFILE[0] = '\0'; SQLGetPrivateProfileString( szDataSource, "DATABASE", "", szDATABASE, sizeof(szDATABASE), ".odbc.ini" ); if ( szDATABASE[0] == '\0' ) { sprintf( hDbc->szSqlMsg, "SQL_ERROR Could not find Driver entry for %s in system information", szDataSource ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); return SQL_ERROR; } SQLGetPrivateProfileString( szDataSource, "HOST", "", szHOST, sizeof(szHOST), ".odbc.ini" ); SQLGetPrivateProfileString( szDataSource, "CONFIGFILE", "", szCONFIGFILE, sizeof(szCONFIGFILE), ".odbc.ini" ); /******************** * 1. initialise structures * 2. try connection with database using your native calls * 3. store your server handle in the extras somewhere * 4. set connection state * hDbc->bConnected = TRUE; ********************/ if ( szCONFIGFILE[0] != '\0' ) { if ( msqlLoadConfigFile( szCONFIGFILE ) != 0 ) { sprintf( hDbc->szSqlMsg, "SQL_ERROR %s", msqlErrMsg ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); sprintf( hDbc->szSqlMsg, "SQL_WARNING Failed to use (%s)", szCONFIGFILE ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); return SQL_ERROR; } } if ( szHOST[0] == '\0' ) { hDbc->hDbcExtras->hServer = msqlConnect( NULL ); /* this is faster than using localhost */ strcpy( szHOST, "localhost" ); } else hDbc->hDbcExtras->hServer = msqlConnect( szHOST ); if ( hDbc->hDbcExtras->hServer < 0 ) { sprintf( hDbc->szSqlMsg, "SQL_ERROR %s", msqlErrMsg ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); sprintf( hDbc->szSqlMsg, "SQL_ERROR Failed to connect to (%s)", szHOST ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); return SQL_ERROR; } hDbc->bConnected = 1; /* SET DATABASE */ if ( szDATABASE[0] != '\0' ) { if ( msqlSelectDB( hDbc->hDbcExtras->hServer, szDATABASE ) == -1 ) { sprintf( hDbc->szSqlMsg, "SQL_WARNING %s", msqlErrMsg ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); sprintf( hDbc->szSqlMsg, "SQL_WARNING Connected to server but failed to use database (%s)", szDATABASE ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); } else { sprintf( hDbc->szSqlMsg, "SQL_INFO DATABASE=%s", szDATABASE ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); } } logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLParamOptions.c0000755000175000017500000000226312262474476016137 00000000000000/********************************************************************** * SQLParamOptions (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLParamOptions( SQLHSTMT hDrvStmt, SQLULEN nRow, SQLULEN *pnRow ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLTables.c0000755000175000017500000001077312262474476014742 00000000000000/********************************************************************** * SQLTables * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" enum nSQLTables { TABLE_CAT = 1, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS, COL_MAX }; m_field aSQLTables[] = { "", "", 0, 0, 0, /* keep things 1 based */ "TABLE_CAT", "sys", CHAR_TYPE, 50, 0, "TABLE_SCHEM", "sys", CHAR_TYPE, 50, 0, "TABLE_NAME", "sys", CHAR_TYPE, 50, 0, "TABLE_TYPE", "sys", CHAR_TYPE, 50, 0, "REMARKS", "sys", CHAR_TYPE, 50, 0 }; SQLRETURN SQLTables( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength, SQLCHAR *szTableType, SQLSMALLINT nTableTypeLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; m_result *pResults; /* mSQL DATA */ m_field *pField; /* mSQL field */ COLUMNHDR *pColumnHeader; m_row rowResult; /* mSQL ROW */ int nColumn; long nResultMemory; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************** * close any existing result **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); if ( hStmt->pszQuery != NULL ) free( hStmt->pszQuery ); hStmt->pszQuery = NULL; /************************ * generate a result set listing tables ************************/ pResults = msqlListTables( ((HDRVDBC)hStmt->hDbc)->hDbcExtras->hServer ); if ( pResults == NULL ) { sprintf( hStmt->szSqlMsg, "SQL_ERROR Query failed. %s", msqlErrMsg ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ hStmt->hStmtExtras->nCols = COL_MAX-1; hStmt->hStmtExtras->nRows = msqlNumRows( pResults ); hStmt->hStmtExtras->nRow = 0; nResultMemory = sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1); hStmt->hStmtExtras->aResults = malloc( nResultMemory ); if ( hStmt->hStmtExtras->aResults == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Not enough memory. (malloc failed)" ); hStmt->hStmtExtras->nRows = 0; hStmt->hStmtExtras->nCols = 0; msqlFreeResult( pResults ); return SQL_ERROR; } /************************** * gather column header information (save col 0 for bookmarks) **************************/ for ( nColumn = 1; nColumn < COL_MAX; nColumn++ ) { (hStmt->hStmtExtras->aResults)[nColumn] = malloc( sizeof(COLUMNHDR) ); pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nColumn]; memset( pColumnHeader, 0, sizeof(COLUMNHDR) ); _NativeToSQLColumnHeader( pColumnHeader, &(aSQLTables[nColumn]) ); } /************************ * gather data (save col 0 for bookmarks) ************************/ hStmt->hStmtExtras->nRow = 0; while ( (rowResult = msqlFetchRow( pResults )) != NULL ) { hStmt->hStmtExtras->nRow++; msqlFieldSeek( pResults, 0 ); for ( nColumn = 1; nColumn <= hStmt->hStmtExtras->nCols; nColumn++ ) { switch ( nColumn ) { case TABLE_NAME: (hStmt->hStmtExtras->aResults)[hStmt->hStmtExtras->nRow*hStmt->hStmtExtras->nCols+nColumn] = (char *)strdup( rowResult[0] ); break; default: (hStmt->hStmtExtras->aResults)[hStmt->hStmtExtras->nRow*hStmt->hStmtExtras->nCols+nColumn] = NULL; } } } hStmt->hStmtExtras->nRow = 0; /************************** * free the snapshot **************************/ msqlFreeResult( pResults ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLRowCount.c0000755000175000017500000000235712262474476015307 00000000000000/********************************************************************** * SQLRowCount * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLRowCount( SQLHSTMT hDrvStmt, SQLINTEGER *pnRowCount) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( NULL == pnRowCount ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR pnRowCount can not be NULL" ); return SQL_ERROR; } *pnRowCount = hStmt->hStmtExtras->nRows; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/_FreeDbc.c0000755000175000017500000000322412262474476014572 00000000000000/************************************************** * _FreeDbc * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _FreeDbc( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; HDRVDBC hPrevDbc; SQLRETURN nReturn; if ( hDbc == SQL_NULL_HDBC ) return SQL_ERROR; /* TRY TO FREE STATEMENTS */ /* THIS IS JUST IN CASE; SHOULD NOT BE REQUIRED */ nReturn = _FreeStmtList( hDbc ); if ( nReturn != SQL_SUCCESS ) return nReturn; /* SPECIAL CHECK FOR FIRST IN LIST */ if ( ((HDRVENV)hDbc->hEnv)->hFirstDbc == hDbc ) ((HDRVENV)hDbc->hEnv)->hFirstDbc = hDbc->pNext; /* SPECIAL CHECK FOR LAST IN LIST */ if ( ((HDRVENV)hDbc->hEnv)->hLastDbc == hDbc ) ((HDRVENV)hDbc->hEnv)->hLastDbc = hDbc->pPrev; /* EXTRACT SELF FROM LIST */ if ( hDbc->pPrev != SQL_NULL_HDBC ) hDbc->pPrev->pNext = hDbc->pNext; if ( hDbc->pNext != SQL_NULL_HDBC ) hDbc->pNext->pPrev = hDbc->pPrev; /**********************************************/ /* !!! CODE TO FREE DRIVER SPECIFIC MEMORY (hidden in hStmtExtras) HERE !!! */ if ( hDbc->hDbcExtras->hServer > -1 ) msqlClose( hDbc->hDbcExtras->hServer ); free( hDbc->hDbcExtras ); /**********************************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); logClose( hDbc->hLog ); free( hDbc ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLTransact.c0000755000175000017500000000252312262474476015301 00000000000000/******************************************************************** * SQLTransact (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLTransact( SQLHENV hDrvEnv, SQLHDBC hDrvDbc, UWORD nType) { HDRVENV hEnv = (HDRVENV)hDrvEnv; HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if ( hEnv == SQL_NULL_HENV ) return SQL_INVALID_HANDLE; sprintf( hEnv->szSqlMsg, "hEnv = $%08lX", hEnv ); logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hEnv->szSqlMsg ); switch ( nType ) { case SQL_COMMIT: break; case SQL_ROLLBACK: break; default: sprintf( hEnv->szSqlMsg, "SQL_ERROR Invalid nType=%d", nType ); logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hEnv->szSqlMsg ); return SQL_ERROR; } logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLStatistics.c0000755000175000017500000001432212262474476015654 00000000000000/******************************************************************** * SQLStatistics * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" enum nSQLStatistics { TABLE_CAT = 1, TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, INDEX_QUALIFIER, INDEX_NAME, TYPE, ORDINAL_POSITION, COLUMN_NAME, ASC_OR_DESC, CARDINALITY, PAGES, FILTER_CONDITION, COL_MAX }; m_field aSQLStatistics[] = { "", "", 0, 0, 0, "TABLE_CAT", "sys", CHAR_TYPE, 50, 0, "TABLE_SCHEM", "sys", CHAR_TYPE, 50, 0, "TABLE_NAME", "sys", CHAR_TYPE, 50, 0, "NON_UNIQUE", "sys", INT_TYPE, 3, 0, "INDEX_QUALIFIER", "sys", CHAR_TYPE, 50, 0, "INDEX_NAME", "sys", CHAR_TYPE, 50, 0, "TYPE", "sys", INT_TYPE, 3, 0, "ORDINAL_POSITION", "sys", CHAR_TYPE, 50, 0, "COLUMN_NAME", "sys", CHAR_TYPE, 50, 0, "ASC_OR_DESC", "sys", INT_TYPE, 3, 0, "CARDINALITY", "sys", INT_TYPE, 3, 0, "PAGES", "sys", INT_TYPE, 3, 0, "FILTER_CONDITION", "sys", CHAR_TYPE, 50, 0 }; SQLRETURN SQLStatistics( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, /* MUST BE SUPPLIED */ SQLSMALLINT nTableNameLength, SQLUSMALLINT nTypeOfIndex, SQLUSMALLINT nReserved ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; m_result *pResults; /* mSQL DATA */ m_field *pField; /* mSQL field */ COLUMNHDR *pColumnHeader; int nColumn; long nCols; long nCurRow; long nRow; char szBuffer[101]; int nIndexColumns = 0; int nNormalColumns = 0; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( szTableName == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No table name" ); return SQL_ERROR; } if ( szTableName[0] == '\0' ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No table name" ); return SQL_ERROR; } /************************** * close any existing result **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); if ( hStmt->pszQuery != NULL ) free( hStmt->pszQuery ); hStmt->pszQuery = NULL; /************************ * generate a result set listing columns (these will be our rows) ************************/ pResults = msqlListFields( ((HDRVDBC)hStmt->hDbc)->hDbcExtras->hServer, szTableName ); if ( pResults == NULL ) { sprintf( hStmt->szSqlMsg, "SQL_ERROR Query failed. %s", msqlErrMsg ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } /************************ * how many columns are indexs? ************************/ nIndexColumns = 0; while ( pField = msqlFetchField( pResults ) ) { if ( pField->type == IDX_TYPE) nIndexColumns++; } msqlFieldSeek( pResults, 0 ); nNormalColumns = msqlNumFields( pResults ) - nIndexColumns; /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ hStmt->hStmtExtras->nCols = COL_MAX-1; hStmt->hStmtExtras->nRows = nIndexColumns; hStmt->hStmtExtras->nRow = 0; hStmt->hStmtExtras->aResults = malloc( sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1) ); memset( hStmt->hStmtExtras->aResults, 0, sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1) ); if ( hStmt->hStmtExtras->aResults == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Not enough memory. (malloc failed)" ); hStmt->hStmtExtras->nRows = 0; hStmt->hStmtExtras->nCols = 0; msqlFreeResult( pResults ); return SQL_ERROR; } /************************** * gather column header information (save col 0 for bookmarks) **************************/ for ( nColumn = 1; nColumn < COL_MAX; nColumn++ ) { (hStmt->hStmtExtras->aResults)[nColumn] = malloc( sizeof(COLUMNHDR) ); pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nColumn]; memset( pColumnHeader, 0, sizeof(COLUMNHDR) ); _NativeToSQLColumnHeader( pColumnHeader, &(aSQLStatistics[nColumn]) ); } /************************ * gather data (save col 0 for bookmarks and factor out normal columns) ************************/ nCols = hStmt->hStmtExtras->nCols; hStmt->hStmtExtras->nRow = 0; for ( nCurRow = 1; nCurRow <= msqlNumFields( pResults ); nCurRow++ ) { pField = msqlFetchField( pResults ); if ( pField->type == IDX_TYPE) { hStmt->hStmtExtras->nRow++; nRow = hStmt->hStmtExtras->nRow; for ( nColumn = 1; nColumn < COL_MAX; nColumn++ ) { switch ( nColumn ) { case TABLE_NAME: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char*)strdup( szTableName ); break; case INDEX_NAME: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char*)strdup( pField->name ); break; case NON_UNIQUE: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char *)strdup( IS_NOT_NULL( pField->flags ) ? "0" : "1" ); break; default: (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = NULL; } /* switch nColumn */ } /* for nColumn */ } /* if */ } /* for nRow */ hStmt->hStmtExtras->nRow = 0; /************************** * free the snapshot **************************/ msqlFreeResult( pResults ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/README0000755000175000017500000000265412262474476013663 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver for MiniSQL | +-------------------------------------------------------------+ This driver is for use with the MiniSQL SQL Server Version 2.x. To build 1. modify Config.mk as required 2. make Compliance This driver is a work in progress which strives to meet 3.51 CLI compliance. This driver currently implements a usefull set of; 1. catalog functions via SQLColumns, SQLTables, SQLDescribeCol, SQLColAttribute 2. alloc and free calls for Environment, Connection, and Statement 3. connect via SQLConnect 4. SQL execution via SQLPrepare, SQLExecute 5. data retreival via SQLFetch, SQLBindCol, SQLGetData If you would like to improve this driver then please send me (Peter Harvey) an email. +-------------------------------------------------------------+ | Please vist; | | www.codebydesign.com/unixODBC | | www.Hughes.com.au | +-------------------------------------------------------------+ unixODBC-2.3.9/Drivers/MiniSQL/SQLFreeConnect.c0000755000175000017500000000137512460435544015712 00000000000000/********************************************************************** * SQLFreeConnect * * Do not try to Free Dbc if there are Stmts... return an error. Let the * Driver Manager do a recursive clean up if it wants. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLFreeConnect( SQLHDBC hDrvDbc ) { return sqlFreeConnect( hDrvDbc ); } unixODBC-2.3.9/Drivers/MiniSQL/_FreeDbcList.c0000755000175000017500000000121112262474476015420 00000000000000/************************************************** * _FreeDbcList * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _FreeDbcList( SQLHENV hDrvEnv ) { HDRVENV hEnv = (HDRVENV)hDrvEnv; if ( hEnv == SQL_NULL_HENV ) return SQL_SUCCESS; while ( _FreeDbc( hEnv->hFirstDbc ) == SQL_SUCCESS ) { } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetStmtOption.c0000755000175000017500000000230712262474476016316 00000000000000/********************************************************************** * SQLSetStmtOption (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetStmtOption( SQLHSTMT hDrvStmt, UWORD fOption, UDWORD vParam) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_AllocConnect.c0000755000175000017500000000520412262474476015644 00000000000000/************************************************** * _AllocConnect * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _AllocConnect( SQLHENV hDrvEnv, SQLHDBC *phDrvDbc ) { HDRVENV hEnv = (HDRVENV)hDrvEnv; HDRVDBC *phDbc = (HDRVDBC*)phDrvDbc; /************************ * SANITY CHECKS ************************/ if( SQL_NULL_HENV == hEnv ) return SQL_INVALID_HANDLE; sprintf( hEnv->szSqlMsg, "hEnv = $%08lX phDbc = $%08lX", hEnv, phDbc ); logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hEnv->szSqlMsg ); if( SQL_NULL_HDBC == phDbc ) { logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR *phDbc is NULL" ); return SQL_ERROR; } /************************ * OK LETS DO IT ************************/ /* allocate database access structure */ *phDbc = (HDRVDBC)malloc( sizeof(DRVDBC) ); if( SQL_NULL_HDBC == *phDbc ) { *phDbc = SQL_NULL_HDBC; logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR malloc error" ); return SQL_ERROR; } /* initialize structure */ memset( *phDbc, 0, sizeof(DRVDBC) ); (*phDbc)->bConnected = 0; (*phDbc)->hDbcExtras = NULL; (*phDbc)->hFirstStmt = NULL; (*phDbc)->hLastStmt = NULL; (*phDbc)->pNext = NULL; (*phDbc)->pPrev = NULL; (*phDbc)->hEnv = (SQLPOINTER)hEnv; /* start logging */ if ( !logOpen( &(*phDbc)->hLog, SQL_DRIVER_NAME, NULL, 50 ) ) (*phDbc)->hLog = NULL; logOn( (*phDbc)->hLog, 1 ); /* ADD TO END OF LIST */ if ( hEnv->hFirstDbc == NULL ) { /* 1st is null so the list is empty right now */ hEnv->hFirstDbc = (*phDbc); hEnv->hLastDbc = (*phDbc); } else { /* at least one node in list */ hEnv->hLastDbc->pNext = (SQLPOINTER)(*phDbc); (*phDbc)->pPrev = (SQLPOINTER)hEnv->hLastDbc; hEnv->hLastDbc = (*phDbc); } /********************************************************/ /* ALLOCATE AND INIT EXTRAS HERE */ (*phDbc)->hDbcExtras = malloc( sizeof(DBCEXTRAS) ); (*phDbc)->hDbcExtras->hServer = -1; /********************************************************/ logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLFreeHandle.c0000755000175000017500000000203212262474476015512 00000000000000/********************************************************************** * SQLFreeHandle * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLFreeHandle( SQLSMALLINT nHandleType, SQLHANDLE nHandle ) { switch( nHandleType ) { case SQL_HANDLE_ENV: return sqlFreeEnv( (SQLHENV)nHandle ); case SQL_HANDLE_DBC: return sqlFreeConnect( (SQLHDBC)nHandle ); case SQL_HANDLE_STMT: return sqlFreeStmt( (SQLHSTMT)nHandle, 0 ); case SQL_HANDLE_DESC: break; default: return SQL_ERROR; } return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetDiagRec.c0000755000175000017500000000210312262474476015452 00000000000000/********************************************************************** * SQLGetDiagRec * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetDiagRec( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecordNumber, SQLCHAR *Sqlstate, SQLINTEGER *NativeError, SQLCHAR *MessageText, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetInfo.c0000755000175000017500000000316412262474476015057 00000000000000/********************************************************************** * SQLGetInfo * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetInfo( SQLHDBC hDbc, SQLUSMALLINT nInfoType, SQLPOINTER pInfoValue, SQLSMALLINT nInfoValueMax, SQLSMALLINT *pnLength) { SQLRETURN rc=SQL_ERROR; switch (nInfoType) { case SQL_DBMS_NAME: if (nInfoValueMax < 5) break; strcpy( pInfoValue, "mSQL"); *pnLength = 4; rc = SQL_SUCCESS; break; case SQL_DBMS_VER: { SQLPOINTER ver=(SQLPOINTER)msqlGetServerInfo(); SQLSMALLINT len=strlen(ver); if (nInfoValueMax < len+1) break; strcpy( pInfoValue, ver); *pnLength = len; rc = SQL_SUCCESS; break; } case SQL_TXN_CAPABLE: { SQLSMALLINT supp=0; if (nInfoValueMax < sizeof(SQLSMALLINT)) break; pInfoValue = (SQLPOINTER)&supp; *pnLength = sizeof(SQLSMALLINT); rc = SQL_SUCCESS; break; } } return rc; } unixODBC-2.3.9/Drivers/MiniSQL/_FreeStmt.c0000755000175000017500000000312512262474476015031 00000000000000/************************************************** * _FreeStmt * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _FreeStmt( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; HDRVSTMT hPrevStmt; SQLRETURN nReturn; if ( hStmt == SQL_NULL_HDBC ) return SQL_ERROR; /* SPECIAL CHECK FOR FIRST IN LIST */ if ( ((HDRVDBC)hStmt->hDbc)->hFirstStmt == hStmt ) ((HDRVDBC)hStmt->hDbc)->hFirstStmt = hStmt->pNext; /* SPECIAL CHECK FOR LAST IN LIST */ if ( ((HDRVDBC)hStmt->hDbc)->hLastStmt == hStmt ) ((HDRVDBC)hStmt->hDbc)->hLastStmt = hStmt->pPrev; /* EXTRACT SELF FROM LIST */ if ( hStmt->pPrev != SQL_NULL_HSTMT ) hStmt->pPrev->pNext = hStmt->pNext; if ( hStmt->pNext != SQL_NULL_HSTMT ) hStmt->pNext->pPrev = hStmt->pPrev; /* FREE STANDARD MEMORY */ if( NULL != hStmt->pszQuery ) free( hStmt->pszQuery ); /*********************************************************************/ /* !!! FREE DRIVER SPECIFIC MEMORY (hidden in hStmtExtras) HERE !!! */ _FreeResults( hStmt->hStmtExtras ); free( hStmt->hStmtExtras ); /*********************************************************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); logClose( hStmt->hLog ); free( hStmt ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLColAttributes.c0000755000175000017500000000475012262474476016312 00000000000000/********************************************************************** * SQLColAttributes (this function has been deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLColAttributes( SQLHSTMT hDrvStmt, UWORD nCol, UWORD nDescType, PTR pszDesc, SWORD nDescMax, SWORD *pcbDesc, SDWORD *pfDesc ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************** * 1. verify we have result set * 2. verify col is within range **************************/ /************************** * 3. process request **************************/ switch( nDescType ) { /* enum these case SQL_COLUMN_AUTO_INCREMENT: case SQL_COLUMN_CASE_SENSITIVE: case SQL_COLUMN_COUNT: case SQL_COLUMN_DISPLAY_SIZE: case SQL_COLUMN_LENGTH: case SQL_COLUMN_MONEY: case SQL_COLUMN_NULLABLE: case SQL_COLUMN_PRECISION: case SQL_COLUMN_SCALE: case SQL_COLUMN_SEARCHABLE: case SQL_COLUMN_TYPE: case SQL_COLUMN_UNSIGNED: case SQL_COLUMN_UPDATABLE: case SQL_COLUMN_CATALOG_NAME: case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_DISTINCT_TYPE: case SQL_COLUMN_LABEL: case SQL_COLUMN_NAME: case SQL_COLUMN_SCHEMA_NAME: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: */ default: sprintf( hStmt->szSqlMsg, "SQL_ERROR nDescType=%d", nDescType ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLDriverConnect.c0000755000175000017500000000464112262474476016272 00000000000000/********************************************************************** * SQLDriverConnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLDriverConnect( SQLHDBC hDrvDbc, SQLHWND hWnd, SQLCHAR *szConnStrIn, SQLSMALLINT nConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pnConnStrOut, SQLUSMALLINT nDriverCompletion ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); if( hDbc->bConnected == 1 ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Already connected" ); return SQL_ERROR; } /************************* * 1. parse nConnStrIn for connection options. Format is; * Property=Value;... * 2. we may not have all options so handle as per DM request * 3. fill as required szConnStrOut *************************/ switch( nDriverCompletion ) { case SQL_DRIVER_PROMPT: case SQL_DRIVER_COMPLETE: case SQL_DRIVER_COMPLETE_REQUIRED: case SQL_DRIVER_NOPROMPT: default: sprintf( hDbc->szSqlMsg, "Invalid nDriverCompletion=%d", nDriverCompletion ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); break; } /************************* * 4. try to connect * 5. set gathered options (ie USE Database or whatever) * 6. set connection state * hDbc->bConnected = TRUE; * hDbc->ciActive = 0; *************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported." ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLProcedureColumns.c0000755000175000017500000000277012262474476017017 00000000000000/******************************************************************** * SQLProcedureColumns * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLProcedureColumns( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szProcName, SQLSMALLINT nProcNameLength, SQLCHAR *szColumnName, SQLSMALLINT nColumnNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLCloseCursor.c0000755000175000017500000000217312262474476015766 00000000000000/********************************************************************** * SQLCloseCursor * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLCloseCursor( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLForeignKeys.c0000755000175000017500000000364312262474476015753 00000000000000/******************************************************************** * SQLForeignKeys * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLForeignKeys( SQLHSTMT hDrvStmt, SQLCHAR *szPKCatalogName, SQLSMALLINT nPKCatalogNameLength, SQLCHAR *szPKSchemaName, SQLSMALLINT nPKSchemaNameLength, SQLCHAR *szPKTableName, SQLSMALLINT nPKTableNameLength, SQLCHAR *szFKCatalogName, SQLSMALLINT nFKCatalogNameLength, SQLCHAR *szFKSchemaName, SQLSMALLINT nFKSchemaNameLength, SQLCHAR *szFKTableName, SQLSMALLINT nFKTableNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_NativeTypeLength.c0000755000175000017500000000215412262474476016533 00000000000000/************************************************** * _NativeTypeLength * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" int _NativeTypeLength( void *pNativeColumnHeader ) { m_field *pField = (m_field*)pNativeColumnHeader; int nLength; /**************************** * DEFAULT ***************************/ nLength = pField->length; /**************************** * NON-DEFAULT ***************************/ switch ( pField->type ) { case MONEY_TYPE: return 16; case INT_TYPE: return 5; case UINT_TYPE: return 5; case TIME_TYPE: return nLength; case DATE_TYPE: return nLength; case REAL_TYPE: return nLength; case CHAR_TYPE: return nLength; case TEXT_TYPE: return nLength; case IDENT_TYPE: return nLength; default: return nLength; } return nLength; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetStmtOption.c0000755000175000017500000000235412262474476016304 00000000000000/********************************************************************** * SQLGetStmtOption (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetStmtOption( SQLHSTMT hDrvStmt, UWORD fOption, PTR pvParam) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLBrowseConnect.c0000755000175000017500000000252412262474476016276 00000000000000/********************************************************************** * SQLBrowseConnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLBrowseConnect( SQLHDBC hDrvDbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; if ( hDbc == NULL ) return SQL_INVALID_HANDLE; sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not currently supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLMoreResults.c0000755000175000017500000000216212262474476016005 00000000000000/********************************************************************** * SQLMoreResults * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLMoreResults( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_NativeTypeDesc.c0000755000175000017500000000111112262474476016160 00000000000000/************************************************** * _NativeTypeDesc * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" char *_NativeTypeDesc( char *pszTypeName, int nMiniSQLType ) { sprintf( pszTypeName, "%s", msqlTypeNames[nMiniSQLType] ); return pszTypeName; } unixODBC-2.3.9/Drivers/MiniSQL/driverextras.h0000755000175000017500000001420412262474476015670 00000000000000/********************************************** * driverextras.h * * Purpose: * * To define driver specifc extras such as structs to be included * along side the common ODBC includes. * * Description: * * The short-term storage a driver requires as infrastructure varies somewhat from * DBMS to DBMS. The ODBC DriverManager requires predictable storage and it is defined * in include files such as hstmt.h. The Driver also requires predictable storage and * it is defined in driver.h. Storage *specific to a type of driver* is defined here. * * The three main storage items are the ENV, DBC, and STMT structs. These are defined * as type void * in sql.h. * * So if your driver requires extra storage (and it probably does) then define * the storage within these structs, allocate/initialize as required. Cast them * to and from the standard names as required. * * For example; * * App DM |DRV * (as per hdbc.h) |(as per driver.h) *==================================================================== * hDbc=void* hDbc=SQLHDBC hDbc=HDBCEXTRAS *-------------------------------------------------------------------- * * DO NOT FORGET TO FREE ANY ALLOCATED MEMORY (at some point) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #ifndef DRIVEREXTRAS_H #define DRIVEREXTRAS_H /********************************************** * KEEP IT SIMPLE; PUT ALL DRIVER INCLUDES HERE THEN EACH DRIVER MODULE JUST INCLUDES THIS ONE FILE **********************************************/ #include #include #include #include #include #include /********************************************** * ENVIRONMENT: DRIVER SPECIFIC STUFF THAT NEEDS TO BE STORED IN THE DRIVERS ENVIRONMENT **********************************************/ typedef struct tENVEXTRAS { int nDummy; } ENVEXTRAS, *HENVEXTRAS; /********************************************** * CONNECTION: DRIVER SPECIFIC STUFF THAT NEEDS TO BE STORED IN THE DRIVERS CONNECTIONS **********************************************/ typedef struct tDBCEXTRAS { int hServer; /* HANDLE TO mSQl SERVER (socket) */ } DBCEXTRAS, *HDBCEXTRAS; /********************************************** * STATEMENT: DRIVER SPECIFIC STUFF THAT NEEDS TO BE STORED IN THE DRIVERS STATEMENTS **********************************************/ typedef struct tCOLUMNHDR /* this is how we will store bound columns */ { /* EVERYTHING YOU WOULD EVER WANT TO KNOW ABOUT THE COLUMN. INIT THIS BY CALLING */ /* _NativeToSQLColumnHeader AS SOON AS YOU HAVE COLUMN INFO. THIS MAKES THE COL HDR LARGER */ /* BUT GENERALIZES MORE CODE. see SQLColAttribute() */ int bSQL_DESC_AUTO_UNIQUE_VALUE; /* IS AUTO INCREMENT COL? */ char *pszSQL_DESC_BASE_COLUMN_NAME; /* empty string if N/A */ char *pszSQL_DESC_BASE_TABLE_NAME; /* empty string if N/A */ int bSQL_DESC_CASE_SENSITIVE; /* IS CASE SENSITIVE COLUMN? */ char *pszSQL_DESC_CATALOG_NAME; /* empty string if N/A */ int nSQL_DESC_CONCISE_TYPE; /* ie SQL_CHAR, SQL_TYPE_TIME... */ int nSQL_DESC_DISPLAY_SIZE; /* max digits required to display */ int bSQL_DESC_FIXED_PREC_SCALE; /* has data source specific precision? */ char *pszSQL_DESC_LABEL; /* display label, col name or empty string */ int nSQL_DESC_LENGTH; /* strlen or bin size */ char *pszSQL_DESC_LITERAL_PREFIX; /* empty string if N/A */ char *pszSQL_DESC_LITERAL_SUFFIX; /* empty string if N/A */ char *pszSQL_DESC_LOCAL_TYPE_NAME; /* empty string if N/A */ char *pszSQL_DESC_NAME; /* col alias, col name or empty string */ int nSQL_DESC_NULLABLE; /* SQL_NULLABLE, _NO_NULLS or _UNKNOWN */ int nSQL_DESC_NUM_PREC_RADIX; /* 2, 10, or if N/A... 0 */ int nSQL_DESC_OCTET_LENGTH; /* max size */ int nSQL_DESC_PRECISION; /* */ int nSQL_DESC_SCALE; /* */ char *pszSQL_DESC_SCHEMA_NAME; /* empty string if N/A */ int nSQL_DESC_SEARCHABLE; /* can be in a filter ie SQL_PRED_NONE... */ char *pszSQL_DESC_TABLE_NAME; /* empty string if N/A */ int nSQL_DESC_TYPE; /* SQL data type ie SQL_CHAR, SQL_INTEGER.. */ char *pszSQL_DESC_TYPE_NAME; /* DBMS data type ie VARCHAR, MONEY... */ int nSQL_DESC_UNNAMED; /* qualifier for SQL_DESC_NAME ie SQL_NAMED */ int bSQL_DESC_UNSIGNED; /* if signed FALSE else TRUE */ int nSQL_DESC_UPDATABLE; /* ie SQL_ATTR_READONLY, SQL_ATTR_WRITE... */ /* BINDING INFO */ short nTargetType; /* BIND: C DATA TYPE ie SQL_C_CHAR */ char *pTargetValue; /* BIND: POINTER FROM APPLICATION TO COPY TO*/ long nTargetValueMax; /* BIND: MAX SPACE IN pTargetValue */ long *pnLengthOrIndicator; /* BIND: TO RETURN LENGTH OR NULL INDICATOR */ } COLUMNHDR; typedef struct tSTMTEXTRAS { char **aResults; /* nRows x nCols OF CHAR POINTERS. Row 0= ptrs to COLUMNHDR. Col 0=Bookmarks */ int nCols; /* # OF VALID COLUMNS IN aColumns */ int nRows; /* # OF ROWS IN aResults */ int nRow; /* CURRENT ROW */ } STMTEXTRAS, *HSTMTEXTRAS; /**************************** * ***************************/ SQLRETURN _GetData( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLSMALLINT nTargetType, SQLPOINTER pTarget, SQLINTEGER nTargetLength, SQLINTEGER *pnLengthOrIndicator ); SQLRETURN _NativeToSQLColumnHeader( COLUMNHDR *pColumnHeader, void *pNativeColumnHeader ); int _NativeToSQLType( void *pNativeColumnHeader ); char *_NativeTypeDesc( char *pszTypeName, int nType ); int _NativeTypeLength( void *pNativeColumnHeader ); int _NativeTypePrecision( void *pNativeColumnHeader ); #endif unixODBC-2.3.9/Drivers/MiniSQL/SQLFreeEnv.c0000755000175000017500000000136012262474476015052 00000000000000/********************************************************************** * SQLFreeEnv * * Do not try to Free Env if there are Dbcs... return an error. Let the * Driver Manager do a recursive clean up if it wants. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLFreeEnv( SQLHENV hDrvEnv ) { return sqlFreeEnv( hDrvEnv ); } unixODBC-2.3.9/Drivers/MiniSQL/SQLExecDirect.c0000755000175000017500000000277112262474476015546 00000000000000/********************************************************************** * SQLExecDirect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLExecDirect( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStr, SQLINTEGER nSqlStr ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; RETCODE rc; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /* prepare command */ rc = _Prepare( hDrvStmt, szSqlStr, nSqlStr ); if ( SQL_SUCCESS != rc ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Could not prepare statement" ); return rc; } /* execute command */ rc = _Execute( hDrvStmt ); if ( SQL_SUCCESS != rc ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Problem calling SQLEXecute" ); return rc; } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/_Execute.c0000755000175000017500000001020712262474476014701 00000000000000/********************************************************************** * SQLExecute * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _Execute( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; int nColumn; int nCols; int nRow; m_result *pResults; /* mSQL DATA */ m_row rowResult; /* mSQL ROW */ m_field *pField; /* mSQL COL HDR */ COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if( hStmt->pszQuery == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No prepared statement" ); return SQL_ERROR; } /************************** * Free any current results **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); /************************** * send prepared query to server **************************/ if ( (hStmt->hStmtExtras->nRows = msqlQuery( ((HDRVDBC)hStmt->hDbc)->hDbcExtras->hServer, hStmt->pszQuery )) == -1 ) { sprintf( hStmt->szSqlMsg, "SQL_ERROR Query failed. %s", msqlErrMsg ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } /************************** * snapshot our results (assume no results means UPDATE, DELETE or INSERT **************************/ pResults = msqlStoreResult(); if ( !pResults ) return SQL_SUCCESS; /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ hStmt->hStmtExtras->nRows = msqlNumRows( pResults ); hStmt->hStmtExtras->nCols = msqlNumFields( pResults ); hStmt->hStmtExtras->aResults = malloc( sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1) ); if ( hStmt->hStmtExtras->aResults == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Not enough memory. (malloc failed)" ); hStmt->hStmtExtras->nRows = 0; hStmt->hStmtExtras->nCols = 0; msqlFreeResult( pResults ); return SQL_ERROR; } memset( hStmt->hStmtExtras->aResults, 0, sizeof(char*) * (hStmt->hStmtExtras->nRows+1) * (hStmt->hStmtExtras->nCols+1) ); /************************** * gather column header information (save col 0 for bookmarks) **************************/ for ( nColumn = 1; nColumn <= hStmt->hStmtExtras->nCols; nColumn++ ) { pField = msqlFetchField( pResults ); (hStmt->hStmtExtras->aResults)[nColumn] = malloc( sizeof(COLUMNHDR) ); memset( (hStmt->hStmtExtras->aResults)[nColumn], 0, sizeof(COLUMNHDR) ); pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nColumn]; _NativeToSQLColumnHeader( pColumnHeader, pField ); } /************************ * gather data (save col 0 for bookmarks) ************************/ nCols = hStmt->hStmtExtras->nCols; nRow = 0; while ( (rowResult = msqlFetchRow( pResults )) != NULL ) { nRow++; msqlFieldSeek( pResults, 0 ); for ( nColumn=1; nColumn <= nCols; nColumn++ ) { if ( rowResult[nColumn-1] ) (hStmt->hStmtExtras->aResults)[nRow*nCols+nColumn] = (char *)strdup( rowResult[nColumn-1] ); } } hStmt->hStmtExtras->nRow = 0; /************************** * free the snapshot **************************/ msqlFreeResult( pResults ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetDescField.c0000755000175000017500000000173012262474476016003 00000000000000/********************************************************************** * SQLGetDescField * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetDescField( SQLHDESC DescriptorHandle, SQLSMALLINT RecordNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/ChangeLog0000755000175000017500000000063712262474476014554 000000000000001999-05-03 Peter Harvey * SQLColAttribute: Returned SQL_ERROR even when all was ok. 1999-04-03 Peter Harvey * SQLSpecialColumns: Mostly implemented. Simply returns _rowid. Quick and dirty. 1999-04-02 Peter Harvey * SQLFetchScroll: Mostly implemented * SQLExecDirect: Created _Execute * SQLPrepare: Created _Prepare unixODBC-2.3.9/Drivers/MiniSQL/SQLColumnPrivileges.c0000755000175000017500000000274712262474476017021 00000000000000/******************************************************************** * SQLColumnPrivileges * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLColumnPrivileges( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength, SQLCHAR *szColumnName, SQLSMALLINT nColumnNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetDescRec.c0000755000175000017500000000226112262474476015505 00000000000000/********************************************************************** * SQLSetDescRec * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetDescRec( SQLHDESC hDescriptorHandle, SQLSMALLINT nRecordNumber, SQLSMALLINT nType, SQLSMALLINT nSubType, SQLINTEGER nLength, SQLSMALLINT nPrecision, SQLSMALLINT nScale, SQLPOINTER pData, SQLINTEGER *pnStringLength, SQLINTEGER *pnIndicator ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLError.c0000755000175000017500000000407612262474476014620 00000000000000/********************************************************************** * SQLError (deprecated see SQLGetDiagRec) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLError( SQLHENV hDrvEnv, SQLHDBC hDrvDbc, SQLHSTMT hDrvStmt, SQLCHAR *szSqlState, SQLINTEGER *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT nErrorMsgMax, SQLSMALLINT *pcbErrorMsg ) { HDRVENV hEnv = (HDRVENV)hDrvEnv; HDRVDBC hDbc = (HDRVDBC)hDrvDbc; HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; char *pszState = NULL; /* pointer to status code */ char *pszErrMsg = NULL; /* pointer to error message */ char szMsgHdr[1024]; int nCode; /* SANITY CHECKS */ if( hEnv == SQL_NULL_HENV && hDbc == SQL_NULL_HDBC && hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; /* DEFAULTS */ szSqlState[0] = '\0'; *pfNativeError = 0; szErrorMsg[0] = '\0'; *pcbErrorMsg = 0; /* STATEMENT */ if( hStmt != SQL_NULL_HENV ) { if ( logPopMsg( hStmt->hLog ) != LOG_SUCCESS ) return SQL_NO_DATA; strncpy( szErrorMsg, hStmt->szSqlMsg, nErrorMsgMax ); *pcbErrorMsg = strlen( szErrorMsg ); return SQL_SUCCESS; } /* CONNECTION */ if( hDbc != SQL_NULL_HDBC ) { if ( logPopMsg( hDbc->hLog ) != LOG_SUCCESS ) return SQL_NO_DATA; strncpy( szErrorMsg, hDbc->szSqlMsg, nErrorMsgMax ); *pcbErrorMsg = strlen( szErrorMsg ); return SQL_SUCCESS; } /* ENVIRONMENT */ if( hEnv != SQL_NULL_HSTMT ) { if ( logPopMsg( hEnv->hLog ) != LOG_SUCCESS ) return SQL_NO_DATA; strncpy( szErrorMsg, hEnv->szSqlMsg, nErrorMsgMax ); *pcbErrorMsg = strlen( szErrorMsg ); return SQL_SUCCESS; } return SQL_NO_DATA; } unixODBC-2.3.9/Drivers/MiniSQL/SQLCopyDesc.c0000755000175000017500000000136612262474476015237 00000000000000/********************************************************************** * SQLCopyDesc * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLCopyDesc( SQLHDESC hSourceDescHandle, SQLHDESC hTargetDescHandle ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/driver.h0000664000175000017500000000615413724126772014442 00000000000000/********************************************** * Driver.h * * Description: * * This is all of the stuff that is common among ALL drivers (but not to the DriverManager). * * Make sure that your driver specific driverextras.h exists! * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************/ #ifndef _H_DRIVER #define _H_DRIVER /***************************************************************************** * ODBC VERSION (THAT THIS DRIVER COMPLIES WITH) *****************************************************************************/ #define ODBCVER 0x0351 /* this is optimistic to say the least but we are heading to full 3.51 compliance */ #include #include #include #include #include "driverextras.h" #define SQL_MAX_CURSOR_NAME 100 /***************************************************************************** * STATEMENT *****************************************************************************/ typedef struct tDRVSTMT { struct tDRVSTMT *pPrev; /* prev struct or null */ struct tDRVSTMT *pNext; /* next struct or null */ SQLPOINTER hDbc; /* pointer to DB context */ SQLCHAR szCursorName[SQL_MAX_CURSOR_NAME]; /* name of cursor */ SQLCHAR *pszQuery; /* query string */ SQLCHAR szSqlMsg[LOG_MSG_MAX]; /* buff to format msgs */ HLOG hLog; /* handle to msg logs */ HSTMTEXTRAS hStmtExtras; /* DRIVER SPECIFIC STORAGE */ } DRVSTMT, *HDRVSTMT; /***************************************************************************** * CONNECTION *****************************************************************************/ typedef struct tDRVDBC { struct tDRVDBC *pPrev; /* prev struct or null */ struct tDRVDBC *pNext; /* next struct or null */ SQLPOINTER hEnv; /* pointer to ENV structure */ HDRVSTMT hFirstStmt; /* first in list or null */ HDRVSTMT hLastStmt; /* last in list or null */ SQLCHAR szSqlMsg[LOG_MSG_MAX]; /* buff to format msgs */ HLOG hLog; /* handle to msg logs */ int bConnected; /* TRUE on open connection */ HDBCEXTRAS hDbcExtras; /* DRIVER SPECIFIC DATA */ } DRVDBC, *HDRVDBC; /***************************************************************************** * ENVIRONMENT *****************************************************************************/ typedef struct tDRVENV { HDRVDBC hFirstDbc; /* first in list or null */ HDRVDBC hLastDbc; /* last in list or null */ SQLCHAR szSqlMsg[LOG_MSG_MAX]; /* buff to format msgs */ HLOG hLog; /* handle to msg logs */ HENVEXTRAS hEnvExtras; } DRVENV, *HDRVENV; #endif unixODBC-2.3.9/Drivers/MiniSQL/SQLGetDescRec.c0000755000175000017500000000235212262474476015472 00000000000000/********************************************************************** * SQLGetDescRec * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetDescRec( SQLHDESC DescriptorHandle, SQLSMALLINT RecordNumber, SQLCHAR *Name, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, SQLSMALLINT *SubType, SQLINTEGER *Length, SQLSMALLINT *Precision, SQLSMALLINT *Scale, SQLSMALLINT *Nullable ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_NativeTypePrecision.c0000755000175000017500000000077612262474476017255 00000000000000/************************************************** * _NativeTypePrecision * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" int _NativeTypePrecision( void *pNativeColumnHeader ) { return 4; } unixODBC-2.3.9/Drivers/MiniSQL/SQLFetch.c0000755000175000017500000000424612262474476014557 00000000000000/********************************************************************** * SQLFetch * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLFetch( SQLHSTMT hDrvStmt) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; int nColumn = -1; COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( hStmt->hStmtExtras->nRows < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } /************************ * goto next row ************************/ if ( hStmt->hStmtExtras->nRow < 0 ) return SQL_NO_DATA; if ( hStmt->hStmtExtras->nRow >= hStmt->hStmtExtras->nRows ) return SQL_NO_DATA; hStmt->hStmtExtras->nRow++; /************************ * transfer bound column values to bound storage as required ************************/ for ( nColumn=1; nColumn <= hStmt->hStmtExtras->nCols; nColumn++ ) { pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nColumn]; if ( pColumnHeader->pTargetValue != NULL ) { if ( _GetData( hDrvStmt, nColumn, pColumnHeader->nTargetType, pColumnHeader->pTargetValue, pColumnHeader->nTargetValueMax, pColumnHeader->pnLengthOrIndicator ) != SQL_SUCCESS ) { sprintf( hStmt->szSqlMsg, "SQL_ERROR Failed to get data for column %d", nColumn ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } } } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLColAttribute.c0000755000175000017500000001250512262474476016124 00000000000000/********************************************************************** * SQLColAttribute * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLColAttribute( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLUSMALLINT nFieldIdentifier, SQLPOINTER pszValue, SQLSMALLINT nValueLengthMax, SQLSMALLINT *pnValueLength, SQLLEN *pnValue ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; int nValue = 0; /* SANITY CHECKS */ if( !hStmt ) return SQL_INVALID_HANDLE; if ( !hStmt->hStmtExtras ) return SQL_INVALID_HANDLE; if ( hStmt->hStmtExtras->nRows < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } if ( nCol < 1 || nCol > hStmt->hStmtExtras->nCols ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Invalid column" ); return SQL_ERROR; } /* OK */ pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nCol]; switch( nFieldIdentifier ) { case SQL_DESC_AUTO_UNIQUE_VALUE: nValue = pColumnHeader->bSQL_DESC_AUTO_UNIQUE_VALUE; break; case SQL_DESC_BASE_COLUMN_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_BASE_COLUMN_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_BASE_TABLE_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_BASE_TABLE_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_CASE_SENSITIVE: nValue = pColumnHeader->bSQL_DESC_CASE_SENSITIVE; break; case SQL_DESC_CATALOG_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_CATALOG_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_CONCISE_TYPE: nValue = pColumnHeader->nSQL_DESC_CONCISE_TYPE; break; case SQL_DESC_COUNT: nValue = hStmt->hStmtExtras->nCols; break; case SQL_DESC_DISPLAY_SIZE: nValue = pColumnHeader->nSQL_DESC_DISPLAY_SIZE; break; case SQL_DESC_FIXED_PREC_SCALE: nValue = pColumnHeader->bSQL_DESC_FIXED_PREC_SCALE; break; case SQL_DESC_LABEL: strncpy( pszValue, pColumnHeader->pszSQL_DESC_LABEL, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_LENGTH: nValue = pColumnHeader->nSQL_DESC_LENGTH; break; case SQL_DESC_LITERAL_PREFIX: strncpy( pszValue, pColumnHeader->pszSQL_DESC_LITERAL_PREFIX, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_LITERAL_SUFFIX: strncpy( pszValue, pColumnHeader->pszSQL_DESC_LITERAL_SUFFIX, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_LOCAL_TYPE_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_LOCAL_TYPE_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_NULLABLE: nValue = pColumnHeader->nSQL_DESC_NULLABLE; break; case SQL_DESC_NUM_PREC_RADIX: nValue = pColumnHeader->nSQL_DESC_NUM_PREC_RADIX; break; case SQL_DESC_OCTET_LENGTH: nValue = pColumnHeader->nSQL_DESC_OCTET_LENGTH; break; case SQL_DESC_PRECISION: nValue = pColumnHeader->nSQL_DESC_PRECISION; break; case SQL_DESC_SCALE: nValue = pColumnHeader->nSQL_DESC_SCALE; break; case SQL_DESC_SCHEMA_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_SCHEMA_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_SEARCHABLE: nValue = pColumnHeader->nSQL_DESC_SEARCHABLE; break; case SQL_DESC_TABLE_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_TABLE_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_TYPE: nValue = pColumnHeader->nSQL_DESC_TYPE; break; case SQL_DESC_TYPE_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_TYPE_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_UNNAMED: nValue = pColumnHeader->nSQL_DESC_UNNAMED; break; case SQL_DESC_UNSIGNED: nValue = pColumnHeader->bSQL_DESC_UNSIGNED; break; case SQL_DESC_UPDATABLE: nValue = pColumnHeader->nSQL_DESC_UPDATABLE; break; default: sprintf( hStmt->szSqlMsg, "Invalid nFieldIdentifier value of %d", nFieldIdentifier ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } if ( pnValue ) *(int*)pnValue = nValue; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLProcedures.c0000755000175000017500000000257612262474476015645 00000000000000/******************************************************************** * SQLProcedures * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLProcedures( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szProcName, SQLSMALLINT nProcNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLNativeSql.c0000755000175000017500000000261112262474476015426 00000000000000/********************************************************************** * SQLNativeSql * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLNativeSql( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLPrimaryKeys.c0000755000175000017500000000257512262474476016010 00000000000000/******************************************************************** * SQLPrimaryKeys * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLPrimaryKeys( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/_FreeStmtList.c0000755000175000017500000000130612262474476015664 00000000000000/************************************************** * _FreeStmtList * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _FreeStmtList( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; if ( hDbc == SQL_NULL_HDBC ) return SQL_SUCCESS; if ( hDbc->hFirstStmt == NULL ) return SQL_SUCCESS; while ( _FreeStmt( hDbc->hFirstStmt ) == SQL_SUCCESS ) { } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLPrepare.c0000755000175000017500000000131312262474476015114 00000000000000/********************************************************************** * SQLPrepare * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLPrepare( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStr, SQLINTEGER nSqlStrLength ) { return _Prepare( hDrvStmt, szSqlStr, nSqlStrLength ); } unixODBC-2.3.9/Drivers/MiniSQL/SQLDescribeCol.c0000755000175000017500000000444212262474476015702 00000000000000/********************************************************************** * SQLDescribeCol * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLDescribeCol( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLCHAR *szColName, SQLSMALLINT nColNameMax, SQLSMALLINT *pnColNameLength, SQLSMALLINT *pnSQLDataType, SQLUINTEGER *pnColSize, SQLSMALLINT *pnDecDigits, SQLSMALLINT *pnNullable ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( hStmt->hStmtExtras->nRows < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } if ( nCol < 1 || nCol > hStmt->hStmtExtras->nCols ) { sprintf( hStmt->szSqlMsg, "SQL_ERROR Column %d is out of range. Range is 1 - %s", nCol, hStmt->hStmtExtras->nCols ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } /**************************** * Ok ***************************/ pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nCol]; if ( szColName ) strncpy( szColName, pColumnHeader->pszSQL_DESC_NAME, nColNameMax ); if ( pnColNameLength ) *pnColNameLength = strlen( szColName ); if ( pnSQLDataType ) *pnSQLDataType = pColumnHeader->nSQL_DESC_TYPE; if ( pnColSize ) *pnColSize = pColumnHeader->nSQL_DESC_LENGTH; if ( pnDecDigits ) *pnDecDigits = pColumnHeader->nSQL_DESC_SCALE; if ( pnNullable ) *pnNullable = pColumnHeader->nSQL_DESC_NULLABLE; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLFetchScroll.c0000755000175000017500000000547412262474476015742 00000000000000/***************************************************************************** * SQLFetchScroll * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * *****************************************************************************/ #include #include "driver.h" SQLRETURN SQLFetchScroll( SQLHSTMT hDrvStmt, SQLSMALLINT nOrientation, SQLINTEGER nOffset ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; int nColumn = -1; COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /* how much do we want to move */ switch ( nOrientation ) { case SQL_FETCH_NEXT: if ( hStmt->hStmtExtras->nRow >= hStmt->hStmtExtras->nRows ) return SQL_NO_DATA; hStmt->hStmtExtras->nRow++; break; case SQL_FETCH_PRIOR: if ( hStmt->hStmtExtras->nRow == 0 ) return SQL_NO_DATA; hStmt->hStmtExtras->nRow--; break; case SQL_FETCH_FIRST: hStmt->hStmtExtras->nRow = 0; break; case SQL_FETCH_LAST: hStmt->hStmtExtras->nRow = hStmt->hStmtExtras->nRows-1; break; case SQL_FETCH_ABSOLUTE: if ( nOffset < 0 || nOffset >= hStmt->hStmtExtras->nRows ) return SQL_NO_DATA; hStmt->hStmtExtras->nRow = nOffset; break; case SQL_FETCH_RELATIVE: if ( hStmt->hStmtExtras->nRow+nOffset < 0 || hStmt->hStmtExtras->nRow+nOffset >= hStmt->hStmtExtras->nRows ) return SQL_NO_DATA; hStmt->hStmtExtras->nRow += nOffset; break; case SQL_FETCH_BOOKMARK: return SQL_ERROR; break; default: return SQL_ERROR; } /************************ * transfer bound column values to bound storage as required ************************/ for ( nColumn=1; nColumn <= hStmt->hStmtExtras->nCols; nColumn++ ) { pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nColumn]; if ( pColumnHeader->pTargetValue != NULL ) { if ( _GetData( hDrvStmt, nColumn, pColumnHeader->nTargetType, pColumnHeader->pTargetValue, pColumnHeader->nTargetValueMax, pColumnHeader->pnLengthOrIndicator ) != SQL_SUCCESS ) { sprintf( hStmt->szSqlMsg, "SQL_ERROR Failed to get data for column %d", nColumn ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } } } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/Makefile.in0000664000175000017500000011042213725127174015033 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = Drivers/MiniSQL ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libodbcmini_la_LIBADD = am__libodbcmini_la_SOURCES_DIST = SQLAllocConnect.c SQLAllocEnv.c \ SQLAllocHandle.c SQLAllocStmt.c SQLBindCol.c \ SQLBindParameter.c SQLBrowseConnect.c SQLBulkOperations.c \ SQLCancel.c SQLCloseCursor.c SQLColAttribute.c \ SQLColAttributes.c SQLColumnPrivileges.c SQLColumns.c \ SQLConnect.c SQLCopyDesc.c SQLDescribeCol.c SQLDescribeParam.c \ SQLDisconnect.c SQLDriverConnect.c SQLEndTran.c SQLError.c \ SQLExecDirect.c SQLExecute.c SQLExtendedFetch.c SQLFetch.c \ SQLFetchScroll.c SQLForeignKeys.c SQLFreeConnect.c \ SQLFreeEnv.c SQLFreeHandle.c SQLFreeStmt.c SQLGetConnectAttr.c \ SQLGetConnectOption.c SQLGetCursorName.c SQLGetData.c \ SQLGetDescField.c SQLGetDescRec.c SQLGetDiagField.c \ SQLGetDiagRec.c SQLGetEnvAttr.c SQLGetInfo.c SQLGetStmtAttr.c \ SQLGetStmtOption.c SQLGetTypeInfo.c SQLMoreResults.c \ SQLNativeSql.c SQLNumParams.c SQLNumResultCols.c \ SQLParamData.c SQLParamOptions.c SQLPrepare.c SQLPrimaryKeys.c \ SQLProcedureColumns.c SQLProcedures.c SQLPutData.c \ SQLRowCount.c SQLSetConnectOption.c SQLSetCursorName.c \ SQLSetDescField.c SQLSetDescRec.c SQLSetEnvAttr.c \ SQLSetParam.c SQLSetPos.c SQLSetScrollOptions.c \ SQLSetStmtAttr.c SQLSetStmtOption.c SQLSpecialColumns.c \ SQLStatistics.c SQLTablePrivileges.c SQLTables.c SQLTransact.c \ _AllocConnect.c _AllocEnv.c _AllocStmt.c _Execute.c _FreeDbc.c \ _FreeStmt.c _FreeDbcList.c _FreeStmtList.c _FreeResults.c \ _GetData.c _NativeToSQLColumnHeader.c _NativeToSQLType.c \ _NativeTypeDesc.c _NativeTypeLength.c _NativeTypePrecision.c \ _Prepare.c _sqlFreeConnect.c _sqlFreeEnv.c _sqlFreeStmt.c @MSQL_TRUE@am_libodbcmini_la_OBJECTS = SQLAllocConnect.lo \ @MSQL_TRUE@ SQLAllocEnv.lo SQLAllocHandle.lo SQLAllocStmt.lo \ @MSQL_TRUE@ SQLBindCol.lo SQLBindParameter.lo \ @MSQL_TRUE@ SQLBrowseConnect.lo SQLBulkOperations.lo \ @MSQL_TRUE@ SQLCancel.lo SQLCloseCursor.lo SQLColAttribute.lo \ @MSQL_TRUE@ SQLColAttributes.lo SQLColumnPrivileges.lo \ @MSQL_TRUE@ SQLColumns.lo SQLConnect.lo SQLCopyDesc.lo \ @MSQL_TRUE@ SQLDescribeCol.lo SQLDescribeParam.lo \ @MSQL_TRUE@ SQLDisconnect.lo SQLDriverConnect.lo SQLEndTran.lo \ @MSQL_TRUE@ SQLError.lo SQLExecDirect.lo SQLExecute.lo \ @MSQL_TRUE@ SQLExtendedFetch.lo SQLFetch.lo SQLFetchScroll.lo \ @MSQL_TRUE@ SQLForeignKeys.lo SQLFreeConnect.lo SQLFreeEnv.lo \ @MSQL_TRUE@ SQLFreeHandle.lo SQLFreeStmt.lo \ @MSQL_TRUE@ SQLGetConnectAttr.lo SQLGetConnectOption.lo \ @MSQL_TRUE@ SQLGetCursorName.lo SQLGetData.lo \ @MSQL_TRUE@ SQLGetDescField.lo SQLGetDescRec.lo \ @MSQL_TRUE@ SQLGetDiagField.lo SQLGetDiagRec.lo \ @MSQL_TRUE@ SQLGetEnvAttr.lo SQLGetInfo.lo SQLGetStmtAttr.lo \ @MSQL_TRUE@ SQLGetStmtOption.lo SQLGetTypeInfo.lo \ @MSQL_TRUE@ SQLMoreResults.lo SQLNativeSql.lo SQLNumParams.lo \ @MSQL_TRUE@ SQLNumResultCols.lo SQLParamData.lo \ @MSQL_TRUE@ SQLParamOptions.lo SQLPrepare.lo SQLPrimaryKeys.lo \ @MSQL_TRUE@ SQLProcedureColumns.lo SQLProcedures.lo \ @MSQL_TRUE@ SQLPutData.lo SQLRowCount.lo SQLSetConnectOption.lo \ @MSQL_TRUE@ SQLSetCursorName.lo SQLSetDescField.lo \ @MSQL_TRUE@ SQLSetDescRec.lo SQLSetEnvAttr.lo SQLSetParam.lo \ @MSQL_TRUE@ SQLSetPos.lo SQLSetScrollOptions.lo \ @MSQL_TRUE@ SQLSetStmtAttr.lo SQLSetStmtOption.lo \ @MSQL_TRUE@ SQLSpecialColumns.lo SQLStatistics.lo \ @MSQL_TRUE@ SQLTablePrivileges.lo SQLTables.lo SQLTransact.lo \ @MSQL_TRUE@ _AllocConnect.lo _AllocEnv.lo _AllocStmt.lo \ @MSQL_TRUE@ _Execute.lo _FreeDbc.lo _FreeStmt.lo \ @MSQL_TRUE@ _FreeDbcList.lo _FreeStmtList.lo _FreeResults.lo \ @MSQL_TRUE@ _GetData.lo _NativeToSQLColumnHeader.lo \ @MSQL_TRUE@ _NativeToSQLType.lo _NativeTypeDesc.lo \ @MSQL_TRUE@ _NativeTypeLength.lo _NativeTypePrecision.lo \ @MSQL_TRUE@ _Prepare.lo _sqlFreeConnect.lo _sqlFreeEnv.lo \ @MSQL_TRUE@ _sqlFreeStmt.lo libodbcmini_la_OBJECTS = $(am_libodbcmini_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcmini_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcmini_la_LDFLAGS) $(LDFLAGS) -o \ $@ @MSQL_TRUE@am_libodbcmini_la_rpath = -rpath $(libdir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcmini_la_SOURCES) DIST_SOURCES = $(am__libodbcmini_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs ChangeLog README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @MSQL_TRUE@lib_LTLIBRARIES = libodbcmini.la @MSQL_TRUE@AM_CPPFLAGS = -I@top_srcdir@/include -I. -I@msql_headers@ -I${LTDLINCL} @MSQL_TRUE@libodbcmini_la_SOURCES = \ @MSQL_TRUE@ SQLAllocConnect.c \ @MSQL_TRUE@ SQLAllocEnv.c \ @MSQL_TRUE@ SQLAllocHandle.c \ @MSQL_TRUE@ SQLAllocStmt.c \ @MSQL_TRUE@ SQLBindCol.c \ @MSQL_TRUE@ SQLBindParameter.c \ @MSQL_TRUE@ SQLBrowseConnect.c \ @MSQL_TRUE@ SQLBulkOperations.c \ @MSQL_TRUE@ SQLCancel.c \ @MSQL_TRUE@ SQLCloseCursor.c \ @MSQL_TRUE@ SQLColAttribute.c \ @MSQL_TRUE@ SQLColAttributes.c \ @MSQL_TRUE@ SQLColumnPrivileges.c \ @MSQL_TRUE@ SQLColumns.c \ @MSQL_TRUE@ SQLConnect.c \ @MSQL_TRUE@ SQLCopyDesc.c \ @MSQL_TRUE@ SQLDescribeCol.c \ @MSQL_TRUE@ SQLDescribeParam.c \ @MSQL_TRUE@ SQLDisconnect.c \ @MSQL_TRUE@ SQLDriverConnect.c \ @MSQL_TRUE@ SQLEndTran.c \ @MSQL_TRUE@ SQLError.c \ @MSQL_TRUE@ SQLExecDirect.c \ @MSQL_TRUE@ SQLExecute.c \ @MSQL_TRUE@ SQLExtendedFetch.c \ @MSQL_TRUE@ SQLFetch.c \ @MSQL_TRUE@ SQLFetchScroll.c \ @MSQL_TRUE@ SQLForeignKeys.c \ @MSQL_TRUE@ SQLFreeConnect.c \ @MSQL_TRUE@ SQLFreeEnv.c \ @MSQL_TRUE@ SQLFreeHandle.c \ @MSQL_TRUE@ SQLFreeStmt.c \ @MSQL_TRUE@ SQLGetConnectAttr.c \ @MSQL_TRUE@ SQLGetConnectOption.c \ @MSQL_TRUE@ SQLGetCursorName.c \ @MSQL_TRUE@ SQLGetData.c \ @MSQL_TRUE@ SQLGetDescField.c \ @MSQL_TRUE@ SQLGetDescRec.c \ @MSQL_TRUE@ SQLGetDiagField.c \ @MSQL_TRUE@ SQLGetDiagRec.c \ @MSQL_TRUE@ SQLGetEnvAttr.c \ @MSQL_TRUE@ SQLGetInfo.c \ @MSQL_TRUE@ SQLGetStmtAttr.c \ @MSQL_TRUE@ SQLGetStmtOption.c \ @MSQL_TRUE@ SQLGetTypeInfo.c \ @MSQL_TRUE@ SQLMoreResults.c \ @MSQL_TRUE@ SQLNativeSql.c \ @MSQL_TRUE@ SQLNumParams.c \ @MSQL_TRUE@ SQLNumResultCols.c \ @MSQL_TRUE@ SQLParamData.c \ @MSQL_TRUE@ SQLParamOptions.c \ @MSQL_TRUE@ SQLPrepare.c \ @MSQL_TRUE@ SQLPrimaryKeys.c \ @MSQL_TRUE@ SQLProcedureColumns.c \ @MSQL_TRUE@ SQLProcedures.c \ @MSQL_TRUE@ SQLPutData.c \ @MSQL_TRUE@ SQLRowCount.c \ @MSQL_TRUE@ SQLSetConnectOption.c \ @MSQL_TRUE@ SQLSetCursorName.c \ @MSQL_TRUE@ SQLSetDescField.c \ @MSQL_TRUE@ SQLSetDescRec.c \ @MSQL_TRUE@ SQLSetEnvAttr.c \ @MSQL_TRUE@ SQLSetParam.c \ @MSQL_TRUE@ SQLSetPos.c \ @MSQL_TRUE@ SQLSetScrollOptions.c \ @MSQL_TRUE@ SQLSetStmtAttr.c \ @MSQL_TRUE@ SQLSetStmtOption.c \ @MSQL_TRUE@ SQLSpecialColumns.c \ @MSQL_TRUE@ SQLStatistics.c \ @MSQL_TRUE@ SQLTablePrivileges.c \ @MSQL_TRUE@ SQLTables.c \ @MSQL_TRUE@ SQLTransact.c \ @MSQL_TRUE@ _AllocConnect.c \ @MSQL_TRUE@ _AllocEnv.c \ @MSQL_TRUE@ _AllocStmt.c \ @MSQL_TRUE@ _Execute.c \ @MSQL_TRUE@ _FreeDbc.c \ @MSQL_TRUE@ _FreeStmt.c \ @MSQL_TRUE@ _FreeDbcList.c \ @MSQL_TRUE@ _FreeStmtList.c \ @MSQL_TRUE@ _FreeResults.c \ @MSQL_TRUE@ _GetData.c \ @MSQL_TRUE@ _NativeToSQLColumnHeader.c \ @MSQL_TRUE@ _NativeToSQLType.c \ @MSQL_TRUE@ _NativeTypeDesc.c \ @MSQL_TRUE@ _NativeTypeLength.c \ @MSQL_TRUE@ _NativeTypePrecision.c \ @MSQL_TRUE@ _Prepare.c \ @MSQL_TRUE@ _sqlFreeConnect.c \ @MSQL_TRUE@ _sqlFreeEnv.c \ @MSQL_TRUE@ _sqlFreeStmt.c EXTRA_DIST = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocHandle.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParameter.c \ SQLBrowseConnect.c \ SQLBulkOperations.c \ SQLCancel.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagField.c \ SQLGetDiagRec.c \ SQLGetEnvAttr.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescField.c \ SQLSetDescRec.c \ SQLSetEnvAttr.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c \ _AllocConnect.c \ _AllocEnv.c \ _AllocStmt.c \ _Execute.c \ _FreeDbc.c \ _FreeDbcList.c \ _FreeResults.c \ _FreeStmt.c \ _FreeStmtList.c \ _GetData.c \ _NativeToSQLColumnHeader.c \ _NativeToSQLType.c \ _NativeTypeDesc.c \ _NativeTypeLength.c \ _NativeTypePrecision.c \ _Prepare.c \ driver.h \ driverextras.h \ _sqlFreeConnect.c \ _sqlFreeEnv.c \ _sqlFreeStmt.c libodbcmini_la_LDFLAGS = -no-undefined -version-info 1:0:0 \ -L@msql_libraries@ -lmsql -module all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Drivers/MiniSQL/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Drivers/MiniSQL/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcmini.la: $(libodbcmini_la_OBJECTS) $(libodbcmini_la_DEPENDENCIES) $(EXTRA_libodbcmini_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcmini_la_LINK) $(am_libodbcmini_la_rpath) $(libodbcmini_la_OBJECTS) $(libodbcmini_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindParameter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBrowseConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBulkOperations.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCancel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCloseCursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttributes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumnPrivileges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCopyDesc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDisconnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDriverConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLEndTran.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecDirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExtendedFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetchScroll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLForeignKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetCursorName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetEnvAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetTypeInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLMoreResults.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNativeSql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumParams.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumResultCols.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamOptions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrimaryKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedureColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedures.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPutData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRowCount.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetCursorName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetEnvAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetPos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetScrollOptions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSpecialColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLStatistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTablePrivileges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTransact.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_AllocConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_AllocEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_AllocStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_Execute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeDbc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeDbcList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeResults.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeStmtList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_GetData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeToSQLColumnHeader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeToSQLType.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeTypeDesc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeTypeLength.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeTypePrecision.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_Prepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_sqlFreeConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_sqlFreeEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_sqlFreeStmt.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/Drivers/MiniSQL/SQLBulkOperations.c0000755000175000017500000000315512262474476016465 00000000000000/********************************************************************** * SQLBulkOperations * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLBulkOperations( SQLHSTMT hDrvStmt, SQLSMALLINT nOperation ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /* OK */ switch ( nOperation ) { case SQL_ADD: break; case SQL_UPDATE_BY_BOOKMARK: break; case SQL_DELETE_BY_BOOKMARK: break; case SQL_FETCH_BY_BOOKMARK: break; default: sprintf( hStmt->szSqlMsg, "SQL_ERROR Unknown nOperation=%d", nOperation ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not currently supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLAllocStmt.c0000755000175000017500000000130612262474476015422 00000000000000/********************************************************************** * SQLAllocStmt (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLAllocStmt( SQLHDBC hDrvDbc, SQLHSTMT *phDrvStmt ) { return _AllocStmt( hDrvDbc, phDrvStmt ); } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetCursorName.c0000755000175000017500000000307212262474476016254 00000000000000/********************************************************************** * SQLSetCursorName * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetCursorName( SQLHSTMT hDrvStmt, SQLCHAR *szCursor, SQLSMALLINT nCursorLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( NULL == szCursor || 0 == isalpha(*szCursor) ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Invalid cursor name" ); return SQL_ERROR; } /* COPY CURSOR */ if ( SQL_NTS == nCursorLength ) { strncpy( hStmt->szCursorName, szCursor, SQL_MAX_CURSOR_NAME ); } else { /* strncpy( hStmt->szCursorName, szCursor, MIN(SQL_MAX_CURSOR_NAME - 1, nCursorLength) ); hStmt->szCursorName[ MIN( SQL_MAX_CURSOR_NAME - 1, nCursorLength) ] = '\0'; */ } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetConnectOption.c0000755000175000017500000000227212262474476016745 00000000000000/********************************************************************** * SQLGetConnectOption (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetConnectOption( SQLHDBC hDrvDbc, UWORD fOption, PTR pvParam ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLFreeStmt.c0000755000175000017500000000124612262474476015254 00000000000000/********************************************************************** * SQLFreeStmt * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLFreeStmt( SQLHSTMT hDrvStmt, SQLUSMALLINT nOption ) { return sqlFreeStmt( hDrvStmt, nOption ); } unixODBC-2.3.9/Drivers/MiniSQL/SQLDisconnect.c0000755000175000017500000000313612262474476015614 00000000000000/********************************************************************** * SQLDisconnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLDisconnect( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); if( hDbc->bConnected == 0 ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_SUCCESS_WITH_INFO Connection not open" ); return SQL_SUCCESS_WITH_INFO; } if ( hDbc->hFirstStmt != SQL_NULL_HSTMT ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Active Statements exist. Can not disconnect." ); return SQL_ERROR; } /**************************** * 1. do driver specific close here ****************************/ msqlClose( hDbc->hDbcExtras->hServer ); hDbc->hDbcExtras->hServer = -1; hDbc->bConnected = 0; logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/_sqlFreeStmt.c0000755000175000017500000000257012375373620015546 00000000000000/********************************************************************** * sqlFreeStmt * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN sqlFreeStmt( SQLHSTMT hDrvStmt, SQLUSMALLINT nOption ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /********* * RESET PARAMS *********/ switch( nOption ) { case SQL_CLOSE: break; case SQL_DROP: return _FreeStmt( hStmt ); case SQL_UNBIND: break; case SQL_RESET_PARAMS: break; default: sprintf( hStmt->szSqlMsg, "SQL_ERROR Invalid nOption=%d", nOption ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/_AllocStmt.c0000755000175000017500000000650612262474476015210 00000000000000/********************************************************************** * _AllocStmt (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _AllocStmt( SQLHDBC hDrvDbc, SQLHSTMT *phDrvStmt ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; HDRVSTMT *phStmt = (HDRVSTMT*)phDrvStmt; /* SANITY CHECKS */ if( hDbc == SQL_NULL_HDBC ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); if( NULL == phStmt ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR phStmt=NULL" ); return SQL_ERROR; } /* OK */ /* allocate memory */ *phStmt = malloc( sizeof(DRVSTMT) ); if( SQL_NULL_HSTMT == *phStmt ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR memory allocation failure" ); return SQL_ERROR; } /* initialize memory */ sprintf( hDbc->szSqlMsg, "*phstmt = $%08lX", *phStmt ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); memset( *phStmt, 0, sizeof(DRVSTMT) ); /* SAFETY */ (*phStmt)->hDbc = (SQLPOINTER)hDbc; (*phStmt)->hLog = NULL; (*phStmt)->hStmtExtras = NULL; (*phStmt)->pNext = NULL; (*phStmt)->pPrev = NULL; (*phStmt)->pszQuery = NULL; sprintf( (*phStmt)->szCursorName, "CUR_%08lX", *phStmt ); /* ADD TO DBCs STATEMENT LIST */ /* start logging */ if ( logOpen( &(*phStmt)->hLog, SQL_DRIVER_NAME, NULL, 50 ) ) { logOn( (*phStmt)->hLog, 1 ); logPushMsg( (*phStmt)->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Statement logging allocated ok" ); } else (*phStmt)->hLog = NULL; /* ADD TO END OF LIST */ if ( hDbc->hFirstStmt == NULL ) { /* 1st is null so the list is empty right now */ hDbc->hFirstStmt = (*phStmt); hDbc->hLastStmt = (*phStmt); } else { /* at least one node in list */ hDbc->hLastStmt->pNext = (SQLPOINTER)(*phStmt); (*phStmt)->pPrev = (SQLPOINTER)hDbc->hLastStmt; hDbc->hLastStmt = (*phStmt); } /****************************************************************************/ /* ALLOCATE AND INIT DRIVER EXTRAS HERE */ (*phStmt)->hStmtExtras = malloc(sizeof(STMTEXTRAS)); memset( (*phStmt)->hStmtExtras, 0, sizeof(STMTEXTRAS) ); /* SAFETY */ (*phStmt)->hStmtExtras->aResults = NULL; (*phStmt)->hStmtExtras->nCols = 0; (*phStmt)->hStmtExtras->nRow = 0; (*phStmt)->hStmtExtras->nRows = 0; /****************************************************************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetCursorName.c0000755000175000017500000000336412262474476016244 00000000000000/********************************************************************** * SQLGetCursorName * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetCursorName( SQLHSTMT hDrvStmt, SQLCHAR *szCursor, SQLSMALLINT nCursorMaxLength, SQLSMALLINT *pnCursorLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; int ci; /* counter variable */ /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( NULL == szCursor ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No cursor name." ); return SQL_ERROR; } /* ** copy cursor name */ strncpy( szCursor, hStmt->szCursorName, nCursorMaxLength ); /* ** set length of transfered data */ ci = strlen( hStmt->szCursorName ); /* if ( NULL != pnCursorLength ) *pnCursorLength = MIN( ci, nCursorMaxLength ); */ if ( nCursorMaxLength < ci ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_SUCCESS_WITH_INFO Cursor was truncated" ); return SQL_SUCCESS_WITH_INFO; } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLParamData.c0000755000175000017500000000224612262474476015356 00000000000000/********************************************************************** * SQLParamData * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLParamData( SQLHSTMT hDrvStmt, SQLPOINTER *pValue ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLSetConnectOption.c0000755000175000017500000000247312262474476016764 00000000000000/********************************************************************** * SQLSetConnectOption (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetConnectOption( SQLHDBC hDrvDbc, UWORD nOption, UDWORD vParam) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if ( hDbc == SQL_NULL_HDBC ) return SQL_INVALID_HANDLE; switch ( nOption ) { case SQL_TRANSLATE_DLL: case SQL_TRANSLATE_OPTION: /* case SQL_CONNECT_OPT_DRVR_START: */ case SQL_ODBC_CURSORS: case SQL_OPT_TRACE: switch ( vParam ) { case SQL_OPT_TRACE_ON: case SQL_OPT_TRACE_OFF: default: ; } break; case SQL_OPT_TRACEFILE: case SQL_ACCESS_MODE: case SQL_AUTOCOMMIT: default: ; } logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_SUCCESS_WITH_INFO Function not fully implemented" ); return SQL_SUCCESS_WITH_INFO; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetDiagField.c0000755000175000017500000000201412262474476015765 00000000000000/********************************************************************** * SQLGetDiagField * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetDiagField( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecordNumber, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetData.c0000755000175000017500000000202612262474476015031 00000000000000/********************************************************************** * SQLGetData * * 1. MiniSQL server sends all data as ascii strings so things are * simplified. We always convert from string to nTargetType. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetData( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLSMALLINT nTargetType, /* C DATA TYPE */ SQLPOINTER pTarget, SQLINTEGER nTargetLength, SQLINTEGER *pnLengthOrIndicator ) { return _GetData( hDrvStmt, nCol, nTargetType, pTarget, nTargetLength, pnLengthOrIndicator ); } unixODBC-2.3.9/Drivers/MiniSQL/SQLPutData.c0000755000175000017500000000244212262474476015064 00000000000000/********************************************************************** * SQLPutData * * Supplies parameter data at execution time. Used in conjuction with * SQLParamData. ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLPutData( SQLHSTMT hDrvStmt, SQLPOINTER pData, SQLINTEGER nLengthOrIndicator ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLGetEnvAttr.c0000755000175000017500000000162012262474476015542 00000000000000/********************************************************************** * SQLGetEnvAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetEnvAttr( SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLBindParameter.c0000755000175000017500000000337512262474476016245 00000000000000/********************************************************************** * SQLBindParameter * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLBindParameter( SQLHSTMT hDrvStmt, SQLUSMALLINT nParameterNumber, SQLSMALLINT nIOType, SQLSMALLINT nBufferType, SQLSMALLINT nParamType, SQLUINTEGER nParamLength, SQLSMALLINT nScale, SQLPOINTER pData, SQLINTEGER nBufferLength, SQLINTEGER *pnLengthOrIndicator ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt=$%08lX nParameterNumber=%d nIOType=%d nBufferType=%d nParamType=%d nParamLength=%d nScale=%d pData=$%08lX nBufferLength=%d *pnLengthOrIndicator=$%08lX",hStmt,nParameterNumber,nIOType,nBufferType,nParamType,nParamLength,nScale,pData,nBufferLength, *pnLengthOrIndicator ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not currently supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLCancel.c0000755000175000017500000000216512262474476014711 00000000000000/********************************************************************** * SQLCancel * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLCancel( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLExtendedFetch.c0000755000175000017500000000262012262474476016232 00000000000000/********************************************************************** * SQLExtendedFetch * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLExtendedFetch( SQLHSTMT hDrvStmt, SQLUSMALLINT nOrientation, SQLINTEGER nOffset, SQLUINTEGER *pnRowCount, SQLUSMALLINT *pRowStatusArray ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/MiniSQL/SQLBindCol.c0000755000175000017500000000501412262474476015032 00000000000000/********************************************************************** * SQLBindCol * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" /* THIS IS THE CORRECT SYNTAX.... SQLRETURN SQLBindCol( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLSMALLINT nTargetType, SQLPOINTER pTargetValue, SQLINTEGER nTargetValueMax, SQLINTEGER *pnLengthOrIndicator ) AND THIS IS WHAT WORKS... */ SQLRETURN SQLBindCol( SQLHSTMT hDrvStmt, UWORD nCol, SWORD nTargetType, PTR pTargetValue, SDWORD nTargetValueMax, SDWORD *pnLengthOrIndicator ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt=$%08lX nCol=%5d", hStmt, nCol ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); if ( hStmt->hStmtExtras->nRows == 0 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } if ( nCol < 1 || nCol > hStmt->hStmtExtras->nCols ) { sprintf( hStmt->szSqlMsg, "SQL_ERROR Column %d is out of range. Range is 1 - %s", nCol, hStmt->hStmtExtras->nCols ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); return SQL_ERROR; } if ( pTargetValue == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Invalid data pointer" ); return SQL_ERROR; } if ( pnLengthOrIndicator != NULL ) *pnLengthOrIndicator = 0; /* SET DEFAULTS */ /* validate length etc */ /* store app col pointer */ pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nCol]; pColumnHeader->nTargetType = nTargetType; pColumnHeader->nTargetValueMax = nTargetValueMax; pColumnHeader->pnLengthOrIndicator = pnLengthOrIndicator; pColumnHeader->pTargetValue = pTargetValue; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/Makefile.am0000755000175000017500000000733412375373674015042 00000000000000if MSQL lib_LTLIBRARIES = libodbcmini.la AM_CPPFLAGS = -I@top_srcdir@/include -I. -I@msql_headers@ -I${LTDLINCL} libodbcmini_la_SOURCES = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocHandle.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParameter.c \ SQLBrowseConnect.c \ SQLBulkOperations.c \ SQLCancel.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagField.c \ SQLGetDiagRec.c \ SQLGetEnvAttr.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescField.c \ SQLSetDescRec.c \ SQLSetEnvAttr.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c \ _AllocConnect.c \ _AllocEnv.c \ _AllocStmt.c \ _Execute.c \ _FreeDbc.c \ _FreeStmt.c \ _FreeDbcList.c \ _FreeStmtList.c \ _FreeResults.c \ _GetData.c \ _NativeToSQLColumnHeader.c \ _NativeToSQLType.c \ _NativeTypeDesc.c \ _NativeTypeLength.c \ _NativeTypePrecision.c \ _Prepare.c \ _sqlFreeConnect.c \ _sqlFreeEnv.c \ _sqlFreeStmt.c endif EXTRA_DIST = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocHandle.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParameter.c \ SQLBrowseConnect.c \ SQLBulkOperations.c \ SQLCancel.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagField.c \ SQLGetDiagRec.c \ SQLGetEnvAttr.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescField.c \ SQLSetDescRec.c \ SQLSetEnvAttr.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c \ _AllocConnect.c \ _AllocEnv.c \ _AllocStmt.c \ _Execute.c \ _FreeDbc.c \ _FreeDbcList.c \ _FreeResults.c \ _FreeStmt.c \ _FreeStmtList.c \ _GetData.c \ _NativeToSQLColumnHeader.c \ _NativeToSQLType.c \ _NativeTypeDesc.c \ _NativeTypeLength.c \ _NativeTypePrecision.c \ _Prepare.c \ driver.h \ driverextras.h \ _sqlFreeConnect.c \ _sqlFreeEnv.c \ _sqlFreeStmt.c libodbcmini_la_LDFLAGS = -no-undefined -version-info 1:0:0 \ -L@msql_libraries@ -lmsql -module unixODBC-2.3.9/Drivers/MiniSQL/SQLAllocConnect.c0000755000175000017500000000106412262474476016065 00000000000000/************************************************** * SQLAllocConnect * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN SQLAllocConnect( SQLHENV hDrvEnv, SQLHDBC *phDrvDbc ) { return _AllocConnect( hDrvEnv, phDrvDbc ); } unixODBC-2.3.9/Drivers/MiniSQL/_sqlFreeConnect.c0000755000175000017500000000264712460436034016207 00000000000000/********************************************************************** * sqlFreeConnect * * Do not try to Free Dbc if there are Stmts... return an error. Let the * Driver Manager do a recursive clean up if it wants. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN sqlFreeConnect( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; int nReturn; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); if( hDbc->hDbcExtras->hServer > -1 ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Connection is active" ); return SQL_ERROR; } if ( hDbc->hFirstStmt != NULL ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Connection has allocated statements" ); return SQL_ERROR; } nReturn = _FreeDbc( hDbc ); return nReturn; } unixODBC-2.3.9/Drivers/MiniSQL/_GetData.c0000755000175000017500000000644012262474476014614 00000000000000/************************************************** * _GetData * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _GetData( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLSMALLINT nTargetType, /* C DATA TYPE */ SQLPOINTER pTarget, SQLINTEGER nTargetLength, SQLINTEGER *pnLengthOrIndicator ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; char *pSourceData = NULL; /* SANITY CHECKS */ if ( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; if ( hStmt->hStmtExtras == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; if ( hStmt->hStmtExtras->nRows == 0 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } /********************************************************************** * GET pSourceData FOR NORMAL RESULT SETS **********************************************************************/ if ( hStmt->hStmtExtras->nRow > hStmt->hStmtExtras->nRows || hStmt->hStmtExtras->nRow < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No current row" ); return SQL_ERROR; } pSourceData = (hStmt->hStmtExtras->aResults)[hStmt->hStmtExtras->nRow*hStmt->hStmtExtras->nCols+nCol]; /**************************** * ALL cols are stored as SQL_CHAR... bad for storage... good for code * SO no need to determine the source type when translating to destination ***************************/ if ( pSourceData == NULL ) { /********************* * Now get the col if value = NULL *********************/ if ( pnLengthOrIndicator != NULL ) *pnLengthOrIndicator = SQL_NULL_DATA; switch ( nTargetType ) { case SQL_C_LONG: memset( pTarget, 0, sizeof(int) ); break; case SQL_C_FLOAT: memset( pTarget, 0, sizeof(float) ); break; case SQL_C_CHAR: *((char *)pTarget) = '\0'; break; default: sprintf( hStmt->szSqlMsg, "SQL_ERROR Unknown target type %d", nTargetType ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); } } else { /********************* * Now get the col when we have a value *********************/ switch ( nTargetType ) { case SQL_C_LONG: *((int *)pTarget) = atoi(pSourceData); if ( NULL != pnLengthOrIndicator ) *pnLengthOrIndicator = sizeof( int ); break; case SQL_C_FLOAT: sscanf( pSourceData, "%g", pTarget ); if ( NULL != pnLengthOrIndicator ) *pnLengthOrIndicator = sizeof( float ); break; case SQL_C_CHAR: strncpy( pTarget, pSourceData, nTargetLength ); if ( NULL != pnLengthOrIndicator ) *pnLengthOrIndicator = strlen(pTarget); break; default: sprintf( hStmt->szSqlMsg, "SQL_ERROR Unknown target type %d", nTargetType ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); } } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/MiniSQL/SQLAllocEnv.c0000755000175000017500000000116612262474476015227 00000000000000/********************************************************************** * SQLAllocEnv * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLAllocEnv( SQLHENV *phDrvEnv ) { return _AllocEnv( phDrvEnv ); } unixODBC-2.3.9/Drivers/MiniSQL/SQLDescribeParam.c0000755000175000017500000000346512262474476016231 00000000000000/********************************************************************** * SQLDescribeParam * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" /* HERES THE CORRECT WAY... SQLRETURN SQLDescribeParam( SQLHSTMT hDrvStmt, SQLUSMALLINT nParmNumber, SQLSMALLINT *pnDataType, SQLUINTEGER *pnSize, SQLSMALLINT *pnDecDigits, SQLSMALLINT *pnNullable ) HERES THE WAY THAT WORKS... */ SQLRETURN SQLDescribeParam( SQLHSTMT hDrvStmt, UWORD nParmNumber, SWORD *pnDataType, UDWORD *pnSize, SWORD *pnDecDigits, SWORD *pnNullable ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/0000775000175000017500000000000013725127521013401 500000000000000unixODBC-2.3.9/Drivers/template/SQLColumns.c0000755000175000017500000000650512262474476015505 00000000000000/******************************************************************** * SQLColumns * * This is something of a mess. Part of the problem here is that msqlListFields * are returned as mSQL 'column headers'... we want them to be returned as a * row for each. So we have to turn the results on their side . * * Another problem is that msqlListFields will also return indexs. So we have * to make sure that these are not included here. * * The end result is more code than what would usually be found here. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" enum nSQLColumns { TABLE_CAT = 1, TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_SIZE, BUFFER_LENGTH, DECIMAL_DIGITS, NUM_PREC_RADIX, NULLABLE, REMARKS, COLUMN_DEF, SQL_DATA_TYPE, SQL_DATETIME_SUB, CHAR_OCTET_LENGTH, ORDINAL_POSITION, IS_NULLABLE, COL_MAX }; /**************************** * replace this with init of some struct (see same func for MiniSQL driver) */ char *aSQLColumns[] = { "one", "two" }; /***************************/ SQLRETURN SQLColumns( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength, SQLCHAR *szColumnName, SQLSMALLINT nColumnNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; int nColumn; long nCols; long nRow; char szBuffer[101]; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( szTableName == NULL || szTableName[0] == '\0' ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Must supply a valid table name" ); return SQL_ERROR; } /************************** * close any existing result **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); if ( hStmt->pszQuery != NULL ) free( hStmt->pszQuery ); /************************ * generate a result set listing columns ************************/ /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ /************************** * gather column header information (save col 0 for bookmarks) **************************/ /************************ * gather data (save col 0 for bookmarks and factor out index columns) ************************/ /************************** * free the snapshot **************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLNumResultCols.c0000755000175000017500000000257712262474476016651 00000000000000/********************************************************************** * SQLNumResultCols * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLNumResultCols( SQLHSTMT hDrvStmt, SQLSMALLINT *pnColumnCount ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( hStmt->hStmtExtras->nRows < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } /******************** * get number of columns in result set ********************/ *pnColumnCount = hStmt->hStmtExtras->nCols; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLSetStmtAttr.c0000755000175000017500000000256112262474476016321 00000000000000/********************************************************************** * SQLSetStmtAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetStmtAttr( SQLHSTMT hDrvStmt, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLGetConnectAttr.c0000755000175000017500000000267512262474476016755 00000000000000/********************************************************************** * SQLGetConnectAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetConnectAttr( SQLHDBC hDrvDbc, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLSetPos.c0000755000175000017500000000367412262474476015306 00000000000000/******************************************************************** * SQLSetPos * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetPos( SQLHSTMT hDrvStmt, SQLSETPOSIROW nRow, SQLUSMALLINT nOperation, SQLUSMALLINT nLockType ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /* OK */ switch ( nOperation ) { case SQL_POSITION: break; case SQL_REFRESH: break; case SQL_UPDATE: break; case SQL_DELETE: break; default: sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Invalid nOperation=%d", nOperation ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } switch ( nLockType ) { case SQL_LOCK_NO_CHANGE: break; case SQL_LOCK_EXCLUSIVE: break; case SQL_LOCK_UNLOCK: break; default: sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Invalid nLockType=%d", nLockType ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLGetTypeInfo.c0000755000175000017500000000230512262474476016254 00000000000000/********************************************************************** * SQLGetTypeInfo * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetTypeInfo( SQLHSTMT hDrvStmt, SQLSMALLINT nSqlType ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLAllocHandle.c0000755000175000017500000000204412262474476016225 00000000000000/********************************************************************** * SQLAllocHandle * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLAllocHandle( SQLSMALLINT nHandleType, SQLHANDLE nInputHandle, SQLHANDLE *pnOutputHandle ) { switch ( nHandleType ) { case SQL_HANDLE_ENV: return _AllocEnv( (SQLHENV *)pnOutputHandle ); case SQL_HANDLE_DBC: return _AllocConnect( (SQLHENV)nInputHandle, (SQLHDBC *)pnOutputHandle ); case SQL_HANDLE_STMT: return _AllocStmt( (SQLHDBC)nInputHandle, (SQLHSTMT *)pnOutputHandle ); case SQL_HANDLE_DESC: break; default: return SQL_ERROR; break; } return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLSetScrollOptions.c0000755000175000017500000000251112262474476017344 00000000000000/******************************************************************** * SQLSetScrollOptions (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetScrollOptions( /* Use SQLSetStmtOptions */ SQLHSTMT hDrvStmt, SQLUSMALLINT fConcurrency, SQLLEN crowKeyset, SQLUSMALLINT crowRowset) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long) hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/_FreeResults.c0000755000175000017500000000304612262474476016104 00000000000000/********************************************************************** * _FreeResults * **********************************************************************/ #include #include "driver.h" SQLRETURN _FreeResults( HSTMTEXTRAS hStmt ) { COLUMNHDR *pColumnHeader; int nCurColumn; if ( hStmt == NULL ) return SQL_ERROR; if ( hStmt->aResults == NULL ) return SQL_SUCCESS; /* COLUMN HDRS (col=0 is not used) */ for ( nCurColumn = 1; nCurColumn <= hStmt->nCols; nCurColumn++ ) { pColumnHeader = (COLUMNHDR*)(hStmt->aResults)[nCurColumn]; free( pColumnHeader->pszSQL_DESC_BASE_COLUMN_NAME ); free( pColumnHeader->pszSQL_DESC_BASE_TABLE_NAME ); free( pColumnHeader->pszSQL_DESC_CATALOG_NAME ); free( pColumnHeader->pszSQL_DESC_LABEL ); free( pColumnHeader->pszSQL_DESC_LITERAL_PREFIX ); free( pColumnHeader->pszSQL_DESC_LITERAL_SUFFIX ); free( pColumnHeader->pszSQL_DESC_LOCAL_TYPE_NAME ); free( pColumnHeader->pszSQL_DESC_NAME ); free( pColumnHeader->pszSQL_DESC_SCHEMA_NAME ); free( pColumnHeader->pszSQL_DESC_TABLE_NAME ); free( pColumnHeader->pszSQL_DESC_TYPE_NAME ); free( (hStmt->aResults)[nCurColumn] ); } /* RESULT DATA (col=0 is bookmark) */ for ( hStmt->nRow = 1; hStmt->nRow <= hStmt->nRows; hStmt->nRow++ ) { for ( nCurColumn = 1; nCurColumn <= hStmt->nCols; nCurColumn++ ) { free( (hStmt->aResults)[hStmt->nRow*hStmt->nCols+nCurColumn] ); } } free( hStmt->aResults ); hStmt->aResults = NULL; hStmt->nCols = 0; hStmt->nRows = 0; hStmt->nRow = 0; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/_NativeToSQLColumnHeader.c0000755000175000017500000000103012262474476020230 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _NativeToSQLColumnHeader( COLUMNHDR *pColumnHeader, void *pNativeColumnHeader ) { return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLSetParam.c0000755000175000017500000000323712262474476015600 00000000000000/******************************************************************** * SQLSetParam (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetParam(SQLHSTMT hDrvStmt, SQLUSMALLINT nPar, SQLSMALLINT nType, SQLSMALLINT nSqlType, SQLULEN nColDef, SQLSMALLINT nScale, SQLPOINTER pValue, SQLLEN *pnValue) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( NULL == hStmt->pszQuery ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No prepared statement to work with" ); return SQL_ERROR; } /****************** * 1. Your param storage is in hStmt->hStmtExtras * so you will have to code for it. Do it here. ******************/ /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLSpecialColumns.c0000755000175000017500000000364612262474476017011 00000000000000/******************************************************************** * SQLSpecialColumns * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" /* THIS IS CORRECT... SQLRETURN SQLSpecialColumns( SQLHSTMT hDrvStmt, SQLSMALLINT nColumnType, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength, SQLSMALLINT nScope, SQLSMALLINT nNullable ) THIS WORKS... */ SQLRETURN SQLSpecialColumns( SQLHSTMT hDrvStmt, UWORD nColumnType, UCHAR *szCatalogName, SWORD nCatalogNameLength, UCHAR *szSchemaName, SWORD nSchemaNameLength, UCHAR *szTableName, SWORD nTableNameLength, UWORD nScope, UWORD nNullable ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLTablePrivileges.c0000755000175000017500000000263512262474476017146 00000000000000/******************************************************************** * SQLTablePrivileges * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLTablePrivileges( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/_NativeToSQLType.c0000755000175000017500000000075512262474476016620 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" int _NativeToSQLType( void *pNativeColumnHeader ) { return SQL_CHAR; } unixODBC-2.3.9/Drivers/template/SQLExecute.c0000755000175000017500000000401112262474476015455 00000000000000/********************************************************************** * SQLExecute * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLExecute( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; int nColumn; int nCols; int nRow; COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if( hStmt->pszQuery == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No prepared statement" ); return SQL_ERROR; } /************************** * Free any current results **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); /************************** * send prepared query to server **************************/ /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ /************************** * gather column header information (save col 0 for bookmarks) **************************/ /************************ * gather data (save col 0 for bookmarks) ************************/ /************************** * free the snapshot **************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLSetDescField.c0000755000175000017500000000163112262474476016356 00000000000000/********************************************************************** * SQLSetDescField * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetDescField( SQLHDESC DescriptorHandle, SQLSMALLINT RecordNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLNumParams.c0000755000175000017500000000230112262474476015756 00000000000000/********************************************************************** * SQLNumParams * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLNumParams( SQLHSTMT hDrvStmt, SQLSMALLINT *pnParamCount ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLGetStmtAttr.c0000755000175000017500000000263312262474476016305 00000000000000/********************************************************************** * SQLGetStmtAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetStmtAttr( SQLHSTMT hDrvStmt, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLEndTran.c0000755000175000017500000000141612262474476015414 00000000000000/********************************************************************** * SQLEndTran * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLEndTran( SQLSMALLINT nHandleType, SQLHANDLE nHandle, SQLSMALLINT nCompletionType ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLSetEnvAttr.c0000755000175000017500000000152112262474476016115 00000000000000/********************************************************************** * SQLSetEnvAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetEnvAttr( SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLConnect.c0000755000175000017500000000673712262474476015465 00000000000000/********************************************************************** * SQLConnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLConnect( SQLHDBC hDrvDbc, SQLCHAR *szDataSource, SQLSMALLINT nDataSourceLength, SQLCHAR *szUID, SQLSMALLINT nUIDLength, SQLCHAR *szPWD, SQLSMALLINT nPWDLength ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; char szDATABASE[INI_MAX_PROPERTY_VALUE+1]; char szHOST[INI_MAX_PROPERTY_VALUE+1]; char szPORT[INI_MAX_PROPERTY_VALUE+1]; char szFLAG[INI_MAX_PROPERTY_VALUE+1]; /* SANITY CHECKS */ if( SQL_NULL_HDBC == hDbc ) return SQL_INVALID_HANDLE; sprintf((char*) hDbc->szSqlMsg, "hDbc=$%08lX 3zDataSource=(%s)", (long)hDbc, szDataSource ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); if( hDbc->bConnected == 1 ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Already connected" ); return SQL_ERROR; } if ( nDataSourceLength == SQL_NTS ) { if ( strlen((char*) szDataSource ) > ODBC_FILENAME_MAX+INI_MAX_OBJECT_NAME ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Given Data Source is too long. I consider it suspect." ); return SQL_ERROR; } } else { if ( nDataSourceLength > ODBC_FILENAME_MAX+INI_MAX_OBJECT_NAME ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Given Data Source is too long. I consider it suspect." ); return SQL_ERROR; } } /******************** * gather and use any required DSN properties * - DATABASE * - HOST (localhost assumed if not supplied) ********************/ szDATABASE[0] = '\0'; szHOST[0] = '\0'; szPORT[0] = '\0'; szFLAG[0] = '\0'; SQLGetPrivateProfileString((char*) szDataSource, "DATABASE", "", szDATABASE, sizeof(szDATABASE), "odbc.ini" ); if ( szDATABASE[0] == '\0' ) { sprintf((char*) hDbc->szSqlMsg, "SQL_ERROR Could not find Driver entry for %s in system information", szDataSource ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); return SQL_ERROR; } SQLGetPrivateProfileString((char*) szDataSource, "HOST", "localhost", szHOST, sizeof(szHOST), "odbc.ini" ); SQLGetPrivateProfileString((char*) szDataSource, "PORT", "0", szPORT, sizeof(szPORT), "odbc.ini" ); SQLGetPrivateProfileString((char*) szDataSource, "FLAG", "0", szFLAG, sizeof(szFLAG), "odbc.ini" ); /******************** * 1. initialise structures * 2. try connection with database using your native calls * 3. store your server handle in the extras somewhere * 4. set connection state * hDbc->bConnected = TRUE; ********************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLParamOptions.c0000755000175000017500000000230712262474476016475 00000000000000/********************************************************************** * SQLParamOptions (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLParamOptions( SQLHSTMT hDrvStmt, SQLULEN nRow, SQLULEN *pnRow ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLTables.c0000755000175000017500000000524612262474476015300 00000000000000/********************************************************************** * SQLTables * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" /**************************** * STANDARD COLUMNS RETURNED BY SQLTables ***************************/ enum nSQLTables { TABLE_CAT = 1, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS, COL_MAX }; /**************************** * COLUMN HEADERS (1st row of result set) ***************************/ /**************************** * replace this with init of some struct (see same func for MiniSQL driver) */ char *aSQLTables[] = { "one", "two" }; /****************************/ SQLRETURN SQLTables( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength, SQLCHAR *szTableType, SQLSMALLINT nTableTypeLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; int nColumn; long nResultMemory; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************** * close any existing result **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); if ( hStmt->pszQuery != NULL ) free( hStmt->pszQuery ); hStmt->pszQuery = NULL; /************************ * generate a result set listing tables ************************/ /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ /************************** * gather column header information (save col 0 for bookmarks) **************************/ /************************ * gather data (save col 0 for bookmarks) ************************/ /************************** * free the snapshot **************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLRowCount.c0000755000175000017500000000237712262474476015650 00000000000000/********************************************************************** * SQLRowCount * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLRowCount( SQLHSTMT hDrvStmt, SQLLEN *pnRowCount) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( NULL == pnRowCount ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR pnRowCount can not be NULL" ); return SQL_ERROR; } *pnRowCount = hStmt->hStmtExtras->nRows; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/_FreeDbc.c0000755000175000017500000000257712262474476015143 00000000000000/********************************************************************** * _FreeDbc * **********************************************************************/ #include #include "driver.h" SQLRETURN _FreeDbc( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; HDRVDBC hPrevDbc; SQLRETURN nReturn; if ( hDbc == SQL_NULL_HDBC ) return SQL_ERROR; /* TRY TO FREE STATEMENTS */ /* THIS IS JUST IN CASE; SHOULD NOT BE REQUIRED */ nReturn = _FreeStmtList( hDbc ); if ( nReturn != SQL_SUCCESS ) return nReturn; /* SPECIAL CHECK FOR FIRST IN LIST */ if ( ((HDRVENV)hDbc->hEnv)->hFirstDbc == hDbc ) ((HDRVENV)hDbc->hEnv)->hFirstDbc = hDbc->pNext; /* SPECIAL CHECK FOR LAST IN LIST */ if ( ((HDRVENV)hDbc->hEnv)->hLastDbc == hDbc ) ((HDRVENV)hDbc->hEnv)->hLastDbc = hDbc->pPrev; /* EXTRACT SELF FROM LIST */ if ( hDbc->pPrev != SQL_NULL_HDBC ) hDbc->pPrev->pNext = hDbc->pNext; if ( hDbc->pNext != SQL_NULL_HDBC ) hDbc->pNext->pPrev = hDbc->pPrev; /**********************************************/ /* !!! CODE TO FREE DRIVER SPECIFIC MEMORY (hidden in hStmtExtras) HERE !!! */ if ( hDbc->hDbcExtras ) { free( hDbc->hDbcExtras ); } /**********************************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); logClose( hDbc->hLog ); free( hDbc ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLTransact.c0000755000175000017500000000256512262474476015646 00000000000000/******************************************************************** * SQLTransact (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLTransact( SQLHENV hDrvEnv, SQLHDBC hDrvDbc, UWORD nType) { HDRVENV hEnv = (HDRVENV)hDrvEnv; HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if ( hDbc == SQL_NULL_HDBC ) return SQL_INVALID_HANDLE; sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); switch ( nType ) { case SQL_COMMIT: break; case SQL_ROLLBACK: break; default: sprintf((char*) hDbc->szSqlMsg, "SQL_ERROR Invalid nType=%d", nType ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); return SQL_ERROR; } logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLStatistics.c0000755000175000017500000000603012262474476016210 00000000000000/******************************************************************** * SQLStatistics * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" enum nSQLStatistics { TABLE_CAT = 1, TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, INDEX_QUALIFIER, INDEX_NAME, TYPE, ORDINAL_POSITION, COLUMN_NAME, ASC_OR_DESC, CARDINALITY, PAGES, FILTER_CONDITION, COL_MAX }; /**************************** * replace this with init of some struct (see same func for MiniSQL driver) */ char *aSQLStatistics[] = { "one", "two" }; /****************************/ SQLRETURN SQLStatistics( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, /* MUST BE SUPPLIED */ SQLSMALLINT nTableNameLength, SQLUSMALLINT nTypeOfIndex, SQLUSMALLINT nReserved ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; int nColumn; int nCols; int nRow; COLUMNHDR *pColumnHeader; char szSQL[200]; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long) hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( szTableName == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No table name" ); return SQL_ERROR; } if ( szTableName[0] == '\0' ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No table name" ); return SQL_ERROR; } /************************** * close any existing result **************************/ if ( hStmt->hStmtExtras->aResults ) _FreeResults( hStmt->hStmtExtras ); if ( hStmt->pszQuery != NULL ) free( hStmt->pszQuery ); hStmt->pszQuery = NULL; /************************** * EXEC QUERY TO GET KEYS **************************/ /************************** * allocate memory for columns headers and result data (row 0 is column header while col 0 is reserved for bookmarks) **************************/ /************************** * gather column header information (save col 0 for bookmarks) **************************/ /************************ * gather data (save col 0 for bookmarks and factor out index columns) ************************/ /************************** * free the snapshot **************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/README0000755000175000017500000000256512262474476014223 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * * * * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver Template | +-------------------------------------------------------------+ Use this template as a starting point when creating a new driver. You can also reference existing unixODBC drivers. This template provides the infrastructure for a 3.51 compliant ODBC driver. A driver created from this template, and in the unixODBC framework should be easy to port to other platforms. In fact, the Drivers are the only component which one may want to ensure portability ... the remaining components (including the DriverManager) strive for interoperability but not portability. +-------------------------------------------------------------+ | Please visit; | | www.genix.net/unixODBC | +-------------------------------------------------------------+ unixODBC-2.3.9/Drivers/template/SQLFreeConnect.c0000755000175000017500000000277712460436034016253 00000000000000/********************************************************************** * SQLFreeConnect * * Do not try to Free Dbc if there are Stmts... return an error. Let the * Driver Manager do a recursive clean up if it wants. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _FreeConnect( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; int nReturn; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, (char*)hDbc->szSqlMsg ); if( hDbc->bConnected ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Connection is active" ); return SQL_ERROR; } if ( hDbc->hFirstStmt != NULL ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Connection has allocated statements" ); return SQL_ERROR; } nReturn = _FreeDbc( hDbc ); return nReturn; } SQLRETURN SQLFreeConnect( SQLHDBC hDrvDbc ) { return _FreeConnect( hDrvDbc ); } unixODBC-2.3.9/Drivers/template/_FreeDbcList.c0000755000175000017500000000137612262474476015773 00000000000000/********************************************************************** * _FreeDbcList * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _FreeDbcList( SQLHENV hDrvEnv ) { HDRVENV hEnv = (HDRVENV)hDrvEnv; if ( hEnv == SQL_NULL_HENV ) return SQL_SUCCESS; while ( _FreeDbc( hEnv->hFirstDbc ) == SQL_SUCCESS ) { } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLSetStmtOption.c0000755000175000017500000000233412262474476016655 00000000000000/********************************************************************** * SQLSetStmtOption (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetStmtOption( SQLHSTMT hDrvStmt, UWORD fOption, SQLULEN vParam) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLFreeHandle.c0000755000175000017500000000202112262474476016047 00000000000000/********************************************************************** * SQLFreeHandle * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLFreeHandle( SQLSMALLINT nHandleType, SQLHANDLE nHandle ) { switch( nHandleType ) { case SQL_HANDLE_ENV: return _FreeEnv( (SQLHENV)nHandle ); case SQL_HANDLE_DBC: return _FreeConnect( (SQLHDBC)nHandle ); case SQL_HANDLE_STMT: return _FreeStmt( (SQLHSTMT)nHandle ); case SQL_HANDLE_DESC: break; default: return SQL_ERROR; } return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLGetDiagRec.c0000755000175000017500000000550712262474476016024 00000000000000/********************************************************************** * SQLGetDiagRec * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetDiagRec_( SQLSMALLINT nHandleType, SQLHANDLE hHandle, SQLSMALLINT nRecordNumber, SQLCHAR * pszState, SQLINTEGER * pnNativeError, SQLCHAR * pszMessageText, SQLSMALLINT nBufferLength, SQLSMALLINT * pnStringLength ) { HLOG hLog = NULL; HLOGMSG hMsg = NULL; /* sanity checks */ if ( !hHandle ) return SQL_INVALID_HANDLE; /* clear return values */ if ( pszState ) strcpy((char*) pszState, "-----" ); if ( pnNativeError ) *pnNativeError = 0; if ( pszMessageText ) memset( pszMessageText, 0, nBufferLength ); if ( pnStringLength ) *pnStringLength = 0; /* get hLog */ switch ( nHandleType ) { case SQL_HANDLE_ENV: hLog = ((HDRVENV)hHandle)->hLog; break; case SQL_HANDLE_DBC: hLog = ((HDRVDBC)hHandle)->hLog; break; case SQL_HANDLE_STMT: hLog = ((HDRVSTMT)hHandle)->hLog; break; case SQL_HANDLE_DESC: default: return SQL_ERROR; } /* get message */ if ( logPeekMsg( hLog, 1, &hMsg ) != LOG_SUCCESS ) return SQL_NO_DATA; if ( pnNativeError ) *pnNativeError = hMsg->nCode; if ( pszMessageText ) strncpy( (char*)pszMessageText, hMsg->pszMessage, nBufferLength-1 ); if ( pnStringLength ) *pnStringLength = strlen( (char*)hMsg->pszMessage ); return SQL_SUCCESS; } SQLRETURN SQLGetDiagRec( SQLSMALLINT nHandleType, SQLHANDLE hHandle, SQLSMALLINT nRecordNumber, SQLCHAR * pszState, SQLINTEGER * pnNativeError, SQLCHAR * pszMessageText, SQLSMALLINT nBufferLength, SQLSMALLINT * pnStringLength ) { return SQLGetDiagRec_( nHandleType, hHandle, nRecordNumber, pszState, pnNativeError, pszMessageText, nBufferLength, pnStringLength ); } unixODBC-2.3.9/Drivers/template/SQLGetInfo.c0000755000175000017500000000140312262474476015410 00000000000000/********************************************************************** * SQLGetInfo * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetInfo( SQLHDBC hDbc, SQLUSMALLINT nInfoType, SQLPOINTER pInfoValue, SQLSMALLINT nInfoValueMax, SQLSMALLINT *pnLength) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/_FreeStmt.c0000755000175000017500000000256512262474476015377 00000000000000/********************************************************************** * _FreeStmt * **********************************************************************/ #include #include "driver.h" SQLRETURN _FreeStmt( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; HDRVSTMT hPrevStmt; SQLRETURN nReturn; if ( hStmt == SQL_NULL_HDBC ) return SQL_ERROR; /* SPECIAL CHECK FOR FIRST IN LIST */ if ( ((HDRVDBC)hStmt->hDbc)->hFirstStmt == hStmt ) ((HDRVDBC)hStmt->hDbc)->hFirstStmt = hStmt->pNext; /* SPECIAL CHECK FOR LAST IN LIST */ if ( ((HDRVDBC)hStmt->hDbc)->hLastStmt == hStmt ) ((HDRVDBC)hStmt->hDbc)->hLastStmt = hStmt->pPrev; /* EXTRACT SELF FROM LIST */ if ( hStmt->pPrev != SQL_NULL_HSTMT ) hStmt->pPrev->pNext = hStmt->pNext; if ( hStmt->pNext != SQL_NULL_HSTMT ) hStmt->pNext->pPrev = hStmt->pPrev; /* FREE STANDARD MEMORY */ if( NULL != hStmt->pszQuery ) free( hStmt->pszQuery ); /*********************************************************************/ /* !!! FREE DRIVER SPECIFIC MEMORY (hidden in hStmtExtras) HERE !!! */ _FreeResults( hStmt->hStmtExtras ); free( hStmt->hStmtExtras ); /*********************************************************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); logClose( hStmt->hLog ); free( hStmt ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLColAttributes.c0000755000175000017500000000504412262474476016646 00000000000000/********************************************************************** * SQLColAttributes (this function has been deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLColAttributes( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLUSMALLINT nDescType, SQLPOINTER pszDesc, SQLSMALLINT nDescMax, SQLSMALLINT *pcbDesc, SQLLEN *pfDesc) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************** * 1. verify we have result set * 2. verify col is within range **************************/ /************************** * 3. process request **************************/ switch( nDescType ) { /* enum these case SQL_COLUMN_AUTO_INCREMENT: case SQL_COLUMN_CASE_SENSITIVE: case SQL_COLUMN_COUNT: case SQL_COLUMN_DISPLAY_SIZE: case SQL_COLUMN_LENGTH: case SQL_COLUMN_MONEY: case SQL_COLUMN_NULLABLE: case SQL_COLUMN_PRECISION: case SQL_COLUMN_SCALE: case SQL_COLUMN_SEARCHABLE: case SQL_COLUMN_TYPE: case SQL_COLUMN_UNSIGNED: case SQL_COLUMN_UPDATABLE: case SQL_COLUMN_CATALOG_NAME: case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_DISTINCT_TYPE: case SQL_COLUMN_LABEL: case SQL_COLUMN_NAME: case SQL_COLUMN_SCHEMA_NAME: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: */ default: sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR nDescType=%d", nDescType ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLDriverConnect.c0000755000175000017500000001064512262474476016632 00000000000000/********************************************************************** * SQLDriverConnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLDriverConnect( SQLHDBC hDrvDbc, SQLHWND hWnd, SQLCHAR *szConnStrIn, SQLSMALLINT nConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pnConnStrOut, SQLUSMALLINT nDriverCompletion ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; char szDSN[INI_MAX_PROPERTY_VALUE+1] = ""; char szDRIVER[INI_MAX_PROPERTY_VALUE+1] = ""; char szUID[INI_MAX_PROPERTY_VALUE+1] = ""; char szPWD[INI_MAX_PROPERTY_VALUE+1] = ""; char szDATABASE[INI_MAX_PROPERTY_VALUE+1] = ""; char szHOST[INI_MAX_PROPERTY_VALUE+1] = ""; char szPORT[INI_MAX_PROPERTY_VALUE+1] = ""; char szSOCKET[INI_MAX_PROPERTY_VALUE+1] = ""; char szFLAG[INI_MAX_PROPERTY_VALUE+1] = ""; char szNameValue[INI_MAX_PROPERTY_VALUE+1] = ""; char szName[INI_MAX_PROPERTY_VALUE+1] = ""; char szValue[INI_MAX_PROPERTY_VALUE+1] = ""; int nOption = 0; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); if( hDbc->bConnected == 1 ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Already connected" ); return SQL_ERROR; } if( !szConnStrIn ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Bad argument" ); return SQL_ERROR; } switch( nDriverCompletion ) { case SQL_DRIVER_PROMPT: case SQL_DRIVER_COMPLETE: case SQL_DRIVER_COMPLETE_REQUIRED: case SQL_DRIVER_NOPROMPT: default: sprintf((char*) hDbc->szSqlMsg, "Invalid nDriverCompletion=%d", nDriverCompletion ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); break; } /************************* * 1. parse nConnStrIn for connection options. Format is; * Property=Value;... * 2. we may not have all options so handle as per DM request * 3. fill as required szConnStrOut *************************/ for ( nOption = 1; iniElement((char*) szConnStrIn, ';', '\0', nOption, szNameValue, sizeof(szNameValue) ) == INI_SUCCESS ; nOption++ ) { szName[0] = '\0'; szValue[0] = '\0'; iniElement( szNameValue, '=', '\0', 0, szName, sizeof(szName) ); iniElement( szNameValue, '=', '\0', 1, szValue, sizeof(szValue) ); if ( strcasecmp( szName, "DSN" ) == 0 ) strcpy( szDSN, szValue ); else if ( strcasecmp( szName, "DRIVER" ) == 0 ) strcpy( szDRIVER, szValue ); else if ( strcasecmp( szName, "UID" ) == 0 ) strcpy( szUID, szValue ); else if ( strcasecmp( szName, "PWD" ) == 0 ) strcpy( szPWD, szValue ); else if ( strcasecmp( szName, "SERVER" ) == 0 ) strcpy( szHOST, szValue ); else if ( strcasecmp( szName, "DB" ) == 0 ) strcpy( szDATABASE, szValue ); else if ( strcasecmp( szName, "SOCKET" ) == 0 ) strcpy( szSOCKET, szValue ); else if ( strcasecmp( szName, "PORT" ) == 0 ) strcpy( szPORT, szValue ); else if ( strcasecmp( szName, "OPTION" ) == 0 ) strcpy( szFLAG, szValue ); } /**************************** * return the connect string we are using ***************************/ if( !szConnStrOut ) { } /************************* * 4. try to connect * 5. set gathered options (ie USE Database or whatever) * 6. set connection state * hDbc->bConnected = TRUE; *************************/ hDbc->bConnected = 1; logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported." ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLProcedureColumns.c0000755000175000017500000000301412262474476017346 00000000000000/******************************************************************** * SQLProcedureColumns * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLProcedureColumns( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szProcName, SQLSMALLINT nProcNameLength, SQLCHAR *szColumnName, SQLSMALLINT nColumnNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLCloseCursor.c0000755000175000017500000000221712262474476016324 00000000000000/********************************************************************** * SQLCloseCursor * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLCloseCursor( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLForeignKeys.c0000755000175000017500000000366712262474476016320 00000000000000/******************************************************************** * SQLForeignKeys * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLForeignKeys( SQLHSTMT hDrvStmt, SQLCHAR *szPKCatalogName, SQLSMALLINT nPKCatalogNameLength, SQLCHAR *szPKSchemaName, SQLSMALLINT nPKSchemaNameLength, SQLCHAR *szPKTableName, SQLSMALLINT nPKTableNameLength, SQLCHAR *szFKCatalogName, SQLSMALLINT nFKCatalogNameLength, SQLCHAR *szFKSchemaName, SQLSMALLINT nFKSchemaNameLength, SQLCHAR *szFKTableName, SQLSMALLINT nFKTableNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/_NativeTypeLength.c0000755000175000017500000000074712262474476017100 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" int _NativeTypeLength( void *pNativeColumnHeader ) { return 0; } unixODBC-2.3.9/Drivers/template/SQLGetStmtOption.c0000755000175000017500000000240012262474476016633 00000000000000/********************************************************************** * SQLGetStmtOption (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetStmtOption( SQLHSTMT hDrvStmt, UWORD fOption, PTR pvParam) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLBrowseConnect.c0000755000175000017500000000255012262474476016634 00000000000000/********************************************************************** * SQLBrowseConnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLBrowseConnect( SQLHDBC hDrvDbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR *szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT *pcbConnStrOut ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; if ( hDbc == NULL ) return SQL_INVALID_HANDLE; sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not currently supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLMoreResults.c0000755000175000017500000000220612262474476016343 00000000000000/********************************************************************** * SQLMoreResults * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLMoreResults( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/_NativeTypeDesc.c0000755000175000017500000000077112262474476016532 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" char *_NativeTypeDesc( char *pszTypeName, int nMySQLType ) { return pszTypeName; } unixODBC-2.3.9/Drivers/template/driverextras.h0000755000175000017500000001715312262474476016235 00000000000000/********************************************** * driverextras.h * * Purpose: * * To define driver specifc extras such as structs to be included * along side the common ODBC includes. * * Description: * * The short-term storage a driver requires as infrastructure varies somewhat from * DBMS to DBMS. The ODBC DriverManager requires predictable storage and it is defined * in drivermanager.h. The Driver also requires predictable storage and * it is defined in driver.h. Storage *specific to a type of driver* is defined here. * * The three main storage items are the ENV, DBC, and STMT structs. These are defined * as type void * in isql.h. * * So if your driver requires extra storage (and it probably does) then define * the storage within these structs, allocate/initialize as required. Cast them * to and from the standard names as required. * * For example; * * App DM |DRV * (as per hdbc.h) |(as per driver.h) *==================================================================== * hDbc=void* hDbc=SQLHDBC hDbc=HDBCEXTRAS *-------------------------------------------------------------------- * * DO NOT FORGET TO FREE ANY ALLOCATED MEMORY (at some point) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #ifndef DRIVEREXTRAS_H #define DRIVEREXTRAS_H /********************************************** * KEEP IT SIMPLE; PUT ALL DRIVER INCLUDES HERE THEN EACH DRIVER MODULE JUST INCLUDES THIS ONE FILE **********************************************/ #include #include #include #include #include /**************************** * include DBMS specific includes here and make any required defines here as well */ /***************************/ /********************************************** * ENVIRONMENT: DRIVER SPECIFIC STUFF THAT NEEDS TO BE STORED IN THE DRIVERS ENVIRONMENT **********************************************/ typedef struct tENVEXTRAS { /**************************** * this is usually left empty ***************************/ int nDummy; } ENVEXTRAS, *HENVEXTRAS; /********************************************** * CONNECTION: DRIVER SPECIFIC STUFF THAT NEEDS TO BE STORED IN THE DRIVERS CONNECTIONS **********************************************/ typedef struct tDBCEXTRAS { /**************************** * replace dummy with your DBMS specific stuff. This often means such things as a socket handle. ***************************/ int nDummy; } DBCEXTRAS, *HDBCEXTRAS; /********************************************** * STATEMENT: DRIVER SPECIFIC STUFF THAT NEEDS TO BE STORED IN THE DRIVERS STATEMENTS **********************************************/ typedef struct tCOLUMNHDR /* each element of the 1st row of results is one of these (except col 0) */ { /* EVERYTHING YOU WOULD EVER WANT TO KNOW ABOUT THE COLUMN. INIT THIS BY CALLING */ /* _NativeToSQLColumnHeader AS SOON AS YOU HAVE COLUMN INFO. THIS MAKES THE COL HDR LARGER */ /* BUT GENERALIZES MORE CODE. see SQLColAttribute() */ int bSQL_DESC_AUTO_UNIQUE_VALUE; /* IS AUTO INCREMENT COL? */ char *pszSQL_DESC_BASE_COLUMN_NAME; /* empty string if N/A */ char *pszSQL_DESC_BASE_TABLE_NAME; /* empty string if N/A */ int bSQL_DESC_CASE_SENSITIVE; /* IS CASE SENSITIVE COLUMN? */ char *pszSQL_DESC_CATALOG_NAME; /* empty string if N/A */ int nSQL_DESC_CONCISE_TYPE; /* ie SQL_CHAR, SQL_TYPE_TIME... */ int nSQL_DESC_DISPLAY_SIZE; /* max digits required to display */ int bSQL_DESC_FIXED_PREC_SCALE; /* has data source specific precision? */ char *pszSQL_DESC_LABEL; /* display label, col name or empty string */ int nSQL_DESC_LENGTH; /* strlen or bin size */ char *pszSQL_DESC_LITERAL_PREFIX; /* empty string if N/A */ char *pszSQL_DESC_LITERAL_SUFFIX; /* empty string if N/A */ char *pszSQL_DESC_LOCAL_TYPE_NAME; /* empty string if N/A */ char *pszSQL_DESC_NAME; /* col alias, col name or empty string */ int nSQL_DESC_NULLABLE; /* SQL_NULLABLE, _NO_NULLS or _UNKNOWN */ int nSQL_DESC_NUM_PREC_RADIX; /* 2, 10, or if N/A... 0 */ int nSQL_DESC_OCTET_LENGTH; /* max size */ int nSQL_DESC_PRECISION; /* */ int nSQL_DESC_SCALE; /* */ char *pszSQL_DESC_SCHEMA_NAME; /* empty string if N/A */ int nSQL_DESC_SEARCHABLE; /* can be in a filter ie SQL_PRED_NONE... */ char *pszSQL_DESC_TABLE_NAME; /* empty string if N/A */ int nSQL_DESC_TYPE; /* SQL data type ie SQL_CHAR, SQL_INTEGER.. */ char *pszSQL_DESC_TYPE_NAME; /* DBMS data type ie VARCHAR, MONEY... */ int nSQL_DESC_UNNAMED; /* qualifier for SQL_DESC_NAME ie SQL_NAMED */ int bSQL_DESC_UNSIGNED; /* if signed FALSE else TRUE */ int nSQL_DESC_UPDATABLE; /* ie SQL_ATTR_READONLY, SQL_ATTR_WRITE... */ /* BINDING INFO */ short nTargetType; /* BIND: C DATA TYPE ie SQL_C_CHAR */ char *pTargetValue; /* BIND: POINTER FROM APPLICATION TO COPY TO*/ long nTargetValueMax; /* BIND: MAX SPACE IN pTargetValue */ long *pnLengthOrIndicator; /* BIND: TO RETURN LENGTH OR NULL INDICATOR */ } COLUMNHDR; typedef struct tSTMTEXTRAS { char **aResults; /* nRows x nCols OF CHAR POINTERS. Row 0= ptrs to COLUMNHDR. Col 0=Bookmarks */ int nCols; /* # OF VALID COLUMNS IN aColumns */ int nRows; /* # OF ROWS IN aResults */ int nRow; /* CURRENT ROW */ } STMTEXTRAS, *HSTMTEXTRAS; /* * Shadow functions * * There are times when a function needs to call another function to use common functionality. When the * called function is part of the ODBC API (an entry point to the driver) bad things can happen. The * linker will get confused and call the same-named function elsewhere in the namespace (ie the Driver * Manager). To get around this you create a shadow function - a function with a slightly different name * that will not be confused with others - and then put most if not all of the functionality in there for * common use. * */ SQLRETURN SQLGetDiagRec_( SQLSMALLINT nHandleType, SQLHANDLE hHandle, SQLSMALLINT nRecordNumber, SQLCHAR * pszState, SQLINTEGER * pnNativeError, SQLCHAR * pszMessageText, SQLSMALLINT nBufferLength, SQLSMALLINT * pnStringLength ); SQLRETURN _GetData( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLSMALLINT nTargetType, SQLPOINTER pTarget, SQLLEN nTargetLength, SQLLEN *pnLengthOrIndicator ); /* * Internal Support Functions */ SQLRETURN _NativeToSQLColumnHeader( COLUMNHDR *pColumnHeader, void *pNativeColumnHeader ); int _NativeToSQLType( void *pNativeColumnHeader ); char *_NativeTypeDesc( char *pszTypeName, int nType ); int _NativeTypeLength( void *pNativeColumnHeader ); int _NativeTypePrecision( void *pNativeColumnHeader ); SQLRETURN template_SQLPrepare( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStr, SQLINTEGER nSqlStrLength ); #endif unixODBC-2.3.9/Drivers/template/SQLFreeEnv.c0000755000175000017500000000305012262474476015407 00000000000000/********************************************************************** * SQLFreeEnv * * Do not try to Free Env if there are Dbcs... return an error. Let the * Driver Manager do a recursive clean up if it wants. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _FreeEnv( SQLHENV hDrvEnv ) { HDRVENV hEnv = (HDRVENV)hDrvEnv; /* SANITY CHECKS */ if( hEnv == SQL_NULL_HENV ) return SQL_INVALID_HANDLE; sprintf((char*) hEnv->szSqlMsg, "hEnv = $%08lX", (long)hEnv ); logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hEnv->szSqlMsg ); if ( hEnv->hFirstDbc != NULL ) { logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR There are allocated Connections" ); return SQL_ERROR; } /************ * !!! ADD CODE TO FREE DRIVER SPECIFIC MEMORY (hidden in hEnvExtras) HERE !!! ************/ free( hEnv->hEnvExtras ); logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); logClose( hEnv->hLog ); free( hEnv ); return SQL_SUCCESS; } SQLRETURN SQLFreeEnv( SQLHENV hDrvEnv ) { return _FreeEnv( hDrvEnv ); } unixODBC-2.3.9/Drivers/template/SQLExecDirect.c0000755000175000017500000000310712262474476016077 00000000000000/********************************************************************** * SQLExecDirect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLExecDirect( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStr, SQLINTEGER nSqlStr ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; RETCODE rc; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /* prepare command, avoid finding the driver manager SQLPrepare */ rc = template_SQLPrepare( hDrvStmt, szSqlStr, nSqlStr ); if ( SQL_SUCCESS != rc ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Could not prepare statement" ); return rc; } /* execute command */ rc = SQLExecute( hDrvStmt ); if ( SQL_SUCCESS != rc ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Problem calling SQLEXecute" ); return rc; } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLGetDescField.c0000755000175000017500000000173012262474476016342 00000000000000/********************************************************************** * SQLGetDescField * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetDescField( SQLHDESC DescriptorHandle, SQLSMALLINT RecordNumber, SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLColumnPrivileges.c0000755000175000017500000000277312262474476017357 00000000000000/******************************************************************** * SQLColumnPrivileges * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLColumnPrivileges( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength, SQLCHAR *szColumnName, SQLSMALLINT nColumnNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLSetDescRec.c0000755000175000017500000000226112262474476016044 00000000000000/********************************************************************** * SQLSetDescRec * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetDescRec( SQLHDESC hDescriptorHandle, SQLSMALLINT nRecordNumber, SQLSMALLINT nType, SQLSMALLINT nSubType, SQLLEN nLength, SQLSMALLINT nPrecision, SQLSMALLINT nScale, SQLPOINTER pData, SQLLEN *pnStringLength, SQLLEN *pnIndicator ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLError.c0000755000175000017500000000463012262474476015153 00000000000000/********************************************************************** * SQLError (deprecated see SQLGetDiagRec) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" /*! * \brief Get oldest error for the given handle. * * This is deprecated - use SQLGetDiagRec instead. This is mapped * to SQLGetDiagRec. The main difference between this and * SQLGetDiagRec is that this call will delete the error message to * allow multiple calls here to work their way through all of the * errors even with the lack of an ability to pass a specific message * number to be returned. * * \param hDrvEnv * \param hDrvDbc * \param hDrvStmt * \param szSqlState * \param pfNativeError * \param szErrorMsg * \param nErrorMsgMax * \param pcbErrorMsg * * \return SQLRETURN * * \sa SQLGetDiagRec */ SQLRETURN SQLError( SQLHENV hDrvEnv, SQLHDBC hDrvDbc, SQLHSTMT hDrvStmt, SQLCHAR *szSqlState, SQLINTEGER *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT nErrorMsgMax, SQLSMALLINT *pcbErrorMsg ) { SQLSMALLINT nHandleType; SQLHANDLE hHandle; SQLRETURN nReturn; HLOG hLog; /* map call to SQLGetDiagRec */ if ( hDrvEnv ) { nHandleType = SQL_HANDLE_ENV; hHandle = hDrvEnv; hLog = ((HDRVENV)hDrvEnv)->hLog; } else if ( hDrvDbc ) { nHandleType = SQL_HANDLE_DBC; hHandle = hDrvDbc; hLog = ((HDRVDBC)hDrvDbc)->hLog; } else if ( hDrvStmt ) { nHandleType = SQL_HANDLE_STMT; hHandle = hDrvStmt; hLog = ((HDRVSTMT)hDrvStmt)->hLog; } else return SQL_INVALID_HANDLE; nReturn = SQLGetDiagRec_( nHandleType, hHandle, 1, szSqlState, pfNativeError, szErrorMsg, nErrorMsgMax, pcbErrorMsg ); /* unlike SQLGetDiagRec - we delete the message returned */ if ( SQL_SUCCEEDED( nReturn ) ) logPopMsg( hLog ); return nReturn; } unixODBC-2.3.9/Drivers/template/SQLCopyDesc.c0000755000175000017500000000136612262474476015576 00000000000000/********************************************************************** * SQLCopyDesc * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLCopyDesc( SQLHDESC hSourceDescHandle, SQLHDESC hTargetDescHandle ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/driver.h0000664000175000017500000000621113724126772014773 00000000000000/********************************************** * Driver.h * * Description: * * This is all of the stuff that is common among ALL drivers (but not to the DriverManager). * * Make sure that your driver specific driverextras.h exists! * * Creating a new driver? It is unlikely that you will need to change this * but take a look at driverextras.h * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************/ #ifndef _H_DRIVER #define _H_DRIVER /***************************************************************************** * ODBC VERSION (THAT THIS DRIVER COMPLIES WITH) *****************************************************************************/ #define ODBCVER 0x0351 #include #include #include #include #include "driverextras.h" #define SQL_MAX_CURSOR_NAME 100 /***************************************************************************** * STATEMENT *****************************************************************************/ typedef struct tDRVSTMT { struct tDRVSTMT *pPrev; /* prev struct or null */ struct tDRVSTMT *pNext; /* next struct or null */ SQLPOINTER hDbc; /* pointer to DB context */ SQLCHAR szCursorName[SQL_MAX_CURSOR_NAME]; /* name of cursor */ SQLCHAR *pszQuery; /* query string */ SQLCHAR szSqlMsg[LOG_MSG_MAX]; /* buff to format msgs */ HLOG hLog; /* handle to msg logs */ HSTMTEXTRAS hStmtExtras; /* DRIVER SPECIFIC STORAGE */ } DRVSTMT, *HDRVSTMT; /***************************************************************************** * CONNECTION *****************************************************************************/ typedef struct tDRVDBC { struct tDRVDBC *pPrev; /* prev struct or null */ struct tDRVDBC *pNext; /* next struct or null */ SQLPOINTER hEnv; /* pointer to ENV structure */ HDRVSTMT hFirstStmt; /* first in list or null */ HDRVSTMT hLastStmt; /* last in list or null */ SQLCHAR szSqlMsg[LOG_MSG_MAX]; /* buff to format msgs */ HLOG hLog; /* handle to msg logs */ int bConnected; /* TRUE on open connection */ HDBCEXTRAS hDbcExtras; /* DRIVER SPECIFIC DATA */ } DRVDBC, *HDRVDBC; /***************************************************************************** * ENVIRONMENT *****************************************************************************/ typedef struct tDRVENV { HDRVDBC hFirstDbc; /* first in list or null */ HDRVDBC hLastDbc; /* last in list or null */ SQLCHAR szSqlMsg[LOG_MSG_MAX]; /* buff to format msgs */ HLOG hLog; /* handle to msg logs */ HENVEXTRAS hEnvExtras; } DRVENV, *HDRVENV; #endif unixODBC-2.3.9/Drivers/template/SQLGetDescRec.c0000755000175000017500000000235212262474476016031 00000000000000/********************************************************************** * SQLGetDescRec * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetDescRec( SQLHDESC DescriptorHandle, SQLSMALLINT RecordNumber, SQLCHAR *Name, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, SQLSMALLINT *Type, SQLSMALLINT *SubType, SQLLEN *Length, SQLSMALLINT *Precision, SQLSMALLINT *Scale, SQLSMALLINT *Nullable ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/_NativeTypePrecision.c0000755000175000017500000000075212262474476017606 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" int _NativeTypePrecision( void *pNativeColumnHeader ) { return 0; } unixODBC-2.3.9/Drivers/template/SQLFetch.c0000755000175000017500000000431512262474476015113 00000000000000/********************************************************************** * SQLFetch * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLFetch( SQLHSTMT hDrvStmt) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; int nColumn = -1; COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( hStmt->hStmtExtras->nRows < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } /************************ * goto next row ************************/ if ( hStmt->hStmtExtras->nRow < 0 ) return SQL_NO_DATA; if ( hStmt->hStmtExtras->nRow >= hStmt->hStmtExtras->nRows ) return SQL_NO_DATA; hStmt->hStmtExtras->nRow++; /************************ * transfer bound column values to bound storage as required ************************/ for ( nColumn=1; nColumn <= hStmt->hStmtExtras->nCols; nColumn++ ) { pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nColumn]; if ( pColumnHeader->pTargetValue != NULL ) { if ( _GetData( hDrvStmt, nColumn, pColumnHeader->nTargetType, pColumnHeader->pTargetValue, pColumnHeader->nTargetValueMax, pColumnHeader->pnLengthOrIndicator ) != SQL_SUCCESS ) { sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Failed to get data for column %d", nColumn ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } } } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLColAttribute.c0000755000175000017500000001274212262474476016466 00000000000000/********************************************************************** * SQLColAttribute * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLColAttribute( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLUSMALLINT nFieldIdentifier, SQLPOINTER pszValue, SQLSMALLINT nValueLengthMax, SQLSMALLINT *pnValueLength, SQLLEN *pnValue ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; int nValue = 0; /* SANITY CHECKS */ if( !hStmt ) return SQL_INVALID_HANDLE; if ( !hStmt->hStmtExtras ) return SQL_INVALID_HANDLE; if ( hStmt->hStmtExtras->nRows < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } if ( nCol < 1 || nCol > hStmt->hStmtExtras->nCols ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Invalid column" ); return SQL_ERROR; } /* OK */ pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nCol]; switch( nFieldIdentifier ) { case SQL_DESC_AUTO_UNIQUE_VALUE: nValue = pColumnHeader->bSQL_DESC_AUTO_UNIQUE_VALUE; break; case SQL_DESC_BASE_COLUMN_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_BASE_COLUMN_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_BASE_TABLE_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_BASE_TABLE_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_CASE_SENSITIVE: nValue = pColumnHeader->bSQL_DESC_CASE_SENSITIVE; break; case SQL_DESC_CATALOG_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_CATALOG_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_CONCISE_TYPE: nValue = pColumnHeader->nSQL_DESC_CONCISE_TYPE; break; case SQL_DESC_COUNT: nValue = hStmt->hStmtExtras->nCols; break; case SQL_DESC_DISPLAY_SIZE: nValue = pColumnHeader->nSQL_DESC_DISPLAY_SIZE; break; case SQL_DESC_FIXED_PREC_SCALE: nValue = pColumnHeader->bSQL_DESC_FIXED_PREC_SCALE; break; case SQL_DESC_LABEL: strncpy( pszValue, pColumnHeader->pszSQL_DESC_LABEL, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_LENGTH: nValue = pColumnHeader->nSQL_DESC_LENGTH; break; case SQL_DESC_LITERAL_PREFIX: strncpy( pszValue, pColumnHeader->pszSQL_DESC_LITERAL_PREFIX, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_LITERAL_SUFFIX: strncpy( pszValue, pColumnHeader->pszSQL_DESC_LITERAL_SUFFIX, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_LOCAL_TYPE_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_LOCAL_TYPE_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_NULLABLE: nValue = pColumnHeader->nSQL_DESC_NULLABLE; break; case SQL_DESC_NUM_PREC_RADIX: nValue = pColumnHeader->nSQL_DESC_NUM_PREC_RADIX; break; case SQL_DESC_OCTET_LENGTH: nValue = pColumnHeader->nSQL_DESC_OCTET_LENGTH; break; case SQL_DESC_PRECISION: nValue = pColumnHeader->nSQL_DESC_PRECISION; break; case SQL_DESC_SCALE: nValue = pColumnHeader->nSQL_DESC_SCALE; break; case SQL_DESC_SCHEMA_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_SCHEMA_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_SEARCHABLE: nValue = pColumnHeader->nSQL_DESC_SEARCHABLE; break; case SQL_DESC_TABLE_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_TABLE_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_TYPE: nValue = pColumnHeader->nSQL_DESC_TYPE; break; case SQL_DESC_TYPE_NAME: strncpy( pszValue, pColumnHeader->pszSQL_DESC_TYPE_NAME, nValueLengthMax ); if ( pnValueLength ) *pnValueLength = strlen( pszValue ); break; case SQL_DESC_UNNAMED: nValue = pColumnHeader->nSQL_DESC_UNNAMED; break; case SQL_DESC_UNSIGNED: nValue = pColumnHeader->bSQL_DESC_UNSIGNED; break; case SQL_DESC_UPDATABLE: nValue = pColumnHeader->nSQL_DESC_UPDATABLE; break; default: sprintf((char*) hStmt->szSqlMsg, "Invalid nFieldIdentifier value of %d", nFieldIdentifier ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } if ( pnValue ) *(int*)pnValue = nValue; /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLProcedures.c0000755000175000017500000000262212262474476016174 00000000000000/******************************************************************** * SQLProcedures * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLProcedures( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szProcName, SQLSMALLINT nProcNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLNativeSql.c0000755000175000017500000000263512262474476015773 00000000000000/********************************************************************** * SQLNativeSql * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLNativeSql( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLPrimaryKeys.c0000755000175000017500000000262112262474476016337 00000000000000/******************************************************************** * SQLPrimaryKeys * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * ********************************************************************/ #include #include "driver.h" SQLRETURN SQLPrimaryKeys( SQLHSTMT hDrvStmt, SQLCHAR *szCatalogName, SQLSMALLINT nCatalogNameLength, SQLCHAR *szSchemaName, SQLSMALLINT nSchemaNameLength, SQLCHAR *szTableName, SQLSMALLINT nTableNameLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/_FreeStmtList.c0000755000175000017500000000147312262474476016230 00000000000000/********************************************************************** * _FreeStmtList * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _FreeStmtList( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; if ( hDbc == SQL_NULL_HDBC ) return SQL_SUCCESS; if ( hDbc->hFirstStmt == NULL ) return SQL_SUCCESS; while ( _FreeStmt( hDbc->hFirstStmt ) == SQL_SUCCESS ) { } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLPrepare.c0000755000175000017500000000363512262474476015464 00000000000000/********************************************************************** * SQLPrepare * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLPrepare( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStr, SQLINTEGER nSqlStrLength ) { return template_SQLPrepare( hDrvStmt, szSqlStr, nSqlStrLength ); } SQLRETURN template_SQLPrepare( SQLHSTMT hDrvStmt, SQLCHAR *szSqlStr, SQLINTEGER nSqlStrLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( szSqlStr == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No SQL to process" ); return SQL_ERROR; } if ( hStmt->pszQuery != NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Statement already in use." ); return SQL_ERROR; } /* allocate and copy statement to buffer (process escape sequences and parameter tokens as required) */ hStmt->pszQuery = (SQLCHAR*)strdup((char*) szSqlStr ); if ( NULL == hStmt->pszQuery ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Memory allocation error" ); return SQL_ERROR; } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLDescribeCol.c0000755000175000017500000000424612262474476016243 00000000000000/********************************************************************** * SQLDescribeCol * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLDescribeCol( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLCHAR *szColName, SQLSMALLINT nColNameMax, SQLSMALLINT *pnColNameLength, SQLSMALLINT *pnSQLDataType, SQLULEN *pnColSize, SQLSMALLINT *pnDecDigits, SQLSMALLINT *pnNullable ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; if ( NULL == hStmt->hStmtExtras ) return SQL_INVALID_HANDLE; if ( hStmt->hStmtExtras->nRows < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } if ( nCol < 1 || nCol > hStmt->hStmtExtras->nCols ) { sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Column %d is out of range. Range is 1 - %d", nCol, hStmt->hStmtExtras->nCols ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } /* OK */ pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nCol]; if ( szColName ) strncpy((char*) szColName, pColumnHeader->pszSQL_DESC_NAME, nColNameMax ); if ( pnColNameLength ) *pnColNameLength = strlen((char*) szColName ); if ( pnSQLDataType ) *pnSQLDataType = pColumnHeader->nSQL_DESC_TYPE; if ( pnColSize ) *pnColSize = pColumnHeader->nSQL_DESC_LENGTH; if ( pnDecDigits ) *pnDecDigits = pColumnHeader->nSQL_DESC_SCALE; if ( pnNullable ) *pnNullable = pColumnHeader->nSQL_DESC_NULLABLE; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLFetchScroll.c0000755000175000017500000000241312262474476016267 00000000000000/***************************************************************************** * SQLFetchScroll * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * *****************************************************************************/ #include #include "driver.h" SQLRETURN SQLFetchScroll( SQLHSTMT hDrvStmt, SQLSMALLINT nOrientation, SQLLEN nOffset ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/Makefile.in0000664000175000017500000007557513725127174015415 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = Drivers/template ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libtemplate_la_DEPENDENCIES = ../../lst/liblstlc.la \ ../../log/libloglc.la ../../ini/libinilc.la \ ../../odbcinst/libodbcinstlc.la $(am__DEPENDENCIES_1) am_libtemplate_la_OBJECTS = SQLAllocConnect.lo SQLAllocEnv.lo \ SQLAllocHandle.lo SQLAllocStmt.lo SQLBindCol.lo \ SQLBindParameter.lo SQLBrowseConnect.lo SQLBulkOperations.lo \ SQLCancel.lo SQLCloseCursor.lo SQLColAttribute.lo \ SQLColAttributes.lo SQLColumnPrivileges.lo SQLColumns.lo \ SQLConnect.lo SQLCopyDesc.lo SQLDescribeCol.lo \ SQLDescribeParam.lo SQLDisconnect.lo SQLDriverConnect.lo \ SQLEndTran.lo SQLError.lo SQLExecDirect.lo SQLExecute.lo \ SQLExtendedFetch.lo SQLFetch.lo SQLFetchScroll.lo \ SQLForeignKeys.lo SQLFreeConnect.lo SQLFreeEnv.lo \ SQLFreeHandle.lo SQLFreeStmt.lo SQLGetConnectAttr.lo \ SQLGetConnectOption.lo SQLGetCursorName.lo SQLGetData.lo \ SQLGetDescField.lo SQLGetDescRec.lo SQLGetDiagField.lo \ SQLGetDiagRec.lo SQLGetEnvAttr.lo SQLGetInfo.lo \ SQLGetStmtAttr.lo SQLGetStmtOption.lo SQLGetTypeInfo.lo \ SQLMoreResults.lo SQLNativeSql.lo SQLNumParams.lo \ SQLNumResultCols.lo SQLParamData.lo SQLParamOptions.lo \ SQLPrepare.lo SQLPrimaryKeys.lo SQLProcedureColumns.lo \ SQLProcedures.lo SQLPutData.lo SQLRowCount.lo \ SQLSetConnectOption.lo SQLSetCursorName.lo SQLSetDescField.lo \ SQLSetDescRec.lo SQLSetEnvAttr.lo SQLSetParam.lo SQLSetPos.lo \ SQLSetScrollOptions.lo SQLSetStmtAttr.lo SQLSetStmtOption.lo \ SQLSpecialColumns.lo SQLStatistics.lo SQLTablePrivileges.lo \ SQLTables.lo SQLTransact.lo _FreeDbc.lo _FreeStmt.lo \ _FreeDbcList.lo _FreeStmtList.lo _FreeResults.lo _GetData.lo \ _NativeToSQLColumnHeader.lo _NativeToSQLType.lo \ _NativeTypeDesc.lo _NativeTypeLength.lo \ _NativeTypePrecision.lo libtemplate_la_OBJECTS = $(am_libtemplate_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libtemplate_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libtemplate_la_LDFLAGS) $(LDFLAGS) -o \ $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtemplate_la_SOURCES) DIST_SOURCES = $(libtemplate_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libtemplate.la AM_CPPFLAGS = -I@top_srcdir@/include -I. $(LTDLINCL) libtemplate_la_LDFLAGS = -no-undefined -version-info 1:0:0 EXTRA_DIST = \ driver.h \ driverextras.h libtemplate_la_LIBADD = \ ../../lst/liblstlc.la \ ../../log/libloglc.la \ ../../ini/libinilc.la \ ../../odbcinst/libodbcinstlc.la \ $(LIBLTDL) libtemplate_la_SOURCES = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocHandle.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParameter.c \ SQLBrowseConnect.c \ SQLBulkOperations.c \ SQLCancel.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagField.c \ SQLGetDiagRec.c \ SQLGetEnvAttr.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescField.c \ SQLSetDescRec.c \ SQLSetEnvAttr.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c \ _FreeDbc.c \ _FreeStmt.c \ _FreeDbcList.c \ _FreeStmtList.c \ _FreeResults.c \ _GetData.c \ _NativeToSQLColumnHeader.c \ _NativeToSQLType.c \ _NativeTypeDesc.c \ _NativeTypeLength.c \ _NativeTypePrecision.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Drivers/template/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Drivers/template/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libtemplate.la: $(libtemplate_la_OBJECTS) $(libtemplate_la_DEPENDENCIES) $(EXTRA_libtemplate_la_DEPENDENCIES) $(AM_V_CCLD)$(libtemplate_la_LINK) -rpath $(libdir) $(libtemplate_la_OBJECTS) $(libtemplate_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindParameter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBrowseConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBulkOperations.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCancel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCloseCursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttributes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumnPrivileges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCopyDesc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDisconnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDriverConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLEndTran.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecDirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExtendedFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetchScroll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLForeignKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetCursorName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetEnvAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetTypeInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLMoreResults.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNativeSql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumParams.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumResultCols.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamOptions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrimaryKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedureColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedures.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPutData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRowCount.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetCursorName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetEnvAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetPos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetScrollOptions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSpecialColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLStatistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTablePrivileges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTransact.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeDbc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeDbcList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeResults.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_FreeStmtList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_GetData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeToSQLColumnHeader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeToSQLType.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeTypeDesc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeTypeLength.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_NativeTypePrecision.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/Drivers/template/SQLBulkOperations.c0000755000175000017500000000321112262474476017015 00000000000000/********************************************************************** * SQLBulkOperations * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLBulkOperations( SQLHSTMT hDrvStmt, SQLSMALLINT nOperation ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /* OK */ switch ( nOperation ) { case SQL_ADD: break; case SQL_UPDATE_BY_BOOKMARK: break; case SQL_DELETE_BY_BOOKMARK: break; case SQL_FETCH_BY_BOOKMARK: break; default: sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Unknown nOperation=%d", nOperation ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not currently supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLAllocStmt.c0000755000175000017500000000675212262474476015773 00000000000000/********************************************************************** * SQLAllocStmt (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _AllocStmt( SQLHDBC hDrvDbc, SQLHSTMT *phDrvStmt ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; HDRVSTMT *phStmt = (HDRVSTMT*)phDrvStmt; /* SANITY CHECKS */ if( hDbc == SQL_NULL_HDBC ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); if( NULL == phStmt ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR phStmt=NULL" ); return SQL_ERROR; } /* OK */ /* allocate memory */ *phStmt = malloc( sizeof(DRVSTMT) ); if( SQL_NULL_HSTMT == *phStmt ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR memory allocation failure" ); return SQL_ERROR; } /* initialize memory */ sprintf((char*) hDbc->szSqlMsg, "*phstmt = $%08lX", (long)*phStmt ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); memset( *phStmt, 0, sizeof(DRVSTMT) ); /* SAFETY */ (*phStmt)->hDbc = (SQLPOINTER)hDbc; (*phStmt)->hLog = NULL; (*phStmt)->hStmtExtras = NULL; (*phStmt)->pNext = NULL; (*phStmt)->pPrev = NULL; (*phStmt)->pszQuery = NULL; sprintf((char*)(*phStmt)->szCursorName, "CUR_%08lX", *phStmt ); /* ADD TO DBCs STATEMENT LIST */ /* start logging */ if ( logOpen( &(*phStmt)->hLog, "[template]", NULL, 50 ) ) { logOn( (*phStmt)->hLog, 1 ); logPushMsg( (*phStmt)->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "Statement logging allocated ok" ); } else (*phStmt)->hLog = NULL; /* ADD TO END OF LIST */ if ( hDbc->hFirstStmt == NULL ) { /* 1st is null so the list is empty right now */ hDbc->hFirstStmt = (*phStmt); hDbc->hLastStmt = (*phStmt); } else { /* at least one node in list */ hDbc->hLastStmt->pNext = (SQLPOINTER)(*phStmt); (*phStmt)->pPrev = (SQLPOINTER)hDbc->hLastStmt; hDbc->hLastStmt = (*phStmt); } /****************************************************************************/ /* ALLOCATE AND INIT DRIVER EXTRAS HERE */ (*phStmt)->hStmtExtras = malloc(sizeof(STMTEXTRAS)); memset( (*phStmt)->hStmtExtras, 0, sizeof(STMTEXTRAS) ); /* SAFETY */ (*phStmt)->hStmtExtras->aResults = NULL; (*phStmt)->hStmtExtras->nCols = 0; (*phStmt)->hStmtExtras->nRow = 0; (*phStmt)->hStmtExtras->nRows = 0; /****************************************************************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } SQLRETURN SQLAllocStmt( SQLHDBC hDrvDbc, SQLHSTMT *phDrvStmt ) { return _AllocStmt( hDrvDbc, phDrvStmt ); } unixODBC-2.3.9/Drivers/template/SQLSetCursorName.c0000755000175000017500000000313412262474476016612 00000000000000/********************************************************************** * SQLSetCursorName * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetCursorName( SQLHSTMT hDrvStmt, SQLCHAR *szCursor, SQLSMALLINT nCursorLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( NULL == szCursor || 0 == isalpha(*szCursor) ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Invalid cursor name" ); return SQL_ERROR; } /* COPY CURSOR */ if ( SQL_NTS == nCursorLength ) { strncpy((char*) hStmt->szCursorName,(char*) szCursor, SQL_MAX_CURSOR_NAME ); } else { /* strncpy( hStmt->szCursorName, szCursor, MIN(SQL_MAX_CURSOR_NAME - 1, nCursorLength) ); hStmt->szCursorName[ MIN( SQL_MAX_CURSOR_NAME - 1, nCursorLength) ] = '\0'; */ } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLGetConnectOption.c0000755000175000017500000000231612262474476017303 00000000000000/********************************************************************** * SQLGetConnectOption (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetConnectOption( SQLHDBC hDrvDbc, UWORD fOption, PTR pvParam ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLFreeStmt.c0000755000175000017500000000263212262474476015613 00000000000000/********************************************************************** * SQLFreeStmt * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLFreeStmt( SQLHSTMT hDrvStmt, SQLUSMALLINT nOption ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /********* * RESET PARAMS *********/ switch( nOption ) { case SQL_CLOSE: break; case SQL_DROP: return _FreeStmt( hStmt ); case SQL_UNBIND: break; case SQL_RESET_PARAMS: break; default: sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Invalid nOption=%d", nOption ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLDisconnect.c0000755000175000017500000000305112262474476016147 00000000000000/********************************************************************** * SQLDisconnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLDisconnect( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, (char*)hDbc->szSqlMsg ); if( hDbc->bConnected == 0 ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_SUCCESS_WITH_INFO Connection not open" ); return SQL_SUCCESS_WITH_INFO; } if ( hDbc->hFirstStmt != SQL_NULL_HSTMT ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Active Statements exist. Can not disconnect." ); return SQL_ERROR; } /**************************** * 1. do driver specific close here ****************************/ hDbc->bConnected = 0; logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLGetCursorName.c0000755000175000017500000000343512262474476016602 00000000000000/********************************************************************** * SQLGetCursorName * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetCursorName( SQLHSTMT hDrvStmt, SQLCHAR *szCursor, SQLSMALLINT nCursorMaxLength, SQLSMALLINT *pnCursorLength ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; int ci; /* counter variable */ /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); if ( NULL == szCursor ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No cursor name." ); return SQL_ERROR; } /* ** copy cursor name */ strncpy((char*) szCursor, (char*)hStmt->szCursorName, nCursorMaxLength ); /* ** set length of transfered data */ ci = strlen((char*) hStmt->szCursorName ); /* if ( NULL != pnCursorLength ) *pnCursorLength = MIN( ci, nCursorMaxLength ); */ if ( nCursorMaxLength < ci ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_SUCCESS_WITH_INFO Cursor was truncated" ); return SQL_SUCCESS_WITH_INFO; } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLParamData.c0000755000175000017500000000227212262474476015714 00000000000000/********************************************************************** * SQLParamData * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLParamData( SQLHSTMT hDrvStmt, SQLPOINTER *pValue ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if ( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLSetConnectOption.c0000755000175000017500000000244112262474476017316 00000000000000/********************************************************************** * SQLSetConnectOption (deprecated) * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLSetConnectOption( SQLHDBC hDrvDbc, UWORD nOption, SQLULEN vParam) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; /* SANITY CHECKS */ if ( hDbc == SQL_NULL_HDBC ) return SQL_INVALID_HANDLE; switch ( nOption ) { case SQL_TRANSLATE_DLL: case SQL_TRANSLATE_OPTION: /* case SQL_CONNECT_OPT_DRVR_START: */ case SQL_ODBC_CURSORS: case SQL_OPT_TRACE: switch ( vParam ) { case SQL_OPT_TRACE_ON: case SQL_OPT_TRACE_OFF: default: ; } break; case SQL_OPT_TRACEFILE: case SQL_ACCESS_MODE: case SQL_AUTOCOMMIT: default: ; } logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_SUCCESS_WITH_INFO Function not fully implemented" ); return SQL_SUCCESS_WITH_INFO; } unixODBC-2.3.9/Drivers/template/SQLGetDiagField.c0000755000175000017500000000201412262474476016324 00000000000000/********************************************************************** * SQLGetDiagField * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetDiagField( SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMALLINT RecordNumber, SQLSMALLINT DiagIdentifier, SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, SQLSMALLINT *StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLGetData.c0000755000175000017500000000202312262474476015365 00000000000000/********************************************************************** * SQLGetData * * 1. mSQL server sends all data as ascii strings so things are * simplified. We always convert from string to nTargetType. * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetData( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLSMALLINT nTargetType, /* C DATA TYPE */ SQLPOINTER pTarget, SQLLEN nTargetLength, SQLLEN *pnLengthOrIndicator ) { return _GetData( hDrvStmt, nCol, nTargetType, pTarget, nTargetLength, pnLengthOrIndicator ); } unixODBC-2.3.9/Drivers/template/SQLPutData.c0000755000175000017500000000246612262474476015431 00000000000000/********************************************************************** * SQLPutData * * Supplies parameter data at execution time. Used in conjuction with * SQLParamData. ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLPutData( SQLHSTMT hDrvStmt, SQLPOINTER pData, SQLLEN nLengthOrIndicator ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLGetEnvAttr.c0000755000175000017500000000162012262474476016101 00000000000000/********************************************************************** * SQLGetEnvAttr * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLGetEnvAttr( SQLHENV EnvironmentHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER *StringLength ) { return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLBindParameter.c0000755000175000017500000000345212262474476016600 00000000000000/********************************************************************** * SQLBindParameter * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLBindParameter( SQLHSTMT hDrvStmt, SQLUSMALLINT nParameterNumber, SQLSMALLINT nIOType, SQLSMALLINT nBufferType, SQLSMALLINT nParamType, SQLULEN nParamLength, SQLSMALLINT nScale, SQLPOINTER pData, SQLLEN nBufferLength, SQLLEN *pnLengthOrIndicator ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt=$%08lX nParameterNumber=%d nIOType=%d nBufferType=%d nParamType=%d nParamLength=%ld nScale=%d pData=$%08lX nBufferLength=%ld *pnLengthOrIndicator=$%08lX",(long) hStmt,nParameterNumber,nIOType,nBufferType,nParamType,(long) nParamLength,nScale,(long) pData,(long) nBufferLength, *pnLengthOrIndicator ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not currently supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLCancel.c0000755000175000017500000000221112262474476015240 00000000000000/********************************************************************** * SQLCancel * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLCancel( SQLHSTMT hDrvStmt ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLExtendedFetch.c0000755000175000017500000000264412262474476016577 00000000000000/********************************************************************** * SQLExtendedFetch * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLExtendedFetch( SQLHSTMT hDrvStmt, SQLUSMALLINT nOrientation, SQLLEN nOffset, SQLULEN *pnRowCount, SQLUSMALLINT *pRowStatusArray ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/template/SQLBindCol.c0000755000175000017500000000437512262474476015402 00000000000000/********************************************************************** * SQLBindCol * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLBindCol( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLSMALLINT nTargetType, SQLPOINTER pTargetValue, SQLLEN nTargetValueMax, SQLLEN *pnLengthOrIndicator ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; COLUMNHDR *pColumnHeader; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt=$%08lX nCol=%5d", (long) hStmt, nCol ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO,(char*) hStmt->szSqlMsg ); if ( hStmt->hStmtExtras->nRows == 0 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } if ( nCol < 1 || nCol > hStmt->hStmtExtras->nCols ) { sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Column %d is out of range. Range is 1 - %d", nCol, hStmt->hStmtExtras->nCols ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); return SQL_ERROR; } if ( pTargetValue == NULL ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Invalid data pointer" ); return SQL_ERROR; } if ( pnLengthOrIndicator != NULL ) *pnLengthOrIndicator = 0; /* SET DEFAULTS */ /* store app col pointer */ pColumnHeader = (COLUMNHDR*)(hStmt->hStmtExtras->aResults)[nCol]; pColumnHeader->nTargetType = nTargetType; pColumnHeader->nTargetValueMax = nTargetValueMax; pColumnHeader->pnLengthOrIndicator = pnLengthOrIndicator; pColumnHeader->pTargetValue = pTargetValue; logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/Makefile.am0000755000175000017500000000371112262756055015365 00000000000000lib_LTLIBRARIES = libtemplate.la AM_CPPFLAGS = -I@top_srcdir@/include -I. $(LTDLINCL) libtemplate_la_LDFLAGS = -no-undefined -version-info 1:0:0 EXTRA_DIST = \ driver.h \ driverextras.h libtemplate_la_LIBADD = \ ../../lst/liblstlc.la \ ../../log/libloglc.la \ ../../ini/libinilc.la \ ../../odbcinst/libodbcinstlc.la \ $(LIBLTDL) libtemplate_la_SOURCES = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocHandle.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParameter.c \ SQLBrowseConnect.c \ SQLBulkOperations.c \ SQLCancel.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagField.c \ SQLGetDiagRec.c \ SQLGetEnvAttr.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescField.c \ SQLSetDescRec.c \ SQLSetEnvAttr.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c \ _FreeDbc.c \ _FreeStmt.c \ _FreeDbcList.c \ _FreeStmtList.c \ _FreeResults.c \ _GetData.c \ _NativeToSQLColumnHeader.c \ _NativeToSQLType.c \ _NativeTypeDesc.c \ _NativeTypeLength.c \ _NativeTypePrecision.c unixODBC-2.3.9/Drivers/template/SQLAllocConnect.c0000755000175000017500000000566212262474476016434 00000000000000/********************************************************************** * SQLAllocConnect * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _AllocConnect( SQLHENV hDrvEnv, SQLHDBC *phDrvDbc ) { HDRVENV hEnv = (HDRVENV)hDrvEnv; HDRVDBC *phDbc = (HDRVDBC*)phDrvDbc; /************************ * SANITY CHECKS ************************/ if( SQL_NULL_HENV == hEnv ) return SQL_INVALID_HANDLE; sprintf((char*) hEnv->szSqlMsg, "hEnv = $%08lX phDbc = $%08lX", (long)hEnv, (long)phDbc ); logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hEnv->szSqlMsg ); if( SQL_NULL_HDBC == phDbc ) { logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR *phDbc is NULL" ); return SQL_ERROR; } /************************ * OK LETS DO IT ************************/ /* allocate database access structure */ *phDbc = (HDRVDBC)malloc( sizeof(DRVDBC) ); if( SQL_NULL_HDBC == *phDbc ) { *phDbc = SQL_NULL_HDBC; logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR malloc error" ); return SQL_ERROR; } /* initialize structure */ memset( *phDbc, 0, sizeof(DRVDBC) ); (*phDbc)->bConnected = 0; (*phDbc)->hDbcExtras = NULL; (*phDbc)->hFirstStmt = NULL; (*phDbc)->hLastStmt = NULL; (*phDbc)->pNext = NULL; (*phDbc)->pPrev = NULL; (*phDbc)->hEnv = (SQLPOINTER)hEnv; /* start logging */ if ( !logOpen( &(*phDbc)->hLog, "[template]", NULL, 50 ) ) (*phDbc)->hLog = NULL; logOn( (*phDbc)->hLog, 1 ); /* ADD TO END OF LIST */ if ( hEnv->hFirstDbc == NULL ) { /* 1st is null so the list is empty right now */ hEnv->hFirstDbc = (*phDbc); hEnv->hLastDbc = (*phDbc); } else { /* at least one node in list */ hEnv->hLastDbc->pNext = (SQLPOINTER)(*phDbc); (*phDbc)->pPrev = (SQLPOINTER)hEnv->hLastDbc; hEnv->hLastDbc = (*phDbc); } /********************************************************/ /* ALLOCATE AND INIT EXTRAS HERE */ (*phDbc)->hDbcExtras = (HDBCEXTRAS)malloc( sizeof(DBCEXTRAS) ); memset( (*phDbc)->hDbcExtras, 0, sizeof(DBCEXTRAS) ); /********************************************************/ logPushMsg( hEnv->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } SQLRETURN SQLAllocConnect( SQLHENV hDrvEnv, SQLHDBC *phDrvDbc ) { return _AllocConnect( hDrvEnv, phDrvDbc ); } unixODBC-2.3.9/Drivers/template/_GetData.c0000755000175000017500000000647212262474476015160 00000000000000/************************************************** * * ************************************************** * This code was created by Peter Harvey @ CodeByDesign. * Released under LGPL 31.JAN.99 * * Contributions from... * ----------------------------------------------- * Peter Harvey - pharvey@codebydesign.com **************************************************/ #include #include "driver.h" SQLRETURN _GetData( SQLHSTMT hDrvStmt, SQLUSMALLINT nCol, SQLSMALLINT nTargetType, /* C DATA TYPE */ SQLPOINTER pTarget, SQLLEN nTargetLength, SQLLEN *pnLengthOrIndicator ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; char *pSourceData = NULL; /* SANITY CHECKS */ if ( hStmt == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; if ( hStmt->hStmtExtras == SQL_NULL_HSTMT ) return SQL_INVALID_HANDLE; if ( hStmt->hStmtExtras->nRows == 0 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No result set." ); return SQL_ERROR; } /********************************************************************** * GET pSourceData FOR NORMAL RESULT SETS **********************************************************************/ if ( hStmt->hStmtExtras->nRow > hStmt->hStmtExtras->nRows || hStmt->hStmtExtras->nRow < 1 ) { logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR No current row" ); return SQL_ERROR; } pSourceData = (hStmt->hStmtExtras->aResults)[hStmt->hStmtExtras->nRow*hStmt->hStmtExtras->nCols+nCol]; /**************************** * ALL cols are stored as SQL_CHAR... bad for storage... good for code * SO no need to determine the source type when translating to destination ***************************/ if ( pSourceData == NULL ) { /********************* * Now get the col if value = NULL *********************/ if ( pnLengthOrIndicator != NULL ) *pnLengthOrIndicator = SQL_NULL_DATA; switch ( nTargetType ) { case SQL_C_LONG: memset( pTarget, 0, sizeof(int) ); break; case SQL_C_FLOAT: memset( pTarget, 0, sizeof(float) ); break; case SQL_C_CHAR: *((char *)pTarget) = '\0'; break; default: sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Unknown target type %d", nTargetType ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); } } else { /********************* * Now get the col when we have a value *********************/ switch ( nTargetType ) { case SQL_C_LONG: *((int *)pTarget) = atoi(pSourceData); if ( NULL != pnLengthOrIndicator ) *pnLengthOrIndicator = sizeof( int ); break; case SQL_C_FLOAT: sscanf( pSourceData, "%g", (float*)pTarget ); if ( NULL != pnLengthOrIndicator ) *pnLengthOrIndicator = sizeof( float ); break; case SQL_C_CHAR: strncpy( pTarget, pSourceData, nTargetLength ); if ( NULL != pnLengthOrIndicator ) *pnLengthOrIndicator = strlen(pTarget); break; default: sprintf((char*) hStmt->szSqlMsg, "SQL_ERROR Unknown target type %d", nTargetType ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); } } logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/template/SQLAllocEnv.c0000755000175000017500000000303512262474476015563 00000000000000/********************************************************************** * SQLAllocEnv * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN _AllocEnv( SQLHENV *phDrvEnv ) { HDRVENV *phEnv = (HDRVENV*)phDrvEnv; /* SANITY CHECKS */ if( NULL == phEnv ) return SQL_INVALID_HANDLE; /* OK */ /* allocate environment */ *phEnv = malloc( sizeof(DRVENV) ); if( SQL_NULL_HENV == *phEnv ) { *phEnv = SQL_NULL_HENV; return SQL_ERROR; } /* initialise environment */ memset( *phEnv, 0, sizeof(DRVENV) ); (*phEnv)->hFirstDbc = NULL; (*phEnv)->hLastDbc = NULL; (*phEnv)->hLog = NULL; /* start logging */ if ( !logOpen( &(*phEnv)->hLog, "[template]", NULL, 50 ) ) (*phEnv)->hLog = NULL; logOn( (*phEnv)->hLog, 1 ); /* ALLOCATE AND INIT DRIVER SPECIFIC STORAGE */ (*phEnv)->hEnvExtras = malloc(sizeof(ENVEXTRAS)); (*phEnv)->hEnvExtras->nDummy = -1; logPushMsg( (*phEnv)->hLog, __FILE__, __FILE__, __LINE__, LOG_INFO, LOG_INFO, "SQL_SUCCESS" ); return SQL_SUCCESS; } SQLRETURN SQLAllocEnv( SQLHENV *phDrvEnv ) { return _AllocEnv( phDrvEnv ); } unixODBC-2.3.9/Drivers/template/SQLDescribeParam.c0000755000175000017500000000270512262474476016564 00000000000000/********************************************************************** * SQLDescribeParam * ********************************************************************** * * This code was created by Peter Harvey (mostly during Christmas 98/99). * This code is LGPL. Please ensure that this message remains in future * distributions and uses of this code (thats about all I get out of it). * - Peter Harvey pharvey@codebydesign.com * **********************************************************************/ #include #include "driver.h" SQLRETURN SQLDescribeParam( SQLHSTMT hDrvStmt, SQLUSMALLINT nParmNumber, SQLSMALLINT *pnDataType, SQLULEN *pnSize, SQLSMALLINT *pnDecDigits, SQLSMALLINT *pnNullable ) { HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; /* SANITY CHECKS */ if( NULL == hStmt ) return SQL_INVALID_HANDLE; sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); /************************ * REPLACE THIS COMMENT WITH SOMETHING USEFULL ************************/ logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/README0000755000175000017500000000354712262474476012411 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Drivers | +-------------------------------------------------------------+ Some unixODBC drivers have been coded from scratch while others have been integerated (tweeked to compile and tested) into unixODBC. It is unlikely that you have all of the required libs to build all of these drivers so edit the Makefile in this dir... comment out any unwanted drivers. Getting all drivers up to the latest ODBC Level (ie 3.51) is an ongoing effort. You will find that each driver will implement a different level of compliance but, hopefully, enough to be quite usefull. If you develop a new driver than please let us know. We have created a Template to help you (see template dir). Drivers which are under development or are currently being tested with unixODBC may not be included in this distribution and some others may have to be downloaded from the DBMS vendor. The txt and nn drivers are good candidates for testing when you do not want to install a full DBMS. The txt driver will use a text file based database which may take a bit of time to understand in terms of setting it up. The nn driver uses internet News Servers as a data server so it is, perhaps, the easiest to get started with. +-------------------------------------------------------------+ | Peter Harvey pharvey@codebydesign.com | | www.genix.net/unixODBC | +-------------------------------------------------------------+ unixODBC-2.3.9/Drivers/Postgre7.1/0000775000175000017500000000000013725127521013437 500000000000000unixODBC-2.3.9/Drivers/Postgre7.1/psqlodbc.c0000755000175000017500000000552712262474475015354 00000000000000 /* Module: psqlodbc.c * * Description: This module contains the main entry point (DllMain) for the library. * It also contains functions to get and set global variables for the * driver in the registry. * * Classes: n/a * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "psqlodbc.h" #include "dlg_specific.h" #ifndef WIN32 #include "isql.h" #include "isqlext.h" #else #include #include #include #include #endif GLOBAL_VALUES globals; RETCODE SQL_API SQLDummyOrdinal(void); #ifdef WIN32 HINSTANCE NEAR s_hModule; /* Saved module handle. */ /* This is where the Driver Manager attaches to this Driver */ BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) { WORD wVersionRequested; WSADATA wsaData; switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: s_hModule = hInst; /* Save for dialog boxes */ /* Load the WinSock Library */ wVersionRequested = MAKEWORD(1, 1); if ( WSAStartup(wVersionRequested, &wsaData)) return FALSE; /* Verify that this is the minimum version of WinSock */ if ( LOBYTE( wsaData.wVersion ) != 1 || HIBYTE( wsaData.wVersion ) != 1 ) { WSACleanup(); return FALSE; } getGlobalDefaults(DBMS_NAME, ODBCINST_INI, FALSE); break; case DLL_THREAD_ATTACH: break; case DLL_PROCESS_DETACH: WSACleanup(); return TRUE; case DLL_THREAD_DETACH: break; default: break; } return TRUE; UNREFERENCED_PARAMETER(lpReserved); } #else /* not WIN32 */ #ifndef TRUE #define TRUE (BOOL)1 #endif #ifndef FALSE #define FALSE (BOOL)0 #endif #ifdef __GNUC__ /* This function is called at library initialization time. */ static BOOL __attribute__((constructor)) init(void) { getGlobalDefaults(DBMS_NAME, ODBCINST_INI, FALSE); return TRUE; } #else /* not __GNUC__ */ #ifdef DONT_DO_IT /* These two functions do shared library initialziation on UNIX, well at least * on Linux. I don't know about other systems. */ BOOL _init(void) { getGlobalDefaults(DBMS_NAME, ODBCINST_INI, FALSE); return TRUE; } BOOL _fini(void) { return TRUE; } #endif /* not __GNUC__ */ #endif #endif /* not WIN32 */ /* This function is used to cause the Driver Manager to call functions by number rather than name, which is faster. The ordinal value of this function must be 199 to have the Driver Manager do this. Also, the ordinal values of the functions must match the value of fFunction in SQLGetFunctions() */ RETCODE SQL_API SQLDummyOrdinal(void) { return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/Postgre7.1/dlg_specific.h0000755000175000017500000001203012262474475016150 00000000000000 /* File: dlg_specific.h * * Description: See "dlg_specific.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __DLG_SPECIFIC_H__ #define __DLG_SPECIFIC_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "psqlodbc.h" #include "connection.h" #ifdef WIN32 #include #include #include #include "resource.h" #endif /* Unknown data type sizes */ #define UNKNOWNS_AS_MAX 0 #define UNKNOWNS_AS_DONTKNOW 1 #define UNKNOWNS_AS_LONGEST 2 /* INI File Stuff */ #ifndef WIN32 #ifdef UNIXODBC #define ODBC_INI "ODBC.INI" /* ODBC initialization file */ #define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */ #else # define ODBC_INI ".odbc.ini" # ifdef ODBCINSTDIR # define ODBCINST_INI ODBCINSTDIR "/odbcinst.ini" # else # define ODBCINST_INI "/etc/odbcinst.ini" # endif #endif #else /* WIN32 */ # define ODBC_INI "ODBC.INI" /* ODBC initialization file */ # define ODBCINST_INI "ODBCINST.INI" /* ODBC Installation file */ #endif /* WIN32 */ #define INI_DSN DBMS_NAME /* Name of default Datasource in ini file (not used?) */ #define INI_KDESC "Description" /* Data source description */ #define INI_SERVER "Servername" /* Name of Server running the Postgres service */ #define INI_PORT "Port" /* Port on which the Postmaster is listening */ #define INI_UDS "Uds" /* Unix Domain socket path */ #define INI_DATABASE "Database" /* Database Name */ #define INI_USER "Username" /* Default User Name */ #define INI_PASSWORD "Password" /* Default Password */ #define INI_DEBUG "Debug" /* Debug flag */ #define INI_FETCH "Fetch" /* Fetch Max Count */ #define INI_SOCKET "Socket" /* Socket buffer size */ #define INI_READONLY "ReadOnly" /* Database is read only */ #define INI_COMMLOG "CommLog" /* Communication to backend logging */ #define INI_PROTOCOL "Protocol" /* What protocol (6.2) */ #define INI_OPTIMIZER "Optimizer" /* Use backend genetic optimizer */ #define INI_KSQO "Ksqo" /* Keyset query optimization */ #define INI_CONNSETTINGS "ConnSettings" /* Anything to send to backend on successful connection */ #define INI_UNIQUEINDEX "UniqueIndex" /* Recognize unique indexes */ #define INI_UNKNOWNSIZES "UnknownSizes" /* How to handle unknown result set sizes */ #define INI_CANCELASFREESTMT "CancelAsFreeStmt" #define INI_USEDECLAREFETCH "UseDeclareFetch" /* Use Declare/Fetch cursors */ /* More ini stuff */ #define INI_TEXTASLONGVARCHAR "TextAsLongVarchar" #define INI_UNKNOWNSASLONGVARCHAR "UnknownsAsLongVarchar" #define INI_BOOLSASCHAR "BoolsAsChar" #define INI_MAXVARCHARSIZE "MaxVarcharSize" #define INI_MAXLONGVARCHARSIZE "MaxLongVarcharSize" #define INI_FAKEOIDINDEX "FakeOidIndex" #define INI_SHOWOIDCOLUMN "ShowOidColumn" #define INI_ROWVERSIONING "RowVersioning" #define INI_SHOWSYSTEMTABLES "ShowSystemTables" #define INI_LIE "Lie" #define INI_PARSE "Parse" #define INI_EXTRASYSTABLEPREFIXES "ExtraSysTablePrefixes" #define INI_TRANSLATIONNAME "TranslationName" #define INI_TRANSLATIONDLL "TranslationDLL" #define INI_TRANSLATIONOPTION "TranslationOption" /* Connection Defaults */ #define DEFAULT_PORT "5432" #define DEFAULT_UDS "" #define DEFAULT_READONLY 1 #define DEFAULT_PROTOCOL "6.4" /* the latest protocol is the default */ #define DEFAULT_USEDECLAREFETCH 0 #define DEFAULT_TEXTASLONGVARCHAR 1 #define DEFAULT_UNKNOWNSASLONGVARCHAR 0 #define DEFAULT_BOOLSASCHAR 1 #define DEFAULT_OPTIMIZER 1 /* disable */ #define DEFAULT_KSQO 1 /* on */ #define DEFAULT_UNIQUEINDEX 0 /* dont recognize */ #define DEFAULT_COMMLOG 0 /* dont log */ #define DEFAULT_DEBUG 0 #define DEFAULT_UNKNOWNSIZES UNKNOWNS_AS_MAX #define DEFAULT_FAKEOIDINDEX 0 #define DEFAULT_SHOWOIDCOLUMN 0 #define DEFAULT_ROWVERSIONING 0 #define DEFAULT_SHOWSYSTEMTABLES 0 /* dont show system tables */ #define DEFAULT_LIE 0 #define DEFAULT_PARSE 0 #define DEFAULT_CANCELASFREESTMT 0 #define DEFAULT_EXTRASYSTABLEPREFIXES "dd_;" /* prototypes */ void getGlobalDefaults(char *section, char *filename, char override); #ifdef WIN32 void SetDlgStuff(HWND hdlg, ConnInfo *ci); void GetDlgStuff(HWND hdlg, ConnInfo *ci); int CALLBACK driver_optionsProc(HWND hdlg, WORD wMsg, WPARAM wParam, LPARAM lParam); int CALLBACK ds_optionsProc(HWND hdlg, WORD wMsg, WPARAM wParam, LPARAM lParam); #endif /* WIN32 */ void updateGlobals(void); void writeDSNinfo(ConnInfo *ci); void getDSNdefaults(ConnInfo *ci); void getDSNinfo(ConnInfo *ci, char overwrite); void makeConnectString(char *connect_string, ConnInfo *ci); void copyAttributes(ConnInfo *ci, char *attribute, char *value); #endif unixODBC-2.3.9/Drivers/Postgre7.1/parse.c0000755000175000017500000004644512262474475014663 00000000000000 /* Module: parse.c * * Description: This module contains routines related to parsing SQL statements. * This can be useful for two reasons: * * 1. So the query does not actually have to be executed to return data about it * * 2. To be able to return information about precision, nullability, aliases, etc. * in the functions SQLDescribeCol and SQLColAttributes. Currently, Postgres * doesn't return any information about these things in a query. * * Classes: none * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #include #include #include #include #include #include "statement.h" #include "connection.h" #include "qresult.h" #include "pgtypes.h" #ifndef WIN32 #ifndef HAVE_STRICMP #define stricmp(s1,s2) strcasecmp(s1,s2) #define strnicmp(s1,s2,n) strncasecmp(s1,s2,n) #endif #endif #define FLD_INCR 32 #define TAB_INCR 8 #define COL_INCR 16 char *getNextToken(char *s, char *token, int smax, char *delim, char *quote, char *dquote, char *numeric); void getColInfo(COL_INFO *col_info, FIELD_INFO *fi, int k); char searchColInfo(COL_INFO *col_info, FIELD_INFO *fi); char * getNextToken(char *s, char *token, int smax, char *delim, char *quote, char *dquote, char *numeric) { int i = 0; int out = 0; char qc, in_escape = FALSE; if (smax <= 1) return NULL; smax--; /* skip leading delimiters */ while (isspace((unsigned char) s[i]) || s[i] == ',') { /* mylog("skipping '%c'\n", s[i]); */ i++; } if (s[0] == '\0') { token[0] = '\0'; return NULL; } if (quote) *quote = FALSE; if (dquote) *dquote = FALSE; if (numeric) *numeric = FALSE; /* get the next token */ while ( ! isspace((unsigned char) s[i]) && s[i] != ',' && s[i] != '\0' && out != smax) { /* Handle quoted stuff */ if ( out == 0 && (s[i] == '\"' || s[i] == '\'')) { qc = s[i]; if (qc == '\"') { if (dquote) *dquote = TRUE; } if (qc == '\'') { if (quote) *quote = TRUE; } i++; /* dont return the quote */ while (s[i] != '\0' && out != smax) { if (s[i] == qc && ! in_escape) { break; } if (s[i] == '\\' && ! in_escape) { in_escape = TRUE; } else { in_escape = FALSE; token[out++] = s[i]; } i++; } if (s[i] == qc) i++; break; } /* Check for numeric literals */ if ( out == 0 && isdigit((unsigned char) s[i])) { if (numeric) *numeric = TRUE; token[out++] = s[i++]; while ( isalnum((unsigned char) s[i]) || s[i] == '.') token[out++] = s[i++]; break; } if ( ispunct((unsigned char) s[i]) && s[i] != '_') { mylog("got ispunct: s[%d] = '%c'\n", i, s[i]); if (out == 0) { token[out++] = s[i++]; break; } else break; } if (out != smax) token[out++] = s[i]; i++; } /* mylog("done -- s[%d] = '%c'\n", i, s[i]); */ token[out] = '\0'; /* find the delimiter */ while ( isspace((unsigned char) s[i])) i++; /* return the most priority delimiter */ if (s[i] == ',') { if (delim) *delim = s[i]; } else if (s[i] == '\0') { if (delim) *delim = '\0'; } else { if (delim) *delim = ' '; } /* skip trailing blanks */ while ( isspace((unsigned char) s[i])) { i++; } return &s[i]; } #if 0 QR_set_num_fields(stmt->result, 14); QR_set_field_info(stmt->result, 0, "TABLE_QUALIFIER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 1, "TABLE_OWNER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 2, "TABLE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 3, "COLUMN_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 4, "DATA_TYPE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 5, "TYPE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 6, "PRECISION", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 7, "LENGTH", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 8, "SCALE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 9, "RADIX", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 10, "NULLABLE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 11, "REMARKS", PG_TYPE_TEXT, 254); /* User defined fields */ QR_set_field_info(stmt->result, 12, "DISPLAY_SIZE", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 13, "FIELD_TYPE", PG_TYPE_INT4, 4); #endif void getColInfo(COL_INFO *col_info, FIELD_INFO *fi, int k) { if (fi->name[0] == '\0') strcpy(fi->name, QR_get_value_manual(col_info->result, k, 3)); fi->type = atoi( QR_get_value_manual(col_info->result, k, 13)); fi->precision = atoi( QR_get_value_manual(col_info->result, k, 6)); fi->length = atoi( QR_get_value_manual(col_info->result, k, 7)); fi->nullable = atoi( QR_get_value_manual(col_info->result, k, 10)); fi->display_size = atoi( QR_get_value_manual(col_info->result, k, 12)); } char searchColInfo(COL_INFO *col_info, FIELD_INFO *fi) { int k; char *col; for (k = 0; k < QR_get_num_tuples(col_info->result); k++) { col = QR_get_value_manual(col_info->result, k, 3); if ( ! strcmp(col, fi->name)) { getColInfo(col_info, fi, k); mylog("PARSE: searchColInfo: \n"); return TRUE; } } return FALSE; } char parse_statement(StatementClass *stmt) { static char* const func="parse_statement"; char token[256]; char delim, quote, dquote, numeric, unquoted; char *ptr; char in_select = FALSE, in_distinct = FALSE, in_on = FALSE, in_from = FALSE, in_where = FALSE, in_table = FALSE; char in_field = FALSE, in_expr = FALSE, in_func = FALSE, in_dot = FALSE, in_as = FALSE; int j, i, k = 0, n, blevel = 0; FIELD_INFO **fi; TABLE_INFO **ti; char parse; ConnectionClass *conn = stmt->hdbc; HSTMT hcol_stmt; StatementClass *col_stmt; RETCODE result; mylog("%s: entering...\n", func); ptr = stmt->statement; fi = stmt->fi; ti = stmt->ti; stmt->nfld = 0; stmt->ntab = 0; while ((ptr = getNextToken(ptr, token, sizeof(token), &delim, "e, &dquote, &numeric)) != NULL) { unquoted = ! ( quote || dquote ); mylog("unquoted=%d, quote=%d, dquote=%d, numeric=%d, delim='%c', token='%s', ptr='%s'\n", unquoted, quote, dquote, numeric, delim, token, ptr); if ( unquoted && ! stricmp(token, "select")) { in_select = TRUE; mylog("SELECT\n"); continue; } if ( unquoted && in_select && ! stricmp(token, "distinct")) { in_distinct = TRUE; mylog("DISTINCT\n"); continue; } if ( unquoted && ! stricmp(token, "into")) { in_select = FALSE; mylog("INTO\n"); continue; } if ( unquoted && ! stricmp(token, "from")) { in_select = FALSE; in_from = TRUE; mylog("FROM\n"); continue; } if ( unquoted && (! stricmp(token, "where") || ! stricmp(token, "union") || ! stricmp(token, "order") || ! stricmp(token, "group") || ! stricmp(token, "having"))) { in_select = FALSE; in_from = FALSE; in_where = TRUE; mylog("WHERE...\n"); break; } if (in_select) { if ( in_distinct) { mylog("in distinct\n"); if (unquoted && ! stricmp(token, "on")) { in_on = TRUE; mylog("got on\n"); continue; } if (in_on) { in_distinct = FALSE; in_on = FALSE; continue; /* just skip the unique on field */ } mylog("done distinct\n"); in_distinct = FALSE; } if ( in_expr || in_func) { /* just eat the expression */ mylog("in_expr=%d or func=%d\n", in_expr, in_func); if (quote || dquote) continue; if (in_expr && blevel == 0 && delim == ',') { mylog("**** in_expr and Got comma\n"); in_expr = FALSE; in_field = FALSE; } else if (token[0] == '(') { blevel++; mylog("blevel++ = %d\n", blevel); } else if (token[0] == ')') { blevel--; mylog("blevel-- = %d\n", blevel); if (delim==',') { in_func = FALSE; in_expr = FALSE; in_field = FALSE; } } continue; } if ( ! in_field) { if ( ! token[0]) continue; if ( ! (stmt->nfld % FLD_INCR)) { mylog("reallocing at nfld=%d\n", stmt->nfld); fi = (FIELD_INFO **) realloc(fi, (stmt->nfld + FLD_INCR) * sizeof(FIELD_INFO *)); if ( ! fi) { stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } stmt->fi = fi; } fi[stmt->nfld] = (FIELD_INFO *) malloc( sizeof(FIELD_INFO)); if (fi[stmt->nfld] == NULL) { stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } /* Initialize the field info */ memset(fi[stmt->nfld], 0, sizeof(FIELD_INFO)); /* double quotes are for qualifiers */ if (dquote) fi[stmt->nfld]->dquote = TRUE; if (quote) { fi[stmt->nfld++]->quote = TRUE; continue; } else if (numeric) { mylog("**** got numeric: nfld = %d\n", stmt->nfld); fi[stmt->nfld]->numeric = TRUE; } else if (token[0] == '(') { /* expression */ mylog("got EXPRESSION\n"); fi[stmt->nfld++]->expr = TRUE; in_expr = TRUE; blevel = 1; continue; } else { strcpy(fi[stmt->nfld]->name, token); fi[stmt->nfld]->dot[0] = '\0'; } mylog("got field='%s', dot='%s'\n", fi[stmt->nfld]->name, fi[stmt->nfld]->dot); if (delim == ',') { mylog("comma (1)\n"); } else { in_field = TRUE; } stmt->nfld++; continue; } /**************************/ /* We are in a field now */ /**************************/ if (in_dot) { stmt->nfld--; strcpy(fi[stmt->nfld]->dot, fi[stmt->nfld]->name); strcpy(fi[stmt->nfld]->name, token); stmt->nfld++; in_dot = FALSE; if (delim == ',') { mylog("in_dot: got comma\n"); in_field = FALSE; } continue; } if (in_as) { stmt->nfld--; strcpy(fi[stmt->nfld]->alias, token); mylog("alias for field '%s' is '%s'\n", fi[stmt->nfld]->name, fi[stmt->nfld]->alias); in_as = FALSE; in_field = FALSE; stmt->nfld++; if (delim == ',') { mylog("comma(2)\n"); } continue; } /* Function */ if (token[0] == '(') { in_func = TRUE; blevel = 1; fi[stmt->nfld-1]->func = TRUE; /* name will have the function name -- maybe useful some day */ mylog("**** got function = '%s'\n", fi[stmt->nfld-1]->name); continue; } if (token[0] == '.') { in_dot = TRUE; mylog("got dot\n"); continue; } if ( ! stricmp(token, "as")) { in_as = TRUE; mylog("got AS\n"); continue; } /* otherwise, it's probably an expression */ in_expr = TRUE; fi[stmt->nfld-1]->expr = TRUE; fi[stmt->nfld-1]->name[0] = '\0'; mylog("*** setting expression\n"); } if (in_from) { if ( ! in_table) { if ( ! token[0]) continue; if ( ! (stmt->ntab % TAB_INCR)) { ti = (TABLE_INFO **) realloc(ti, (stmt->ntab + TAB_INCR) * sizeof(TABLE_INFO *)); if ( ! ti) { stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } stmt->ti = ti; } ti[stmt->ntab] = (TABLE_INFO *) malloc(sizeof(TABLE_INFO)); if (ti[stmt->ntab] == NULL) { stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } ti[stmt->ntab]->alias[0] = '\0'; strcpy(ti[stmt->ntab]->name, token); mylog("got table = '%s'\n", ti[stmt->ntab]->name); if (delim == ',') { mylog("more than 1 tables\n"); } else { in_table = TRUE; } stmt->ntab++; continue; } strcpy(ti[stmt->ntab-1]->alias, token); mylog("alias for table '%s' is '%s'\n", ti[stmt->ntab-1]->name, ti[stmt->ntab-1]->alias); in_table = FALSE; if (delim == ',') { mylog("more than 1 tables\n"); } } } /*************************************************/ /* Resolve any possible field names with tables */ /*************************************************/ parse = TRUE; /* Resolve field names with tables */ for (i = 0; i < stmt->nfld; i++) { if (fi[i]->func || fi[i]->expr || fi[i]->numeric) { fi[i]->ti = NULL; fi[i]->type = -1; parse = FALSE; continue; } else if (fi[i]->quote) { /* handle as text */ fi[i]->ti = NULL; fi[i]->type = PG_TYPE_TEXT; fi[i]->precision = 0; continue; } /* it's a dot, resolve to table or alias */ else if (fi[i]->dot[0]) { for (k = 0; k < stmt->ntab; k++) { if ( ! stricmp(ti[k]->name, fi[i]->dot)) { fi[i]->ti = ti[k]; break; } else if ( ! stricmp(ti[k]->alias, fi[i]->dot)) { fi[i]->ti = ti[k]; break; } } } else if (stmt->ntab == 1) fi[i]->ti = ti[0]; } mylog("--------------------------------------------\n"); mylog("nfld=%d, ntab=%d\n", stmt->nfld, stmt->ntab); for (i=0; i < stmt->nfld; i++) { mylog("Field %d: expr=%d, func=%d, quote=%d, dquote=%d, numeric=%d, name='%s', alias='%s', dot='%s'\n", i, fi[i]->expr, fi[i]->func, fi[i]->quote, fi[i]->dquote, fi[i]->numeric, fi[i]->name, fi[i]->alias, fi[i]->dot); if (fi[i]->ti) mylog(" ----> table_name='%s', table_alias='%s'\n", fi[i]->ti->name, fi[i]->ti->alias); } for (i=0; i < stmt->ntab; i++) { mylog("Table %d: name='%s', alias='%s'\n", i, ti[i]->name, ti[i]->alias); } /******************************************************/ /* Now save the SQLColumns Info for the parse tables */ /******************************************************/ /* Call SQLColumns for each table and store the result */ for (i = 0; i < stmt->ntab; i++) { /* See if already got it */ char found = FALSE; for (k = 0; k < conn->ntables; k++) { if ( ! stricmp(conn->col_info[k]->name, ti[i]->name)) { mylog("FOUND col_info table='%s'\n", ti[i]->name); found = TRUE; break; } } if ( ! found) { mylog("PARSE: Getting SQLColumns for table[%d]='%s'\n", i, ti[i]->name); result = PG_SQLAllocStmt( stmt->hdbc, &hcol_stmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "SQLAllocStmt failed in parse_statement for columns."); stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } col_stmt = (StatementClass *) hcol_stmt; col_stmt->internal = TRUE; result = PG_SQLColumns(hcol_stmt, "", 0, "", 0, ti[i]->name, (SWORD) strlen(ti[i]->name), "", 0); mylog(" Past SQLColumns\n"); if (result == SQL_SUCCESS) { mylog(" Success\n"); if ( ! (conn->ntables % COL_INCR)) { mylog("PARSE: Allocing col_info at ntables=%d\n", conn->ntables); conn->col_info = (COL_INFO **) realloc(conn->col_info, (conn->ntables + COL_INCR) * sizeof(COL_INFO *)); if ( ! conn->col_info) { stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } } mylog("PARSE: malloc at conn->col_info[%d]\n", conn->ntables); conn->col_info[conn->ntables] = (COL_INFO *) malloc(sizeof(COL_INFO)); if ( ! conn->col_info[conn->ntables]) { stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } /* Store the table name and the SQLColumns result structure */ strcpy(conn->col_info[conn->ntables]->name, ti[i]->name); conn->col_info[conn->ntables]->result = col_stmt->result; /* The connection will now free the result structures, so make sure that the statement doesn't free it */ col_stmt->result = NULL; conn->ntables++; PG_SQLFreeStmt(hcol_stmt, SQL_DROP); mylog("Created col_info table='%s', ntables=%d\n", ti[i]->name, conn->ntables); } else { PG_SQLFreeStmt(hcol_stmt, SQL_DROP); break; } } /* Associate a table from the statement with a SQLColumn info */ ti[i]->col_info = conn->col_info[k]; mylog("associate col_info: i=%d, k=%d\n", i, k); } mylog("Done SQLColumns\n"); /******************************************************/ /* Now resolve the fields to point to column info */ /******************************************************/ for (i = 0; i < stmt->nfld;) { /* Dont worry about functions or quotes */ if (fi[i]->func || fi[i]->quote || fi[i]->numeric) { i++; continue; } /* Stars get expanded to all fields in the table */ else if (fi[i]->name[0] == '*') { char do_all_tables; int total_cols, old_alloc, new_size, cols; int increased_cols; mylog("expanding field %d\n", i); total_cols = 0; if (fi[i]->ti) /* The star represents only the qualified table */ total_cols = QR_get_num_tuples(fi[i]->ti->col_info->result); else { /* The star represents all tables */ /* Calculate the total number of columns after expansion */ for (k = 0; k < stmt->ntab; k++) { total_cols += QR_get_num_tuples(ti[k]->col_info->result); } } increased_cols = total_cols - 1; /* Allocate some more field pointers if necessary */ /*------------------------------------------------------------- */ old_alloc = ((stmt->nfld - 1) / FLD_INCR + 1) * FLD_INCR; new_size = stmt->nfld + increased_cols; mylog("k=%d, increased_cols=%d, old_alloc=%d, new_size=%d\n", k,increased_cols,old_alloc,new_size); if (new_size > old_alloc) { int new_alloc = ((new_size / FLD_INCR) + 1) * FLD_INCR; mylog("need more cols: new_alloc = %d\n", new_alloc); fi = (FIELD_INFO **) realloc(fi, new_alloc * sizeof(FIELD_INFO *)); if ( ! fi) { stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } stmt->fi = fi; } /*------------------------------------------------------------- */ /* copy any other fields (if there are any) up past the expansion */ for (j = stmt->nfld - 1; j > i; j--) { mylog("copying field %d to %d\n", j, increased_cols + j); fi[increased_cols + j] = fi[j]; } mylog("done copying fields\n"); /*------------------------------------------------------------- */ /* Set the new number of fields */ stmt->nfld += increased_cols; mylog("stmt->nfld now at %d\n", stmt->nfld); /*------------------------------------------------------------- */ /* copy the new field info */ do_all_tables = (fi[i]->ti ? FALSE : TRUE); for (k = 0; k < (do_all_tables ? stmt->ntab : 1); k++) { TABLE_INFO *the_ti = do_all_tables ? ti[k] : fi[i]->ti; cols = QR_get_num_tuples(the_ti->col_info->result); for (n = 0; n < cols; n++) { mylog("creating field info: n=%d\n", n); /* skip malloc (already did it for the Star) */ if (k > 0 || n > 0) { mylog("allocating field info at %d\n", n + i); fi[n + i] = (FIELD_INFO *) malloc( sizeof(FIELD_INFO)); if (fi[n + i] == NULL) { stmt->parse_status = STMT_PARSE_FATAL; return FALSE; } } /* Initialize the new space (or the * field) */ memset(fi[n + i], 0, sizeof(FIELD_INFO)); fi[n + i]->ti = the_ti; mylog("about to copy at %d\n", n + i); getColInfo(the_ti->col_info, fi[n + i], n); mylog("done copying\n"); } i += cols; mylog("i now at %d\n", i); } /*------------------------------------------------------------- */ } /* We either know which table the field was in because it was qualified with a table name or alias -OR- there was only 1 table. */ else if (fi[i]->ti) { if ( ! searchColInfo(fi[i]->ti->col_info, fi[i])) parse = FALSE; i++; } /* Don't know the table -- search all tables in "from" list */ else { parse = FALSE; for (k = 0; k < stmt->ntab; k++) { if ( searchColInfo(ti[k]->col_info, fi[i])) { fi[i]->ti = ti[k]; /* now know the table */ parse = TRUE; break; } } i++; } } if ( ! parse) stmt->parse_status = STMT_PARSE_INCOMPLETE; else stmt->parse_status = STMT_PARSE_COMPLETE; mylog("done parse_statement: parse=%d, parse_status=%d\n", parse, stmt->parse_status); return parse; } unixODBC-2.3.9/Drivers/Postgre7.1/md5.h0000644000175000017500000000162513274317063014220 00000000000000/* File: md5.h * * Description: See "md5.h" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __MD5_H__ #define __MD5_H__ #include "psqlodbc.h" #include #include #define MD5_PASSWD_LEN 35 /* From c.h */ #ifndef __BEOS__ #ifndef __cplusplus #if !defined(bool) || defined(__APPLE_ALTIVEC__) typedef char bool; #endif #ifndef true #define true ((bool) 1) #endif #ifndef false #define false ((bool) 0) #endif #endif /* not C++ */ #endif /* __BEOS__ */ /* Also defined in include/c.h */ #ifndef HAVE_UINT8 typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ #endif /* not HAVE_UINT8 */ extern bool md5_hash(const void *buff, size_t len, char *hexsum); extern bool EncryptMD5(const char *passwd, const char *salt, size_t salt_len, char *buf); #endif unixODBC-2.3.9/Drivers/Postgre7.1/statement.c0000755000175000017500000006261212262474475015547 00000000000000 /* Module: statement.c * * Description: This module contains functions related to creating * and manipulating a statement. * * Classes: StatementClass (Functions prefix: "SC_") * * API functions: SQLAllocStmt, SQLFreeStmt * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "statement.h" #include "bind.h" #include "connection.h" #include "qresult.h" #include "convert.h" #include "environ.h" #include #include #include #ifndef WIN32 #include "isql.h" #else #include #include #endif extern GLOBAL_VALUES globals; #ifndef WIN32 #ifndef HAVE_STRICMP #define stricmp(s1,s2) strcasecmp(s1,s2) #define strnicmp(s1,s2,n) strncasecmp(s1,s2,n) #endif #endif #define PRN_NULLCHECK /* Map sql commands to statement types */ static struct { int type; char *s; } Statement_Type[] = { { STMT_TYPE_SELECT, "SELECT" }, { STMT_TYPE_INSERT, "INSERT" }, { STMT_TYPE_UPDATE, "UPDATE" }, { STMT_TYPE_DELETE, "DELETE" }, { STMT_TYPE_CREATE, "CREATE" }, { STMT_TYPE_ALTER, "ALTER" }, { STMT_TYPE_DROP, "DROP" }, { STMT_TYPE_GRANT, "GRANT" }, { STMT_TYPE_REVOKE, "REVOKE" }, { 0, NULL } }; RETCODE SQL_API PG_SQLAllocStmt(HDBC hdbc, HSTMT FAR *phstmt) { static char* const func="SQLAllocStmt"; ConnectionClass *conn = (ConnectionClass *) hdbc; StatementClass *stmt; mylog("%s: entering...\n", func); if( ! conn) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } stmt = SC_Constructor(); mylog("**** SQLAllocStmt: hdbc = %u, stmt = %u\n", hdbc, stmt); if ( ! stmt) { CC_set_error(conn, CONN_STMT_ALLOC_ERROR, "No more memory to allocate a further SQL-statement"); *phstmt = SQL_NULL_HSTMT; CC_log_error(func, "", conn); return SQL_ERROR; } if ( ! CC_add_statement(conn, stmt)) { CC_set_error(conn, CONN_STMT_ALLOC_ERROR, "Maximum number of connections exceeded."); CC_log_error(func, "", conn); SC_Destructor(stmt); *phstmt = SQL_NULL_HSTMT; return SQL_ERROR; } *phstmt = (HSTMT) stmt; /* Copy default statement options based from Connection options */ stmt->options = conn->stmtOptions; /* Save the handle for later */ stmt->phstmt = phstmt; return SQL_SUCCESS; } RETCODE SQL_API SQLAllocStmt(HDBC hdbc, HSTMT FAR *phstmt) { return PG_SQLAllocStmt( hdbc, phstmt ); } RETCODE SQL_API PG_SQLFreeStmt(HSTMT hstmt, UWORD fOption) { static char* const func="SQLFreeStmt"; StatementClass *stmt = (StatementClass *) hstmt; mylog("%s: entering...hstmt=%u, fOption=%d\n", func, hstmt, fOption); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if (fOption == SQL_DROP) { ConnectionClass *conn = stmt->hdbc; /* Remove the statement from the connection's statement list */ if ( conn) { if ( ! CC_remove_statement(conn, stmt)) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Statement is currently executing a transaction."); SC_log_error(func, "", stmt); return SQL_ERROR; /* stmt may be executing a transaction */ } /* Free any cursors and discard any result info */ if (stmt->result) { QR_Destructor(stmt->result); stmt->result = NULL; } } /* Destroy the statement and free any results, cursors, etc. */ SC_Destructor(stmt); } else if (fOption == SQL_UNBIND) { SC_unbind_cols(stmt); } else if (fOption == SQL_CLOSE) { /* this should discard all the results, but leave the statement */ /* itself in place (it can be executed again) */ if (!SC_recycle_statement(stmt)) { /* errormsg passed in above */ SC_log_error(func, "", stmt); return SQL_ERROR; } } else if(fOption == SQL_RESET_PARAMS) { SC_free_params(stmt, STMT_FREE_PARAMS_ALL); } else { SC_set_error(stmt, STMT_OPTION_OUT_OF_RANGE_ERROR, "Invalid option passed to SQLFreeStmt."); SC_log_error(func, "", stmt); return SQL_ERROR; } return SQL_SUCCESS; } RETCODE SQL_API SQLFreeStmt(HSTMT hstmt, UWORD fOption) { return PG_SQLFreeStmt( hstmt, fOption ); } /********************************************************************** * StatementClass implementation */ void InitializeStatementOptions(StatementOptions *opt) { opt->maxRows = 0; /* driver returns all rows */ opt->maxLength = 0; /* driver returns all data for char/binary */ opt->rowset_size = 1; opt->keyset_size = 0; /* fully keyset driven is the default */ opt->scroll_concurrency = SQL_CONCUR_READ_ONLY; opt->cursor_type = SQL_CURSOR_FORWARD_ONLY; opt->bind_size = 0; /* default is to bind by column */ opt->retrieve_data = SQL_RD_ON; opt->use_bookmarks = SQL_UB_OFF; } StatementClass * SC_Constructor(void) { StatementClass *rv; rv = (StatementClass *) malloc(sizeof(StatementClass)); if (rv) { rv->hdbc = NULL; /* no connection associated yet */ rv->phstmt = NULL; rv->result = NULL; rv->manual_result = FALSE; rv->prepare = FALSE; rv->status = STMT_ALLOCATED; rv->internal = FALSE; SC_clear_error(rv); rv->statement = NULL; rv->stmt_with_params[0] = '\0'; rv->statement_type = STMT_TYPE_UNKNOWN; rv->bindings = NULL; rv->bindings_allocated = 0; rv->bookmark.buffer = NULL; rv->bookmark.used = NULL; rv->parameters_allocated = 0; rv->parameters = 0; rv->currTuple = -1; rv->rowset_start = -1; rv->current_col = -1; rv->bind_row = 0; rv->last_fetch_count = 0; rv->save_rowset_size = -1; rv->data_at_exec = -1; rv->current_exec_param = -1; rv->put_data = FALSE; rv->lobj_fd = -1; rv->cursor_name[0] = '\0'; /* Parse Stuff */ rv->ti = NULL; rv->fi = NULL; rv->ntab = 0; rv->nfld = 0; rv->parse_status = STMT_PARSE_NONE; /* Clear Statement Options -- defaults will be set in AllocStmt */ memset(&rv->options, 0, sizeof(StatementOptions)); } return rv; } char SC_Destructor(StatementClass *self) { mylog("SC_Destructor: self=%u, self->result=%u, self->hdbc=%u\n", self, self->result, self->hdbc); if (STMT_EXECUTING == self->status) { SC_set_error(self, STMT_SEQUENCE_ERROR, "Statement is currently executing a transaction."); return FALSE; } if (self->result) { if ( ! self->hdbc) self->result->conn = NULL; /* prevent any dbase activity */ QR_Destructor(self->result); } if (self->statement) free(self->statement); SC_free_params(self, STMT_FREE_PARAMS_ALL); /* the memory pointed to by the bindings is not deallocated by the driver */ /* by by the application that uses that driver, so we don't have to care */ /* about that here. */ if (self->bindings) free(self->bindings); /* Free the parsed table information */ if (self->ti) { int i; for (i = 0; i < self->ntab; i++) { free(self->ti[i]); } free(self->ti); } /* Free the parsed field information */ if (self->fi) { int i; for (i = 0; i < self->nfld; i++) { free(self->fi[i]); } free(self->fi); } SC_set_errormsg(self, NULL); free(self); mylog("SC_Destructor: EXIT\n"); return TRUE; } /* Free parameters and free the memory from the data-at-execution parameters that was allocated in SQLPutData. */ void SC_free_params(StatementClass *self, char option) { int i; mylog("SC_free_params: ENTER, self=%d\n", self); if( ! self->parameters) return; for (i = 0; i < self->parameters_allocated; i++) { if (self->parameters[i].data_at_exec == TRUE) { if (self->parameters[i].EXEC_used) { free(self->parameters[i].EXEC_used); self->parameters[i].EXEC_used = NULL; } if (self->parameters[i].EXEC_buffer) { if (self->parameters[i].SQLType != SQL_LONGVARBINARY) free(self->parameters[i].EXEC_buffer); self->parameters[i].EXEC_buffer = NULL; } } } self->data_at_exec = -1; self->current_exec_param = -1; self->put_data = FALSE; if (option == STMT_FREE_PARAMS_ALL) { free(self->parameters); self->parameters = NULL; self->parameters_allocated = 0; } mylog("SC_free_params: EXIT\n"); } int statement_type(char *statement) { int i; /* ignore leading whitespace in query string */ while (*statement && isspace((unsigned char) *statement)) statement++; for (i = 0; Statement_Type[i].s; i++) if ( ! strnicmp(statement, Statement_Type[i].s, strlen(Statement_Type[i].s))) return Statement_Type[i].type; return STMT_TYPE_OTHER; } /* Called from SQLPrepare if STMT_PREMATURE, or from SQLExecute if STMT_FINISHED, or from SQLFreeStmt(SQL_CLOSE) */ char SC_recycle_statement(StatementClass *self) { ConnectionClass *conn; mylog("recycle statement: self= %u\n", self); /* This would not happen */ if (self->status == STMT_EXECUTING) { SC_set_error(self, STMT_SEQUENCE_ERROR, "Statement is currently executing a transaction."); return FALSE; } SC_set_errormsg(self, NULL); SC_clear_error(self); switch (self->status) { case STMT_ALLOCATED: /* this statement does not need to be recycled */ return TRUE; case STMT_READY: break; case STMT_PREMATURE: /* Premature execution of the statement might have caused the start of a transaction. If so, we have to rollback that transaction. */ conn = SC_get_conn(self); if ( ! CC_is_in_autocommit(conn) && CC_is_in_trans(conn)) { CC_send_query(conn, "ABORT", NULL); CC_set_no_trans(conn); } break; case STMT_FINISHED: break; default: SC_set_error(self, STMT_INTERNAL_ERROR, "An internal error occured while recycling statements"); return FALSE; } /* Free the parsed table information */ if (self->ti) { int i; for (i = 0; i < self->ntab; i++) { free(self->ti[i]); } free(self->ti); self->ti = NULL; self->ntab = 0; } /* Free the parsed field information */ if (self->fi) { int i; for (i = 0; i < self->nfld; i++) { free(self->fi[i]); } free(self->fi); self->fi = NULL; self->nfld = 0; } self->parse_status = STMT_PARSE_NONE; /* Free any cursors */ if (self->result) { QR_Destructor(self->result); self->result = NULL; } /****************************************************************/ /* Reset only parameters that have anything to do with results */ /****************************************************************/ self->status = STMT_READY; self->manual_result = FALSE; /* very important */ self->currTuple = -1; self->rowset_start = -1; self->current_col = -1; self->bind_row = 0; self->last_fetch_count = 0; SC_set_errormsg(self, NULL); SC_clear_error(self); self->lobj_fd = -1; /* Free any data at exec params before the statement is executed */ /* again. If not, then there will be a memory leak when */ /* the next SQLParamData/SQLPutData is called. */ SC_free_params(self, STMT_FREE_PARAMS_DATA_AT_EXEC_ONLY); return TRUE; } /* Pre-execute a statement (SQLPrepare/SQLDescribeCol) */ void SC_pre_execute(StatementClass *self) { mylog("SC_pre_execute: status = %d\n", self->status); if (self->status == STMT_READY) { mylog(" preprocess: status = READY\n"); PG_SQLExecute(self); if (self->status == STMT_FINISHED) { mylog(" preprocess: after status = FINISHED, so set PREMATURE\n"); self->status = STMT_PREMATURE; } } } /* This is only called from SQLFreeStmt(SQL_UNBIND) */ char SC_unbind_cols(StatementClass *self) { Int2 lf; for(lf = 0; lf < self->bindings_allocated; lf++) { self->bindings[lf].data_left = -1; self->bindings[lf].buflen = 0; self->bindings[lf].buffer = NULL; self->bindings[lf].used = NULL; self->bindings[lf].returntype = SQL_C_CHAR; } self->bookmark.buffer = NULL; self->bookmark.used = NULL; return 1; } void SC_clear_error(StatementClass *self) { self->__error_number = 0; self->__error_message = NULL; self->errormsg_created = FALSE; } /* This function creates an error msg which is the concatenation */ /* of the result, statement, connection, and socket messages. */ char * SC_create_errormsg(StatementClass *self) { QResultClass *res = self->result; ConnectionClass *conn = self->hdbc; int pos; BOOL detailmsg = FALSE; char msg[4096]; msg[0] = '\0'; if (res && res->message) { strncpy(msg, res->message, sizeof(msg)); detailmsg = TRUE; } else if (SC_get_errormsg(self)) strncpy(msg, SC_get_errormsg(self), sizeof(msg)); if (!msg[0] && res && QR_get_notice(res)) { char *notice = QR_get_notice(res); int len = strlen(notice); if (len < sizeof(msg)) { memcpy(msg, notice, len); msg[len] = '\0'; } else return strdup(notice); } if (conn) { SocketClass *sock = conn->sock; if (!detailmsg && CC_get_errormsg(conn) && (CC_get_errormsg(conn))[0] != '\0') { pos = strlen(msg); sprintf(&msg[pos], ";\n%s", CC_get_errormsg(conn)); } if (sock && sock->errormsg && sock->errormsg[0] != '\0') { pos = strlen(msg); sprintf(&msg[pos], ";\n%s", sock->errormsg); } } return msg[0] ? strdup(msg) : NULL; } void SC_set_error(StatementClass *self, int number, const char *message) { if (self->__error_message) free(self->__error_message); self->__error_number = number; self->__error_message = message ? strdup(message) : NULL; } void SC_set_errormsg(StatementClass *self, const char *message) { if (self->__error_message) free(self->__error_message); self->__error_message = message ? strdup(message) : NULL; } char SC_get_error(StatementClass *self, int *number, char **message) { char rv; /* Create a very informative errormsg if it hasn't been done yet. */ if ( ! self->errormsg_created) { self->__error_message = SC_create_errormsg(self); self->errormsg_created = TRUE; } if (self->__error_number) { *number = self->__error_number; *message = self->__error_message; self->__error_message = NULL; } rv = (self->__error_number != 0); self->__error_number = 0; return rv; } /* Currently, the driver offers very simple bookmark support -- it is just the current row number. But it could be more sophisticated someday, such as mapping a key to a 32 bit value */ unsigned long SC_get_bookmark(StatementClass *self) { return (self->currTuple + 1); } RETCODE SC_fetch(StatementClass *self) { static char* const func = "SC_fetch"; QResultClass *res = self->result; int retval, result; Int2 num_cols, lf; Oid type; char *value; ColumnInfoClass *ci; /* TupleField *tupleField; */ self->last_fetch_count = 0; ci = QR_get_fields(res); /* the column info */ mylog("manual_result = %d, use_declarefetch = %d\n", self->manual_result, globals.use_declarefetch); if ( self->manual_result || ! globals.use_declarefetch) { if (self->currTuple >= QR_get_num_tuples(res) -1 || (self->options.maxRows > 0 && self->currTuple == self->options.maxRows - 1)) { /* if at the end of the tuples, return "no data found" and set the cursor past the end of the result set */ self->currTuple = QR_get_num_tuples(res); return SQL_NO_DATA_FOUND; } mylog("**** SQLFetch: manual_result\n"); (self->currTuple)++; } else { /* read from the cache or the physical next tuple */ retval = QR_next_tuple(res); if (retval < 0) { mylog("**** SQLFetch: end_tuples\n"); return SQL_NO_DATA_FOUND; } else if (retval > 0) (self->currTuple)++; /* all is well */ else { mylog("SQLFetch: error\n"); SC_set_error(self, STMT_EXEC_ERROR, "Error fetching next row"); SC_log_error(func, "", self); return SQL_ERROR; } } num_cols = QR_NumResultCols(res); result = SQL_SUCCESS; self->last_fetch_count = 1; /* If the bookmark column was bound then return a bookmark. Since this is used with SQLExtendedFetch, and the rowset size may be greater than 1, and an application can use row or column wise binding, use the code in copy_and_convert_field() to handle that. */ if (self->bookmark.buffer) { char buf[32]; sprintf(buf, "%ld", SC_get_bookmark(self)); result = copy_and_convert_field(self, 0, buf, SQL_C_ULONG, self->bookmark.buffer, 0, self->bookmark.used); } for (lf=0; lf < num_cols; lf++) { mylog("fetch: cols=%d, lf=%d, self = %u, self->bindings = %u, buffer[] = %u\n", num_cols, lf, self, self->bindings, self->bindings[lf].buffer); /* reset for SQLGetData */ self->bindings[lf].data_left = -1; if (self->bindings[lf].buffer != NULL) { /* this column has a binding */ /* type = QR_get_field_type(res, lf); */ type = CI_get_oid(ci, lf); /* speed things up */ mylog("type = %d\n", type); if (self->manual_result) { value = QR_get_value_manual(res, self->currTuple, lf); mylog("manual_result\n"); } else if (globals.use_declarefetch) value = QR_get_value_backend(res, lf); else { value = QR_get_value_backend_row(res, self->currTuple, lf); } mylog("value = '%s'\n", (value==NULL)?"":value); retval = copy_and_convert_field_bindinfo(self, type, value, lf); mylog("copy_and_convert: retval = %d\n", retval); switch(retval) { case COPY_OK: break; /* OK, do next bound column */ case COPY_UNSUPPORTED_TYPE: SC_set_error(self, STMT_RESTRICTED_DATA_TYPE_ERROR, "Received an unsupported type from Postgres."); SC_log_error(func, "", self); result = SQL_ERROR; break; case COPY_UNSUPPORTED_CONVERSION: SC_set_error(self, STMT_RESTRICTED_DATA_TYPE_ERROR, "Couldn't handle the necessary data type conversion."); SC_log_error(func, "", self); result = SQL_ERROR; break; case COPY_RESULT_TRUNCATED: SC_set_error(self, STMT_TRUNCATED, "The buffer was too small for the result."); result = SQL_SUCCESS_WITH_INFO; break; case COPY_GENERAL_ERROR: /* error msg already filled in */ SC_log_error(func, "", self); result = SQL_ERROR; break; /* This would not be meaningful in SQLFetch. */ case COPY_NO_DATA_FOUND: break; default: SC_set_error(self, STMT_INTERNAL_ERROR, "Unrecognized return value from copy_and_convert_field."); SC_log_error(func, "", self); result = SQL_ERROR; break; } } } return result; } RETCODE SC_execute(StatementClass *self) { static char* const func="SC_execute"; ConnectionClass *conn; QResultClass *res; char ok, was_ok, was_nonfatal; Int2 oldstatus, numcols; QueryInfo qi; conn = SC_get_conn(self); /* Begin a transaction if one is not already in progress */ /* * Basically we don't have to begin a transaction in autocommit mode * because Postgres backend runs in autocomit mode. We issue "BEGIN" * in the following cases. 1) we use declare/fetch and the statement * is SELECT (because declare/fetch must be called in a transaction). * 2) we are in autocommit off state and the statement isn't of type * OTHER. */ if (!self->internal && !CC_is_in_trans(conn) && ((globals.use_declarefetch && self->statement_type == STMT_TYPE_SELECT) || (!CC_is_in_autocommit(conn) && self->statement_type != STMT_TYPE_OTHER))) { mylog(" about to begin a transaction on statement = %u\n", self); res = CC_send_query(conn, "BEGIN", NULL); if (QR_aborted(res)) { SC_set_error(self, STMT_EXEC_ERROR, "Could not begin a transaction"); SC_log_error(func, "", self); return SQL_ERROR; } ok = QR_command_successful(res); mylog("SQLExecute: ok = %d, status = %d\n", ok, QR_get_status(res)); QR_Destructor(res); if (!ok) { SC_set_error(self, STMT_EXEC_ERROR, "Could not begin a transaction"); SC_log_error(func, "", self); return SQL_ERROR; } else CC_set_in_trans(conn); } oldstatus = conn->status; conn->status = CONN_EXECUTING; self->status = STMT_EXECUTING; /* If it's a SELECT statement, use a cursor. */ /* Note that the declare cursor has already been prepended to the statement */ /* in copy_statement... */ if (self->statement_type == STMT_TYPE_SELECT) { char fetch[128]; mylog(" Sending SELECT statement on stmt=%u, cursor_name='%s'\n", self, self->cursor_name); /* send the declare/select */ self->result = CC_send_query(conn, self->stmt_with_params, NULL); if (globals.use_declarefetch && self->result != NULL && QR_command_successful(self->result)) { QR_Destructor(self->result); /* That worked, so now send the fetch to start getting data back */ qi.result_in = NULL; qi.cursor = self->cursor_name; qi.row_size = globals.fetch_max; /* Most likely the rowset size will not be set by the application until after the statement is executed, so might as well use the cache size. The qr_next_tuple() function will correct for any discrepancies in sizes and adjust the cache accordingly. */ sprintf(fetch, "fetch %d in %s", qi.row_size, self->cursor_name); self->result = CC_send_query( conn, fetch, &qi); } mylog(" done sending the query:\n"); } else { /* not a SELECT statement so don't use a cursor */ mylog(" it's NOT a select statement: stmt=%u\n", self); self->result = CC_send_query(conn, self->stmt_with_params, NULL); /* We shouldn't send COMMIT. Postgres backend does the autocommit if neccessary. (Zoltan, 04/26/2000) */ /* Above seems wrong. Even in case of autocommit, started transactions must be committed. (Hiroshi, 02/11/2001) */ if ( ! self->internal && CC_is_in_autocommit(conn) && CC_is_in_trans(conn)) { res = CC_send_query(conn, "COMMIT", NULL); QR_Destructor(res); CC_set_no_trans(conn); } } conn->status = oldstatus; self->status = STMT_FINISHED; /* Check the status of the result */ if (self->result) { was_ok = QR_command_successful(self->result); was_nonfatal = QR_command_nonfatal(self->result); if ( was_ok) SC_set_errornumber(self, STMT_OK); else SC_set_errornumber(self, was_nonfatal ? STMT_INFO_ONLY : STMT_ERROR_TAKEN_FROM_BACKEND); self->currTuple = -1; /* set cursor before the first tuple in the list */ self->current_col = -1; self->rowset_start = -1; /* see if the query did return any result columns */ numcols = QR_NumResultCols(self->result); /* now allocate the array to hold the binding info */ if (numcols > 0) { extend_bindings(self, numcols); if (self->bindings == NULL) { SC_set_error(self, STMT_NO_MEMORY_ERROR, "Could not get enough free memory to store the binding information"); SC_log_error(func, "", self); return SQL_ERROR; } } /* issue "ABORT" when query aborted */ if (QR_get_aborted(self->result) && ! self->internal ) CC_abort(conn); } else { /* Bad Error -- The error message will be in the Connection */ if (self->statement_type == STMT_TYPE_CREATE) { SC_set_error(self, STMT_CREATE_TABLE_ERROR, "Error creating the table"); /* This would allow the table to already exists, thus appending rows to it. BUT, if the table didn't have the same attributes, it would fail. return SQL_SUCCESS_WITH_INFO; */ } else { SC_set_error(self, STMT_EXEC_ERROR, "Error while executing the query"); } if ( ! self->internal) CC_abort(conn); } if (SC_get_errornumber(self) == STMT_OK) return SQL_SUCCESS; else { /* Modified, 2000-04-29, Zoltan */ if (SC_get_errornumber(self) == STMT_INFO_ONLY) SC_set_errormsg(self, "Error while executing the query (non-fatal)"); else SC_set_errormsg(self, "Unknown error"); SC_log_error(func, "", self); return SQL_ERROR; } } void SC_log_error(char *func, char *desc, StatementClass *self) { #ifdef PRN_NULLCHECK #define nullcheck(a) (a ? a : "(NULL)") #endif if (self) { qlog("STATEMENT ERROR: func=%s, desc='%s', errnum=%d, errmsg='%s'\n", func, desc, self->__error_number, nullcheck(self->__error_message)); mylog("STATEMENT ERROR: func=%s, desc='%s', errnum=%d, errmsg='%s'\n", func, desc, self->__error_number, nullcheck(self->__error_message)); qlog(" ------------------------------------------------------------\n"); qlog(" hdbc=%u, stmt=%u, result=%u\n", self->hdbc, self, self->result); qlog(" manual_result=%d, prepare=%d, internal=%d\n", self->manual_result, self->prepare, self->internal); qlog(" bindings=%u, bindings_allocated=%d\n", self->bindings, self->bindings_allocated); qlog(" parameters=%u, parameters_allocated=%d\n", self->parameters, self->parameters_allocated); qlog(" statement_type=%d, statement='%s'\n", self->statement_type, nullcheck(self->statement)); qlog(" stmt_with_params='%s'\n", nullcheck(self->stmt_with_params)); qlog(" data_at_exec=%d, current_exec_param=%d, put_data=%d\n", self->data_at_exec, self->current_exec_param, self->put_data); qlog(" currTuple=%d, current_col=%d, lobj_fd=%d\n", self->currTuple, self->current_col, self->lobj_fd); qlog(" maxRows=%d, rowset_size=%d, keyset_size=%d, cursor_type=%d, scroll_concurrency=%d\n", self->options.maxRows, self->options.rowset_size, self->options.keyset_size, self->options.cursor_type, self->options.scroll_concurrency); qlog(" cursor_name='%s'\n", nullcheck(self->cursor_name)); qlog(" ----------------QResult Info -------------------------------\n"); if (self->result) { QResultClass *res = self->result; qlog(" fields=%u, manual_tuples=%u, backend_tuples=%u, tupleField=%d, conn=%u\n", res->fields, res->manual_tuples, res->backend_tuples, res->tupleField, res->conn); qlog(" fetch_count=%d, fcount=%d, num_fields=%d, cursor='%s'\n", res->fetch_count, res->fcount, res->num_fields, nullcheck(res->cursor)); qlog(" message='%s', command='%s', notice='%s'\n", nullcheck(res->message), nullcheck(res->command), nullcheck(res->notice)); qlog(" status=%d, inTuples=%d\n", res->status, res->inTuples); } /* Log the connection error if there is one */ CC_log_error(func, desc, self->hdbc); } else qlog("INVALID STATEMENT HANDLE ERROR: func=%s, desc='%s'\n", func, desc); #undef PRN_NULLCHECK } unixODBC-2.3.9/Drivers/Postgre7.1/environ.c0000755000175000017500000003601712262474475015223 00000000000000 /* Module: environ.c * * Description: This module contains routines related to * the environment, such as storing connection handles, * and returning errors. * * Classes: EnvironmentClass (Functions prefix: "EN_") * * API functions: SQLAllocEnv, SQLFreeEnv, SQLError * * Comments: See "notice.txt" for copyright and license information. * */ #include #include #include "environ.h" #include "connection.h" #include "statement.h" #include #include #ifdef UNIXODBC #include #include #include "dlg_specific.h" #else #include "isql.h" #include "isqlext.h" #endif /* The one instance of the handles */ ConnectionClass *conns[MAX_CONNECTIONS]; RETCODE SQL_API SQLAllocEnv(HENV FAR *phenv) { static char* const func = "SQLAllocEnv"; mylog("**** in SQLAllocEnv ** \n"); /* * add this here from _init (NG) */ getGlobalDefaults(DBMS_NAME, ODBCINST_INI, FALSE); *phenv = (HENV) EN_Constructor(); if ( ! *phenv) { *phenv = SQL_NULL_HENV; EN_log_error(func, "Error allocating environment", NULL); return SQL_ERROR; } mylog("** exit SQLAllocEnv: phenv = %u **\n", *phenv); return SQL_SUCCESS; } RETCODE SQL_API SQLFreeEnv(HENV henv) { static char* const func = "SQLFreeEnv"; EnvironmentClass *env = (EnvironmentClass *) henv; mylog("**** in SQLFreeEnv: env = %u ** \n", env); if (env && EN_Destructor(env)) { mylog(" ok\n"); return SQL_SUCCESS; } mylog(" error\n"); EN_log_error(func, "Error freeing environment", env); return SQL_ERROR; } /* Returns the next SQL error information. */ SQLRETURN SQLError(SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt, SQLCHAR *szSqlState, SQLINTEGER *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT *pcbErrorMsg) { char *msg; int status; mylog("**** SQLError: henv=%u, hdbc=%u, hstmt=%u\n", henv, hdbc, hstmt); if (SQL_NULL_HSTMT != hstmt) { /* CC: return an error of a hstmt */ StatementClass *stmt = (StatementClass *) hstmt; if (SC_get_error(stmt, &status, &msg)) { mylog("SC_get_error: status = %d, msg = #%s#\n", status, msg); if (NULL == msg) { if (NULL != szSqlState) strcpy((char*)szSqlState, "00000"); if (NULL != pcbErrorMsg) *pcbErrorMsg = 0; if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) szErrorMsg[0] = '\0'; return SQL_NO_DATA_FOUND; } if (NULL != pcbErrorMsg) *pcbErrorMsg = (SWORD)strlen(msg); if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) strncpy_null((char*)szErrorMsg, msg, cbErrorMsgMax); if (NULL != pfNativeError) *pfNativeError = status; if (NULL != szSqlState) switch (status) { /* now determine the SQLSTATE to be returned */ case STMT_TRUNCATED: strcpy((char*)szSqlState, "01004"); /* data truncated */ break; case STMT_INFO_ONLY: strcpy((char*)szSqlState, "01000"); /* just information that is returned, no error */ break; case STMT_BAD_ERROR: strcpy((char*)szSqlState, "08S01"); /* communication link failure */ break; case STMT_CREATE_TABLE_ERROR: strcpy((char*)szSqlState, "S0001"); /* table already exists */ break; case STMT_STATUS_ERROR: case STMT_SEQUENCE_ERROR: strcpy((char*)szSqlState, "S1010"); /* Function sequence error */ break; case STMT_NO_MEMORY_ERROR: strcpy((char*)szSqlState, "S1001"); /* memory allocation failure */ break; case STMT_COLNUM_ERROR: strcpy((char*)szSqlState, "S1002"); /* invalid column number */ break; case STMT_NO_STMTSTRING: strcpy((char*)szSqlState, "S1001"); /* having no stmtstring is also a malloc problem */ break; case STMT_ERROR_TAKEN_FROM_BACKEND: strcpy((char*)szSqlState, "S1000"); /* general error */ break; case STMT_INTERNAL_ERROR: strcpy((char*)szSqlState, "S1000"); /* general error */ break; case STMT_ROW_OUT_OF_RANGE: strcpy((char*)szSqlState, "S1107"); break; case STMT_OPERATION_CANCELLED: strcpy((char*)szSqlState, "S1008"); break; case STMT_NOT_IMPLEMENTED_ERROR: strcpy((char*)szSqlState, "S1C00"); /* == 'driver not capable' */ break; case STMT_OPTION_OUT_OF_RANGE_ERROR: strcpy((char*)szSqlState, "S1092"); break; case STMT_BAD_PARAMETER_NUMBER_ERROR: strcpy((char*)szSqlState, "S1093"); break; case STMT_INVALID_COLUMN_NUMBER_ERROR: strcpy((char*)szSqlState, "S1002"); break; case STMT_RESTRICTED_DATA_TYPE_ERROR: strcpy((char*)szSqlState, "07006"); break; case STMT_INVALID_CURSOR_STATE_ERROR: strcpy((char*)szSqlState, "24000"); break; case STMT_OPTION_VALUE_CHANGED: strcpy((char*)szSqlState, "01S02"); break; case STMT_INVALID_CURSOR_NAME: strcpy((char*)szSqlState, "34000"); break; case STMT_NO_CURSOR_NAME: strcpy((char*)szSqlState, "S1015"); break; case STMT_INVALID_ARGUMENT_NO: strcpy((char*)szSqlState, "S1009"); /* invalid argument value */ break; case STMT_INVALID_CURSOR_POSITION: strcpy((char*)szSqlState, "S1109"); break; case STMT_VALUE_OUT_OF_RANGE: strcpy((char*)szSqlState, "22003"); break; case STMT_OPERATION_INVALID: strcpy((char*)szSqlState, "S1011"); break; case STMT_EXEC_ERROR: default: strcpy((char*)szSqlState, "S1000"); /* also a general error */ break; } mylog(" szSqlState = '%s', szError='%s'\n", szSqlState, szErrorMsg); } else { if (NULL != szSqlState) strcpy((char*)szSqlState, "00000"); if (NULL != pcbErrorMsg) *pcbErrorMsg = 0; if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) szErrorMsg[0] = '\0'; mylog(" returning NO_DATA_FOUND\n"); return SQL_NO_DATA_FOUND; } return SQL_SUCCESS; } else if (SQL_NULL_HDBC != hdbc) { ConnectionClass *conn = (ConnectionClass *) hdbc; mylog("calling CC_get_error\n"); if (CC_get_error(conn, &status, &msg)) { mylog("CC_get_error: status = %d, msg = #%s#\n", status, msg); if (NULL == msg) { if (NULL != szSqlState) strcpy((char*)szSqlState, "00000"); if (NULL != pcbErrorMsg) *pcbErrorMsg = 0; if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) szErrorMsg[0] = '\0'; return SQL_NO_DATA_FOUND; } if (NULL != pcbErrorMsg) *pcbErrorMsg = (SWORD)strlen(msg); if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) strncpy_null((char*)szErrorMsg, msg, cbErrorMsgMax); if (NULL != pfNativeError) *pfNativeError = status; if (NULL != szSqlState) switch(status) { case STMT_OPTION_VALUE_CHANGED: case CONN_OPTION_VALUE_CHANGED: strcpy((char*)szSqlState, "01S02"); break; case STMT_TRUNCATED: case CONN_TRUNCATED: strcpy((char*)szSqlState, "01004"); /* data truncated */ break; case CONN_INIREAD_ERROR: strcpy((char*)szSqlState, "IM002"); /* data source not found */ break; case CONN_OPENDB_ERROR: strcpy((char*)szSqlState, "08001"); /* unable to connect to data source */ break; case CONN_INVALID_AUTHENTICATION: case CONN_AUTH_TYPE_UNSUPPORTED: strcpy((char*)szSqlState, "28000"); break; case CONN_STMT_ALLOC_ERROR: strcpy((char*)szSqlState, "S1001"); /* memory allocation failure */ break; case CONN_IN_USE: strcpy((char*)szSqlState, "S1000"); /* general error */ break; case CONN_UNSUPPORTED_OPTION: strcpy((char*)szSqlState, "IM001"); /* driver does not support this function */ case CONN_INVALID_ARGUMENT_NO: strcpy((char*)szSqlState, "S1009"); /* invalid argument value */ break; case CONN_TRANSACT_IN_PROGRES: strcpy((char*)szSqlState, "S1010"); /* when the user tries to switch commit mode in a transaction */ /* -> function sequence error */ break; case CONN_NO_MEMORY_ERROR: strcpy((char*)szSqlState, "S1001"); break; case CONN_NOT_IMPLEMENTED_ERROR: case STMT_NOT_IMPLEMENTED_ERROR: strcpy((char*)szSqlState, "S1C00"); break; case CONN_VALUE_OUT_OF_RANGE: case STMT_VALUE_OUT_OF_RANGE: strcpy((char*)szSqlState, "22003"); break; default: strcpy((char*)szSqlState, "S1000"); /* general error */ break; } } else { mylog("CC_Get_error returned nothing.\n"); if (NULL != szSqlState) strcpy((char*)szSqlState, "00000"); if (NULL != pcbErrorMsg) *pcbErrorMsg = 0; if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) szErrorMsg[0] = '\0'; return SQL_NO_DATA_FOUND; } return SQL_SUCCESS; } else if (SQL_NULL_HENV != henv) { EnvironmentClass *env = (EnvironmentClass *)henv; if(EN_get_error(env, &status, &msg)) { mylog("EN_get_error: status = %d, msg = #%s#\n", status, msg); if (NULL == msg) { if (NULL != szSqlState) strcpy((char*)szSqlState, "00000"); if (NULL != pcbErrorMsg) *pcbErrorMsg = 0; if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) szErrorMsg[0] = '\0'; return SQL_NO_DATA_FOUND; } if (NULL != pcbErrorMsg) *pcbErrorMsg = (SWORD)strlen(msg); if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) strncpy_null((char*)szErrorMsg, msg, cbErrorMsgMax); if (NULL != pfNativeError) *pfNativeError = status; if(szSqlState) { switch(status) { case ENV_ALLOC_ERROR: /* memory allocation failure */ strcpy((char*)szSqlState, "S1001"); break; default: strcpy((char*)szSqlState, "S1000"); /* general error */ break; } } } else { if (NULL != szSqlState) strcpy((char*)szSqlState, "00000"); if (NULL != pcbErrorMsg) *pcbErrorMsg = 0; if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) szErrorMsg[0] = '\0'; return SQL_NO_DATA_FOUND; } return SQL_SUCCESS; } if (NULL != szSqlState) strcpy((char*)szSqlState, "00000"); if (NULL != pcbErrorMsg) *pcbErrorMsg = 0; if ((NULL != szErrorMsg) && (cbErrorMsgMax > 0)) szErrorMsg[0] = '\0'; return SQL_NO_DATA_FOUND; } /*********************************************************************/ /* * EnvironmentClass implementation */ EnvironmentClass *EN_Constructor(void) { EnvironmentClass *rv; rv = (EnvironmentClass *) malloc(sizeof(EnvironmentClass)); if( rv) { rv->errormsg = 0; rv->errornumber = 0; } return rv; } char EN_Destructor(EnvironmentClass *self) { int lf; char rv = 1; mylog("in EN_Destructor, self=%u\n", self); /* the error messages are static strings distributed throughout */ /* the source--they should not be freed */ /* Free any connections belonging to this environment */ for (lf = 0; lf < MAX_CONNECTIONS; lf++) { if (conns[lf] && conns[lf]->henv == (HENV) self) rv = rv && CC_Destructor(conns[lf]); } free( self ); mylog("exit EN_Destructor: rv = %d\n", rv); return rv; } char EN_get_error(EnvironmentClass *self, int *number, char **message) { if(self && self->errormsg && self->errornumber) { *message = self->errormsg; *number = self->errornumber; self->errormsg = 0; self->errornumber = 0; return 1; } else { return 0; } } char EN_add_connection(EnvironmentClass *self, ConnectionClass *conn) { int i; mylog("EN_add_connection: self = %u, conn = %u\n", self, conn); for (i = 0; i < MAX_CONNECTIONS; i++) { if ( ! conns[i]) { conn->henv = (HENV)self; conns[i] = conn; mylog(" added at i =%d, conn->henv = %u, conns[i]->henv = %u\n", i, conn->henv, conns[i]->henv); return TRUE; } } return FALSE; } char EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn) { int i; for (i = 0; i < MAX_CONNECTIONS; i++) if (conns[i] == conn && conns[i]->status != CONN_EXECUTING) { conns[i] = NULL; return TRUE; } return FALSE; } void EN_log_error(char *func, char *desc, EnvironmentClass *self) { if (self) { qlog("ENVIRON ERROR: func=%s, desc='%s', errnum=%d, errmsg='%s'\n", func, desc, self->errornumber, self->errormsg); } else qlog("INVALID ENVIRON HANDLE ERROR: func=%s, desc='%s'\n", func, desc); } unixODBC-2.3.9/Drivers/Postgre7.1/columninfo.h0000755000175000017500000000257612262474475015724 00000000000000 /* File: columninfo.h * * Description: See "columninfo.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __COLUMNINFO_H__ #define __COLUMNINFO_H__ #include "psqlodbc.h" struct ColumnInfoClass_ { Int2 num_fields; char **name; /* list of type names */ Oid *adtid; /* list of type ids */ Int2 *adtsize; /* list type sizes */ Int2 *display_size; /* the display size (longest row) */ Int4 *atttypmod; /* the length of bpchar/varchar */ }; #define CI_get_num_fields(self) ((self) ? (self->num_fields) : (-1)) #define CI_get_oid(self, col) (self->adtid[col]) #define CI_get_fieldname(self, col) (self->name[col]) #define CI_get_fieldsize(self, col) (self->adtsize[col]) #define CI_get_display_size(self, col) (self->display_size[col]) #define CI_get_atttypmod(self, col) (self->atttypmod[col]) ColumnInfoClass *CI_Constructor(void); void CI_Destructor(ColumnInfoClass *self); void CI_free_memory(ColumnInfoClass *self); char CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn); /* functions for setting up the fields from within the program, */ /* without reading from a socket */ void CI_set_num_fields(ColumnInfoClass *self, int new_num_fields); void CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name, Oid new_adtid, Int2 new_adtsize, Int4 atttypmod); #endif unixODBC-2.3.9/Drivers/Postgre7.1/bind.h0000755000175000017500000000221412262474475014454 00000000000000 /* File: bind.h * * Description: See "bind.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __BIND_H__ #define __BIND_H__ #include "psqlodbc.h" /* * BindInfoClass -- stores information about a bound column */ struct BindInfoClass_ { Int4 buflen; /* size of buffer */ Int4 data_left; /* amount of data left to read (SQLGetData) */ char *buffer; /* pointer to the buffer */ SQLLEN *used; /* used space in the buffer (for strings not counting the '\0') */ Int2 returntype; /* kind of conversion to be applied when returning (SQL_C_DEFAULT, SQL_C_CHAR...) */ }; /* * ParameterInfoClass -- stores information about a bound parameter */ struct ParameterInfoClass_ { Int4 buflen; char *buffer; SQLLEN *used; Int2 paramType; Int2 CType; Int2 SQLType; UInt4 precision; Int2 scale; Oid lobj_oid; Int4 *EXEC_used; /* amount of data OR the oid of the large object */ char *EXEC_buffer; /* the data or the FD of the large object */ char data_at_exec; }; BindInfoClass *create_empty_bindings(int num_columns); void extend_bindings(StatementClass *stmt, int num_columns); #endif unixODBC-2.3.9/Drivers/Postgre7.1/resource.h0000755000175000017500000000471312262474475015375 00000000000000/* {{NO_DEPENDENCIES}} */ /* Microsoft Developer Studio generated include file. */ /* Used by psqlodbc.rc */ #define IDS_BADDSN 1 #define IDS_MSGTITLE 2 #define DLG_OPTIONS_DRV 102 #define DLG_OPTIONS_DS 103 #define IDC_DSNAME 400 #define IDC_DSNAMETEXT 401 #define IDC_DESC 404 #define IDC_SERVER 407 #define IDC_DATABASE 408 #define DLG_CONFIG 1001 #define IDC_PORT 1002 #define IDC_USER 1006 #define IDC_PASSWORD 1009 #define DS_READONLY 1011 #define DS_SHOWOIDCOLUMN 1012 #define DS_FAKEOIDINDEX 1013 #define DRV_COMMLOG 1014 #define DS_PG62 1016 #define IDC_DATASOURCE 1018 #define DRV_OPTIMIZER 1019 #define DS_CONNSETTINGS 1020 #define IDC_DRIVER 1021 #define DRV_CONNSETTINGS 1031 #define DRV_UNIQUEINDEX 1032 #define DRV_UNKNOWN_MAX 1035 #define DRV_UNKNOWN_DONTKNOW 1036 #define DRV_READONLY 1037 #define IDC_DESCTEXT 1039 #define DRV_MSG_LABEL 1040 #define DRV_UNKNOWN_LONGEST 1041 #define DRV_TEXT_LONGVARCHAR 1043 #define DRV_UNKNOWNS_LONGVARCHAR 1044 #define DRV_CACHE_SIZE 1045 #define DRV_VARCHAR_SIZE 1046 #define DRV_LONGVARCHAR_SIZE 1047 #define IDDEFAULTS 1048 #define DRV_USEDECLAREFETCH 1049 #define DRV_BOOLS_CHAR 1050 #define DS_SHOWSYSTEMTABLES 1051 #define DRV_EXTRASYSTABLEPREFIXES 1051 #define DS_ROWVERSIONING 1052 #define DRV_PARSE 1052 #define DRV_CANCELASFREESTMT 1053 #define IDC_OPTIONS 1054 #define DRV_KSQO 1055 #define DS_PG64 1057 #define DS_PG63 1058 /* Next default values for new objects */ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 104 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1060 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif unixODBC-2.3.9/Drivers/Postgre7.1/lobj.c0000755000175000017500000000606412262474475014470 00000000000000 /* Module: lobj.c * * Description: This module contains routines related to manipulating * large objects. * * Classes: none * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "lobj.h" #include "psqlodbc.h" #include "connection.h" Oid odbc_lo_creat(ConnectionClass *conn, int mode) { LO_ARG argv[1]; int retval, result_len; argv[0].isint = 1; argv[0].len = 4; argv[0].u.integer = mode; if ( ! CC_send_function(conn, LO_CREAT, &retval, &result_len, 1, argv, 1)) return 0; /* invalid oid */ else return retval; } int odbc_lo_open(ConnectionClass *conn, int lobjId, int mode) { int fd; int result_len; LO_ARG argv[2]; argv[0].isint = 1; argv[0].len = 4; argv[0].u.integer = lobjId; argv[1].isint = 1; argv[1].len = 4; argv[1].u.integer = mode; if ( ! CC_send_function(conn, LO_OPEN, &fd, &result_len, 1, argv, 2)) return -1; if (fd >= 0 && odbc_lo_lseek(conn, fd, 0L, SEEK_SET) < 0) return -1; return fd; } int odbc_lo_close(ConnectionClass *conn, int fd) { LO_ARG argv[1]; int retval, result_len; argv[0].isint = 1; argv[0].len = 4; argv[0].u.integer = fd; if ( ! CC_send_function(conn, LO_CLOSE, &retval, &result_len, 1, argv, 1)) return -1; else return retval; } int odbc_lo_read(ConnectionClass *conn, int fd, char *buf, int len) { LO_ARG argv[2]; int result_len; argv[0].isint = 1; argv[0].len = 4; argv[0].u.integer = fd; argv[1].isint = 1; argv[1].len = 4; argv[1].u.integer = len; if ( ! CC_send_function(conn, LO_READ, (int *) buf, &result_len, 0, argv, 2)) return -1; else return result_len; } int odbc_lo_write(ConnectionClass *conn, int fd, char *buf, int len) { LO_ARG argv[2]; int retval, result_len; if (len <= 0) return 0; argv[0].isint = 1; argv[0].len = 4; argv[0].u.integer = fd; argv[1].isint = 0; argv[1].len = len; argv[1].u.ptr = (char *) buf; if ( ! CC_send_function(conn, LO_WRITE, &retval, &result_len, 1, argv, 2)) return -1; else return retval; } int odbc_lo_lseek(ConnectionClass *conn, int fd, int offset, int whence) { LO_ARG argv[3]; int retval, result_len; argv[0].isint = 1; argv[0].len = 4; argv[0].u.integer = fd; argv[1].isint = 1; argv[1].len = 4; argv[1].u.integer = offset; argv[2].isint = 1; argv[2].len = 4; argv[2].u.integer = whence; if ( ! CC_send_function(conn, LO_LSEEK, &retval, &result_len, 1, argv, 3)) return -1; else return retval; } int odbc_lo_tell(ConnectionClass *conn, int fd) { LO_ARG argv[1]; int retval, result_len; argv[0].isint = 1; argv[0].len = 4; argv[0].u.integer = fd; if ( ! CC_send_function(conn, LO_TELL, &retval, &result_len, 1, argv, 1)) return -1; else return retval; } int odbc_lo_unlink(ConnectionClass *conn, Oid lobjId) { LO_ARG argv[1]; int retval, result_len; argv[0].isint = 1; argv[0].len = 4; argv[0].u.integer = lobjId; if ( ! CC_send_function(conn, LO_UNLINK, &retval, &result_len, 1, argv, 1)) return -1; else return retval; } unixODBC-2.3.9/Drivers/Postgre7.1/execute.c0000755000175000017500000005266512262474475015214 00000000000000 /* Module: execute.c * * Description: This module contains routines related to * preparing and executing an SQL statement. * * Classes: n/a * * API functions: SQLPrepare, SQLExecute, SQLExecDirect, SQLTransact, * SQLCancel, SQLNativeSql, SQLParamData, SQLPutData * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "psqlodbc.h" #include #include #ifndef WIN32 #include "isqlext.h" #else #include #include #endif #include "connection.h" #include "statement.h" #include "qresult.h" #include "convert.h" #include "bind.h" #include "lobj.h" extern GLOBAL_VALUES globals; RETCODE SQL_API PG_SQLExecute( HSTMT hstmt); SQLRETURN PG_SQLPrepare(SQLHSTMT hstmt, SQLCHAR *szSqlStr , SQLINTEGER cbSqlStr); SQLRETURN SQLPrepare(SQLHSTMT hstmt, SQLCHAR *szSqlStr , SQLINTEGER cbSqlStr) { return PG_SQLPrepare( hstmt, szSqlStr, cbSqlStr ); } /* Perform a Prepare on the SQL statement */ SQLRETURN PG_SQLPrepare(SQLHSTMT hstmt, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStr) { static char* const func = "SQLPrepare"; StatementClass *self = (StatementClass *) hstmt; int sqllen = 0; /* used for MAX_ROWS if specified */ int limlen = 0; char buffer[32]; mylog( "%s: entering...\n", func); if ( ! self) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } /* According to the ODBC specs it is valid to call SQLPrepare mulitple times. In that case, the bound SQL statement is replaced by the new one */ switch(self->status) { case STMT_PREMATURE: mylog("**** SQLPrepare: STMT_PREMATURE, recycle\n"); SC_recycle_statement(self); /* recycle the statement, but do not remove parameter bindings */ break; case STMT_FINISHED: mylog("**** SQLPrepare: STMT_FINISHED, recycle\n"); SC_recycle_statement(self); /* recycle the statement, but do not remove parameter bindings */ break; case STMT_ALLOCATED: mylog("**** SQLPrepare: STMT_ALLOCATED, copy\n"); self->status = STMT_READY; break; case STMT_READY: mylog("**** SQLPrepare: STMT_READY, change SQL\n"); break; case STMT_EXECUTING: mylog("**** SQLPrepare: STMT_EXECUTING, error!\n"); SC_set_error(self, STMT_SEQUENCE_ERROR, "SQLPrepare(): The handle does not point to a statement that is ready to be executed"); SC_log_error(func, "", self); return SQL_ERROR; default: SC_set_error(self, STMT_INTERNAL_ERROR, "An Internal Error has occured -- Unknown statement status."); SC_log_error(func, "", self); return SQL_ERROR; } if (self->statement) free(self->statement); self->statement_type = statement_type((char*)szSqlStr); if (self->statement_type == STMT_TYPE_SELECT && 0 != self->options.maxRows) { limlen = sprintf(buffer," LIMIT %d", self->options.maxRows); } sqllen = my_strlen((char*)szSqlStr, cbSqlStr) + limlen; self->statement = make_string((char*)szSqlStr, sqllen, NULL); if ( ! self->statement) { SC_set_error(self, STMT_NO_MEMORY_ERROR, "No memory available to store statement"); SC_log_error(func, "", self); return SQL_ERROR; } if (self->statement_type == STMT_TYPE_SELECT && 0 != self->options.maxRows) { strcat(self->statement, buffer); } self->prepare = TRUE; /* Check if connection is onlyread (only selects are allowed) */ if ( CC_is_onlyread(self->hdbc) && STMT_UPDATE(self)) { SC_set_error(self, STMT_EXEC_ERROR, "Connection is readonly, only select statements are allowed."); SC_log_error(func, "", self); return SQL_ERROR; } return SQL_SUCCESS; } /* - - - - - - - - - */ /* Performs the equivalent of SQLPrepare, followed by SQLExecute. */ RETCODE SQL_API PG_SQLExecDirect( HSTMT hstmt, UCHAR FAR *szSqlStr, SDWORD cbSqlStr) { StatementClass *stmt = (StatementClass *) hstmt; RETCODE result; static char* const func = "SQLExecDirect"; mylog( "%s: entering...\n", func); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if (stmt->statement) free(stmt->statement); /* keep a copy of the un-parametrized statement, in case */ /* they try to execute this statement again */ stmt->statement = make_string((char*)szSqlStr, cbSqlStr, NULL); if ( ! stmt->statement) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "No memory available to store statement"); SC_log_error(func, "", stmt); return SQL_ERROR; } mylog("**** %s: hstmt=%u, statement='%s'\n", func, hstmt, stmt->statement); stmt->prepare = FALSE; /* If an SQLPrepare was performed prior to this, but was left in */ /* the premature state because an error occurred prior to SQLExecute */ /* then set the statement to finished so it can be recycled. */ if ( stmt->status == STMT_PREMATURE ) stmt->status = STMT_FINISHED; stmt->statement_type = statement_type(stmt->statement); /* Check if connection is onlyread (only selects are allowed) */ if ( CC_is_onlyread(stmt->hdbc) && STMT_UPDATE(stmt)) { SC_set_error(stmt, STMT_EXEC_ERROR, "Connection is readonly, only select statements are allowed."); SC_log_error(func, "", stmt); return SQL_ERROR; } mylog("%s: calling SQLExecute...\n", func); result = PG_SQLExecute(hstmt); mylog("%s: returned %hd from SQLExecute\n", func, result); return result; } SQLRETURN SQLExecDirect(SQLHSTMT hstmt, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStr) { return PG_SQLExecDirect( hstmt, szSqlStr, cbSqlStr ); } /* Execute a prepared SQL statement */ RETCODE SQL_API PG_SQLExecute( HSTMT hstmt) { static char* const func="SQLExecute"; StatementClass *stmt = (StatementClass *) hstmt; ConnectionClass *conn; int i, retval; mylog("%s: entering...\n", func); if ( ! stmt) { SC_log_error(func, "", NULL); mylog("%s: NULL statement so return SQL_INVALID_HANDLE\n", func); return SQL_INVALID_HANDLE; } /* If the statement is premature, it means we already executed it from an SQLPrepare/SQLDescribeCol type of scenario. So just return success. */ if ( stmt->prepare && stmt->status == STMT_PREMATURE && !stmt->reexecute ) { stmt->status = STMT_FINISHED; if (NULL == SC_get_errormsg(stmt)) { mylog("%s: premature statement but return SQL_SUCCESS\n", func); return SQL_SUCCESS; } else { SC_log_error(func, "", stmt); mylog("%s: premature statement so return SQL_ERROR\n", func); return SQL_ERROR; } } else if ( stmt->prepare && stmt->status == STMT_PREMATURE && stmt->reexecute ) { /* * cause it to be reexecuted */ char *str; str = strdup( stmt->statement ); stmt->status = STMT_FINISHED; PG_SQLPrepare( hstmt, (SQLCHAR*) str, SQL_NTS ); free( str ); } mylog("%s: clear errors...\n", func); SC_clear_error(stmt); conn = SC_get_conn(stmt); if (conn->status == CONN_EXECUTING) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Connection is already in use."); SC_log_error(func, "", stmt); mylog("%s: problem with connection\n", func); return SQL_ERROR; } if ( ! stmt->statement) { SC_set_error(stmt, STMT_NO_STMTSTRING, "This handle does not have a SQL statement stored in it"); SC_log_error(func, "", stmt); mylog("%s: problem with handle\n", func); return SQL_ERROR; } /* If SQLExecute is being called again, recycle the statement. Note this should have been done by the application in a call to SQLFreeStmt(SQL_CLOSE) or SQLCancel. */ if (stmt->status == STMT_FINISHED) { mylog("%s: recycling statement (should have been done by app)...\n", func); SC_recycle_statement(stmt); } /* Check if the statement is in the correct state */ if ((stmt->prepare && stmt->status != STMT_READY) || (stmt->status != STMT_ALLOCATED && stmt->status != STMT_READY)) { SC_set_error(stmt, STMT_STATUS_ERROR, "The handle does not point to a statement that is ready to be executed"); SC_log_error(func, "", stmt); mylog("%s: problem with statement\n", func); return SQL_ERROR; } /* The bound parameters could have possibly changed since the last execute of this statement? Therefore check for params and re-copy. */ stmt->data_at_exec = -1; for (i = 0; i < stmt->parameters_allocated; i++) { /* Check for data at execution parameters */ if ( stmt->parameters[i].data_at_exec == TRUE) { if (stmt->data_at_exec < 0) stmt->data_at_exec = 1; else stmt->data_at_exec++; } } /* If there are some data at execution parameters, return need data */ /* SQLParamData and SQLPutData will be used to send params and execute the statement. */ if (stmt->data_at_exec > 0) return SQL_NEED_DATA; mylog("%s: copying statement params: trans_status=%d, len=%d, stmt='%s'\n", func, conn->transact_status, strlen(stmt->statement), stmt->statement); /* Create the statement with parameters substituted. */ retval = copy_statement_with_parameters(stmt); if( retval != SQL_SUCCESS) /* error msg passed from above */ return retval; mylog(" stmt_with_params = '%s'\n", stmt->stmt_with_params); return SC_execute(stmt); } RETCODE SQL_API SQLExecute( HSTMT hstmt) { return PG_SQLExecute( hstmt ); } /* - - - - - - - - - */ RETCODE SQL_API SQLTransact( HENV henv, HDBC hdbc, UWORD fType) { static char* const func = "SQLTransact"; extern ConnectionClass *conns[]; ConnectionClass *conn; QResultClass *res; char ok, *stmt_string; int lf; mylog("entering %s: hdbc=%u, henv=%u\n", func, hdbc, henv); if (hdbc == SQL_NULL_HDBC && henv == SQL_NULL_HENV) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } /* If hdbc is null and henv is valid, it means transact all connections on that henv. */ if (hdbc == SQL_NULL_HDBC && henv != SQL_NULL_HENV) { for (lf=0; lf henv == henv) if ( SQLTransact(henv, (HDBC) conn, fType) != SQL_SUCCESS) return SQL_ERROR; } return SQL_SUCCESS; } conn = (ConnectionClass *) hdbc; if (fType == SQL_COMMIT) { stmt_string = "COMMIT"; } else if (fType == SQL_ROLLBACK) { stmt_string = "ROLLBACK"; } else { CC_set_error(conn, CONN_INVALID_ARGUMENT_NO, "SQLTransact can only be called with SQL_COMMIT or SQL_ROLLBACK as parameter"); CC_log_error(func, "", conn); return SQL_ERROR; } /* If manual commit and in transaction, then proceed. */ if ( ! CC_is_in_autocommit(conn) && CC_is_in_trans(conn)) { mylog("SQLTransact: sending on conn %d '%s'\n", conn, stmt_string); res = CC_send_query(conn, stmt_string, NULL); CC_set_no_trans(conn); if ( ! res) { /* error msg will be in the connection */ CC_log_error(func, "", conn); return SQL_ERROR; } ok = QR_command_successful(res); QR_Destructor(res); if (!ok) { CC_log_error(func, "", conn); return SQL_ERROR; } } return SQL_SUCCESS; } /* - - - - - - - - - */ RETCODE SQL_API SQLCancel( HSTMT hstmt) /* Statement to cancel. */ { static char* const func="SQLCancel"; StatementClass *stmt = (StatementClass *) hstmt; RETCODE result; #ifdef WIN32 HMODULE hmodule; FARPROC addr; #endif mylog( "%s: entering...\n", func); /* Check if this can handle canceling in the middle of a SQLPutData? */ if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } /* Not in the middle of SQLParamData/SQLPutData so cancel like a close. */ if (stmt->data_at_exec < 0) { /* MAJOR HACK for Windows to reset the driver manager's cursor state: Because of what seems like a bug in the Odbc driver manager, SQLCancel does not act like a SQLFreeStmt(CLOSE), as many applications depend on this behavior. So, this brute force method calls the driver manager's function on behalf of the application. */ #ifdef WIN32 if (globals.cancel_as_freestmt) { hmodule = GetModuleHandle("ODBC32"); addr = GetProcAddress(hmodule, "SQLFreeStmt"); result = addr( (char *) (stmt->phstmt) - 96, SQL_CLOSE); } else { result = PG_SQLFreeStmt( hstmt, SQL_CLOSE); } #else result = PG_SQLFreeStmt( hstmt, SQL_CLOSE); #endif mylog("SQLCancel: SQLFreeStmt returned %d\n", result); SC_clear_error(hstmt); return SQL_SUCCESS; } /* In the middle of SQLParamData/SQLPutData, so cancel that. */ /* Note, any previous data-at-exec buffers will be freed in the recycle */ /* if they call SQLExecDirect or SQLExecute again. */ stmt->data_at_exec = -1; stmt->current_exec_param = -1; stmt->put_data = FALSE; return SQL_SUCCESS; } /* - - - - - - - - - */ /* Returns the SQL string as modified by the driver. */ /* Currently, just copy the input string without modification */ /* observing buffer limits and truncation. */ SQLRETURN SQLNativeSql( SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR *szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr) { static char* const func="SQLNativeSql"; int len = 0; char *ptr; ConnectionClass *conn = (ConnectionClass *) hdbc; RETCODE result; mylog( "%s: entering...cbSqlStrIn=%d\n", func, cbSqlStrIn); ptr = (cbSqlStrIn == 0) ? "" : make_string((char*)szSqlStrIn, cbSqlStrIn, NULL); if ( ! ptr) { CC_set_error(conn, CONN_NO_MEMORY_ERROR, "No memory available to store native sql string"); CC_log_error(func, "", conn); return SQL_ERROR; } result = SQL_SUCCESS; len = strlen(ptr); if (szSqlStr) { strncpy_null((char*)szSqlStr, ptr, cbSqlStrMax); if (len >= cbSqlStrMax) { result = SQL_SUCCESS_WITH_INFO; CC_set_error(conn, STMT_TRUNCATED, "The buffer was too small for the result."); } } if (pcbSqlStr) *pcbSqlStr = len; free(ptr); return result; } /* - - - - - - - - - */ /* Supplies parameter data at execution time. Used in conjuction with */ /* SQLPutData. */ RETCODE SQL_API SQLParamData( HSTMT hstmt, PTR FAR *prgbValue) { static char* const func = "SQLParamData"; StatementClass *stmt = (StatementClass *) hstmt; int i, retval; mylog( "%s: entering...\n", func); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } mylog("%s: data_at_exec=%d, params_alloc=%d\n", func, stmt->data_at_exec, stmt->parameters_allocated); if (stmt->data_at_exec < 0) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "No execution-time parameters for this statement"); SC_log_error(func, "", stmt); return SQL_ERROR; } if (stmt->data_at_exec > stmt->parameters_allocated) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Too many execution-time parameters were present"); SC_log_error(func, "", stmt); return SQL_ERROR; } /* close the large object */ if ( stmt->lobj_fd >= 0) { odbc_lo_close(stmt->hdbc, stmt->lobj_fd); /* commit transaction if needed */ if (!globals.use_declarefetch && CC_is_in_autocommit(stmt->hdbc)) { QResultClass *res; char ok; res = CC_send_query(stmt->hdbc, "COMMIT", NULL); if (!res) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction"); SC_log_error(func, "", stmt); return SQL_ERROR; } ok = QR_command_successful(res); QR_Destructor(res); if (!ok) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction"); SC_log_error(func, "", stmt); return SQL_ERROR; } CC_set_no_trans(stmt->hdbc); } stmt->lobj_fd = -1; } /* Done, now copy the params and then execute the statement */ if (stmt->data_at_exec == 0) { retval = copy_statement_with_parameters(stmt); if (retval != SQL_SUCCESS) return retval; stmt->current_exec_param = -1; return SC_execute(stmt); } /* Set beginning param; if first time SQLParamData is called , start at 0. Otherwise, start at the last parameter + 1. */ i = stmt->current_exec_param >= 0 ? stmt->current_exec_param+1 : 0; /* At least 1 data at execution parameter, so Fill in the token value */ for ( ; i < stmt->parameters_allocated; i++) { if (stmt->parameters[i].data_at_exec == TRUE) { stmt->data_at_exec--; stmt->current_exec_param = i; stmt->put_data = FALSE; *prgbValue = stmt->parameters[i].buffer; /* token */ break; } } return SQL_NEED_DATA; } /* - - - - - - - - - */ /* Supplies parameter data at execution time. Used in conjunction with */ /* SQLParamData. */ SQLRETURN SQLPutData(SQLHSTMT hstmt, SQLPOINTER rgbValue, SQLLEN cbValue) { static char* const func = "SQLPutData"; StatementClass *stmt = (StatementClass *) hstmt; int old_pos, retval; ParameterInfoClass *current_param; char *buffer; mylog( "%s: entering...\n", func); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if (stmt->current_exec_param < 0) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Previous call was not SQLPutData or SQLParamData"); SC_log_error(func, "", stmt); return SQL_ERROR; } current_param = &(stmt->parameters[stmt->current_exec_param]); if ( ! stmt->put_data) { /* first call */ mylog("SQLPutData: (1) cbValue = %d\n", cbValue); stmt->put_data = TRUE; current_param->EXEC_used = malloc(sizeof(SDWORD)); if ( ! current_param->EXEC_used) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Out of memory in SQLPutData (1)"); SC_log_error(func, "", stmt); return SQL_ERROR; } *current_param->EXEC_used = cbValue; if (cbValue == SQL_NULL_DATA) return SQL_SUCCESS; /* Handle Long Var Binary with Large Objects */ if ( current_param->SQLType == SQL_LONGVARBINARY) { /* begin transaction if needed */ if(!CC_is_in_trans(stmt->hdbc)) { QResultClass *res; char ok; res = CC_send_query(stmt->hdbc, "BEGIN", NULL); if (!res) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not begin (in-line) a transaction"); SC_log_error(func, "", stmt); return SQL_ERROR; } ok = QR_command_successful(res); QR_Destructor(res); if (!ok) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not begin (in-line) a transaction"); SC_log_error(func, "", stmt); return SQL_ERROR; } CC_set_in_trans(stmt->hdbc); } /* store the oid */ current_param->lobj_oid = odbc_lo_creat(stmt->hdbc, INV_READ | INV_WRITE); if (current_param->lobj_oid == 0) { SC_set_error(stmt, STMT_EXEC_ERROR, "Couldnt create large object."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* major hack -- to allow convert to see somethings there */ /* have to modify convert to handle this better */ current_param->EXEC_buffer = (char *) ¤t_param->lobj_oid; /* store the fd */ stmt->lobj_fd = odbc_lo_open(stmt->hdbc, current_param->lobj_oid, INV_WRITE); if ( stmt->lobj_fd < 0) { SC_set_error(stmt, STMT_EXEC_ERROR, "Couldnt open large object for writing."); SC_log_error(func, "", stmt); return SQL_ERROR; } retval = odbc_lo_write(stmt->hdbc, stmt->lobj_fd, rgbValue, cbValue); mylog("odbc_lo_write: cbValue=%d, wrote %d bytes\n", cbValue, retval); } else { /* for handling text fields and small binaries */ if (cbValue == SQL_NTS) { current_param->EXEC_buffer = strdup(rgbValue); if ( ! current_param->EXEC_buffer) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Out of memory in SQLPutData (2)"); SC_log_error(func, "", stmt); return SQL_ERROR; } } else { current_param->EXEC_buffer = malloc(cbValue + 1); if ( ! current_param->EXEC_buffer) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Out of memory in SQLPutData (2)"); SC_log_error(func, "", stmt); return SQL_ERROR; } memcpy(current_param->EXEC_buffer, rgbValue, cbValue); current_param->EXEC_buffer[cbValue] = '\0'; } } } else { /* calling SQLPutData more than once */ mylog("SQLPutData: (>1) cbValue = %d\n", cbValue); if (current_param->SQLType == SQL_LONGVARBINARY) { /* the large object fd is in EXEC_buffer */ retval = odbc_lo_write(stmt->hdbc, stmt->lobj_fd, rgbValue, cbValue); mylog("odbc_lo_write(2): cbValue = %d, wrote %d bytes\n", cbValue, retval); *current_param->EXEC_used += cbValue; } else { buffer = current_param->EXEC_buffer; if (cbValue == SQL_NTS) { buffer = realloc(buffer, strlen(buffer) + strlen(rgbValue) + 1); if ( ! buffer) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Out of memory in SQLPutData (3)"); SC_log_error(func, "", stmt); return SQL_ERROR; } strcat(buffer, rgbValue); mylog(" cbValue = SQL_NTS: strlen(buffer) = %d\n", strlen(buffer)); *current_param->EXEC_used = cbValue; /* reassign buffer incase realloc moved it */ current_param->EXEC_buffer = buffer; } else if (cbValue > 0) { old_pos = *current_param->EXEC_used; *current_param->EXEC_used += cbValue; mylog(" cbValue = %d, old_pos = %d, *used = %d\n", cbValue, old_pos, *current_param->EXEC_used); /* dont lose the old pointer in case out of memory */ buffer = realloc(current_param->EXEC_buffer, *current_param->EXEC_used + 1); if ( ! buffer) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Out of memory in SQLPutData (3)"); SC_log_error(func, "", stmt); return SQL_ERROR; } memcpy(&buffer[old_pos], rgbValue, cbValue); buffer[*current_param->EXEC_used] = '\0'; /* reassign buffer incase realloc moved it */ current_param->EXEC_buffer = buffer; } else { SC_log_error(func, "bad cbValue", stmt); return SQL_ERROR; } } } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/Postgre7.1/dlg_specific.c0000755000175000017500000006534612262474475016165 00000000000000 /* Module: dlg_specific.c * * Description: This module contains any specific code for handling * dialog boxes such as driver/datasource options. Both the * ConfigDSN() and the SQLDriverConnect() functions use * functions in this module. If you were to add a new option * to any dialog box, you would most likely only have to change * things in here rather than in 2 separate places as before. * * Classes: none * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef WIN32 # include # include # ifdef UNIXODBC # include # else # include "gpps.h" # define SQLGetPrivateProfileString(a,b,c,d,e,f) GetPrivateProfileString(a,b,c,d,e,f) # define SQLWritePrivateProfileString(a,b,c,d) WritePrivateProfileString(a,b,c,d) # endif # ifndef HAVE_STRICMP # define stricmp(s1,s2) strcasecmp(s1,s2) # define strnicmp(s1,s2,n) strncasecmp(s1,s2,n) # endif #endif #include "dlg_specific.h" #include "convert.h" #ifndef BOOL #define BOOL int #endif #ifndef FALSE #define FALSE (BOOL)0 #endif #ifndef TRUE #define TRUE (BOOL)1 #endif extern GLOBAL_VALUES globals; #ifdef WIN32 void SetDlgStuff(HWND hdlg, ConnInfo *ci) { /* If driver attribute NOT present, then set the datasource name and description */ if (ci->driver[0] == '\0') { SetDlgItemText(hdlg, IDC_DSNAME, ci->dsn); SetDlgItemText(hdlg, IDC_DESC, ci->desc); } SetDlgItemText(hdlg, IDC_DATABASE, ci->database); SetDlgItemText(hdlg, IDC_SERVER, ci->server); SetDlgItemText(hdlg, IDC_USER, ci->username); SetDlgItemText(hdlg, IDC_PASSWORD, ci->password); SetDlgItemText(hdlg, IDC_PORT, ci->port); } void GetDlgStuff(HWND hdlg, ConnInfo *ci) { GetDlgItemText(hdlg, IDC_DESC, ci->desc, sizeof(ci->desc)); GetDlgItemText(hdlg, IDC_DATABASE, ci->database, sizeof(ci->database)); GetDlgItemText(hdlg, IDC_SERVER, ci->server, sizeof(ci->server)); GetDlgItemText(hdlg, IDC_USER, ci->username, sizeof(ci->username)); GetDlgItemText(hdlg, IDC_PASSWORD, ci->password, sizeof(ci->password)); GetDlgItemText(hdlg, IDC_PORT, ci->port, sizeof(ci->port)); } int CALLBACK driver_optionsProc(HWND hdlg, WORD wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { case WM_INITDIALOG: CheckDlgButton(hdlg, DRV_COMMLOG, globals.commlog); CheckDlgButton(hdlg, DRV_OPTIMIZER, globals.disable_optimizer); CheckDlgButton(hdlg, DRV_KSQO, globals.ksqo); CheckDlgButton(hdlg, DRV_UNIQUEINDEX, globals.unique_index); CheckDlgButton(hdlg, DRV_READONLY, globals.onlyread); CheckDlgButton(hdlg, DRV_USEDECLAREFETCH, globals.use_declarefetch); /* Unknown (Default) Data Type sizes */ switch(globals.unknown_sizes) { case UNKNOWNS_AS_DONTKNOW: CheckDlgButton(hdlg, DRV_UNKNOWN_DONTKNOW, 1); break; case UNKNOWNS_AS_LONGEST: CheckDlgButton(hdlg, DRV_UNKNOWN_LONGEST, 1); break; case UNKNOWNS_AS_MAX: default: CheckDlgButton(hdlg, DRV_UNKNOWN_MAX, 1); break; } CheckDlgButton(hdlg, DRV_TEXT_LONGVARCHAR, globals.text_as_longvarchar); CheckDlgButton(hdlg, DRV_UNKNOWNS_LONGVARCHAR, globals.unknowns_as_longvarchar); CheckDlgButton(hdlg, DRV_BOOLS_CHAR, globals.bools_as_char); CheckDlgButton(hdlg, DRV_PARSE, globals.parse); CheckDlgButton(hdlg, DRV_CANCELASFREESTMT, globals.cancel_as_freestmt); SetDlgItemInt(hdlg, DRV_CACHE_SIZE, globals.fetch_max, FALSE); SetDlgItemInt(hdlg, DRV_VARCHAR_SIZE, globals.max_varchar_size, FALSE); SetDlgItemInt(hdlg, DRV_LONGVARCHAR_SIZE, globals.max_longvarchar_size, TRUE); SetDlgItemText(hdlg, DRV_EXTRASYSTABLEPREFIXES, globals.extra_systable_prefixes); /* Driver Connection Settings */ SetDlgItemText(hdlg, DRV_CONNSETTINGS, globals.conn_settings); break; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { case IDOK: globals.commlog = IsDlgButtonChecked(hdlg, DRV_COMMLOG); globals.disable_optimizer = IsDlgButtonChecked(hdlg, DRV_OPTIMIZER); globals.ksqo = IsDlgButtonChecked(hdlg, DRV_KSQO); globals.unique_index = IsDlgButtonChecked(hdlg, DRV_UNIQUEINDEX); globals.onlyread = IsDlgButtonChecked(hdlg, DRV_READONLY); globals.use_declarefetch = IsDlgButtonChecked(hdlg, DRV_USEDECLAREFETCH); /* Unknown (Default) Data Type sizes */ if (IsDlgButtonChecked(hdlg, DRV_UNKNOWN_MAX)) globals.unknown_sizes = UNKNOWNS_AS_MAX; else if (IsDlgButtonChecked(hdlg, DRV_UNKNOWN_DONTKNOW)) globals.unknown_sizes = UNKNOWNS_AS_DONTKNOW; else if (IsDlgButtonChecked(hdlg, DRV_UNKNOWN_LONGEST)) globals.unknown_sizes = UNKNOWNS_AS_LONGEST; else globals.unknown_sizes = UNKNOWNS_AS_MAX; globals.text_as_longvarchar = IsDlgButtonChecked(hdlg, DRV_TEXT_LONGVARCHAR); globals.unknowns_as_longvarchar = IsDlgButtonChecked(hdlg, DRV_UNKNOWNS_LONGVARCHAR); globals.bools_as_char = IsDlgButtonChecked(hdlg, DRV_BOOLS_CHAR); globals.parse = IsDlgButtonChecked(hdlg, DRV_PARSE); globals.cancel_as_freestmt = IsDlgButtonChecked(hdlg, DRV_CANCELASFREESTMT); globals.fetch_max = GetDlgItemInt(hdlg, DRV_CACHE_SIZE, NULL, FALSE); globals.max_varchar_size = GetDlgItemInt(hdlg, DRV_VARCHAR_SIZE, NULL, FALSE); globals.max_longvarchar_size= GetDlgItemInt(hdlg, DRV_LONGVARCHAR_SIZE, NULL, TRUE); /* allows for SQL_NO_TOTAL */ GetDlgItemText(hdlg, DRV_EXTRASYSTABLEPREFIXES, globals.extra_systable_prefixes, sizeof(globals.extra_systable_prefixes)); /* Driver Connection Settings */ GetDlgItemText(hdlg, DRV_CONNSETTINGS, globals.conn_settings, sizeof(globals.conn_settings)); updateGlobals(); /* fall through */ case IDCANCEL: EndDialog(hdlg, GET_WM_COMMAND_ID(wParam, lParam) == IDOK); return TRUE; case IDDEFAULTS: CheckDlgButton(hdlg, DRV_COMMLOG, DEFAULT_COMMLOG); CheckDlgButton(hdlg, DRV_OPTIMIZER, DEFAULT_OPTIMIZER); CheckDlgButton(hdlg, DRV_KSQO, DEFAULT_KSQO); CheckDlgButton(hdlg, DRV_UNIQUEINDEX, DEFAULT_UNIQUEINDEX); CheckDlgButton(hdlg, DRV_READONLY, DEFAULT_READONLY); CheckDlgButton(hdlg, DRV_USEDECLAREFETCH, DEFAULT_USEDECLAREFETCH); CheckDlgButton(hdlg, DRV_PARSE, DEFAULT_PARSE); CheckDlgButton(hdlg, DRV_CANCELASFREESTMT, DEFAULT_CANCELASFREESTMT); /* Unknown Sizes */ CheckDlgButton(hdlg, DRV_UNKNOWN_DONTKNOW, 0); CheckDlgButton(hdlg, DRV_UNKNOWN_LONGEST, 0); CheckDlgButton(hdlg, DRV_UNKNOWN_MAX, 0); switch(DEFAULT_UNKNOWNSIZES) { case UNKNOWNS_AS_DONTKNOW: CheckDlgButton(hdlg, DRV_UNKNOWN_DONTKNOW, 1); break; case UNKNOWNS_AS_LONGEST: CheckDlgButton(hdlg, DRV_UNKNOWN_LONGEST, 1); break; case UNKNOWNS_AS_MAX: CheckDlgButton(hdlg, DRV_UNKNOWN_MAX, 1); break; } CheckDlgButton(hdlg, DRV_TEXT_LONGVARCHAR, DEFAULT_TEXTASLONGVARCHAR); CheckDlgButton(hdlg, DRV_UNKNOWNS_LONGVARCHAR, DEFAULT_UNKNOWNSASLONGVARCHAR); CheckDlgButton(hdlg, DRV_BOOLS_CHAR, DEFAULT_BOOLSASCHAR); SetDlgItemInt(hdlg, DRV_CACHE_SIZE, FETCH_MAX, FALSE); SetDlgItemInt(hdlg, DRV_VARCHAR_SIZE, MAX_VARCHAR_SIZE, FALSE); SetDlgItemInt(hdlg, DRV_LONGVARCHAR_SIZE, TEXT_FIELD_SIZE, TRUE); SetDlgItemText(hdlg, DRV_EXTRASYSTABLEPREFIXES, DEFAULT_EXTRASYSTABLEPREFIXES); /* Driver Connection Settings */ SetDlgItemText(hdlg, DRV_CONNSETTINGS, ""); break; } } return FALSE; } int CALLBACK ds_optionsProc(HWND hdlg, WORD wMsg, WPARAM wParam, LPARAM lParam) { ConnInfo *ci; char buf[128]; switch (wMsg) { case WM_INITDIALOG: ci = (ConnInfo *) lParam; SetWindowLong(hdlg, DWL_USER, lParam); /* save for OK */ /* Change window caption */ if (ci->driver[0]) SetWindowText(hdlg, "Advanced Options (Connection)"); else { sprintf(buf, "Advanced Options (%s)", ci->dsn); SetWindowText(hdlg, buf); } /* Readonly */ CheckDlgButton(hdlg, DS_READONLY, atoi(ci->onlyread)); /* Protocol */ if (strncmp(ci->protocol, PG62, strlen(PG62)) == 0) CheckDlgButton(hdlg, DS_PG62, 1); else if (strncmp(ci->protocol, PG63, strlen(PG63)) == 0) CheckDlgButton(hdlg, DS_PG63, 1); else /* latest */ CheckDlgButton(hdlg, DS_PG64, 1); CheckDlgButton(hdlg, DS_SHOWOIDCOLUMN, atoi(ci->show_oid_column)); CheckDlgButton(hdlg, DS_FAKEOIDINDEX, atoi(ci->fake_oid_index)); CheckDlgButton(hdlg, DS_ROWVERSIONING, atoi(ci->row_versioning)); CheckDlgButton(hdlg, DS_SHOWSYSTEMTABLES, atoi(ci->show_system_tables)); EnableWindow(GetDlgItem(hdlg, DS_FAKEOIDINDEX), atoi(ci->show_oid_column)); /* Datasource Connection Settings */ SetDlgItemText(hdlg, DS_CONNSETTINGS, ci->conn_settings); break; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { case DS_SHOWOIDCOLUMN: mylog("WM_COMMAND: DS_SHOWOIDCOLUMN\n"); EnableWindow(GetDlgItem(hdlg, DS_FAKEOIDINDEX), IsDlgButtonChecked(hdlg, DS_SHOWOIDCOLUMN)); return TRUE; case IDOK: ci = (ConnInfo *)GetWindowLong(hdlg, DWL_USER); mylog("IDOK: got ci = %u\n", ci); /* Readonly */ sprintf(ci->onlyread, "%d", IsDlgButtonChecked(hdlg, DS_READONLY)); /* Protocol */ if ( IsDlgButtonChecked(hdlg, DS_PG62)) strcpy(ci->protocol, PG62); else if ( IsDlgButtonChecked(hdlg, DS_PG63)) strcpy(ci->protocol, PG63); else /* latest */ strcpy(ci->protocol, PG64); sprintf(ci->show_system_tables, "%d", IsDlgButtonChecked(hdlg, DS_SHOWSYSTEMTABLES)); sprintf(ci->row_versioning, "%d", IsDlgButtonChecked(hdlg, DS_ROWVERSIONING)); /* OID Options*/ sprintf(ci->fake_oid_index, "%d", IsDlgButtonChecked(hdlg, DS_FAKEOIDINDEX)); sprintf(ci->show_oid_column, "%d", IsDlgButtonChecked(hdlg, DS_SHOWOIDCOLUMN)); /* Datasource Connection Settings */ GetDlgItemText(hdlg, DS_CONNSETTINGS, ci->conn_settings, sizeof(ci->conn_settings)); /* fall through */ case IDCANCEL: EndDialog(hdlg, GET_WM_COMMAND_ID(wParam, lParam) == IDOK); return TRUE; } } return FALSE; } #endif /* WIN32 */ void makeConnectString(char *connect_string, ConnInfo *ci) { char got_dsn = (ci->dsn[0] != '\0'); char encoded_conn_settings[LARGE_REGISTRY_LEN]; /* fundamental info */ sprintf(connect_string, "%s=%s;DATABASE=%s;SERVER=%s;PORT=%s;UID=%s;PWD=%s", got_dsn ? "DSN" : "DRIVER", got_dsn ? ci->dsn : ci->driver, ci->database, ci->server, ci->port, ci->username, ci->password); encode(ci->conn_settings, encoded_conn_settings); /* extra info */ sprintf(&connect_string[strlen(connect_string)], ";READONLY=%s;PROTOCOL=%s;FAKEOIDINDEX=%s;SHOWOIDCOLUMN=%s;ROWVERSIONING=%s;SHOWSYSTEMTABLES=%s;CONNSETTINGS=%s", ci->onlyread, ci->protocol, ci->fake_oid_index, ci->show_oid_column, ci->row_versioning, ci->show_system_tables, encoded_conn_settings); } void copyAttributes(ConnInfo *ci, char *attribute, char *value) { if(stricmp(attribute, "DSN") == 0) strcpy(ci->dsn, value); else if(stricmp(attribute, "driver") == 0) strcpy(ci->driver, value); else if(stricmp(attribute, INI_DATABASE) == 0) strcpy(ci->database, value); else if(stricmp(attribute, INI_SERVER) == 0 || stricmp(attribute, "server") == 0) strcpy(ci->server, value); else if(stricmp(attribute, INI_USER) == 0 || stricmp(attribute, "uid") == 0) strcpy(ci->username, value); else if(stricmp(attribute, INI_PASSWORD) == 0 || stricmp(attribute, "pwd") == 0) strcpy(ci->password, value); else if(stricmp(attribute, INI_PORT) == 0) strcpy(ci->port, value); else if(stricmp(attribute, INI_UDS) == 0) strcpy(ci->uds, value); else if (stricmp(attribute, INI_READONLY) == 0) strcpy(ci->onlyread, value); else if (stricmp(attribute, INI_PROTOCOL) == 0) strcpy(ci->protocol, value); else if (stricmp(attribute, INI_SHOWOIDCOLUMN) == 0) strcpy(ci->show_oid_column, value); else if (stricmp(attribute, INI_FAKEOIDINDEX) == 0) strcpy(ci->fake_oid_index, value); else if (stricmp(attribute, INI_ROWVERSIONING) == 0) strcpy(ci->row_versioning, value); else if (stricmp(attribute, INI_SHOWSYSTEMTABLES) == 0) strcpy(ci->show_system_tables, value); else if (stricmp(attribute, INI_CONNSETTINGS) == 0) { decode(value, ci->conn_settings); /* strcpy(ci->conn_settings, value); */ } mylog("copyAttributes: DSN='%s',server='%s',dbase='%s',user='%s',passwd='%s',port='%s',onlyread='%s',protocol='%s', conn_settings='%s')\n", ci->dsn, ci->server,ci->database,ci->username,ci->password,ci->port,ci->onlyread,ci->protocol,ci->conn_settings); } void getDSNdefaults(ConnInfo *ci) { if (ci->port[0] == '\0') strcpy(ci->port, DEFAULT_PORT); if (ci->onlyread[0] == '\0') sprintf(ci->onlyread, "%d", globals.onlyread); if (ci->protocol[0] == '\0') strcpy(ci->protocol, globals.protocol); if (ci->fake_oid_index[0] == '\0') sprintf(ci->fake_oid_index, "%d", DEFAULT_FAKEOIDINDEX); if (ci->show_oid_column[0] == '\0') sprintf(ci->show_oid_column, "%d", DEFAULT_SHOWOIDCOLUMN); if (ci->show_system_tables[0] == '\0') sprintf(ci->show_system_tables, "%d", DEFAULT_SHOWSYSTEMTABLES); if (ci->row_versioning[0] == '\0') sprintf(ci->row_versioning, "%d", DEFAULT_ROWVERSIONING); } void getDSNinfo(ConnInfo *ci, char overwrite) { char *DSN = ci->dsn; char encoded_conn_settings[LARGE_REGISTRY_LEN]; /* If a driver keyword was present, then dont use a DSN and return. */ /* If DSN is null and no driver, then use the default datasource. */ if ( DSN[0] == '\0') { if ( ci->driver[0] != '\0') return; else strcpy(DSN, INI_DSN); } /* brute-force chop off trailing blanks... */ while (*(DSN+strlen(DSN)-1) == ' ') *(DSN+strlen(DSN)-1) = '\0'; /* Proceed with getting info for the given DSN. */ if ( ci->desc[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_KDESC, "", ci->desc, sizeof(ci->desc), ODBC_INI); if ( ci->server[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_SERVER, "", ci->server, sizeof(ci->server), ODBC_INI); if ( ci->database[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_DATABASE, "", ci->database, sizeof(ci->database), ODBC_INI); if ( ci->username[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_USER, "", ci->username, sizeof(ci->username), ODBC_INI); if ( ci->password[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_PASSWORD, "", ci->password, sizeof(ci->password), ODBC_INI); if ( ci->port[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_PORT, "", ci->port, sizeof(ci->port), ODBC_INI); if ( ci->uds[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_UDS, "", ci->uds, sizeof(ci->uds), ODBC_INI); if ( ci->onlyread[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_READONLY, "", ci->onlyread, sizeof(ci->onlyread), ODBC_INI); if ( toupper(ci->onlyread[0]) == 'Y' ) strcpy( ci->onlyread, "1" ); if ( ci->show_oid_column[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_SHOWOIDCOLUMN, "", ci->show_oid_column, sizeof(ci->show_oid_column), ODBC_INI); if ( toupper(ci->show_oid_column[0]) == 'Y' ) strcpy( ci->show_oid_column, "1" ); if ( ci->fake_oid_index[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_FAKEOIDINDEX, "", ci->fake_oid_index, sizeof(ci->fake_oid_index), ODBC_INI); if ( toupper(ci->fake_oid_index[0]) == 'Y' ) strcpy( ci->fake_oid_index, "1" ); if ( ci->row_versioning[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_ROWVERSIONING, "", ci->row_versioning, sizeof(ci->row_versioning), ODBC_INI); if ( toupper(ci->row_versioning[0]) == 'Y' ) strcpy( ci->row_versioning, "1" ); if ( ci->show_system_tables[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_SHOWSYSTEMTABLES, "", ci->show_system_tables, sizeof(ci->show_system_tables), ODBC_INI); if ( toupper(ci->show_system_tables[0]) == 'Y' ) strcpy( ci->show_system_tables, "1" ); if ( ci->protocol[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_PROTOCOL, "", ci->protocol, sizeof(ci->protocol), ODBC_INI); if ( ci->conn_settings[0] == '\0' || overwrite) { SQLGetPrivateProfileString(DSN, INI_CONNSETTINGS, "", encoded_conn_settings, sizeof(encoded_conn_settings), ODBC_INI); decode(encoded_conn_settings, ci->conn_settings); } if ( ci->translation_dll[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_TRANSLATIONDLL, "", ci->translation_dll, sizeof(ci->translation_dll), ODBC_INI); if ( ci->translation_option[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_TRANSLATIONOPTION, "", ci->translation_option, sizeof(ci->translation_option), ODBC_INI); /* Allow override of odbcinst.ini parameters here */ getGlobalDefaults(DSN, ODBC_INI, TRUE); qlog("DSN info: DSN='%s',server='%s',port='%s',dbase='%s',user='%s',passwd='%s'\n", DSN, ci->server, ci->port, ci->database, ci->username, ci->password); qlog(" onlyread='%s',protocol='%s',showoid='%s',fakeoidindex='%s',showsystable='%s'\n", ci->onlyread, ci->protocol, ci->show_oid_column, ci->fake_oid_index, ci->show_system_tables); qlog(" conn_settings='%s'\n", ci->conn_settings); qlog(" translation_dll='%s',translation_option='%s'\n", ci->translation_dll, ci->translation_option); } /* This is for datasource based options only */ void writeDSNinfo(ConnInfo *ci) { char *DSN = ci->dsn; char encoded_conn_settings[LARGE_REGISTRY_LEN]; encode(ci->conn_settings, encoded_conn_settings); SQLWritePrivateProfileString(DSN, INI_KDESC, ci->desc, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_DATABASE, ci->database, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_SERVER, ci->server, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_PORT, ci->port, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_UDS, ci->uds, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_USER, ci->username, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_PASSWORD, ci->password, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_READONLY, ci->onlyread, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_SHOWOIDCOLUMN, ci->show_oid_column, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_FAKEOIDINDEX, ci->fake_oid_index, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_ROWVERSIONING, ci->row_versioning, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_SHOWSYSTEMTABLES, ci->show_system_tables, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_PROTOCOL, ci->protocol, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_CONNSETTINGS, encoded_conn_settings, ODBC_INI); } /* This function reads the ODBCINST.INI portion of the registry and gets any driver defaults. */ void getGlobalDefaults(char *section, char *filename, char override) { char temp[256]; /* Fetch Count is stored in driver section */ SQLGetPrivateProfileString(section, INI_FETCH, "", temp, sizeof(temp), filename); if ( temp[0] ) { globals.fetch_max = atoi(temp); /* sanity check if using cursors */ if (globals.fetch_max <= 0) globals.fetch_max = FETCH_MAX; } else if ( ! override) globals.fetch_max = FETCH_MAX; /* Socket Buffersize is stored in driver section */ SQLGetPrivateProfileString(section, INI_SOCKET, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.socket_buffersize = atoi(temp); else if ( ! override) globals.socket_buffersize = SOCK_BUFFER_SIZE; /* Debug is stored in the driver section */ SQLGetPrivateProfileString(section, INI_DEBUG, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.debug = atoi(temp); else if ( ! override) globals.debug = DEFAULT_DEBUG; /* CommLog is stored in the driver section */ SQLGetPrivateProfileString(section, INI_COMMLOG, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.commlog = atoi(temp); else if ( ! override) globals.commlog = DEFAULT_COMMLOG; /* Optimizer is stored in the driver section only */ SQLGetPrivateProfileString(section, INI_OPTIMIZER, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.disable_optimizer = atoi(temp); else if ( ! override) globals.disable_optimizer = DEFAULT_OPTIMIZER; /* KSQO is stored in the driver section only */ SQLGetPrivateProfileString(section, INI_KSQO, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.ksqo = atoi(temp); else if ( ! override) globals.ksqo = DEFAULT_KSQO; /* Recognize Unique Index is stored in the driver section only */ SQLGetPrivateProfileString(section, INI_UNIQUEINDEX, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.unique_index = atoi(temp); else if ( ! override) globals.unique_index = DEFAULT_UNIQUEINDEX; /* Unknown Sizes is stored in the driver section only */ SQLGetPrivateProfileString(section, INI_UNKNOWNSIZES, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.unknown_sizes = atoi(temp); else if ( ! override) globals.unknown_sizes = DEFAULT_UNKNOWNSIZES; /* Lie about supported functions? */ SQLGetPrivateProfileString(section, INI_LIE, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.lie = atoi(temp); else if ( ! override) globals.lie = DEFAULT_LIE; /* Parse statements */ SQLGetPrivateProfileString(section, INI_PARSE, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.parse = atoi(temp); else if ( ! override) globals.parse = DEFAULT_PARSE; /* SQLCancel calls SQLFreeStmt in Driver Manager */ SQLGetPrivateProfileString(section, INI_CANCELASFREESTMT, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.cancel_as_freestmt = atoi(temp); else if ( ! override) globals.cancel_as_freestmt = DEFAULT_CANCELASFREESTMT; /* UseDeclareFetch is stored in the driver section only */ SQLGetPrivateProfileString(section, INI_USEDECLAREFETCH, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.use_declarefetch = atoi(temp); else if ( ! override) globals.use_declarefetch = DEFAULT_USEDECLAREFETCH; /* Max Varchar Size */ SQLGetPrivateProfileString(section, INI_MAXVARCHARSIZE, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.max_varchar_size = atoi(temp); else if ( ! override) globals.max_varchar_size = MAX_VARCHAR_SIZE; /* Max TextField Size */ SQLGetPrivateProfileString(section, INI_MAXLONGVARCHARSIZE, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.max_longvarchar_size = atoi(temp); else if ( ! override) globals.max_longvarchar_size = TEXT_FIELD_SIZE; /* Text As LongVarchar */ SQLGetPrivateProfileString(section, INI_TEXTASLONGVARCHAR, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.text_as_longvarchar = atoi(temp); else if ( ! override) globals.text_as_longvarchar = DEFAULT_TEXTASLONGVARCHAR; /* Unknowns As LongVarchar */ SQLGetPrivateProfileString(section, INI_UNKNOWNSASLONGVARCHAR, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.unknowns_as_longvarchar = atoi(temp); else if ( ! override) globals.unknowns_as_longvarchar = DEFAULT_UNKNOWNSASLONGVARCHAR; /* Bools As Char */ SQLGetPrivateProfileString(section, INI_BOOLSASCHAR, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.bools_as_char = atoi(temp); else if ( ! override) globals.bools_as_char = DEFAULT_BOOLSASCHAR; /* Extra Systable prefixes */ /* Use @@@ to distinguish between blank extra prefixes and no key entry */ SQLGetPrivateProfileString(section, INI_EXTRASYSTABLEPREFIXES, "@@@", temp, sizeof(temp), filename); if ( strcmp(temp, "@@@" )) strcpy(globals.extra_systable_prefixes, temp); else if ( ! override) strcpy(globals.extra_systable_prefixes, DEFAULT_EXTRASYSTABLEPREFIXES); mylog("globals.extra_systable_prefixes = '%s'\n", globals.extra_systable_prefixes); /* Dont allow override of an override! */ if ( ! override) { /* ConnSettings is stored in the driver section and per datasource for override */ SQLGetPrivateProfileString(section, INI_CONNSETTINGS, "", globals.conn_settings, sizeof(globals.conn_settings), filename); /* Default state for future DSN's Readonly attribute */ SQLGetPrivateProfileString(section, INI_READONLY, "", temp, sizeof(temp), filename); if ( temp[0] ) globals.onlyread = atoi(temp); else globals.onlyread = DEFAULT_READONLY; /* Default state for future DSN's protocol attribute This isn't a real driver option YET. This is more intended for customization from the install. */ SQLGetPrivateProfileString(section, INI_PROTOCOL, "@@@", temp, sizeof(temp), filename); if ( strcmp(temp, "@@@" )) strcpy(globals.protocol, temp); else strcpy(globals.protocol, DEFAULT_PROTOCOL); } } /* This function writes any global parameters (that can be manipulated) to the ODBCINST.INI portion of the registry */ void updateGlobals(void) { char tmp[128]; sprintf(tmp, "%d", globals.fetch_max); SQLWritePrivateProfileString(DBMS_NAME, INI_FETCH, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.commlog); SQLWritePrivateProfileString(DBMS_NAME, INI_COMMLOG, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.disable_optimizer); SQLWritePrivateProfileString(DBMS_NAME, INI_OPTIMIZER, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.ksqo); SQLWritePrivateProfileString(DBMS_NAME, INI_KSQO, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.unique_index); SQLWritePrivateProfileString(DBMS_NAME, INI_UNIQUEINDEX, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.onlyread); SQLWritePrivateProfileString(DBMS_NAME, INI_READONLY, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.use_declarefetch); SQLWritePrivateProfileString(DBMS_NAME, INI_USEDECLAREFETCH, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.unknown_sizes); SQLWritePrivateProfileString(DBMS_NAME, INI_UNKNOWNSIZES, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.text_as_longvarchar); SQLWritePrivateProfileString(DBMS_NAME, INI_TEXTASLONGVARCHAR, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.unknowns_as_longvarchar); SQLWritePrivateProfileString(DBMS_NAME, INI_UNKNOWNSASLONGVARCHAR, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.bools_as_char); SQLWritePrivateProfileString(DBMS_NAME, INI_BOOLSASCHAR, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.parse); SQLWritePrivateProfileString(DBMS_NAME, INI_PARSE, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.cancel_as_freestmt); SQLWritePrivateProfileString(DBMS_NAME, INI_CANCELASFREESTMT, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.max_varchar_size); SQLWritePrivateProfileString(DBMS_NAME, INI_MAXVARCHARSIZE, tmp, ODBCINST_INI); sprintf(tmp, "%d", globals.max_longvarchar_size); SQLWritePrivateProfileString(DBMS_NAME, INI_MAXLONGVARCHARSIZE, tmp, ODBCINST_INI); SQLWritePrivateProfileString(DBMS_NAME, INI_EXTRASYSTABLEPREFIXES, globals.extra_systable_prefixes, ODBCINST_INI); SQLWritePrivateProfileString(DBMS_NAME, INI_CONNSETTINGS, globals.conn_settings, ODBCINST_INI); } unixODBC-2.3.9/Drivers/Postgre7.1/tuplelist.c0000755000175000017500000001074412262474475015567 00000000000000 /* Module: tuplelist.c * * Description: This module contains functions for creating a manual result set * (the TupleList) and retrieving data from it for a specific row/column. * * Classes: TupleListClass (Functions prefix: "TL_") * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "tuplelist.h" #include "tuple.h" TupleListClass * TL_Constructor(UInt4 fieldcnt) { TupleListClass *rv; mylog("in TL_Constructor\n"); rv = (TupleListClass *) malloc(sizeof(TupleListClass)); if (rv) { rv->num_fields = fieldcnt; rv->num_tuples = 0; rv->list_start = NULL; rv->list_end = NULL; rv->lastref = NULL; rv->last_indexed = -1; } mylog("exit TL_Constructor\n"); return rv; } void TL_Destructor(TupleListClass *self) { int lf; TupleNode *node, *tp; mylog("TupleList: in DESTRUCTOR\n"); node = self->list_start; while(node != NULL) { for (lf=0; lf < self->num_fields; lf++) if (node->tuple[lf].value != NULL) { free(node->tuple[lf].value); } tp = node->next; free(node); node = tp; } free(self); mylog("TupleList: exit DESTRUCTOR\n"); } void * TL_get_fieldval(TupleListClass *self, Int4 tupleno, Int2 fieldno) { Int4 lf; Int4 delta, from_end; char end_is_closer, start_is_closer; TupleNode *rv; if (self->last_indexed == -1) /* we have an empty tuple list */ return NULL; /* some more sanity checks */ if ((tupleno >= self->num_tuples) || (tupleno < 0)) /* illegal tuple number range */ return NULL; if ((fieldno >= self->num_fields) || (fieldno < 0)) /* illegel field number range */ return NULL; /* check if we are accessing the same tuple that was used in the last fetch (e.g: for fetching all the fields one after another. Do this to speed things up */ if (tupleno == self->last_indexed) return self->lastref->tuple[fieldno].value; /* now for the tricky part... */ /* Since random access is quite inefficient for linked lists we use the lastref pointer that points to the last element referenced by a get_fieldval() call in conjunction with the its index number that is stored in last_indexed. (So we use some locality of reference principle to speed things up) */ delta = tupleno - self->last_indexed; /* if delta is positive, we have to go forward */ /* now check if we are closer to the start or the end of the list than to our last_indexed pointer */ from_end = (self->num_tuples - 1) - tupleno; start_is_closer = labs(delta) > tupleno; /* true if we are closer to the start of the list than to the last_indexed pointer */ end_is_closer = labs(delta) > from_end; /* true if we are closer at the end of the list */ if (end_is_closer) { /* scanning from the end is the shortest way. so we do that... */ rv = self->list_end; for (lf=0; lf < from_end; lf++) rv = rv->prev; } else if (start_is_closer) { /* the shortest way is to start the search from the head of the list */ rv = self->list_start; for (lf=0; lf < tupleno; lf++) rv = rv->next; } else { /* the closest way is starting from our lastref - pointer */ rv = self->lastref; /* at first determine whether we have to search forward or backwards */ if (delta < 0) { /* we have to search backwards */ for(lf=0; lf < (-1)*delta; lf++) rv = rv->prev; } else { /* ok, we have to search forward... */ for (lf=0; lf < delta; lf++) rv = rv->next; } } /* now we have got our return pointer, so update the lastref and the last_indexed values */ self->lastref = rv; self->last_indexed = tupleno; return rv->tuple[fieldno].value; } char TL_add_tuple(TupleListClass *self, TupleNode *new_field) { /* we append the tuple at the end of the doubly linked list of the tuples we have already read in */ new_field->prev = NULL; new_field->next = NULL; if (self->list_start == NULL) { /* the list is empty, we have to add the first tuple */ self->list_start = new_field; self->list_end = new_field; self->lastref = new_field; self->last_indexed = 0; } else { /* there is already an element in the list, so add the new one at the end of the list */ self->list_end->next = new_field; new_field->prev = self->list_end; self->list_end = new_field; } self->num_tuples++; /* this method of building a list cannot fail, so we return 1 */ return 1; } unixODBC-2.3.9/Drivers/Postgre7.1/pgtypes.c0000755000175000017500000004404612262474475015237 00000000000000 /* Module: pgtypes.c * * Description: This module contains routines for getting information * about the supported Postgres data types. Only the function * pgtype_to_sqltype() returns an unknown condition. All other * functions return a suitable default so that even data types that * are not directly supported can be used (it is handled as char data). * * Classes: n/a * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "psqlodbc.h" #include "dlg_specific.h" #include "pgtypes.h" #include "statement.h" #include "connection.h" #include "qresult.h" #ifndef WIN32 #include "isql.h" #include "isqlext.h" #else #include #include #include #endif extern GLOBAL_VALUES globals; Int4 getCharPrecision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as); /* these are the types we support. all of the pgtype_ functions should */ /* return values for each one of these. */ /* Even types not directly supported are handled as character types so all types should work (points, etc.) */ /* ALL THESE TYPES ARE NO LONGER REPORTED in SQLGetTypeInfo. Instead, all the SQL TYPES are reported and mapped to a corresponding Postgres Type */ /* Int4 pgtypes_defined[] = { PG_TYPE_CHAR, PG_TYPE_CHAR2, PG_TYPE_CHAR4, PG_TYPE_CHAR8, PG_TYPE_CHAR16, PG_TYPE_NAME, PG_TYPE_VARCHAR, PG_TYPE_BPCHAR, PG_TYPE_DATE, PG_TYPE_TIME, PG_TYPE_DATETIME, PG_TYPE_ABSTIME, PG_TYPE_TIMESTAMP, PG_TYPE_TEXT, PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_FLOAT4, PG_TYPE_FLOAT8, PG_TYPE_OID, PG_TYPE_MONEY, PG_TYPE_BOOL, PG_TYPE_BYTEA, PG_TYPE_LO, 0 }; */ /* These are NOW the SQL Types reported in SQLGetTypeInfo. */ Int2 sqlTypes [] = { SQL_BIGINT, /* SQL_BINARY, -- Commented out because VarBinary is more correct. */ SQL_BIT, SQL_CHAR, SQL_DATE, SQL_DECIMAL, SQL_DOUBLE, SQL_FLOAT, SQL_INTEGER, SQL_LONGVARBINARY, SQL_LONGVARCHAR, SQL_NUMERIC, SQL_REAL, SQL_SMALLINT, SQL_TIME, SQL_TIMESTAMP, SQL_TINYINT, SQL_VARBINARY, SQL_VARCHAR, 0 }; Int4 sqltype_to_pgtype(SWORD fSqlType) { Int4 pgType; switch(fSqlType) { case SQL_BINARY: pgType = PG_TYPE_BYTEA; break; case SQL_CHAR: pgType = PG_TYPE_BPCHAR; break; case SQL_BIT: pgType = globals.bools_as_char ? PG_TYPE_CHAR : PG_TYPE_BOOL; break; case SQL_DATE: pgType = PG_TYPE_DATE; break; case SQL_DOUBLE: case SQL_FLOAT: pgType = PG_TYPE_FLOAT8; break; case SQL_DECIMAL: case SQL_NUMERIC: pgType = PG_TYPE_NUMERIC; break; case SQL_BIGINT: pgType = PG_TYPE_INT8; break; case SQL_INTEGER: pgType = PG_TYPE_INT4; break; case SQL_LONGVARBINARY: pgType = PG_TYPE_LO; break; case SQL_LONGVARCHAR: pgType = globals.text_as_longvarchar ? PG_TYPE_TEXT : PG_TYPE_VARCHAR; break; case SQL_REAL: pgType = PG_TYPE_FLOAT4; break; case SQL_SMALLINT: case SQL_TINYINT: pgType = PG_TYPE_INT2; break; case SQL_TIME: pgType = PG_TYPE_TIME; break; case SQL_TIMESTAMP: pgType = PG_TYPE_DATETIME; break; case SQL_VARBINARY: pgType = PG_TYPE_BYTEA; break; case SQL_VARCHAR: pgType = PG_TYPE_VARCHAR; break; default: pgType = 0; /* ??? */ break; } return pgType; } /* There are two ways of calling this function: 1. When going through the supported PG types (SQLGetTypeInfo) 2. When taking any type id (SQLColumns, SQLGetData) The first type will always work because all the types defined are returned here. The second type will return a default based on global parameter when it does not know. This allows for supporting types that are unknown. All other pg routines in here return a suitable default. */ Int2 pgtype_to_sqltype(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_CHAR: case PG_TYPE_CHAR2: case PG_TYPE_CHAR4: case PG_TYPE_CHAR8: case PG_TYPE_NAME: return SQL_CHAR; case PG_TYPE_BPCHAR: return SQL_CHAR; case PG_TYPE_VARCHAR: return SQL_VARCHAR; case PG_TYPE_TEXT: return globals.text_as_longvarchar ? SQL_LONGVARCHAR : SQL_VARCHAR; case PG_TYPE_BYTEA: return SQL_VARBINARY; case PG_TYPE_LO: return SQL_LONGVARBINARY; case PG_TYPE_INT2: return SQL_SMALLINT; case PG_TYPE_OID: case PG_TYPE_XID: case PG_TYPE_INT4: return SQL_INTEGER; /* Change this to SQL_BIGINT for ODBC v3 bjm 2001-01-23 */ #ifdef HAVE_LONG_LONG case PG_TYPE_INT8: return SQL_BIGINT; #else case PG_TYPE_INT8: return SQL_INTEGER; #endif case PG_TYPE_NUMERIC: return SQL_NUMERIC; case PG_TYPE_FLOAT4: return SQL_REAL; case PG_TYPE_FLOAT8: return SQL_FLOAT; case PG_TYPE_DATE: return SQL_DATE; case PG_TYPE_TIME: return SQL_TIME; case PG_TYPE_ABSTIME: case PG_TYPE_DATETIME: case PG_TYPE_TIMESTAMP_NO_TMZONE: case PG_TYPE_TIMESTAMP: return SQL_TIMESTAMP; case PG_TYPE_MONEY: return SQL_FLOAT; case PG_TYPE_BOOL: return globals.bools_as_char ? SQL_CHAR : SQL_BIT; default: /* first, check to see if 'type' is in list. If not, look up with query. Add oid, name to list. If it's already in list, just return. */ if (type == stmt->hdbc->lobj_type) /* hack until permanent type is available */ return SQL_LONGVARBINARY; return globals.unknowns_as_longvarchar ? SQL_LONGVARCHAR : SQL_VARCHAR; } } Int2 pgtype_to_ctype(StatementClass *stmt, Int4 type) { switch(type) { #ifdef HAVE_LONG_LONG case PG_TYPE_INT8: return SQL_BIGINT; #else case PG_TYPE_INT8: return SQL_INTEGER; #endif case PG_TYPE_NUMERIC: return SQL_C_CHAR; case PG_TYPE_INT2: return SQL_C_SSHORT; case PG_TYPE_OID: case PG_TYPE_XID: case PG_TYPE_INT4: return SQL_C_SLONG; case PG_TYPE_FLOAT4: return SQL_C_FLOAT; case PG_TYPE_FLOAT8: return SQL_C_DOUBLE; case PG_TYPE_DATE: return SQL_C_DATE; case PG_TYPE_TIME: return SQL_C_TIME; case PG_TYPE_ABSTIME: case PG_TYPE_DATETIME: case PG_TYPE_TIMESTAMP_NO_TMZONE: case PG_TYPE_TIMESTAMP: return SQL_C_TIMESTAMP; case PG_TYPE_MONEY: return SQL_C_FLOAT; case PG_TYPE_BOOL: return globals.bools_as_char ? SQL_C_CHAR : SQL_C_BIT; case PG_TYPE_BYTEA: return SQL_C_BINARY; case PG_TYPE_LO: return SQL_C_BINARY; default: if (type == stmt->hdbc->lobj_type) /* hack until permanent type is available */ return SQL_C_BINARY; return SQL_C_CHAR; } } char *pgtype_to_name(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_CHAR: return "char"; case PG_TYPE_CHAR2: return "char2"; case PG_TYPE_CHAR4: return "char4"; case PG_TYPE_CHAR8: return "char8"; case PG_TYPE_INT8: return "int8"; case PG_TYPE_NUMERIC: return "numeric"; case PG_TYPE_VARCHAR: return "varchar"; case PG_TYPE_BPCHAR: return "char"; case PG_TYPE_TEXT: return "text"; case PG_TYPE_NAME: return "name"; case PG_TYPE_INT2: return "int2"; case PG_TYPE_OID: return "oid"; case PG_TYPE_INT4: return "int4"; case PG_TYPE_FLOAT4: return "float4"; case PG_TYPE_FLOAT8: return "float8"; case PG_TYPE_DATE: return "date"; case PG_TYPE_TIME: return "time"; case PG_TYPE_ABSTIME: return "abstime"; case PG_TYPE_DATETIME: return "datetime"; case PG_TYPE_TIMESTAMP: return "timestamp"; case PG_TYPE_MONEY: return "money"; case PG_TYPE_BOOL: return "bool"; case PG_TYPE_BYTEA: return "bytea"; case PG_TYPE_LO: return PG_TYPE_LO_NAME; default: if (type == stmt->hdbc->lobj_type) /* hack until permanent type is available */ return PG_TYPE_LO_NAME; /* "unknown" can actually be used in alter table because it is a real PG type! */ return "unknown"; } } static Int2 getNumericScale(StatementClass *stmt, Int4 type, int col) { Int4 atttypmod; QResultClass *result; ColumnInfoClass *flds; mylog("getNumericScale: type=%d, col=%d, unknown = %d\n", type,col); if (col < 0) return PG_NUMERIC_MAX_SCALE; result = SC_get_Result(stmt); /* Manual Result Sets -- use assigned column width (i.e., from set_tuplefield_string) */ if (stmt->manual_result) { flds = result->fields; if (flds) return flds->adtsize[col]; else return PG_NUMERIC_MAX_SCALE; } atttypmod = QR_get_atttypmod(result, col); if ( atttypmod > -1 ) return (atttypmod & 0xffff); else return ( QR_get_display_size(result, col) ? QR_get_display_size(result, col) : PG_NUMERIC_MAX_SCALE); } static Int4 getNumericPrecision(StatementClass *stmt, Int4 type, int col) { Int4 atttypmod; QResultClass *result; ColumnInfoClass *flds; mylog("getNumericPrecision: type=%d, col=%d, unknown = %d\n", type,col); if (col < 0) return PG_NUMERIC_MAX_PRECISION; result = SC_get_Result(stmt); /* Manual Result Sets -- use assigned column width (i.e., from set_tuplefield_string) */ if (stmt->manual_result) { flds = result->fields; if (flds) return flds->adtsize[col]; else return PG_NUMERIC_MAX_PRECISION; } atttypmod = QR_get_atttypmod(result, col); if ( atttypmod > -1 ) return (atttypmod >> 16) & 0xffff; else return ( QR_get_display_size(result, col) >= 0 ? QR_get_display_size(result, col) : PG_NUMERIC_MAX_PRECISION ); } Int4 getCharPrecision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as) { int p = -1, maxsize; QResultClass *result; ColumnInfoClass *flds; mylog("getCharPrecision: type=%d, col=%d, unknown = %d\n", type,col,handle_unknown_size_as); /* Assign Maximum size based on parameters */ switch(type) { case PG_TYPE_TEXT: if (globals.text_as_longvarchar) maxsize = globals.max_longvarchar_size; else maxsize = globals.max_varchar_size; break; case PG_TYPE_VARCHAR: case PG_TYPE_BPCHAR: maxsize = globals.max_varchar_size; break; default: if (globals.unknowns_as_longvarchar) maxsize = globals.max_longvarchar_size; else maxsize = globals.max_varchar_size; break; } /* Static Precision (i.e., the Maximum Precision of the datatype) This has nothing to do with a result set. */ if (col < 0) return maxsize; result = SC_get_Result(stmt); /* Manual Result Sets -- use assigned column width (i.e., from set_tuplefield_string) */ if (stmt->manual_result) { flds = result->fields; if (flds) return flds->adtsize[col]; else return maxsize; } /* Size is unknown -- handle according to parameter */ if (QR_get_atttypmod(result, col) > -1) return QR_get_atttypmod(result, col); if (type == PG_TYPE_BPCHAR || handle_unknown_size_as == UNKNOWNS_AS_LONGEST) { p = QR_get_display_size(result, col); mylog("getCharPrecision: LONGEST: p = %d\n", p); } if (p < 0 && handle_unknown_size_as == UNKNOWNS_AS_MAX) return maxsize; else return p; } /* For PG_TYPE_VARCHAR, PG_TYPE_BPCHAR, PG_TYPE_NUMERIC, SQLColumns will override this length with the atttypmod length from pg_attribute . If col >= 0, then will attempt to get the info from the result set. This is used for functions SQLDescribeCol and SQLColAttributes. */ Int4 pgtype_precision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as) { switch(type) { case PG_TYPE_CHAR: return 1; case PG_TYPE_CHAR2: return 2; case PG_TYPE_CHAR4: return 4; case PG_TYPE_CHAR8: return 8; case PG_TYPE_NAME: return NAME_FIELD_SIZE; case PG_TYPE_INT2: return 5; case PG_TYPE_OID: case PG_TYPE_XID: case PG_TYPE_INT4: return 10; case PG_TYPE_INT8: return 19; /* signed */ case PG_TYPE_NUMERIC: return getNumericPrecision(stmt,type,col); case PG_TYPE_FLOAT4: case PG_TYPE_MONEY: return 7; case PG_TYPE_FLOAT8: return 15; case PG_TYPE_DATE: return 10; case PG_TYPE_TIME: return 8; case PG_TYPE_ABSTIME: case PG_TYPE_DATETIME: case PG_TYPE_TIMESTAMP: return 19; case PG_TYPE_BOOL: return 1; case PG_TYPE_LO: return SQL_NO_TOTAL; default: if (type == stmt->hdbc->lobj_type) /* hack until permanent type is available */ return SQL_NO_TOTAL; /* Handle Character types and unknown types */ return getCharPrecision(stmt, type, col, handle_unknown_size_as); } } Int4 pgtype_display_size(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as) { switch(type) { case PG_TYPE_INT2: return 6; case PG_TYPE_OID: case PG_TYPE_XID: return 10; case PG_TYPE_INT4: return 11; case PG_TYPE_INT8: return 20; /* signed: 19 digits + sign */ case PG_TYPE_NUMERIC: return getNumericPrecision(stmt,type,col) + 2; case PG_TYPE_MONEY: return 15; /* ($9,999,999.99) */ case PG_TYPE_FLOAT4: return 13; case PG_TYPE_FLOAT8: return 22; /* Character types use regular precision */ default: return pgtype_precision(stmt, type, col, handle_unknown_size_as); } } /* For PG_TYPE_VARCHAR, PG_TYPE_BPCHAR, SQLColumns will override this length with the atttypmod length from pg_attribute */ Int4 pgtype_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as) { switch(type) { case PG_TYPE_INT2: return 2; case PG_TYPE_OID: case PG_TYPE_XID: case PG_TYPE_INT4: return 4; case PG_TYPE_INT8: return 20; /* signed: 19 digits + sign */ case PG_TYPE_NUMERIC: return getNumericPrecision(stmt,type,col) + 2; case PG_TYPE_FLOAT4: case PG_TYPE_MONEY: return 4; case PG_TYPE_FLOAT8: return 8; case PG_TYPE_DATE: case PG_TYPE_TIME: return 6; case PG_TYPE_ABSTIME: case PG_TYPE_DATETIME: case PG_TYPE_TIMESTAMP: return 16; /* Character types (and NUMERIC) use the default precision */ default: return pgtype_precision(stmt, type, col, handle_unknown_size_as); } } Int2 pgtype_scale(StatementClass *stmt, Int4 type, int col) { switch(type) { case PG_TYPE_INT2: case PG_TYPE_OID: case PG_TYPE_XID: case PG_TYPE_INT4: case PG_TYPE_INT8: case PG_TYPE_FLOAT4: case PG_TYPE_FLOAT8: case PG_TYPE_MONEY: case PG_TYPE_BOOL: /* Number of digits to the right of the decimal point in "yyyy-mm=dd hh:mm:ss[.f...]" */ case PG_TYPE_ABSTIME: case PG_TYPE_DATETIME: case PG_TYPE_TIMESTAMP: return 0; case PG_TYPE_NUMERIC: return getNumericScale(stmt,type,col); default: return -1; } } Int2 pgtype_radix(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_INT2: case PG_TYPE_OID: case PG_TYPE_INT4: case PG_TYPE_INT8: case PG_TYPE_NUMERIC: case PG_TYPE_FLOAT4: case PG_TYPE_MONEY: case PG_TYPE_FLOAT8: return 10; default: return -1; } } Int2 pgtype_nullable(StatementClass *stmt, Int4 type) { return SQL_NULLABLE; /* everything should be nullable */ } Int2 pgtype_auto_increment(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_INT2: case PG_TYPE_OID: case PG_TYPE_XID: case PG_TYPE_INT4: case PG_TYPE_FLOAT4: case PG_TYPE_MONEY: case PG_TYPE_BOOL: case PG_TYPE_FLOAT8: case PG_TYPE_INT8: case PG_TYPE_NUMERIC: case PG_TYPE_DATE: case PG_TYPE_TIME: case PG_TYPE_ABSTIME: case PG_TYPE_DATETIME: case PG_TYPE_TIMESTAMP: return FALSE; default: return -1; } } Int2 pgtype_case_sensitive(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_CHAR: case PG_TYPE_CHAR2: case PG_TYPE_CHAR4: case PG_TYPE_CHAR8: case PG_TYPE_VARCHAR: case PG_TYPE_BPCHAR: case PG_TYPE_TEXT: case PG_TYPE_NAME: return TRUE; default: return FALSE; } } Int2 pgtype_money(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_MONEY: return TRUE; default: return FALSE; } } Int2 pgtype_searchable(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_CHAR: case PG_TYPE_CHAR2: case PG_TYPE_CHAR4: case PG_TYPE_CHAR8: case PG_TYPE_VARCHAR: case PG_TYPE_BPCHAR: case PG_TYPE_TEXT: case PG_TYPE_NAME: return SQL_SEARCHABLE; default: return SQL_ALL_EXCEPT_LIKE; } } Int2 pgtype_unsigned(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_OID: case PG_TYPE_XID: return TRUE; case PG_TYPE_INT2: case PG_TYPE_INT4: case PG_TYPE_INT8: case PG_TYPE_NUMERIC: case PG_TYPE_FLOAT4: case PG_TYPE_FLOAT8: case PG_TYPE_MONEY: return FALSE; default: return -1; } } char *pgtype_literal_prefix(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_INT2: case PG_TYPE_OID: case PG_TYPE_XID: case PG_TYPE_INT4: case PG_TYPE_INT8: case PG_TYPE_NUMERIC: case PG_TYPE_FLOAT4: case PG_TYPE_FLOAT8: case PG_TYPE_MONEY: return NULL; default: return "'"; } } char *pgtype_literal_suffix(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_INT2: case PG_TYPE_OID: case PG_TYPE_XID: case PG_TYPE_INT4: case PG_TYPE_INT8: case PG_TYPE_NUMERIC: case PG_TYPE_FLOAT4: case PG_TYPE_FLOAT8: case PG_TYPE_MONEY: return NULL; default: return "'"; } } char *pgtype_create_params(StatementClass *stmt, Int4 type) { switch(type) { case PG_TYPE_BPCHAR: case PG_TYPE_CHAR: case PG_TYPE_VARCHAR: return "max. length"; case PG_TYPE_NUMERIC: return "precision, scale"; default: return NULL; } } Int2 sqltype_to_default_ctype(Int2 sqltype) { /* from the table on page 623 of ODBC 2.0 Programmer's Reference */ /* (Appendix D) */ switch(sqltype) { case SQL_CHAR: case SQL_VARCHAR: case SQL_LONGVARCHAR: case SQL_DECIMAL: case SQL_NUMERIC: #ifndef HAVE_LONG_LONG case SQL_BIGINT: #endif return SQL_C_CHAR; #ifdef HAVE_LONG_LONG case SQL_BIGINT: return SQL_BIGINT; #endif case SQL_BIT: return SQL_C_BIT; case SQL_TINYINT: return SQL_C_STINYINT; case SQL_SMALLINT: return SQL_C_SSHORT; case SQL_INTEGER: return SQL_C_SLONG; case SQL_REAL: return SQL_C_FLOAT; case SQL_FLOAT: case SQL_DOUBLE: return SQL_C_DOUBLE; case SQL_BINARY: case SQL_VARBINARY: case SQL_LONGVARBINARY: return SQL_C_BINARY; case SQL_DATE: return SQL_C_DATE; case SQL_TIME: return SQL_C_TIME; case SQL_TIMESTAMP: return SQL_C_TIMESTAMP; default: /* should never happen */ return SQL_C_CHAR; } } unixODBC-2.3.9/Drivers/Postgre7.1/qresult.h0000755000175000017500000001147012262474475015243 00000000000000 /* File: qresult.h * * Description: See "qresult.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __QRESULT_H__ #define __QRESULT_H__ #include "connection.h" #include "socket.h" #include "columninfo.h" #include "tuplelist.h" #include "psqlodbc.h" #include "tuple.h" enum QueryResultCode_ { PGRES_EMPTY_QUERY = 0, PGRES_COMMAND_OK, /* a query command that doesn't return */ /* anything was executed properly by the backend */ PGRES_TUPLES_OK, /* a query command that returns tuples */ /* was executed properly by the backend, PGresult */ /* contains the resulttuples */ PGRES_COPY_OUT, PGRES_COPY_IN, PGRES_BAD_RESPONSE, /* an unexpected response was recv'd from the backend */ PGRES_NONFATAL_ERROR, PGRES_FATAL_ERROR, PGRES_FIELDS_OK, /* field information from a query was successful */ PGRES_END_TUPLES, PGRES_INTERNAL_ERROR }; typedef enum QueryResultCode_ QueryResultCode; struct QResultClass_ { ColumnInfoClass *fields; /* the Column information */ TupleListClass *manual_tuples; /* manual result tuple list */ ConnectionClass *conn; /* the connection this result is using (backend) */ /* Stuff for declare/fetch tuples */ int fetch_count; /* logical rows read so far */ int fcount; /* actual rows read in the fetch */ int currTuple; int base; int num_fields; /* number of fields in the result */ int cache_size; int rowset_size; QueryResultCode status; char *message; char *cursor; /* The name of the cursor for select statements */ char *command; char *notice; TupleField *backend_tuples; /* data from the backend (the tuple cache) */ TupleField *tupleField; /* current backend tuple being retrieved */ char inTuples; /* is a fetch of rows from the backend in progress? */ char aborted; /* was aborted?*/ }; #define QR_get_fields(self) (self->fields) /* These functions are for retrieving data from the qresult */ #define QR_get_value_manual(self, tupleno, fieldno) (TL_get_fieldval(self->manual_tuples, tupleno, fieldno)) #define QR_get_value_backend(self, fieldno) (self->tupleField[fieldno].value) #define QR_get_value_backend_row(self, tupleno, fieldno) ((self->backend_tuples + (tupleno * self->num_fields))[fieldno].value) /* These functions are used by both manual and backend results */ #define QR_NumResultCols(self) (CI_get_num_fields(self->fields)) #define QR_get_fieldname(self, fieldno_) (CI_get_fieldname(self->fields, fieldno_)) #define QR_get_fieldsize(self, fieldno_) (CI_get_fieldsize(self->fields, fieldno_)) #define QR_get_display_size(self, fieldno_) (CI_get_display_size(self->fields, fieldno_)) #define QR_get_atttypmod(self, fieldno_) (CI_get_atttypmod(self->fields, fieldno_)) #define QR_get_field_type(self, fieldno_) (CI_get_oid(self->fields, fieldno_)) /* These functions are used only for manual result sets */ #define QR_get_num_tuples(self) (self->manual_tuples ? TL_get_num_tuples(self->manual_tuples) : self->fcount) #define QR_add_tuple(self, new_tuple) (TL_add_tuple(self->manual_tuples, new_tuple)) #define QR_set_field_info(self, field_num, name, adtid, adtsize) (CI_set_field_info(self->fields, field_num, name, adtid, adtsize, -1)) /* status macros */ #define QR_command_successful(self) ( !(self->status == PGRES_BAD_RESPONSE || self->status == PGRES_NONFATAL_ERROR || self->status == PGRES_FATAL_ERROR)) #define QR_command_nonfatal(self) ( self->status == PGRES_NONFATAL_ERROR) #define QR_end_tuples(self) ( self->status == PGRES_END_TUPLES) #define QR_set_status(self, condition) ( self->status = condition ) #define QR_set_message(self, message_) ( self->message = message_) #define QR_set_aborted(self, aborted_) ( self->aborted = aborted_) #define QR_get_message(self) (self->message) #define QR_get_command(self) (self->command) #define QR_get_notice(self) (self->notice) #define QR_get_status(self) (self->status) #define QR_get_aborted(self) (self->aborted) #define QR_aborted(self) (!self || self->aborted) /* Core Functions */ QResultClass *QR_Constructor(void); void QR_Destructor(QResultClass *self); char QR_read_tuple(QResultClass *self, char binary); int QR_next_tuple(QResultClass *self); int QR_close(QResultClass *self); char QR_fetch_tuples(QResultClass *self, ConnectionClass *conn, char *cursor); void QR_free_memory(QResultClass *self); void QR_set_command(QResultClass *self, char *msg); void QR_set_notice(QResultClass *self, char *msg); void QR_set_num_fields(QResultClass *self, int new_num_fields); /* manual result only */ void QR_inc_base(QResultClass *self, int base_inc); void QR_set_cache_size(QResultClass *self, int cache_size); void QR_set_rowset_size(QResultClass *self, int rowset_size); void QR_set_position(QResultClass *self, int pos); #endif unixODBC-2.3.9/Drivers/Postgre7.1/md5.c0000755000175000017500000002412012262474475014220 00000000000000/* * md5.c * * Implements the MD5 Message-Digest Algorithm as specified in * RFC 1321. This implementation is a simple one, in that it * needs every input byte to be buffered before doing any * calculations. I do not expect this file to be used for * general purpose MD5'ing of large amounts of data, only for * generating hashed passwords from limited input. * * Sverre H. Huseby * * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * $Header: /cvsroot/unixodbc/unixODBC/Drivers/Postgre7.1/md5.c,v 1.2 2009/02/18 17:59:16 lurcher Exp $ */ /* * NOTE: * * There are two copies of this file, one in backend/libpq and another * in interfaces/odbc. They should be identical. This is done so ODBC * can be compiled stand-alone. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "md5.h" #undef palloc #define palloc malloc #undef pfree #define pfree free /* * PRIVATE FUNCTIONS */ /* * The returned array is allocated using malloc. the caller should free it * when it is no longer needed. */ static uint8 * createPaddedCopyWithLength(uint8 *b, uint32 *l) { uint8 *ret; uint32 q; uint32 len, newLen448; uint32 len_high, len_low; /* 64-bit value split into 32-bit sections */ len = ((b == NULL) ? 0 : *l); newLen448 = len + 64 - (len % 64) - 8; if (newLen448 <= len) newLen448 += 64; *l = newLen448 + 8; if ((ret = (uint8 *) malloc(sizeof(uint8) * *l)) == NULL) return NULL; if (b != NULL) memcpy(ret, b, sizeof(uint8) * len); /* pad */ ret[len] = 0x80; for (q = len + 1; q < newLen448; q++) ret[q] = 0x00; /* append length as a 64 bit bitcount */ len_low = len; /* split into two 32-bit values */ /* we only look at the bottom 32-bits */ len_high = len >> 29; len_low <<= 3; q = newLen448; ret[q++] = (len_low & 0xff); len_low >>= 8; ret[q++] = (len_low & 0xff); len_low >>= 8; ret[q++] = (len_low & 0xff); len_low >>= 8; ret[q++] = (len_low & 0xff); ret[q++] = (len_high & 0xff); len_high >>= 8; ret[q++] = (len_high & 0xff); len_high >>= 8; ret[q++] = (len_high & 0xff); len_high >>= 8; ret[q] = (len_high & 0xff); return ret; } #define F(x, y, z) (((x) & (y)) | (~(x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | ~(z))) #define ROT_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) static void doTheRounds(uint32 X[16], uint32 state[4]) { uint32 a, b, c, d; a = state[0]; b = state[1]; c = state[2]; d = state[3]; /* round 1 */ a = b + ROT_LEFT((a + F(b, c, d) + X[0] + 0xd76aa478), 7); /* 1 */ d = a + ROT_LEFT((d + F(a, b, c) + X[1] + 0xe8c7b756), 12); /* 2 */ c = d + ROT_LEFT((c + F(d, a, b) + X[2] + 0x242070db), 17); /* 3 */ b = c + ROT_LEFT((b + F(c, d, a) + X[3] + 0xc1bdceee), 22); /* 4 */ a = b + ROT_LEFT((a + F(b, c, d) + X[4] + 0xf57c0faf), 7); /* 5 */ d = a + ROT_LEFT((d + F(a, b, c) + X[5] + 0x4787c62a), 12); /* 6 */ c = d + ROT_LEFT((c + F(d, a, b) + X[6] + 0xa8304613), 17); /* 7 */ b = c + ROT_LEFT((b + F(c, d, a) + X[7] + 0xfd469501), 22); /* 8 */ a = b + ROT_LEFT((a + F(b, c, d) + X[8] + 0x698098d8), 7); /* 9 */ d = a + ROT_LEFT((d + F(a, b, c) + X[9] + 0x8b44f7af), 12); /* 10 */ c = d + ROT_LEFT((c + F(d, a, b) + X[10] + 0xffff5bb1), 17); /* 11 */ b = c + ROT_LEFT((b + F(c, d, a) + X[11] + 0x895cd7be), 22); /* 12 */ a = b + ROT_LEFT((a + F(b, c, d) + X[12] + 0x6b901122), 7); /* 13 */ d = a + ROT_LEFT((d + F(a, b, c) + X[13] + 0xfd987193), 12); /* 14 */ c = d + ROT_LEFT((c + F(d, a, b) + X[14] + 0xa679438e), 17); /* 15 */ b = c + ROT_LEFT((b + F(c, d, a) + X[15] + 0x49b40821), 22); /* 16 */ /* round 2 */ a = b + ROT_LEFT((a + G(b, c, d) + X[1] + 0xf61e2562), 5); /* 17 */ d = a + ROT_LEFT((d + G(a, b, c) + X[6] + 0xc040b340), 9); /* 18 */ c = d + ROT_LEFT((c + G(d, a, b) + X[11] + 0x265e5a51), 14); /* 19 */ b = c + ROT_LEFT((b + G(c, d, a) + X[0] + 0xe9b6c7aa), 20); /* 20 */ a = b + ROT_LEFT((a + G(b, c, d) + X[5] + 0xd62f105d), 5); /* 21 */ d = a + ROT_LEFT((d + G(a, b, c) + X[10] + 0x02441453), 9); /* 22 */ c = d + ROT_LEFT((c + G(d, a, b) + X[15] + 0xd8a1e681), 14); /* 23 */ b = c + ROT_LEFT((b + G(c, d, a) + X[4] + 0xe7d3fbc8), 20); /* 24 */ a = b + ROT_LEFT((a + G(b, c, d) + X[9] + 0x21e1cde6), 5); /* 25 */ d = a + ROT_LEFT((d + G(a, b, c) + X[14] + 0xc33707d6), 9); /* 26 */ c = d + ROT_LEFT((c + G(d, a, b) + X[3] + 0xf4d50d87), 14); /* 27 */ b = c + ROT_LEFT((b + G(c, d, a) + X[8] + 0x455a14ed), 20); /* 28 */ a = b + ROT_LEFT((a + G(b, c, d) + X[13] + 0xa9e3e905), 5); /* 29 */ d = a + ROT_LEFT((d + G(a, b, c) + X[2] + 0xfcefa3f8), 9); /* 30 */ c = d + ROT_LEFT((c + G(d, a, b) + X[7] + 0x676f02d9), 14); /* 31 */ b = c + ROT_LEFT((b + G(c, d, a) + X[12] + 0x8d2a4c8a), 20); /* 32 */ /* round 3 */ a = b + ROT_LEFT((a + H(b, c, d) + X[5] + 0xfffa3942), 4); /* 33 */ d = a + ROT_LEFT((d + H(a, b, c) + X[8] + 0x8771f681), 11); /* 34 */ c = d + ROT_LEFT((c + H(d, a, b) + X[11] + 0x6d9d6122), 16); /* 35 */ b = c + ROT_LEFT((b + H(c, d, a) + X[14] + 0xfde5380c), 23); /* 36 */ a = b + ROT_LEFT((a + H(b, c, d) + X[1] + 0xa4beea44), 4); /* 37 */ d = a + ROT_LEFT((d + H(a, b, c) + X[4] + 0x4bdecfa9), 11); /* 38 */ c = d + ROT_LEFT((c + H(d, a, b) + X[7] + 0xf6bb4b60), 16); /* 39 */ b = c + ROT_LEFT((b + H(c, d, a) + X[10] + 0xbebfbc70), 23); /* 40 */ a = b + ROT_LEFT((a + H(b, c, d) + X[13] + 0x289b7ec6), 4); /* 41 */ d = a + ROT_LEFT((d + H(a, b, c) + X[0] + 0xeaa127fa), 11); /* 42 */ c = d + ROT_LEFT((c + H(d, a, b) + X[3] + 0xd4ef3085), 16); /* 43 */ b = c + ROT_LEFT((b + H(c, d, a) + X[6] + 0x04881d05), 23); /* 44 */ a = b + ROT_LEFT((a + H(b, c, d) + X[9] + 0xd9d4d039), 4); /* 45 */ d = a + ROT_LEFT((d + H(a, b, c) + X[12] + 0xe6db99e5), 11); /* 46 */ c = d + ROT_LEFT((c + H(d, a, b) + X[15] + 0x1fa27cf8), 16); /* 47 */ b = c + ROT_LEFT((b + H(c, d, a) + X[2] + 0xc4ac5665), 23); /* 48 */ /* round 4 */ a = b + ROT_LEFT((a + I(b, c, d) + X[0] + 0xf4292244), 6); /* 49 */ d = a + ROT_LEFT((d + I(a, b, c) + X[7] + 0x432aff97), 10); /* 50 */ c = d + ROT_LEFT((c + I(d, a, b) + X[14] + 0xab9423a7), 15); /* 51 */ b = c + ROT_LEFT((b + I(c, d, a) + X[5] + 0xfc93a039), 21); /* 52 */ a = b + ROT_LEFT((a + I(b, c, d) + X[12] + 0x655b59c3), 6); /* 53 */ d = a + ROT_LEFT((d + I(a, b, c) + X[3] + 0x8f0ccc92), 10); /* 54 */ c = d + ROT_LEFT((c + I(d, a, b) + X[10] + 0xffeff47d), 15); /* 55 */ b = c + ROT_LEFT((b + I(c, d, a) + X[1] + 0x85845dd1), 21); /* 56 */ a = b + ROT_LEFT((a + I(b, c, d) + X[8] + 0x6fa87e4f), 6); /* 57 */ d = a + ROT_LEFT((d + I(a, b, c) + X[15] + 0xfe2ce6e0), 10); /* 58 */ c = d + ROT_LEFT((c + I(d, a, b) + X[6] + 0xa3014314), 15); /* 59 */ b = c + ROT_LEFT((b + I(c, d, a) + X[13] + 0x4e0811a1), 21); /* 60 */ a = b + ROT_LEFT((a + I(b, c, d) + X[4] + 0xf7537e82), 6); /* 61 */ d = a + ROT_LEFT((d + I(a, b, c) + X[11] + 0xbd3af235), 10); /* 62 */ c = d + ROT_LEFT((c + I(d, a, b) + X[2] + 0x2ad7d2bb), 15); /* 63 */ b = c + ROT_LEFT((b + I(c, d, a) + X[9] + 0xeb86d391), 21); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; } static int calculateDigestFromBuffer(uint8 *b, uint32 len, uint8 sum[16]) { register uint32 i, j, k, newI; uint32 l; uint8 *input; register uint32 *wbp; uint32 workBuff[16], state[4]; l = len; state[0] = 0x67452301; state[1] = 0xEFCDAB89; state[2] = 0x98BADCFE; state[3] = 0x10325476; if ((input = createPaddedCopyWithLength(b, &l)) == NULL) return 0; for (i = 0;;) { if ((newI = i + 16 * 4) > l) break; k = i + 3; for (j = 0; j < 16; j++) { wbp = (workBuff + j); *wbp = input[k--]; *wbp <<= 8; *wbp |= input[k--]; *wbp <<= 8; *wbp |= input[k--]; *wbp <<= 8; *wbp |= input[k]; k += 7; } doTheRounds(workBuff, state); i = newI; } free(input); j = 0; for (i = 0; i < 4; i++) { k = state[i]; sum[j++] = (k & 0xff); k >>= 8; sum[j++] = (k & 0xff); k >>= 8; sum[j++] = (k & 0xff); k >>= 8; sum[j++] = (k & 0xff); } return 1; } static void bytesToHex(uint8 b[16], char *s) { static char *hex = "0123456789abcdef"; int q, w; for (q = 0, w = 0; q < 16; q++) { s[w++] = hex[(b[q] >> 4) & 0x0F]; s[w++] = hex[b[q] & 0x0F]; } s[w] = '\0'; } /* * PUBLIC FUNCTIONS */ /* * md5_hash * * Calculates the MD5 sum of the bytes in a buffer. * * SYNOPSIS #include "crypt.h" * int md5_hash(const void *buff, size_t len, char *hexsum) * * INPUT buff the buffer containing the bytes that you want * the MD5 sum of. * len number of bytes in the buffer. * * OUTPUT hexsum the MD5 sum as a '\0'-terminated string of * hexadecimal digits. an MD5 sum is 16 bytes long. * each byte is represented by two heaxadecimal * characters. you thus need to provide an array * of 33 characters, including the trailing '\0'. * * RETURNS 0 on failure (out of memory for internal buffers) or * non-zero on success. * * STANDARDS MD5 is described in RFC 1321. * * AUTHOR Sverre H. Huseby * */ bool md5_hash(const void *buff, size_t len, char *hexsum) { uint8 sum[16]; if (!calculateDigestFromBuffer((uint8 *) buff, len, sum)) return false; bytesToHex(sum, hexsum); return true; } /* * Computes MD5 checksum of "passwd" (a null-terminated string) followed * by "salt" (which need not be null-terminated). * * Output format is "md5" followed by a 32-hex-digit MD5 checksum. * Hence, the output buffer "buf" must be at least 36 bytes long. * * Returns TRUE if okay, FALSE on error (out of memory). */ bool EncryptMD5(const char *passwd, const char *salt, size_t salt_len, char *buf) { size_t passwd_len = strlen(passwd); char *crypt_buf = palloc(passwd_len + salt_len); bool ret; /* * Place salt at the end because it may be known by users trying to * crack the MD5 output. */ strcpy(crypt_buf, passwd); memcpy(crypt_buf + passwd_len, salt, salt_len); strcpy(buf, "md5"); ret = md5_hash(crypt_buf, passwd_len + salt_len, buf + 3); pfree(crypt_buf); return ret; } unixODBC-2.3.9/Drivers/Postgre7.1/psqlodbc.h0000755000175000017500000001165412262474475015357 00000000000000 /* File: psqlodbc.h * * Description: This file contains defines and declarations that are related to * the entire driver. * * Comments: See "notice.txt" for copyright and license information. * * $Id: psqlodbc.h,v 1.4 2003/02/18 18:46:48 lurcher Exp $ */ #ifndef __PSQLODBC_H__ #define __PSQLODBC_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for FILE* pointers: see GLOBAL_VALUES */ #ifndef WIN32 #include /* for prototype of atof() etc */ #define Int4 int #define UInt4 unsigned int #define Int2 short #define UInt2 unsigned short #else #define Int4 int #define UInt4 unsigned int #define Int2 short #define UInt2 unsigned short #endif typedef UInt4 Oid; #undef ODBCVER /* Driver stuff */ #define ODBCVER 0x0250 #define DRIVER_ODBC_VER "02.50" #define DRIVERNAME "PostgreSQL ODBC" #define DBMS_NAME "PostgreSQL" #define POSTGRESDRIVERVERSION "07.01.0003" #ifdef WIN32 #define DRIVER_FILE_NAME "PSQLODBC.DLL" #else #define DRIVER_FILE_NAME "libpsqlodbc.so" #endif /* Limits */ #define BLCKSZ 4096 #define MAX_MESSAGE_LEN 65536 /* This puts a limit on query size but I don't */ /* see an easy way round this - DJP 24-1-2001 */ #define MAX_CONNECT_STRING 4096 #define ERROR_MSG_LENGTH 4096 #define FETCH_MAX 100 /* default number of rows to cache for declare/fetch */ #define TUPLE_MALLOC_INC 100 #define SOCK_BUFFER_SIZE 4096 /* default socket buffer size */ #define MAX_CONNECTIONS 128 /* conns per environment (arbitrary) */ #define MAX_FIELDS 512 #define BYTELEN 8 #define VARHDRSZ sizeof(Int4) #define MAX_TABLE_LEN 32 #define MAX_COLUMN_LEN 32 #define MAX_CURSOR_LEN 32 /* Registry length limits */ #define LARGE_REGISTRY_LEN 4096 /* used for special cases */ #define MEDIUM_REGISTRY_LEN 256 /* normal size for user,database,etc. */ #define SMALL_REGISTRY_LEN 10 /* for 1/0 settings */ /* These prefixes denote system tables */ #define POSTGRES_SYS_PREFIX "pg_" #define KEYS_TABLE "dd_fkey" /* Info limits */ #define MAX_INFO_STRING 128 #define MAX_KEYPARTS 20 #define MAX_KEYLEN 512 /* max key of the form "date+outlet+invoice" */ #define MAX_ROW_SIZE 0 /* Unlimited rowsize with the Tuple Toaster */ #define MAX_STATEMENT_LEN 0 /* Unlimited statement size with 7.0 */ /* Previously, numerous query strings were defined of length MAX_STATEMENT_LEN */ /* Now that's 0, lets use this instead. DJP 24-1-2001 */ #define STD_STATEMENT_LEN MAX_MESSAGE_LEN #define PG62 "6.2" /* "Protocol" key setting to force Postgres 6.2 */ #define PG63 "6.3" /* "Protocol" key setting to force postgres 6.3 */ #define PG64 "6.4" typedef struct ConnectionClass_ ConnectionClass; typedef struct StatementClass_ StatementClass; typedef struct QResultClass_ QResultClass; typedef struct SocketClass_ SocketClass; typedef struct BindInfoClass_ BindInfoClass; typedef struct ParameterInfoClass_ ParameterInfoClass; typedef struct ColumnInfoClass_ ColumnInfoClass; typedef struct TupleListClass_ TupleListClass; typedef struct EnvironmentClass_ EnvironmentClass; typedef struct TupleNode_ TupleNode; typedef struct TupleField_ TupleField; typedef struct col_info COL_INFO; typedef struct lo_arg LO_ARG; typedef struct GlobalValues_ { int fetch_max; int socket_buffersize; int unknown_sizes; int max_varchar_size; int max_longvarchar_size; char debug; char commlog; char disable_optimizer; char ksqo; char unique_index; char onlyread; /* readonly is reserved on Digital C++ compiler */ char use_declarefetch; char text_as_longvarchar; char unknowns_as_longvarchar; char bools_as_char; char lie; char parse; char cancel_as_freestmt; char extra_systable_prefixes[MEDIUM_REGISTRY_LEN]; char conn_settings[LARGE_REGISTRY_LEN]; char protocol[SMALL_REGISTRY_LEN]; FILE* mylogFP; FILE* qlogFP; } GLOBAL_VALUES; /* * rename to avoid colision */ #define global pg_global typedef struct StatementOptions_ { int maxRows; int maxLength; int rowset_size; int keyset_size; int cursor_type; int scroll_concurrency; int retrieve_data; int bind_size; /* size of each structure if using Row Binding */ int use_bookmarks; } StatementOptions; /* Used to pass extra query info to send_query */ typedef struct QueryInfo_ { int row_size; QResultClass *result_in; char *cursor; } QueryInfo; #define PG_TYPE_LO -999 /* hack until permanent type available */ #define PG_TYPE_LO_NAME "lo" #define OID_ATTNUM -2 /* the attnum in pg_index of the oid */ /* sizes */ #define TEXT_FIELD_SIZE 65536 /* size of text fields (not including null term) */ #define NAME_FIELD_SIZE 32 /* size of name fields */ #define MAX_VARCHAR_SIZE 254 /* maximum size of a varchar (not including null term) */ #define PG_NUMERIC_MAX_PRECISION 1000 #define PG_NUMERIC_MAX_SCALE 1000 #include "misc.h" #endif unixODBC-2.3.9/Drivers/Postgre7.1/statement.h0000755000175000017500000001507312262474475015553 00000000000000 /* File: statement.h * * Description: See "statement.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __STATEMENT_H__ #define __STATEMENT_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "psqlodbc.h" #include "bind.h" #ifndef WIN32 #include "isql.h" #else #include #include #endif #ifndef FALSE #define FALSE (BOOL)0 #endif #ifndef TRUE #define TRUE (BOOL)1 #endif typedef enum { STMT_ALLOCATED, /* The statement handle is allocated, but not used so far */ STMT_READY, /* the statement is waiting to be executed */ STMT_PREMATURE, /* ODBC states that it is legal to call e.g. SQLDescribeCol before a call to SQLExecute, but after SQLPrepare. To get all the necessary information in such a case, we simply execute the query _before_ the actual call to SQLExecute, so that statement is considered to be "premature". */ STMT_FINISHED, /* statement execution has finished */ STMT_EXECUTING /* statement execution is still going on */ } STMT_Status; #define STMT_TRUNCATED -2 #define STMT_INFO_ONLY -1 /* not an error message, just a notification to be returned by SQLError */ #define STMT_OK 0 /* will be interpreted as "no error pending" */ #define STMT_EXEC_ERROR 1 #define STMT_STATUS_ERROR 2 #define STMT_SEQUENCE_ERROR 3 #define STMT_NO_MEMORY_ERROR 4 #define STMT_COLNUM_ERROR 5 #define STMT_NO_STMTSTRING 6 #define STMT_ERROR_TAKEN_FROM_BACKEND 7 #define STMT_INTERNAL_ERROR 8 #define STMT_STILL_EXECUTING 9 #define STMT_NOT_IMPLEMENTED_ERROR 10 #define STMT_BAD_PARAMETER_NUMBER_ERROR 11 #define STMT_OPTION_OUT_OF_RANGE_ERROR 12 #define STMT_INVALID_COLUMN_NUMBER_ERROR 13 #define STMT_RESTRICTED_DATA_TYPE_ERROR 14 #define STMT_INVALID_CURSOR_STATE_ERROR 15 #define STMT_OPTION_VALUE_CHANGED 16 #define STMT_CREATE_TABLE_ERROR 17 #define STMT_NO_CURSOR_NAME 18 #define STMT_INVALID_CURSOR_NAME 19 #define STMT_INVALID_ARGUMENT_NO 20 #define STMT_ROW_OUT_OF_RANGE 21 #define STMT_OPERATION_CANCELLED 22 #define STMT_INVALID_CURSOR_POSITION 23 #define STMT_VALUE_OUT_OF_RANGE 24 #define STMT_OPERATION_INVALID 25 #define STMT_PROGRAM_TYPE_OUT_OF_RANGE 26 #define STMT_BAD_ERROR 27 /* statement types */ enum { STMT_TYPE_UNKNOWN = -2, STMT_TYPE_OTHER = -1, STMT_TYPE_SELECT = 0, STMT_TYPE_INSERT, STMT_TYPE_UPDATE, STMT_TYPE_DELETE, STMT_TYPE_CREATE, STMT_TYPE_ALTER, STMT_TYPE_DROP, STMT_TYPE_GRANT, STMT_TYPE_REVOKE }; #define STMT_UPDATE(stmt) (stmt->statement_type > STMT_TYPE_SELECT) /* Parsing status */ enum { STMT_PARSE_NONE = 0, STMT_PARSE_COMPLETE, STMT_PARSE_INCOMPLETE, STMT_PARSE_FATAL }; /* Result style */ enum { STMT_FETCH_NONE = 0, STMT_FETCH_NORMAL, STMT_FETCH_EXTENDED }; typedef struct { COL_INFO *col_info; /* cached SQLColumns info for this table */ char name[MAX_TABLE_LEN+1]; char alias[MAX_TABLE_LEN+1]; } TABLE_INFO; typedef struct { TABLE_INFO *ti; /* resolve to explicit table names */ int precision; int display_size; int length; int type; char nullable; char func; char expr; char quote; char dquote; char numeric; char dot[MAX_TABLE_LEN+1]; char name[MAX_COLUMN_LEN+1]; char alias[MAX_COLUMN_LEN+1]; } FIELD_INFO; /******** Statement Handle ***********/ struct StatementClass_ { ConnectionClass *hdbc; /* pointer to ConnectionClass this statement belongs to */ QResultClass *result; /* result of the current statement */ HSTMT FAR *phstmt; StatementOptions options; STMT_Status status; char *__error_message; int __error_number; /* information on bindings */ BindInfoClass *bindings; /* array to store the binding information */ BindInfoClass bookmark; int bindings_allocated; /* information on statement parameters */ int parameters_allocated; ParameterInfoClass *parameters; Int4 currTuple; /* current absolute row number (GetData, SetPos, SQLFetch) */ int save_rowset_size; /* saved rowset size in case of change/FETCH_NEXT */ int rowset_start; /* start of rowset (an absolute row number) */ int bind_row; /* current offset for Multiple row/column binding */ int last_fetch_count; /* number of rows retrieved in last fetch/extended fetch */ int current_col; /* current column for GetData -- used to handle multiple calls */ int lobj_fd; /* fd of the current large object */ char *statement; /* if non--null pointer to the SQL statement that has been executed */ TABLE_INFO **ti; FIELD_INFO **fi; int nfld; int ntab; int parse_status; int statement_type; /* According to the defines above */ int data_at_exec; /* Number of params needing SQLPutData */ int current_exec_param; /* The current parameter for SQLPutData */ char put_data; /* Has SQLPutData been called yet? */ char errormsg_created; /* has an informative error msg been created? */ char manual_result; /* Is the statement result manually built? */ char prepare; /* is this statement a prepared statement or direct */ char internal; /* Is this statement being called internally? */ char cursor_name[MAX_CURSOR_LEN+1]; char stmt_with_params[STD_STATEMENT_LEN]; /* statement after parameter substitution */ int reexecute; }; #define SC_get_conn(a) (a->hdbc) #define SC_get_Result(a) (a->result); #define SC_get_errornumber(a) (a->__error_number) #define SC_set_errornumber(a, n) (a->__error_number = n) #define SC_get_errormsg(a) (a->__error_message) /* options for SC_free_params() */ #define STMT_FREE_PARAMS_ALL 0 #define STMT_FREE_PARAMS_DATA_AT_EXEC_ONLY 1 /* Statement prototypes */ StatementClass *SC_Constructor(void); void InitializeStatementOptions(StatementOptions *opt); char SC_Destructor(StatementClass *self); int statement_type(char *statement); char parse_statement(StatementClass *stmt); void SC_pre_execute(StatementClass *self); char SC_unbind_cols(StatementClass *self); char SC_recycle_statement(StatementClass *self); void SC_clear_error(StatementClass *self); void SC_set_error(StatementClass *self, int errnum, const char *msg); void SC_set_errormsg(StatementClass *self, const char *msg); char SC_get_error(StatementClass *self, int *number, char **message); char *SC_create_errormsg(StatementClass *self); RETCODE SC_execute(StatementClass *self); RETCODE SC_fetch(StatementClass *self); void SC_free_params(StatementClass *self, char option); void SC_log_error(char *func, char *desc, StatementClass *self); unsigned long SC_get_bookmark(StatementClass *self); #endif unixODBC-2.3.9/Drivers/Postgre7.1/socket.h0000755000175000017500000000441012262474475015030 00000000000000 /* File: socket.h * * Description: See "socket.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __SOCKET_H__ #define __SOCKET_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef WIN32 #include #include #include #include #include #include #define closesocket(xxx) close(xxx) #define SOCKETFD int #ifndef INADDR_NONE #ifndef _IN_ADDR_T #define _IN_ADDR_T typedef unsigned int in_addr_t; #endif #define INADDR_NONE ((in_addr_t)-1) #endif #else #include #define SOCKETFD SOCKET #endif #include "psqlodbc.h" #define SOCKET_ALREADY_CONNECTED 1 #define SOCKET_HOST_NOT_FOUND 2 #define SOCKET_COULD_NOT_CREATE_SOCKET 3 #define SOCKET_COULD_NOT_CONNECT 4 #define SOCKET_READ_ERROR 5 #define SOCKET_WRITE_ERROR 6 #define SOCKET_NULLPOINTER_PARAMETER 7 #define SOCKET_PUT_INT_WRONG_LENGTH 8 #define SOCKET_GET_INT_WRONG_LENGTH 9 #define SOCKET_CLOSED 10 struct SocketClass_ { int buffer_filled_in; int buffer_filled_out; int buffer_read_in; unsigned char *buffer_in; unsigned char *buffer_out; SOCKETFD socket; char *errormsg; int errornumber; char reverse; /* used to handle Postgres 6.2 protocol (reverse byte order) */ }; #define SOCK_get_char(self) (SOCK_get_next_byte(self)) #define SOCK_put_char(self, c) (SOCK_put_next_byte(self, c)) /* error functions */ #define SOCK_get_errcode(self) (self->errornumber) #define SOCK_get_errmsg(self) (self->errormsg) /* Socket prototypes */ SocketClass *SOCK_Constructor(void); void SOCK_Destructor(SocketClass *self); char SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname, char*uds); void SOCK_get_n_char(SocketClass *self, char *buffer, int len); void SOCK_put_n_char(SocketClass *self, char *buffer, int len); BOOL SOCK_get_string(SocketClass *self, char *buffer, int bufsize); void SOCK_put_string(SocketClass *self, char *string); int SOCK_get_int(SocketClass *self, short len); void SOCK_put_int(SocketClass *self, int value, short len); void SOCK_flush_output(SocketClass *self); UCHAR SOCK_get_next_byte(SocketClass *self); void SOCK_put_next_byte(SocketClass *self, unsigned char next_byte); void SOCK_clear_error(SocketClass *self); #endif unixODBC-2.3.9/Drivers/Postgre7.1/convert.c0000755000175000017500000012771712262474475015233 00000000000000 /* Module: convert.c * * Description: This module contains routines related to * converting parameters and columns into requested data types. * Parameters are converted from their SQL_C data types into * the appropriate postgres type. Columns are converted from * their postgres type (SQL type) into the appropriate SQL_C * data type. * * Classes: n/a * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "psqlodbc.h" #ifndef WIN32 #include "isql.h" #include "isqlext.h" #else #include #include #include #endif #include #ifdef HAVE_LOCALE_H #include #endif #include #include "convert.h" #include "statement.h" #include "qresult.h" #include "bind.h" #include "pgtypes.h" #include "lobj.h" #include "connection.h" #ifndef WIN32 #ifndef HAVE_STRICMP #define stricmp(s1,s2) strcasecmp(s1,s2) #define strnicmp(s1,s2,n) strncasecmp(s1,s2,n) #endif #endif extern GLOBAL_VALUES globals; /* How to map ODBC scalar functions {fn func(args)} to Postgres * This is just a simple substitution * List augmented from * http://www.merant.com/datadirect/download/docs/odbc16/Odbcref/rappc.htm * - thomas 2000-04-03 */ char* const mapFuncs[][2] = { /* { "ASCII", "ascii" }, */ { "CHAR", "chr" }, { "CONCAT", "textcat" }, /* { "DIFFERENCE", "difference" }, */ /* { "INSERT", "insert" }, */ { "LCASE", "lower" }, { "LEFT", "ltrunc" }, { "LOCATE", "strpos" }, { "LENGTH", "char_length"}, /* { "LTRIM", "ltrim" }, */ { "RIGHT", "rtrunc" }, /* { "REPEAT", "repeat" }, */ /* { "REPLACE", "replace" }, */ /* { "RTRIM", "rtrim" }, */ /* { "SOUNDEX", "soundex" }, */ { "SUBSTRING", "substr" }, { "UCASE", "upper" }, /* { "ABS", "abs" }, */ /* { "ACOS", "acos" }, */ /* { "ASIN", "asin" }, */ /* { "ATAN", "atan" }, */ /* { "ATAN2", "atan2" }, */ { "CEILING", "ceil" }, /* { "COS", "cos" }, */ /* { "COT", "cot" }, */ /* { "DEGREES", "degrees" }, */ /* { "EXP", "exp" }, */ /* { "FLOOR", "floor" }, */ { "LOG", "ln" }, { "LOG10", "log" }, /* { "MOD", "mod" }, */ /* { "PI", "pi" }, */ { "POWER", "pow" }, /* { "RADIANS", "radians" }, */ { "RAND", "random" }, /* { "ROUND", "round" }, */ /* { "SIGN", "sign" }, */ /* { "SIN", "sin" }, */ /* { "SQRT", "sqrt" }, */ /* { "TAN", "tan" }, */ { "TRUNCATE", "trunc" }, /* { "CURDATE", "curdate" }, */ /* { "CURTIME", "curtime" }, */ /* { "DAYNAME", "dayname" }, */ /* { "DAYOFMONTH", "dayofmonth" }, */ /* { "DAYOFWEEK", "dayofweek" }, */ /* { "DAYOFYEAR", "dayofyear" }, */ /* { "HOUR", "hour" }, */ /* { "MINUTE", "minute" }, */ /* { "MONTH", "month" }, */ /* { "MONTHNAME", "monthname" }, */ /* { "NOW", "now" }, */ /* { "QUARTER", "quarter" }, */ /* { "SECOND", "second" }, */ /* { "WEEK", "week" }, */ /* { "YEAR", "year" }, */ /* { "DATABASE", "database" }, */ { "IFNULL", "coalesce" }, { "USER", "odbc_user" }, { 0, 0 } }; char *mapFunction(char *func); unsigned int conv_from_octal(unsigned char *s); unsigned int conv_from_hex(unsigned char *s); char *conv_to_octal(unsigned char val); /******** A Guide for date/time/timestamp conversions ************** field_type fCType Output ---------- ------ ---------- PG_TYPE_DATE SQL_C_DEFAULT SQL_C_DATE PG_TYPE_DATE SQL_C_DATE SQL_C_DATE PG_TYPE_DATE SQL_C_TIMESTAMP SQL_C_TIMESTAMP (time = 0 (midnight)) PG_TYPE_TIME SQL_C_DEFAULT SQL_C_TIME PG_TYPE_TIME SQL_C_TIME SQL_C_TIME PG_TYPE_TIME SQL_C_TIMESTAMP SQL_C_TIMESTAMP (date = current date) PG_TYPE_ABSTIME SQL_C_DEFAULT SQL_C_TIMESTAMP PG_TYPE_ABSTIME SQL_C_DATE SQL_C_DATE (time is truncated) PG_TYPE_ABSTIME SQL_C_TIME SQL_C_TIME (date is truncated) PG_TYPE_ABSTIME SQL_C_TIMESTAMP SQL_C_TIMESTAMP ******************************************************************************/ /* This is called by SQLFetch() */ int copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col) { BindInfoClass *bic = &(stmt->bindings[col]); return copy_and_convert_field(stmt, field_type, value, (Int2)bic->returntype, (PTR)bic->buffer, (SDWORD)bic->buflen, (SQLLEN *)bic->used); } static void setup_ts( SIMPLE_TIME st ) { time_t t = time( NULL ); struct tm *tim; #ifdef HAVE_LOCALTIME_R struct tm tp; #endif #ifdef HAVE_LOCALTIME_R tim = localtime_r(&t, &tp); #else tim = localtime(&t); #endif st.m = tim->tm_mon + 1; st.d = tim->tm_mday; st.y = tim->tm_year + 1900; st.hh = tim->tm_hour; st.mm = tim->tm_min; st.ss = tim->tm_sec; } /* This is called by SQLGetData() */ int copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType, PTR rgbValue, SDWORD cbValueMax, SQLLEN *pcbValue) { Int4 len = 0, copy_len = 0; SIMPLE_TIME st; time_t t; struct tm *tim; int pcbValueOffset, rgbValueOffset; char *rgbValueBindRow, *ptr; int bind_row = stmt->bind_row; int bind_size = stmt->options.bind_size; int result = COPY_OK; /* char tempBuf[TEXT_FIELD_SIZE+5]; */ char *tempBuf; #ifdef HAVE_LOCALE_H char saved_locale[256]; #endif #ifdef HAVE_LOCALTIME_R struct tm tp; #endif /* rgbValueOffset is *ONLY* for character and binary data */ /* pcbValueOffset is for computing any pcbValue location */ tempBuf = (char *) malloc(TEXT_FIELD_SIZE+5); if (bind_size > 0) { pcbValueOffset = rgbValueOffset = (bind_size * bind_row); } else { pcbValueOffset = bind_row * sizeof(SDWORD); rgbValueOffset = bind_row * cbValueMax; } memset(&st, 0, sizeof(SIMPLE_TIME)); mylog("copy_and_convert: field_type = %d, fctype = %d, value = '%s', cbValueMax=%d\n", field_type, fCType, (value==NULL)?"":value, cbValueMax); if ( ! value) { /* handle a null just by returning SQL_NULL_DATA in pcbValue, */ /* and doing nothing to the buffer. */ if(pcbValue) { *(SDWORD *) ((char *) pcbValue + pcbValueOffset) = SQL_NULL_DATA; } free(tempBuf); return COPY_OK; } if (stmt->hdbc->DataSourceToDriver != NULL) { int length = strlen (value); stmt->hdbc->DataSourceToDriver (stmt->hdbc->translation_option, SQL_CHAR, value, length, value, length, NULL, NULL, 0, NULL); } /******************************************************************** First convert any specific postgres types into more useable data. NOTE: Conversions from PG char/varchar of a date/time/timestamp value to SQL_C_DATE,SQL_C_TIME, SQL_C_TIMESTAMP not supported *********************************************************************/ switch(field_type) { /* $$$ need to add parsing for date/time/timestamp strings in PG_TYPE_CHAR,VARCHAR $$$ */ case PG_TYPE_DATE: setup_ts( st ); sscanf(value, "%4d-%2d-%2d", &st.y, &st.m, &st.d); break; case PG_TYPE_TIME: setup_ts( st ); sscanf(value, "%2d:%2d:%2d", &st.hh, &st.mm, &st.ss); break; case PG_TYPE_ABSTIME: case PG_TYPE_DATETIME: case PG_TYPE_TIMESTAMP: case PG_TYPE_TIMESTAMP_NO_TMZONE: setup_ts( st ); if (strnicmp(value, "invalid", 7) != 0) { sscanf(value, "%4d-%2d-%2d %2d:%2d:%2d", &st.y, &st.m, &st.d, &st.hh, &st.mm, &st.ss); } else { /* The timestamp is invalid so set something conspicuous, like the epoch */ t = 0; #ifdef HAVE_LOCALTIME_R tim = localtime_r(&t, &tp); #else tim = localtime(&t); #endif st.m = tim->tm_mon + 1; st.d = tim->tm_mday; st.y = tim->tm_year + 1900; st.hh = tim->tm_hour; st.mm = tim->tm_min; st.ss = tim->tm_sec; } break; case PG_TYPE_BOOL: { /* change T/F to 1/0 */ char *s = (char *) value; if (s[0] == 'T' || s[0] == 't') s[0] = '1'; else s[0] = '0'; } break; /* This is for internal use by SQLStatistics() */ case PG_TYPE_INT2VECTOR: { int nval, i; char *vp; /* this is an array of eight integers */ short *short_array = (short *) ( (char *) rgbValue + rgbValueOffset); len = 16; vp = value; nval = 0; for (i = 0; i < 8; i++) { if (sscanf(vp, "%hd", &short_array[i]) != 1) break; nval++; /* skip the current token */ while ((*vp != '\0') && (! isspace((unsigned char) *vp))) vp++; /* and skip the space to the next token */ while ((*vp != '\0') && (isspace((unsigned char) *vp))) vp++; if (*vp == '\0') break; } for (i = nval; i < 8; i++) { short_array[i] = 0; } #if 0 sscanf(value, "%hd %hd %hd %hd %hd %hd %hd %hd", &short_array[0], &short_array[1], &short_array[2], &short_array[3], &short_array[4], &short_array[5], &short_array[6], &short_array[7]); #endif /* There is no corresponding fCType for this. */ if(pcbValue) *(SDWORD *) ((char *) pcbValue + pcbValueOffset) = len; free(tempBuf); return COPY_OK; /* dont go any further or the data will be trashed */ } /* This is a large object OID, which is used to store LONGVARBINARY objects. */ case PG_TYPE_LO: free(tempBuf); return convert_lo( stmt, value, fCType, ((char *) rgbValue + rgbValueOffset), cbValueMax, (SDWORD *) ((char *) pcbValue + pcbValueOffset)); default: if (field_type == stmt->hdbc->lobj_type) /* hack until permanent type available */ { free(tempBuf); return convert_lo( stmt, value, fCType, ((char *) rgbValue + rgbValueOffset), cbValueMax, (SDWORD *) ((char *) pcbValue + pcbValueOffset)); } } /* Change default into something useable */ if (fCType == SQL_C_DEFAULT) { fCType = pgtype_to_ctype(stmt, field_type); mylog("copy_and_convert, SQL_C_DEFAULT: fCType = %d\n", fCType); } rgbValueBindRow = (char *) rgbValue + rgbValueOffset; if(fCType == SQL_C_CHAR) { /* Special character formatting as required */ /* These really should return error if cbValueMax is not big enough. */ switch(field_type) { case PG_TYPE_DATE: len = 10; if (cbValueMax > len) sprintf(rgbValueBindRow, "%.4d-%.2d-%.2d", st.y, st.m, st.d); break; case PG_TYPE_TIME: len = 8; if (cbValueMax > len) sprintf(rgbValueBindRow, "%.2d:%.2d:%.2d", st.hh, st.mm, st.ss); break; case PG_TYPE_ABSTIME: case PG_TYPE_DATETIME: case PG_TYPE_TIMESTAMP: case PG_TYPE_TIMESTAMP_NO_TMZONE: len = 19; if (cbValueMax > len) sprintf(rgbValueBindRow, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d", st.y, st.m, st.d, st.hh, st.mm, st.ss); break; case PG_TYPE_BOOL: len = 1; if (cbValueMax > len) { strcpy(rgbValueBindRow, value); mylog("PG_TYPE_BOOL: rgbValueBindRow = '%s'\n", rgbValueBindRow); } break; /* Currently, data is SILENTLY TRUNCATED for BYTEA and character data types if there is not enough room in cbValueMax because the driver can't handle multiple calls to SQLGetData for these, yet. Most likely, the buffer passed in will be big enough to handle the maximum limit of postgres, anyway. LongVarBinary types are handled correctly above, observing truncation and all that stuff since there is essentially no limit on the large object used to store those. */ case PG_TYPE_BYTEA: /* convert binary data to hex strings (i.e, 255 = "FF") */ len = convert_pgbinary_to_char(value, rgbValueBindRow, cbValueMax); /***** THIS IS NOT PROPERLY IMPLEMENTED *****/ break; default: /* convert linefeeds to carriage-return/linefeed */ len = convert_linefeeds(value, tempBuf, TEXT_FIELD_SIZE+5); ptr = tempBuf; mylog("DEFAULT: len = %d, ptr = '%s'\n", len, ptr); if (stmt->current_col >= 0) { if (stmt->bindings[stmt->current_col].data_left == 0) { free( tempBuf ); return COPY_NO_DATA_FOUND; } else if (stmt->bindings[stmt->current_col].data_left > 0) { ptr += len - stmt->bindings[stmt->current_col].data_left; len = stmt->bindings[stmt->current_col].data_left; } else stmt->bindings[stmt->current_col].data_left = strlen(ptr); } if (cbValueMax > 0) { copy_len = (len >= cbValueMax) ? cbValueMax -1 : len; #ifdef HAVE_LOCALE_H switch (field_type) { case PG_TYPE_FLOAT4: case PG_TYPE_FLOAT8: case PG_TYPE_NUMERIC: { struct lconv *lc; char *new_string; int i, j, dplen; new_string = malloc( cbValueMax ); lc = localeconv(); dplen = strlen(lc->decimal_point); for (i = 0, j = 0; (j < cbValueMax - 1) && ptr[i]; i++) if (ptr[i] == '.') { if ((j + dplen) <= (cbValueMax - 1)) { strncpy(&new_string[j], lc->decimal_point, dplen); j += dplen; } else break; } else new_string[j++] = ptr[i]; new_string[j] = '\0'; strncpy_null(rgbValueBindRow, new_string, copy_len + 1); free(new_string); break; } default: /* Copy the data */ strncpy_null(rgbValueBindRow, ptr, copy_len + 1); } #else /* Copy the data */ strncpy_null(rgbValueBindRow, ptr, copy_len + 1); #endif /* Adjust data_left for next time */ if (stmt->current_col >= 0) { stmt->bindings[stmt->current_col].data_left -= copy_len; } } /* Finally, check for truncation so that proper status can be returned */ if ( len >= cbValueMax) result = COPY_RESULT_TRUNCATED; mylog(" SQL_C_CHAR, default: len = %d, cbValueMax = %d, rgbValueBindRow = '%s'\n", len, cbValueMax, rgbValueBindRow); break; } } else { /* for SQL_C_CHAR, it's probably ok to leave currency symbols in. But to convert to numeric types, it is necessary to get rid of those. */ if (field_type == PG_TYPE_MONEY) convert_money(value); switch(fCType) { case SQL_C_DATE: len = 6; { DATE_STRUCT *ds; if (bind_size > 0) { ds = (DATE_STRUCT *) ((char *) rgbValue + (bind_row * bind_size)); } else { ds = (DATE_STRUCT *) rgbValue + bind_row; } ds->year = st.y; ds->month = st.m; ds->day = st.d; } break; case SQL_C_TIME: len = 6; { TIME_STRUCT *ts; if (bind_size > 0) { ts = (TIME_STRUCT *) ((char *) rgbValue + (bind_row * bind_size)); } else { ts = (TIME_STRUCT *) rgbValue + bind_row; } ts->hour = st.hh; ts->minute = st.mm; ts->second = st.ss; } break; case SQL_C_TIMESTAMP: len = 16; { TIMESTAMP_STRUCT *ts; if (bind_size > 0) { ts = (TIMESTAMP_STRUCT *) ((char *) rgbValue + (bind_row * bind_size)); } else { ts = (TIMESTAMP_STRUCT *) rgbValue + bind_row; } ts->year = st.y; ts->month = st.m; ts->day = st.d; ts->hour = st.hh; ts->minute = st.mm; ts->second = st.ss; ts->fraction = 0; } break; case SQL_C_BIT: len = 1; if (bind_size > 0) { *(UCHAR *) ((char *) rgbValue + (bind_row * bind_size)) = atoi(value); } else { *((UCHAR *)rgbValue + bind_row) = atoi(value); } /* mylog("SQL_C_BIT: val = %d, cb = %d, rgb=%d\n", atoi(value), cbValueMax, *((UCHAR *)rgbValue)); */ break; case SQL_C_STINYINT: case SQL_C_TINYINT: len = 1; if (bind_size > 0) { *(SCHAR *) ((char *) rgbValue + (bind_row * bind_size)) = atoi(value); } else { *((SCHAR *) rgbValue + bind_row) = atoi(value); } break; case SQL_C_UTINYINT: len = 1; if (bind_size > 0) { *(UCHAR *) ((char *) rgbValue + (bind_row * bind_size)) = atoi(value); } else { *((UCHAR *) rgbValue + bind_row) = atoi(value); } break; case SQL_C_FLOAT: #ifdef HAVE_LOCALE_H strcpy(saved_locale,setlocale(LC_ALL, NULL)); setlocale(LC_ALL, "C"); #endif len = 4; if (bind_size > 0) { *(SFLOAT *) ((char *) rgbValue + (bind_row * bind_size)) = (float) atof(value); } else { *((SFLOAT *)rgbValue + bind_row) = (float) atof(value); } #ifdef HAVE_LOCALE_H setlocale(LC_ALL, saved_locale); #endif break; case SQL_C_DOUBLE: #ifdef HAVE_LOCALE_H strcpy(saved_locale, setlocale(LC_ALL, NULL)); setlocale(LC_ALL, "C"); #endif len = 8; if (bind_size > 0) { *(SDOUBLE *) ((char *) rgbValue + (bind_row * bind_size)) = atof(value); } else { *((SDOUBLE *)rgbValue + bind_row) = atof(value); } #ifdef HAVE_LOCALE_H setlocale(LC_ALL, saved_locale); #endif break; case SQL_C_SSHORT: case SQL_C_SHORT: len = 2; if (bind_size > 0) { *(SWORD *) ((char *) rgbValue + (bind_row * bind_size)) = atoi(value); } else { *((SWORD *)rgbValue + bind_row) = atoi(value); } break; case SQL_C_USHORT: len = 2; if (bind_size > 0) { *(UWORD *) ((char *) rgbValue + (bind_row * bind_size)) = atoi(value); } else { *((UWORD *)rgbValue + bind_row) = atoi(value); } break; case SQL_C_SLONG: case SQL_C_LONG: len = 4; if (bind_size > 0) { *(SDWORD *) ((char *) rgbValue + (bind_row * bind_size)) = atol(value); } else { *((SDWORD *)rgbValue + bind_row) = atol(value); } break; case SQL_C_ULONG: len = 4; if (bind_size > 0) { *(UDWORD *) ((char *) rgbValue + (bind_row * bind_size)) = atol(value); } else { *((UDWORD *)rgbValue + bind_row) = atol(value); } break; #ifdef HAVE_LONG_LONG case SQL_BIGINT: { long long lv; len = 8; #ifdef HAVE_ATOLL lv = atoll( value ); #elif HAVE_STROLL lv = strtoll( value, NULL, 10 ); #else lv = atol( value ); #endif if (bind_size > 0) { *(long long *) ((char *) rgbValue + (bind_row * bind_size)) = lv; } else { *((long long *)rgbValue + bind_row) = lv; } } break; #endif case SQL_C_BINARY: /* truncate if necessary */ /* convert octal escapes to bytes */ len = convert_from_pgbinary(value, (SQLCHAR*)tempBuf, TEXT_FIELD_SIZE+5); ptr = tempBuf; if (stmt->current_col >= 0) { /* No more data left for this column */ if (stmt->bindings[stmt->current_col].data_left == 0) { free(tempBuf); return COPY_NO_DATA_FOUND; } /* Second (or more) call to SQLGetData so move the pointer */ else if (stmt->bindings[stmt->current_col].data_left > 0) { ptr += len - stmt->bindings[stmt->current_col].data_left; len = stmt->bindings[stmt->current_col].data_left; } /* First call to SQLGetData so initialize data_left */ else stmt->bindings[stmt->current_col].data_left = len; } if (cbValueMax > 0) { copy_len = (len > cbValueMax) ? cbValueMax : len; /* Copy the data */ memcpy(rgbValueBindRow, ptr, copy_len); /* Adjust data_left for next time */ if (stmt->current_col >= 0) { stmt->bindings[stmt->current_col].data_left -= copy_len; } } /* Finally, check for truncation so that proper status can be returned */ if ( len > cbValueMax) result = COPY_RESULT_TRUNCATED; mylog("SQL_C_BINARY: len = %d, copy_len = %d\n", len, copy_len); break; default: free(tempBuf); return COPY_UNSUPPORTED_TYPE; } } /* store the length of what was copied, if there's a place for it */ if(pcbValue) { *(SDWORD *) ((char *)pcbValue + pcbValueOffset) = len; } free(tempBuf); return result; } /* This function inserts parameters into an SQL statements. It will also modify a SELECT statement for use with declare/fetch cursors. This function no longer does any dynamic memory allocation! */ int copy_statement_with_parameters(StatementClass *stmt) { static char* const func="copy_statement_with_parameters"; unsigned int opos, npos, oldstmtlen; char param_string[1024], tmp[256]; char * cbuf; /* [TEXT_FIELD_SIZE+5]; */ int param_number; Int2 param_ctype, param_sqltype; char *old_statement = stmt->statement; char *new_statement = stmt->stmt_with_params; SIMPLE_TIME st; time_t t = time(NULL); struct tm *tim; SDWORD used; char *buffer, *buf; char in_quote = FALSE; Oid lobj_oid; int lobj_fd, retval; stmt -> reexecute = 0; cbuf=(char *)malloc(TEXT_FIELD_SIZE+5); if ( ! old_statement) { SC_log_error(func, "No statement string", stmt); free(cbuf); return SQL_ERROR; } memset(&st, 0, sizeof(SIMPLE_TIME)); /* If the application hasn't set a cursor name, then generate one */ if ( stmt->cursor_name[0] == '\0') sprintf(stmt->cursor_name, "SQL_CUR%p", stmt); /* For selects, prepend a declare cursor to the statement */ if (stmt->statement_type == STMT_TYPE_SELECT && globals.use_declarefetch) { sprintf(new_statement, "declare %s cursor for ", stmt->cursor_name); npos = strlen(new_statement); } else { new_statement[0] = '0'; npos = 0; } param_number = -1; oldstmtlen = strlen(old_statement); for (opos = 0; opos < oldstmtlen; opos++) { /* Squeeze carriage-return/linefeed pairs to linefeed only */ if (old_statement[opos] == '\r' && opos+1 < oldstmtlen && old_statement[opos+1] == '\n') { continue; } /* Handle literals (date, time, timestamp) and ODBC scalar functions */ else if (old_statement[opos] == '{') { char *esc; char *begin = &old_statement[opos + 1]; char *end = strchr(begin, '}'); if ( ! end) continue; *end = '\0'; esc = convert_escape(begin); if (esc) { memcpy(&new_statement[npos], esc, strlen(esc)); npos += strlen(esc); } else { /* it's not a valid literal so just copy */ *end = '}'; new_statement[npos++] = old_statement[opos]; continue; } opos += end - begin + 1; *end = '}'; continue; } /* Can you have parameter markers inside of quotes? I dont think so. All the queries I've seen expect the driver to put quotes if needed. */ else if (old_statement[opos] == '?' && !in_quote) ; /* ok */ else { if (old_statement[opos] == '\'') in_quote = (in_quote ? FALSE : TRUE); new_statement[npos++] = old_statement[opos]; continue; } /****************************************************/ /* Its a '?' parameter alright */ /****************************************************/ param_number++; if (param_number >= stmt->parameters_allocated) { strcpy(&new_statement[npos], "NULL"); npos += strlen("NULL"); stmt -> reexecute = 1; continue; } /* Assign correct buffers based on data at exec param or not */ if ( stmt->parameters[param_number].data_at_exec) { used = stmt->parameters[param_number].EXEC_used ? *stmt->parameters[param_number].EXEC_used : SQL_NTS; buffer = stmt->parameters[param_number].EXEC_buffer; } else { used = stmt->parameters[param_number].used ? *stmt->parameters[param_number].used : SQL_NTS; buffer = stmt->parameters[param_number].buffer; } /* Handle NULL parameter data */ if (used == SQL_NULL_DATA) { strcpy(&new_statement[npos], "NULL"); npos += 4; continue; } /* If no buffer, and it's not null, then what the hell is it? Just leave it alone then. */ if ( ! buffer) { new_statement[npos++] = '?'; continue; } param_ctype = stmt->parameters[param_number].CType; param_sqltype = stmt->parameters[param_number].SQLType; mylog("copy_statement_with_params: from(fcType)=%d, to(fSqlType)=%d\n", param_ctype, param_sqltype); /* replace DEFAULT with something we can use */ if(param_ctype == SQL_C_DEFAULT) param_ctype = sqltype_to_default_ctype(param_sqltype); buf = NULL; param_string[0] = '\0'; cbuf[0] = '\0'; /* Convert input C type to a neutral format */ switch(param_ctype) { case SQL_C_BINARY: buf = buffer; break; #ifdef HAVE_LOCALE_H case SQL_C_CHAR: if (param_sqltype == SQL_NUMERIC || param_sqltype == SQL_DECIMAL || param_sqltype == SQL_FLOAT || param_sqltype == SQL_REAL || param_sqltype == SQL_DOUBLE) { struct lconv *lc; int i, j, dplen; lc = localeconv(); dplen = strlen(lc->decimal_point); for (i = 0, j = 0; j < sizeof(param_string)-1 && buffer[i]; ) if (!strncmp(&buffer[i], lc->decimal_point, dplen)) { param_string[j++] = '.'; i += dplen; } else param_string[j++] = buffer[i++]; param_string[j] = '\0'; break; } else buf = buffer; break; #else case SQL_C_CHAR: buf = buffer; break; #endif case SQL_C_DOUBLE: #ifdef HAVE_LOCALE_H strcpy(tmp, setlocale(LC_ALL, NULL)); setlocale(LC_ALL, "C"); #endif sprintf(param_string, "%g", *((SDOUBLE *) buffer)); #ifdef HAVE_LOCALE_H setlocale(LC_ALL, tmp); #endif break; case SQL_C_FLOAT: #ifdef HAVE_LOCALE_H strcpy(tmp, setlocale(LC_ALL, NULL)); setlocale(LC_ALL, "C"); #endif sprintf(param_string, "%g", *((SFLOAT *) buffer)); #ifdef HAVE_LOCALE_H setlocale(LC_ALL, tmp); #endif break; case SQL_C_SLONG: case SQL_C_LONG: #if (SIZEOF_LONG_INT == 4) sprintf(param_string, "%ld", #else sprintf(param_string, "%d", #endif *((SDWORD *) buffer)); break; case SQL_C_SSHORT: case SQL_C_SHORT: sprintf(param_string, "%d", *((SWORD *) buffer)); break; case SQL_C_STINYINT: case SQL_C_TINYINT: sprintf(param_string, "%d", *((SCHAR *) buffer)); break; case SQL_C_ULONG: #if (SIZEOF_LONG_INT == 4) sprintf(param_string, "%lu", #else sprintf(param_string, "%u", #endif *((UDWORD *) buffer)); break; case SQL_C_USHORT: sprintf(param_string, "%u", *((UWORD *) buffer)); break; case SQL_C_UTINYINT: sprintf(param_string, "%u", *((UCHAR *) buffer)); break; case SQL_C_BIT: { int i = *((UCHAR *) buffer); sprintf(param_string, "%d", i ? 1 : 0); break; } case SQL_C_DATE: { DATE_STRUCT *ds = (DATE_STRUCT *) buffer; setup_ts( st ); st.m = ds->month; st.d = ds->day; st.y = ds->year; break; } case SQL_C_TIME: { TIME_STRUCT *ts = (TIME_STRUCT *) buffer; setup_ts( st ); st.hh = ts->hour; st.mm = ts->minute; st.ss = ts->second; break; } case SQL_C_TIMESTAMP: { TIMESTAMP_STRUCT *tss = (TIMESTAMP_STRUCT *) buffer; setup_ts( st ); st.m = tss->month; st.d = tss->day; st.y = tss->year; st.hh = tss->hour; st.mm = tss->minute; st.ss = tss->second; mylog("m=%d,d=%d,y=%d,hh=%d,mm=%d,ss=%d\n", st.m, st.d, st.y, st.hh, st.mm, st.ss); break; } default: /* error */ SC_set_error(stmt, STMT_NOT_IMPLEMENTED_ERROR, "Unrecognized C_parameter type in copy_statement_with_parameters"); new_statement[npos] = '\0'; /* just in case */ SC_log_error(func, "", stmt); free(cbuf); return SQL_ERROR; } /* Now that the input data is in a neutral format, convert it to the desired output format (sqltype) */ switch(param_sqltype) { case SQL_CHAR: case SQL_VARCHAR: case SQL_LONGVARCHAR: new_statement[npos++] = '\''; /* Open Quote */ /* it was a SQL_C_CHAR */ if (buf) { convert_special_chars(buf, &new_statement[npos], used); npos += strlen(&new_statement[npos]); } /* it was a numeric type */ else if (param_string[0] != '\0') { strcpy(&new_statement[npos], param_string); npos += strlen(param_string); } /* it was date,time,timestamp -- use m,d,y,hh,mm,ss */ else { setup_ts( st ); sprintf(tmp, "%.4d-%.2d-%.2d %.2d:%.2d:%.2d", st.y, st.m, st.d, st.hh, st.mm, st.ss); strcpy(&new_statement[npos], tmp); npos += strlen(tmp); } new_statement[npos++] = '\''; /* Close Quote */ break; case SQL_DATE: if (buf) { /* copy char data to time */ my_strcpy(cbuf, TEXT_FIELD_SIZE+5, buf, used); parse_datetime(cbuf, &st); } sprintf(tmp, "'%.4d-%.2d-%.2d'", st.y, st.m, st.d); strcpy(&new_statement[npos], tmp); npos += strlen(tmp); break; case SQL_TIME: if (buf) { /* copy char data to time */ my_strcpy(cbuf, TEXT_FIELD_SIZE+5, buf, used); parse_datetime(cbuf, &st); } sprintf(tmp, "'%.2d:%.2d:%.2d'", st.hh, st.mm, st.ss); strcpy(&new_statement[npos], tmp); npos += strlen(tmp); break; case SQL_TIMESTAMP: if (buf) { my_strcpy(cbuf, TEXT_FIELD_SIZE+5, buf, used); parse_datetime(cbuf, &st); } sprintf(tmp, "'%.4d-%.2d-%.2d %.2d:%.2d:%.2d'", st.y, st.m, st.d, st.hh, st.mm, st.ss); strcpy(&new_statement[npos], tmp); npos += strlen(tmp); break; case SQL_BINARY: case SQL_VARBINARY: /* non-ascii characters should be converted to octal */ new_statement[npos++] = '\''; /* Open Quote */ mylog("SQL_VARBINARY: about to call convert_to_pgbinary, used = %d\n", used); npos += convert_to_pgbinary((SQLCHAR*)buf, &new_statement[npos], used); new_statement[npos++] = '\''; /* Close Quote */ break; case SQL_LONGVARBINARY: if ( stmt->parameters[param_number].data_at_exec) { lobj_oid = stmt->parameters[param_number].lobj_oid; } else { /* begin transaction if needed */ if(!CC_is_in_trans(stmt->hdbc)) { QResultClass *res; char ok; res = CC_send_query(stmt->hdbc, "BEGIN", NULL); if (!res) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not begin (in-line) a transaction"); SC_log_error(func, "", stmt); free(cbuf); return SQL_ERROR; } ok = QR_command_successful(res); QR_Destructor(res); if (!ok) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not begin (in-line) a transaction"); SC_log_error(func, "", stmt); free(cbuf); return SQL_ERROR; } CC_set_in_trans(stmt->hdbc); } /* store the oid */ lobj_oid = odbc_lo_creat(stmt->hdbc, INV_READ | INV_WRITE); if (lobj_oid == 0) { SC_set_error(stmt, STMT_EXEC_ERROR, "Couldnt create (in-line) large object."); SC_log_error(func, "", stmt); free(cbuf); return SQL_ERROR; } /* store the fd */ lobj_fd = odbc_lo_open(stmt->hdbc, lobj_oid, INV_WRITE); if ( lobj_fd < 0) { SC_set_error(stmt, STMT_EXEC_ERROR, "Couldnt open (in-line) large object for writing."); SC_log_error(func, "", stmt); free(cbuf); return SQL_ERROR; } retval = odbc_lo_write(stmt->hdbc, lobj_fd, buffer, used); odbc_lo_close(stmt->hdbc, lobj_fd); /* commit transaction if needed */ if (!globals.use_declarefetch && CC_is_in_autocommit(stmt->hdbc)) { QResultClass *res; char ok; res = CC_send_query(stmt->hdbc, "COMMIT", NULL); if (!res) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction"); SC_log_error(func, "", stmt); free(cbuf); return SQL_ERROR; } ok = QR_command_successful(res); QR_Destructor(res); if (!ok) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction"); SC_log_error(func, "", stmt); free(cbuf); return SQL_ERROR; } CC_set_no_trans(stmt->hdbc); } } /* the oid of the large object -- just put that in for the parameter marker -- the data has already been sent to the large object */ sprintf(param_string, "'%d'", lobj_oid); strcpy(&new_statement[npos], param_string); npos += strlen(param_string); break; /* because of no conversion operator for bool and int4, SQL_BIT */ /* must be quoted (0 or 1 is ok to use inside the quotes) */ case SQL_REAL: if (buf) my_strcpy(param_string, sizeof(param_string), buf, used); sprintf(tmp, "'%s'::float4", param_string); strcpy(&new_statement[npos], tmp); npos += strlen(tmp); break; case SQL_FLOAT: case SQL_DOUBLE: if (buf) my_strcpy(param_string, sizeof(param_string), buf, used); sprintf(tmp, "'%s'::float8", param_string); strcpy(&new_statement[npos], tmp); npos += strlen(tmp); break; case SQL_NUMERIC: if (buf) { cbuf[0] = '\''; my_strcpy(cbuf + 1, TEXT_FIELD_SIZE+5 - 12, buf, used); /* 12 = 1('\'') + strlen("'::numeric") + 1('\0') */ strcat(cbuf, "'::numeric"); } else sprintf(cbuf, "'%s'::numeric", param_string); my_strcpy(&new_statement[npos], sizeof(stmt->stmt_with_params) - npos - 1, cbuf, strlen(cbuf)); npos += strlen(&new_statement[npos]); break; default: /* a numeric type or SQL_BIT */ if (param_sqltype == SQL_BIT) new_statement[npos++] = '\''; /* Open Quote */ if (buf) { my_strcpy(&new_statement[npos], sizeof(stmt->stmt_with_params) - npos, buf, used); npos += strlen(&new_statement[npos]); } else { strcpy(&new_statement[npos], param_string); npos += strlen(param_string); } if (param_sqltype == SQL_BIT) new_statement[npos++] = '\''; /* Close Quote */ break; } } /* end, for */ /* make sure new_statement is always null-terminated */ new_statement[npos] = '\0'; if(stmt->hdbc->DriverToDataSource != NULL) { int length = strlen (new_statement); stmt->hdbc->DriverToDataSource (stmt->hdbc->translation_option, SQL_CHAR, new_statement, length, new_statement, length, NULL, NULL, 0, NULL); } free(cbuf); return SQL_SUCCESS; } char * mapFunction(char *func) { int i; for (i = 0; mapFuncs[i][0]; i++) if ( ! stricmp(mapFuncs[i][0], func)) return mapFuncs[i][1]; return NULL; } /* convert_escape() * This function returns a pointer to static memory! */ char * convert_escape(char *value) { static char escape[1024]; char key[33]; /* Separate off the key, skipping leading and trailing whitespace */ while ((*value != '\0') && isspace((unsigned char) *value)) value++; sscanf(value, "%32s", key); while ((*value != '\0') && (! isspace((unsigned char) *value))) value++; while ((*value != '\0') && isspace((unsigned char) *value)) value++; mylog("convert_escape: key='%s', val='%s'\n", key, value); if ( (strcmp(key, "d") == 0) || (strcmp(key, "t") == 0) || (strcmp(key, "ts") == 0) || (stricmp(key, "oj") == 0)) { /* Literal; return the escape part as-is */ strncpy(escape, value, sizeof(escape)-1); } else if (strcmp(key, "fn") == 0) { /* Function invocation * Separate off the func name, * skipping trailing whitespace. */ char *funcEnd = value; char svchar; char *mapFunc; while ((*funcEnd != '\0') && (*funcEnd != '(') && (! isspace((unsigned char) *funcEnd))) funcEnd++; svchar = *funcEnd; *funcEnd = '\0'; sscanf(value, "%32s", key); *funcEnd = svchar; while ((*funcEnd != '\0') && isspace((unsigned char) *funcEnd)) funcEnd++; /* We expect left parenthesis here, * else return fn body as-is since it is * one of those "function constants". */ if (*funcEnd != '(') { strncpy(escape, value, sizeof(escape)-1); return escape; } mapFunc = mapFunction(key); /* We could have mapFunction() return key if not in table... * - thomas 2000-04-03 */ if (mapFunc == NULL) { /* If unrecognized function name, return fn body as-is */ strncpy(escape, value, sizeof(escape)-1); return escape; } /* copy mapped name and remaining input string */ strcpy(escape, mapFunc); strncat(escape, funcEnd, sizeof(escape)-1-strlen(mapFunc)); } else { /* Bogus key, leave untranslated */ return NULL; } return escape; } char * convert_money(char *s) { size_t i = 0, out = 0, slen=strlen(s); for (i = 0; i < slen; i++) { if (s[i] == '$' || s[i] == ',' || s[i] == ')') ; /* skip these characters */ else if (s[i] == '(') s[out++] = '-'; else s[out++] = s[i]; } s[out] = '\0'; return s; } /* This function parses a character string for date/time info and fills in SIMPLE_TIME */ /* It does not zero out SIMPLE_TIME in case it is desired to initialize it with a value */ char parse_datetime(char *buf, SIMPLE_TIME *st) { int y,m,d,hh,mm,ss; int nf; y = m = d = hh = mm = ss = 0; if (buf[4] == '-') /* year first */ nf = sscanf(buf, "%4d-%2d-%2d %2d:%2d:%2d", &y,&m,&d,&hh,&mm,&ss); else nf = sscanf(buf, "%2d-%2d-%4d %2d:%2d:%2d", &m,&d,&y,&hh,&mm,&ss); if (nf == 5 || nf == 6) { st->y = y; st->m = m; st->d = d; st->hh = hh; st->mm = mm; st->ss = ss; return TRUE; } if (buf[4] == '-') /* year first */ nf = sscanf(buf, "%4d-%2d-%2d", &y, &m, &d); else nf = sscanf(buf, "%2d-%2d-%4d", &m, &d, &y); if (nf == 3) { st->y = y; st->m = m; st->d = d; return TRUE; } nf = sscanf(buf, "%2d:%2d:%2d", &hh, &mm, &ss); if (nf == 2 || nf == 3) { st->hh = hh; st->mm = mm; st->ss = ss; return TRUE; } return FALSE; } /* Change linefeed to carriage-return/linefeed */ int convert_linefeeds(char *si, char *dst, size_t max) { size_t i = 0, out = 0; for (i = 0; si[ i ] && out < max - 1; i++) { if (si[i] == '\n') { /* Only add the carriage-return if needed */ if (i > 0 && si[i-1] == '\r') { dst[out++] = si[i]; continue; } dst[out++] = '\r'; dst[out++] = '\n'; } else dst[out++] = si[i]; } dst[out] = '\0'; return out; } /* Change carriage-return/linefeed to just linefeed Plus, escape any special characters. */ char * convert_special_chars(char *si, char *dst, int used) { size_t i = 0, out = 0, max; /*static char sout[TEXT_FIELD_SIZE+5];*/ char *p; int in_len = strlen( si ); if (dst) p = dst; else /* p = sout; */ { printf("BUG !!! convert_special_chars\n"); exit(0); } p[0] = '\0'; if (used == SQL_NTS) max = strlen(si); else max = used; for (i = 0; i < max; i++) { if (si[i] == '\r' && i+1 < in_len && si[i+1] == '\n') continue; else if (si[i] == '\'' || si[i] == '\\') p[out++] = '\\'; p[out++] = si[i]; } p[out] = '\0'; return p; } /* !!! Need to implement this function !!! */ int convert_pgbinary_to_char(char *value, char *rgbValue, int cbValueMax) { mylog("convert_pgbinary_to_char: value = '%s'\n", value); strncpy_null(rgbValue, value, cbValueMax); return 0; } unsigned int conv_from_octal(unsigned char *s) { int i, y=0; for (i = 1; i <= 3; i++) { y += (s[i] - 48) * (int) pow(8, 3-i); } return y; } unsigned int conv_from_hex(unsigned char *s) { int i, y=0, val; for (i = 1; i <= 2; i++) { if (s[i] >= 'a' && s[i] <= 'f') val = s[i] - 'a' + 10; else if (s[i] >= 'A' && s[i] <= 'F') val = s[i] - 'A' + 10; else val = s[i] - '0'; y += val * (int) pow(16, 2-i); } return y; } /* convert octal escapes to bytes */ int convert_from_pgbinary(unsigned char *value, unsigned char *rgbValue, int cbValueMax) { int o=0; size_t i, valen=strlen((char*)value);; for (i = 0; i < valen && o < cbValueMax; ) { if (value[i] == '\\') { rgbValue[o] = conv_from_octal(&value[i]); i += 4; } else { rgbValue[o] = value[i++]; } mylog("convert_from_pgbinary: i=%d, rgbValue[%d] = %d, %c\n", i, o, rgbValue[o], rgbValue[o]); o++; } rgbValue[o] = '\0'; /* extra protection */ return o; } char * conv_to_octal(unsigned char val) { int i; static char x[6]; x[0] = '\\'; x[1] = '\\'; x[5] = '\0'; for (i = 4; i > 1; i--) { x[i] = (val & 7) + 48; val >>= 3; } return x; } /* convert non-ascii bytes to octal escape sequences */ int convert_to_pgbinary(unsigned char *in, char *out, int len) { int i, o=0; for (i = 0; i < len; i++) { mylog("convert_to_pgbinary: in[%d] = %d, %c\n", i, in[i], in[i]); if ( isalnum(in[i]) || in[i] == ' ') { out[o++] = in[i]; } else { strcpy(&out[o], conv_to_octal(in[i])); o += 5; } } mylog("convert_to_pgbinary: returning %d, out='%.*s'\n", o, o, out); return o; } void encode(char *in, char *out) { unsigned int i, o = 0; size_t inlen=strlen(in); for (i = 0; i < inlen; i++) { if ( in[i] == '+') { sprintf(&out[o], "%%2B"); o += 3; } else if ( isspace((unsigned char) in[i])) { out[o++] = '+'; } else if ( ! isalnum((unsigned char) in[i])) { sprintf(&out[o], "%%%02x", (unsigned char) in[i]); o += 3; } else out[o++] = in[i]; } out[o++] = '\0'; } void decode(char *in, char *out) { unsigned int i, o = 0; size_t stlen=strlen(in); for(i=0; i < stlen; i++) { if (in[i] == '+') out[o++] = ' '; else if (in[i] == '%') { sprintf(&out[o++], "%c", conv_from_hex((SQLCHAR*)&in[i])); i+=2; } else out[o++] = in[i]; } out[o++] = '\0'; } /* 1. get oid (from 'value') 2. open the large object 3. read from the large object (handle multiple GetData) 4. close when read less than requested? -OR- lseek/read each time handle case where application receives truncated and decides not to continue reading. CURRENTLY, ONLY LONGVARBINARY is handled, since that is the only data type currently mapped to a PG_TYPE_LO. But, if any other types are desired to map to a large object (PG_TYPE_LO), then that would need to be handled here. For example, LONGVARCHAR could possibly be mapped to PG_TYPE_LO someday, instead of PG_TYPE_TEXT as it is now. */ int convert_lo(StatementClass *stmt, void *value, Int2 fCType, PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue) { Oid oid; int retval, result, left = -1; BindInfoClass *bindInfo = NULL; /* If using SQLGetData, then current_col will be set */ if (stmt->current_col >= 0) { bindInfo = &stmt->bindings[stmt->current_col]; left = bindInfo->data_left; } /* if this is the first call for this column, open the large object for reading */ if ( ! bindInfo || bindInfo->data_left == -1) { /* begin transaction if needed */ if(!CC_is_in_trans(stmt->hdbc)) { QResultClass *res; char ok; res = CC_send_query(stmt->hdbc, "BEGIN", NULL); if (!res) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not begin (in-line) a transaction"); return COPY_GENERAL_ERROR; } ok = QR_command_successful(res); QR_Destructor(res); if (!ok) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not begin (in-line) a transaction"); return COPY_GENERAL_ERROR; } CC_set_in_trans(stmt->hdbc); } oid = atoi(value); stmt->lobj_fd = odbc_lo_open(stmt->hdbc, oid, INV_READ); if (stmt->lobj_fd < 0) { SC_set_error(stmt, STMT_EXEC_ERROR, "Couldnt open large object for reading."); return COPY_GENERAL_ERROR; } /* Get the size */ retval = odbc_lo_lseek(stmt->hdbc, stmt->lobj_fd, 0L, SEEK_END); if (retval >= 0) { left = odbc_lo_tell(stmt->hdbc, stmt->lobj_fd); if (bindInfo) bindInfo->data_left = left; /* return to beginning */ odbc_lo_lseek(stmt->hdbc, stmt->lobj_fd, 0L, SEEK_SET); } } if (left == 0) { return COPY_NO_DATA_FOUND; } if (stmt->lobj_fd < 0) { SC_set_error(stmt, STMT_EXEC_ERROR, "Large object FD undefined for multiple read."); return COPY_GENERAL_ERROR; } retval = odbc_lo_read(stmt->hdbc, stmt->lobj_fd, (char *) rgbValue, cbValueMax); if (retval < 0) { odbc_lo_close(stmt->hdbc, stmt->lobj_fd); /* commit transaction if needed */ if (!globals.use_declarefetch && CC_is_in_autocommit(stmt->hdbc)) { QResultClass *res; char ok; res = CC_send_query(stmt->hdbc, "COMMIT", NULL); if (!res) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction"); return COPY_GENERAL_ERROR; } ok = QR_command_successful(res); QR_Destructor(res); if (!ok) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction"); return COPY_GENERAL_ERROR; } CC_set_no_trans(stmt->hdbc); } stmt->lobj_fd = -1; SC_set_error(stmt, STMT_EXEC_ERROR, "Error reading from large object."); return COPY_GENERAL_ERROR; } if (retval < left) result = COPY_RESULT_TRUNCATED; else result = COPY_OK; if (pcbValue) *pcbValue = left < 0 ? SQL_NO_TOTAL : left; if (bindInfo && bindInfo->data_left > 0) bindInfo->data_left -= retval; if (! bindInfo || bindInfo->data_left == 0) { odbc_lo_close(stmt->hdbc, stmt->lobj_fd); /* commit transaction if needed */ if (!globals.use_declarefetch && CC_is_in_autocommit(stmt->hdbc)) { QResultClass *res; char ok; res = CC_send_query(stmt->hdbc, "COMMIT", NULL); if (!res) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction"); return COPY_GENERAL_ERROR; } ok = QR_command_successful(res); QR_Destructor(res); if (!ok) { SC_set_error(stmt, STMT_EXEC_ERROR, "Could not commit (in-line) a transaction"); return COPY_GENERAL_ERROR; } CC_set_no_trans(stmt->hdbc); } stmt->lobj_fd = -1; /* prevent further reading */ } return result; } unixODBC-2.3.9/Drivers/Postgre7.1/tuple.c0000755000175000017500000000263112262474475014667 00000000000000 /* Module: tuple.c * * Description: This module contains functions for setting the data for individual * fields (TupleField structure) of a manual result set. * * Important Note: These functions are ONLY used in building manual result sets for * info functions (SQLTables, SQLColumns, etc.) * * Classes: n/a * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "tuple.h" #include #include void set_tuplefield_null(TupleField *tuple_field) { tuple_field->len = 0; tuple_field->value = NULL; /* strdup(""); */ } void set_tuplefield_string(TupleField *tuple_field, char *string) { tuple_field->len = strlen(string); tuple_field->value = malloc(strlen(string)+1); strcpy(tuple_field->value, string); } void set_tuplefield_int2(TupleField *tuple_field, Int2 value) { char buffer[10]; sprintf(buffer,"%d", value); tuple_field->len = strlen(buffer)+1; /* +1 ... is this correct (better be on the save side-...) */ tuple_field->value = strdup(buffer); } void set_tuplefield_int4(TupleField *tuple_field, Int4 value) { char buffer[15]; sprintf(buffer,"%ld", (long)value); tuple_field->len = strlen(buffer)+1; /* +1 ... is this correct (better be on the save side-...) */ tuple_field->value = strdup(buffer); } unixODBC-2.3.9/Drivers/Postgre7.1/misc.c0000755000175000017500000001211112262474475014463 00000000000000 /* Module: misc.c * * Description: This module contains miscellaneous routines * such as for debugging/logging and string functions. * * Classes: n/a * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "psqlodbc.h" #ifndef WIN32 #if HAVE_PWD_H #include #endif #include #include #else #include /* Byron: is this where Windows keeps def. of getpid ? */ #endif extern GLOBAL_VALUES globals; void generate_filename(char*,char*,char*); void generate_filename(char* dirname,char* prefix,char* filename) { int pid = 0; #ifndef WIN32 struct passwd *ptr = 0; ptr = getpwuid(getuid()); #endif pid = getpid(); if(dirname == 0 || filename == 0) return; strcpy(filename,dirname); strcat(filename,DIRSEPARATOR); if(prefix != 0) strcat(filename,prefix); #ifndef WIN32 strcat(filename,ptr->pw_name); #endif sprintf(filename,"%s%u%s",filename,pid,".log"); return; } #ifdef MY_LOG void mylog(char * fmt, ...) { va_list args; char filebuf[80]; FILE* LOGFP = globals.mylogFP; if ( globals.debug) { va_start(args, fmt); if (! LOGFP) { generate_filename(MYLOGDIR,MYLOGFILE,filebuf); LOGFP = fopen(filebuf, PG_BINARY_W); globals.mylogFP = LOGFP; setbuf(LOGFP, NULL); } if (LOGFP) vfprintf(LOGFP, fmt, args); va_end(args); } } #endif #ifdef Q_LOG void qlog(char * fmt, ...) { va_list args; char filebuf[80]; FILE* LOGFP = globals.qlogFP; if ( globals.commlog) { va_start(args, fmt); if (! LOGFP) { generate_filename(QLOGDIR,QLOGFILE,filebuf); LOGFP = fopen(filebuf, PG_BINARY_W); globals.qlogFP = LOGFP; setbuf(LOGFP, NULL); } if (LOGFP) vfprintf(LOGFP, fmt, args); va_end(args); } } #endif /* Undefine these because windows.h will redefine and cause a warning */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef WIN32 #undef va_start #undef va_end #endif #ifndef WIN32 #include "isql.h" #else #include #include #endif /* returns STRCPY_FAIL, STRCPY_TRUNCATED, or #bytes copied (not including null term) */ int my_strcpy(char *dst, int dst_len, char *src, int src_len) { if (dst_len <= 0) return STRCPY_FAIL; if (src_len == SQL_NULL_DATA) { dst[0] = '\0'; return STRCPY_NULL; } else if (src_len == SQL_NTS) src_len = strlen(src); if (src_len <= 0) return STRCPY_FAIL; else { if (src_len < dst_len) { memcpy(dst, src, src_len); dst[src_len] = '\0'; } else { memcpy(dst, src, dst_len-1); dst[dst_len-1] = '\0'; /* truncated */ return STRCPY_TRUNCATED; } } return strlen(dst); } /* strncpy copies up to len characters, and doesn't terminate */ /* the destination string if src has len characters or more. */ /* instead, I want it to copy up to len-1 characters and always */ /* terminate the destination string. */ char *strncpy_null(char *dst, const char *src, int len) { int i; if (NULL != dst) { /* Just in case, check for special lengths */ if (len == SQL_NULL_DATA) { dst[0] = '\0'; return NULL; } else if (len == SQL_NTS) len = strlen(src) + 1; for(i = 0; src[i] && i < len - 1; i++) { dst[i] = src[i]; } if(len > 0) { dst[i] = '\0'; } } return dst; } /* Create a null terminated string (handling the SQL_NTS thing): */ /* 1. If buf is supplied, place the string in there (assumes enough space) and return buf. */ /* 2. If buf is not supplied, malloc space and return this string */ char * make_string(char *s, int len, char *buf) { int length; char *str; if(s && (len > 0 || (len == SQL_NTS && strlen(s) > 0))) { length = (len > 0) ? len : strlen(s); if (buf) { strncpy_null(buf, s, length+1); return buf; } str = malloc(length + 1); if ( ! str) return NULL; strncpy_null(str, s, length+1); return str; } return NULL; } /* Return the length of a string (handling the SQL_NTS thing): */ int my_strlen(char *s, int len) { int length = 0; if(s && (len > 0 || (len == SQL_NTS && strlen(s) > 0))) { length = (len > 0) ? len : strlen(s); } return length; } /* Concatenate a single formatted argument to a given buffer handling the SQL_NTS thing. */ /* "fmt" must contain somewhere in it the single form '%.*s' */ /* This is heavily used in creating queries for info routines (SQLTables, SQLColumns). */ /* This routine could be modified to use vsprintf() to handle multiple arguments. */ char * my_strcat(char *buf, char *fmt, char *s, int len) { if (s && (len > 0 || (len == SQL_NTS && strlen(s) > 0))) { int length = (len > 0) ? len : strlen(s); int pos = strlen(buf); sprintf(&buf[pos], fmt, length, s); return buf; } return NULL; } void remove_newlines(char *string) { unsigned int i; size_t stlen=strlen(string); for(i=0; i < stlen; i++) { if((string[i] == '\n') || (string[i] == '\r')) { string[i] = ' '; } } } char * trim(char *s) { int i; for (i = strlen(s) - 1; i >= 0; i--) { if (s[i] == ' ') s[i] = '\0'; else break; } return s; } unixODBC-2.3.9/Drivers/Postgre7.1/socket.c0000644000175000017500000002073413245016302015006 00000000000000 /* Module: socket.c * * Description: This module contains functions for low level socket * operations (connecting/reading/writing to the backend) * * Classes: SocketClass (Functions prefix: "SOCK_") * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "socket.h" #ifndef WIN32 #ifndef VMS #include "sys/un.h" #endif #include #include /* for memset */ #endif extern GLOBAL_VALUES globals; #ifndef BOOL #define BOOL int #endif #ifndef TRUE #define TRUE (BOOL)1 #endif #ifndef FALSE #define FALSE (BOOL)0 #endif void SOCK_clear_error(SocketClass *self) { self->errornumber = 0; self->errormsg = NULL; } SocketClass * SOCK_Constructor() { SocketClass *rv; rv = (SocketClass *) malloc(sizeof(SocketClass)); if (rv != NULL) { rv->socket = (SOCKETFD) -1; rv->buffer_filled_in = 0; rv->buffer_filled_out = 0; rv->buffer_read_in = 0; rv->buffer_in = (unsigned char *) malloc(globals.socket_buffersize); if ( ! rv->buffer_in) return NULL; rv->buffer_out = (unsigned char *) malloc(globals.socket_buffersize); if ( ! rv->buffer_out) return NULL; rv->errormsg = NULL; rv->errornumber = 0; rv->reverse = FALSE; } return rv; } void SOCK_Destructor(SocketClass *self) { if (self->socket != -1) { SOCK_put_char(self, 'X'); SOCK_flush_output(self); closesocket(self->socket); } if (self->buffer_in) free(self->buffer_in); if (self->buffer_out) free(self->buffer_out); free(self); } static char SOCK_connect_to_ip(SocketClass *self, unsigned short port, char *hostname) { struct hostent *host; struct sockaddr_in sadr; struct in_addr iaddr; if (self->socket != -1) { self->errornumber = SOCKET_ALREADY_CONNECTED; self->errormsg = "Socket is already connected"; return 0; } memset((char *)&sadr, 0, sizeof(sadr)); /* If it is a valid IP address, use it. Otherwise use hostname lookup. */ iaddr.s_addr = inet_addr(hostname); if (iaddr.s_addr == INADDR_NONE) { host = gethostbyname(hostname); if (host == NULL) { self->errornumber = SOCKET_HOST_NOT_FOUND; self->errormsg = "Could not resolve hostname."; return 0; } memcpy(&(sadr.sin_addr), host->h_addr, host->h_length); } else memcpy(&(sadr.sin_addr), (struct in_addr *) &iaddr, sizeof(iaddr)); sadr.sin_family = AF_INET; sadr.sin_port = htons(port); self->socket = socket(AF_INET, SOCK_STREAM, 0); if (self->socket == -1) { self->errornumber = SOCKET_COULD_NOT_CREATE_SOCKET; self->errormsg = "Could not create Socket."; return 0; } if ( connect(self->socket, (struct sockaddr *)&(sadr), sizeof(sadr)) < 0) { self->errornumber = SOCKET_COULD_NOT_CONNECT; self->errormsg = "Could not connect to remote socket."; closesocket(self->socket); self->socket = (SOCKETFD) -1; return 0; } return 1; } #ifndef VMS char SOCK_connect_to_unix_port(SocketClass *self, unsigned short port, char *path ) { struct sockaddr_un sadr; if (self->socket != -1) { self->errornumber = SOCKET_ALREADY_CONNECTED; self->errormsg = "Socket is already connected"; return 0; } memset((char *)&sadr, 0, sizeof(sadr)); sadr.sun_family = AF_UNIX; sprintf( sadr.sun_path, "%s.%d", path, port ); self->socket = socket(AF_UNIX, SOCK_STREAM, 0); if (self->socket == -1) { self->errornumber = SOCKET_COULD_NOT_CREATE_SOCKET; self->errormsg = "Could not create Socket."; return 0; } if ( connect(self->socket, (struct sockaddr *)&(sadr), sizeof(sadr)) < 0) { self->errornumber = SOCKET_COULD_NOT_CONNECT; self->errormsg = "Could not connect to remote socket."; closesocket(self->socket); self->socket = (SOCKETFD) -1; return 0; } return 1; } /* * cope with different path for debian distrib */ int SOCK_connect_to_unix(SocketClass *self, unsigned short port, char *path ) { if ( strlen( path ) > 0 ) { return !SOCK_connect_to_unix_port( self, port, path ); } if ( !SOCK_connect_to_unix_port( self, port, "/tmp/.s.PGSQL" )) { if ( SOCK_connect_to_unix_port( self, port, "/var/run/postgresql/.s.PGSQL" )) { SOCK_clear_error(self); return 1; } else { return 0; } } else { return 1; } } #endif char SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname, char *uds) { #ifndef VMS if ( strcmp( hostname, "localhost" ) == 0 ) return SOCK_connect_to_unix( self, port, uds ); else #endif return SOCK_connect_to_ip( self, port, hostname ); } void SOCK_get_n_char(SocketClass *self, char *buffer, int len) { int lf; if ( ! buffer) { self->errornumber = SOCKET_NULLPOINTER_PARAMETER; self->errormsg = "get_n_char was called with NULL-Pointer"; return; } for(lf=0; lf < len; lf++) buffer[lf] = SOCK_get_next_byte(self); } void SOCK_put_n_char(SocketClass *self, char *buffer, int len) { int lf; if ( ! buffer) { self->errornumber = SOCKET_NULLPOINTER_PARAMETER; self->errormsg = "put_n_char was called with NULL-Pointer"; return; } for(lf=0; lf < len; lf++) SOCK_put_next_byte(self, (unsigned char)buffer[lf]); } /* bufsize must include room for the null terminator will read at most bufsize-1 characters + null. */ BOOL SOCK_get_string(SocketClass *self, char *buffer, int bufsize) { register int lf = 0; for (lf = 0; lf < bufsize - 1; lf++) if (!(buffer[lf] = SOCK_get_next_byte(self))) return FALSE; buffer[bufsize - 1] = '\0'; return TRUE; } void SOCK_put_string(SocketClass *self, char *string) { register int lf; int len; len = strlen(string)+1; for(lf = 0; lf < len; lf++) SOCK_put_next_byte(self, (unsigned char)string[lf]); } int SOCK_get_int(SocketClass *self, short len) { char buf[4]; switch (len) { case 2: SOCK_get_n_char(self, buf, len); if (self->reverse) return *((unsigned short *) buf); else return ntohs( *((unsigned short *) buf) ); case 4: SOCK_get_n_char(self, buf, len); if (self->reverse) return *((unsigned int *) buf); else return ntohl( *((unsigned int *) buf) ); default: self->errornumber = SOCKET_GET_INT_WRONG_LENGTH; self->errormsg = "Cannot read ints of that length"; return 0; } } void SOCK_put_int(SocketClass *self, int value, short len) { unsigned int rv; switch (len) { case 2: rv = self->reverse ? value : htons( (unsigned short) value); SOCK_put_n_char(self, (char *) &rv, 2); return; case 4: rv = self->reverse ? value : htonl( (unsigned int) value); SOCK_put_n_char(self, (char *) &rv, 4); return; default: self->errornumber = SOCKET_PUT_INT_WRONG_LENGTH; self->errormsg = "Cannot write ints of that length"; return; } } void SOCK_flush_output(SocketClass *self) { int written; #ifdef MSG_NOSIGNAL written = send(self->socket, (char *)self->buffer_out, self->buffer_filled_out, MSG_NOSIGNAL); #else written = send(self->socket, (char *)self->buffer_out, self->buffer_filled_out, 0); #endif if (written != self->buffer_filled_out) { self->errornumber = SOCKET_WRITE_ERROR; self->errormsg = "Could not flush socket buffer."; } self->buffer_filled_out = 0; } UCHAR SOCK_get_next_byte(SocketClass *self) { if (self->buffer_read_in >= self->buffer_filled_in) { /* there are no more bytes left in the buffer so */ /* reload the buffer */ self->buffer_read_in = 0; self->buffer_filled_in = recv(self->socket, (char *)self->buffer_in, globals.socket_buffersize, 0); mylog("read %d, global_socket_buffersize=%d\n", self->buffer_filled_in, globals.socket_buffersize); if (self->buffer_filled_in < 0) { self->errornumber = SOCKET_READ_ERROR; self->errormsg = "Error while reading from the socket."; self->buffer_filled_in = 0; return 0; } if (self->buffer_filled_in == 0) { self->errornumber = SOCKET_CLOSED; self->errormsg = "Socket has been closed."; self->buffer_filled_in = 0; return 0; } } return self->buffer_in[self->buffer_read_in++]; } void SOCK_put_next_byte(SocketClass *self, unsigned char next_byte) { int bytes_sent; self->buffer_out[self->buffer_filled_out++] = next_byte; if (self->buffer_filled_out == globals.socket_buffersize) { /* buffer is full, so write it out */ bytes_sent = send(self->socket, (char *)self->buffer_out, globals.socket_buffersize, 0); if (bytes_sent != globals.socket_buffersize) { self->errornumber = SOCKET_WRITE_ERROR; self->errormsg = "Error while writing to the socket."; } self->buffer_filled_out = 0; } } unixODBC-2.3.9/Drivers/Postgre7.1/qresult.c0000755000175000017500000004030112262474475015231 00000000000000 /* Module: qresult.c * * Description: This module contains functions related to * managing result information (i.e, fetching rows from the backend, * managing the tuple cache, etc.) and retrieving it. * Depending on the situation, a QResultClass will hold either data * from the backend or a manually built result (see "qresult.h" to * see which functions/macros are for manual or backend results. * For manually built results, the QResultClass simply points to * TupleList and ColumnInfo structures, which actually hold the data. * * Classes: QResultClass (Functions prefix: "QR_") * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "qresult.h" #include "misc.h" #include #include #ifndef TRUE #define TRUE (BOOL)1 #endif #ifndef FALSE #define FALSE (BOOL)0 #endif extern GLOBAL_VALUES globals; /* Used for building a Manual Result only */ /* All info functions call this function to create the manual result set. */ void QR_set_num_fields(QResultClass *self, int new_num_fields) { mylog("in QR_set_num_fields\n"); CI_set_num_fields(self->fields, new_num_fields); if(self->manual_tuples) TL_Destructor(self->manual_tuples); self->manual_tuples = TL_Constructor(new_num_fields); mylog("exit QR_set_num_fields\n"); } void QR_set_position(QResultClass *self, int pos) { self->tupleField = self->backend_tuples + ((self->base + pos) * self->num_fields); } void QR_set_cache_size(QResultClass *self, int cache_size) { self->cache_size = cache_size; } void QR_set_rowset_size(QResultClass *self, int rowset_size) { self->rowset_size = rowset_size; } void QR_inc_base(QResultClass *self, int base_inc) { self->base += base_inc; } /************************************/ /* CLASS QResult */ /************************************/ QResultClass * QR_Constructor(void) { QResultClass *rv; mylog("in QR_Constructor\n"); rv = (QResultClass *) malloc(sizeof(QResultClass)); if (rv != NULL) { rv->status = PGRES_EMPTY_QUERY; /* construct the column info */ if ( ! (rv->fields = CI_Constructor())) { free(rv); return NULL; } rv->manual_tuples = NULL; rv->backend_tuples = NULL; rv->message = NULL; rv->command = NULL; rv->notice = NULL; rv->conn = NULL; rv->inTuples = FALSE; rv->fcount = 0; rv->fetch_count = 0; rv->base = 0; rv->currTuple = -1; rv->num_fields = 0; rv->tupleField = NULL; rv->cursor = NULL; rv->aborted = FALSE; rv->cache_size = globals.fetch_max; rv->rowset_size = 1; } mylog("exit QR_Constructor\n"); return rv; } void QR_Destructor(QResultClass *self) { mylog("QResult: in DESTRUCTOR\n"); /* manual result set tuples */ if (self->manual_tuples) TL_Destructor(self->manual_tuples); /* If conn is defined, then we may have used "backend_tuples", */ /* so in case we need to, free it up. Also, close the cursor. */ if (self->conn && self->conn->sock && CC_is_in_trans(self->conn)) QR_close(self); /* close the cursor if there is one */ QR_free_memory(self); /* safe to call anyway */ /* Should have been freed in the close() but just in case... */ if (self->cursor) free(self->cursor); /* Free up column info */ if (self->fields) CI_Destructor(self->fields); /* Free command info (this is from strdup()) */ if (self->command) free(self->command); /* Free notice info (this is from strdup()) */ if (self->notice) free(self->notice); free(self); mylog("QResult: exit DESTRUCTOR\n"); } void QR_set_command(QResultClass *self, char *msg) { if (self->command) free(self->command); self->command = msg ? strdup(msg) : NULL; } void QR_set_notice(QResultClass *self, char *msg) { if (self->notice) free(self->notice); self->notice = msg ? strdup(msg) : NULL; } void QR_free_memory(QResultClass *self) { register int lf, row; register TupleField *tuple = self->backend_tuples; int fcount = self->fcount; int num_fields = self->num_fields; mylog("QResult: free memory in, fcount=%d\n", fcount); if ( self->backend_tuples) { for (row = 0; row < fcount; row++) { mylog("row = %d, num_fields = %d\n", row, num_fields); for (lf=0; lf < num_fields; lf++) { if (tuple[lf].value != NULL) { mylog("free [lf=%d] %u\n", lf, tuple[lf].value); free(tuple[lf].value); } } tuple += num_fields; /* next row */ } free(self->backend_tuples); self->backend_tuples = NULL; } self->fcount = 0; mylog("QResult: free memory out\n"); } /* This function is called by send_query() */ char QR_fetch_tuples(QResultClass *self, ConnectionClass *conn, char *cursor) { int tuple_size; /* If called from send_query the first time (conn != NULL), */ /* then set the inTuples state, */ /* and read the tuples. If conn is NULL, */ /* it implies that we are being called from next_tuple(), */ /* like to get more rows so don't call next_tuple again! */ if (conn != NULL) { self->conn = conn; mylog("QR_fetch_tuples: cursor = '%s', self->cursor=%u\n", (cursor==NULL)?"":cursor, self->cursor); if (self->cursor) free(self->cursor); if ( globals.use_declarefetch) { if (! cursor || cursor[0] == '\0') { self->status = PGRES_INTERNAL_ERROR; QR_set_message(self, "Internal Error -- no cursor for fetch"); return FALSE; } self->cursor = strdup(cursor); } /* Read the field attributes. */ /* $$$$ Should do some error control HERE! $$$$ */ if ( CI_read_fields(self->fields, self->conn)) { self->status = PGRES_FIELDS_OK; self->num_fields = CI_get_num_fields(self->fields); } else { self->status = PGRES_BAD_RESPONSE; QR_set_message(self, "Error reading field information"); return FALSE; } mylog("QR_fetch_tuples: past CI_read_fields: num_fields = %d\n", self->num_fields); if (globals.use_declarefetch) tuple_size = self->cache_size; else tuple_size = TUPLE_MALLOC_INC; /* allocate memory for the tuple cache */ mylog("MALLOC: tuple_size = %d, size = %d\n", tuple_size, self->num_fields * sizeof(TupleField) * tuple_size); self->backend_tuples = (TupleField *) malloc(self->num_fields * sizeof(TupleField) * tuple_size); if ( ! self->backend_tuples) { self->status = PGRES_FATAL_ERROR; QR_set_message(self, "Could not get memory for tuple cache."); return FALSE; } self->inTuples = TRUE; /* Force a read to occur in next_tuple */ self->fcount = tuple_size+1; self->fetch_count = tuple_size+1; self->base = 0; return QR_next_tuple(self); } else { /* Always have to read the field attributes. */ /* But we dont have to reallocate memory for them! */ if ( ! CI_read_fields(NULL, self->conn)) { self->status = PGRES_BAD_RESPONSE; QR_set_message(self, "Error reading field information"); return FALSE; } return TRUE; } } /* Close the cursor and end the transaction (if no cursors left) */ /* We only close cursor/end the transaction if a cursor was used. */ int QR_close(QResultClass *self) { QResultClass *res; if (globals.use_declarefetch && self->conn && self->cursor) { char buf[64]; sprintf(buf, "close %s", self->cursor); mylog("QResult: closing cursor: '%s'\n", buf); res = CC_send_query(self->conn, buf, NULL); self->inTuples = FALSE; self->currTuple = -1; free(self->cursor); self->cursor = NULL; if (res == NULL) { self->status = PGRES_FATAL_ERROR; QR_set_message(self, "Error closing cursor."); return FALSE; } /* End the transaction if there are no cursors left on this conn */ if (CC_cursor_count(self->conn) == 0) { mylog("QResult: END transaction on conn=%u\n", self->conn); res = CC_send_query(self->conn, "END", NULL); CC_set_no_trans(self->conn); if (res == NULL) { self->status = PGRES_FATAL_ERROR; QR_set_message(self, "Error ending transaction."); return FALSE; } } } return TRUE; } /* This function is called by fetch_tuples() AND SQLFetch() */ int QR_next_tuple(QResultClass *self) { int id; QResultClass *res; SocketClass *sock; /* Speed up access */ int fetch_count = self->fetch_count; int fcount = self->fcount; int fetch_size, offset= 0; int end_tuple = self->rowset_size + self->base; char corrected = FALSE; TupleField *the_tuples = self->backend_tuples; static char msgbuffer[MAX_MESSAGE_LEN+1]; char cmdbuffer[MAX_MESSAGE_LEN+1]; /* QR_set_command() dups this string so dont need static */ char fetch[128]; QueryInfo qi; if (fetch_count < fcount) { /* return a row from cache */ mylog("next_tuple: fetch_count < fcount: returning tuple %d, fcount = %d\n", fetch_count, fcount); self->tupleField = the_tuples + (fetch_count * self->num_fields); /* next row */ self->fetch_count++; return TRUE; } else if (self->fcount < self->cache_size) { /* last row from cache */ /* We are done because we didn't even get CACHE_SIZE tuples */ mylog("next_tuple: fcount < CACHE_SIZE: fcount = %d, fetch_count = %d\n", fcount, fetch_count); self->tupleField = NULL; self->status = PGRES_END_TUPLES; return -1; /* end of tuples */ } else { /* See if we need to fetch another group of rows. We may be being called from send_query(), and if so, don't send another fetch, just fall through and read the tuples. */ self->tupleField = NULL; if ( ! self->inTuples) { if ( ! globals.use_declarefetch) { mylog("next_tuple: ALL_ROWS: done, fcount = %d, fetch_count = %d\n", fcount, fetch_count); self->tupleField = NULL; self->status = PGRES_END_TUPLES; return -1; /* end of tuples */ } if (self->base == fcount) { /* not a correction */ /* Determine the optimum cache size. */ if (globals.fetch_max % self->rowset_size == 0) fetch_size = globals.fetch_max; else if (self->rowset_size < globals.fetch_max) fetch_size = (globals.fetch_max / self->rowset_size) * self->rowset_size; else fetch_size = self->rowset_size; self->cache_size = fetch_size; self->fetch_count = 1; } else { /* need to correct */ corrected = TRUE; fetch_size = end_tuple - fcount; self->cache_size += fetch_size; offset = self->fetch_count; self->fetch_count++; } self->backend_tuples = (TupleField *) realloc(self->backend_tuples, self->num_fields * sizeof(TupleField) * self->cache_size); if ( ! self->backend_tuples) { self->status = PGRES_FATAL_ERROR; QR_set_message(self, "Out of memory while reading tuples."); return FALSE; } sprintf(fetch, "fetch %d in %s", fetch_size, self->cursor); mylog("next_tuple: sending actual fetch (%d) query '%s'\n", fetch_size, fetch); /* don't read ahead for the next tuple (self) ! */ qi.row_size = self->cache_size; qi.result_in = self; qi.cursor = NULL; res = CC_send_query(self->conn, fetch, &qi); if (res == NULL) { self->status = PGRES_FATAL_ERROR; QR_set_message(self, "Error fetching next group."); return FALSE; } self->inTuples = TRUE; } else { mylog("next_tuple: inTuples = true, falling through: fcount = %d, fetch_count = %d\n", self->fcount, self->fetch_count); /* This is a pre-fetch (fetching rows right after query but before any real SQLFetch() calls. This is done so the field attributes are available. */ self->fetch_count = 0; } } if ( ! corrected) { self->base = 0; self->fcount = 0; } sock = CC_get_socket(self->conn); self->tupleField = NULL; for ( ; ;) { id = SOCK_get_char(sock); switch (id) { case 'T': /* Tuples within tuples cannot be handled */ self->status = PGRES_BAD_RESPONSE; QR_set_message(self, "Tuples within tuples cannot be handled"); return FALSE; case 'B': /* Tuples in binary format */ case 'D': /* Tuples in ASCII format */ if ( ! globals.use_declarefetch && self->fcount > 0 && ! (self->fcount % TUPLE_MALLOC_INC)) { size_t old_size = self->fcount * self->num_fields * sizeof(TupleField); mylog("REALLOC: old_size = %d\n", old_size); self->backend_tuples = (TupleField *) realloc(self->backend_tuples, old_size + (self->num_fields * sizeof(TupleField) * TUPLE_MALLOC_INC)); if ( ! self->backend_tuples) { self->status = PGRES_FATAL_ERROR; QR_set_message(self, "Out of memory while reading tuples."); return FALSE; } } if ( ! QR_read_tuple(self, (char) (id == 0))) { self->status = PGRES_BAD_RESPONSE; QR_set_message(self, "Error reading the tuple"); return FALSE; } self->fcount++; break; /* continue reading */ case 'C': /* End of tuple list */ SOCK_get_string(sock, cmdbuffer, MAX_MESSAGE_LEN); QR_set_command(self, cmdbuffer); mylog("end of tuple list -- setting inUse to false: this = %u\n", self); self->inTuples = FALSE; if (self->fcount > 0) { qlog(" [ fetched %d rows ]\n", self->fcount); mylog("_next_tuple: 'C' fetch_max && fcount = %d\n", self->fcount); /* set to first row */ self->tupleField = self->backend_tuples + (offset * self->num_fields); return TRUE; } else { /* We are surely done here (we read 0 tuples) */ qlog(" [ fetched 0 rows ]\n"); mylog("_next_tuple: 'C': DONE (fcount == 0)\n"); return -1; /* end of tuples */ } case 'E': /* Error */ SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); QR_set_message(self, msgbuffer); self->status = PGRES_FATAL_ERROR; if ( ! strncmp(msgbuffer, "FATAL", 5)) CC_set_no_trans(self->conn); qlog("ERROR from backend in next_tuple: '%s'\n", msgbuffer); return FALSE; case 'N': /* Notice */ SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); QR_set_message(self, msgbuffer); self->status = PGRES_NONFATAL_ERROR; qlog("NOTICE from backend in next_tuple: '%s'\n", msgbuffer); continue; default: /* this should only happen if the backend dumped core */ mylog("QR_next_tuple: Unexpected result from backend: id = '%c' (%d)\n", id, id); qlog("QR_next_tuple: Unexpected result from backend: id = '%c' (%d)\n", id, id); QR_set_message(self, "Unexpected result from backend. It probably crashed"); self->status = PGRES_FATAL_ERROR; CC_set_no_trans(self->conn); return FALSE; } } return TRUE; } char QR_read_tuple(QResultClass *self, char binary) { Int2 field_lf; TupleField *this_tuplefield; char bmp, bitmap[MAX_FIELDS]; /* Max. len of the bitmap */ Int2 bitmaplen; /* len of the bitmap in bytes */ Int2 bitmap_pos; Int2 bitcnt; Int4 len; char *buffer; int num_fields = self->num_fields; /* speed up access */ SocketClass *sock = CC_get_socket(self->conn); ColumnInfoClass *flds; /* set the current row to read the fields into */ this_tuplefield = self->backend_tuples + (self->fcount * num_fields); bitmaplen = (Int2) num_fields / BYTELEN; if ((num_fields % BYTELEN) > 0) bitmaplen++; /* At first the server sends a bitmap that indicates which database fields are null */ SOCK_get_n_char(sock, bitmap, bitmaplen); bitmap_pos = 0; bitcnt = 0; bmp = bitmap[bitmap_pos]; for(field_lf = 0; field_lf < num_fields; field_lf++) { /* Check if the current field is NULL */ if(!(bmp & 0200)) { /* YES, it is NULL ! */ this_tuplefield[field_lf].len = 0; this_tuplefield[field_lf].value = 0; } else { /* NO, the field is not null. so get at first the length of the field (four bytes) */ len = SOCK_get_int(sock, VARHDRSZ); if (!binary) len -= VARHDRSZ; buffer = (char *)malloc(len+1); SOCK_get_n_char(sock, buffer, len); buffer[len] = '\0'; mylog("qresult: len=%d, buffer='%s'\n", len, buffer); this_tuplefield[field_lf].len = len; this_tuplefield[field_lf].value = buffer; /* This can be used to set the longest length of the column for any row in the tuple cache. It would not be accurate for varchar and text fields to use this since a tuple cache is only 100 rows. Bpchar can be handled since the strlen of all rows is fixed, assuming there are not 100 nulls in a row! */ flds = self->fields; if (flds->display_size[field_lf] < len) flds->display_size[field_lf] = len; } /* Now adjust for the next bit to be scanned in the next loop. */ bitcnt++; if (BYTELEN == bitcnt) { bitmap_pos++; bmp = bitmap[bitmap_pos]; bitcnt = 0; } else bmp <<= 1; } self->currTuple++; return TRUE; } unixODBC-2.3.9/Drivers/Postgre7.1/connection.h0000755000175000017500000002456112262474475015710 00000000000000 /* File: connection.h * * Description: See "connection.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __CONNECTION_H__ #define __CONNECTION_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "psqlodbc.h" #ifndef WIN32 #include "isql.h" #include "isqlext.h" #else #include #include #include #endif typedef enum { CONN_NOT_CONNECTED, /* Connection has not been established */ CONN_CONNECTED, /* Connection is up and has been established */ CONN_DOWN, /* Connection is broken */ CONN_EXECUTING /* the connection is currently executing a statement */ } CONN_Status; /* These errors have general sql error state */ #define CONNECTION_SERVER_NOT_REACHED 101 #define CONNECTION_MSG_TOO_LONG 103 #define CONNECTION_COULD_NOT_SEND 104 #define CONNECTION_NO_SUCH_DATABASE 105 #define CONNECTION_BACKEND_CRAZY 106 #define CONNECTION_NO_RESPONSE 107 #define CONNECTION_SERVER_REPORTED_ERROR 108 #define CONNECTION_COULD_NOT_RECEIVE 109 #define CONNECTION_SERVER_REPORTED_WARNING 110 #define CONNECTION_NEED_PASSWORD 112 /* These errors correspond to specific SQL states */ #define CONN_INIREAD_ERROR 201 #define CONN_OPENDB_ERROR 202 #define CONN_STMT_ALLOC_ERROR 203 #define CONN_IN_USE 204 #define CONN_UNSUPPORTED_OPTION 205 /* Used by SetConnectoption to indicate unsupported options */ #define CONN_INVALID_ARGUMENT_NO 206 /* SetConnectOption: corresponds to ODBC--"S1009" */ #define CONN_TRANSACT_IN_PROGRES 207 #define CONN_NO_MEMORY_ERROR 208 #define CONN_NOT_IMPLEMENTED_ERROR 209 #define CONN_INVALID_AUTHENTICATION 210 #define CONN_AUTH_TYPE_UNSUPPORTED 211 #define CONN_UNABLE_TO_LOAD_DLL 212 #define CONN_OPTION_VALUE_CHANGED 213 #define CONN_VALUE_OUT_OF_RANGE 214 #define CONN_TRUNCATED 215 /* Conn_status defines */ #define CONN_IN_AUTOCOMMIT 0x01 #define CONN_IN_TRANSACTION 0x02 /* AutoCommit functions */ #define CC_set_autocommit_off(x) (x->transact_status &= ~CONN_IN_AUTOCOMMIT) #define CC_set_autocommit_on(x) (x->transact_status |= CONN_IN_AUTOCOMMIT) #define CC_is_in_autocommit(x) (x->transact_status & CONN_IN_AUTOCOMMIT) /* Transaction in/not functions */ #define CC_set_in_trans(x) (x->transact_status |= CONN_IN_TRANSACTION) #define CC_set_no_trans(x) (x->transact_status &= ~CONN_IN_TRANSACTION) #define CC_is_in_trans(x) (x->transact_status & CONN_IN_TRANSACTION) #define CC_get_errornumber(x) (x->__error_number) #define CC_get_errormsg(x) (x->__error_message) #define CC_set_errornumber(x, n) (x->__error_number = n) /* Authentication types */ #define AUTH_REQ_OK 0 #define AUTH_REQ_KRB4 1 #define AUTH_REQ_KRB5 2 #define AUTH_REQ_PASSWORD 3 #define AUTH_REQ_CRYPT 4 #define AUTH_REQ_MD5 5 #define AUTH_REQ_SCM_CREDS 6 /* Startup Packet sizes */ #define SM_DATABASE 64 #define SM_USER 32 #define SM_OPTIONS 64 #define SM_UNUSED 64 #define SM_TTY 64 /* Old 6.2 protocol defines */ #define NO_AUTHENTICATION 7 #define PATH_SIZE 64 #define ARGV_SIZE 64 #define NAMEDATALEN 16 typedef unsigned int ProtocolVersion; #define PG_PROTOCOL(major, minor) (((major) << 16) | (minor)) #define PG_PROTOCOL_LATEST PG_PROTOCOL(2, 0) #define PG_PROTOCOL_63 PG_PROTOCOL(1, 0) #define PG_PROTOCOL_62 PG_PROTOCOL(0, 0) /* This startup packet is to support latest Postgres protocol (6.4, 6.3) */ typedef struct _StartupPacket { ProtocolVersion protoVersion; char database[SM_DATABASE]; char user[SM_USER]; char options[SM_OPTIONS]; char unused[SM_UNUSED]; char tty[SM_TTY]; } StartupPacket; /* This startup packet is to support pre-Postgres 6.3 protocol */ typedef struct _StartupPacket6_2 { unsigned int authtype; char database[PATH_SIZE]; char user[NAMEDATALEN]; char options[ARGV_SIZE]; char execfile[ARGV_SIZE]; char tty[PATH_SIZE]; } StartupPacket6_2; /* Structure to hold all the connection attributes for a specific connection (used for both registry and file, DSN and DRIVER) */ typedef struct { char dsn[MEDIUM_REGISTRY_LEN]; char desc[MEDIUM_REGISTRY_LEN]; char driver[MEDIUM_REGISTRY_LEN]; char server[MEDIUM_REGISTRY_LEN]; char database[MEDIUM_REGISTRY_LEN]; char username[MEDIUM_REGISTRY_LEN]; char password[MEDIUM_REGISTRY_LEN]; char conn_settings[LARGE_REGISTRY_LEN]; char protocol[SMALL_REGISTRY_LEN]; char port[SMALL_REGISTRY_LEN]; char uds[LARGE_REGISTRY_LEN]; char onlyread[SMALL_REGISTRY_LEN]; char fake_oid_index[SMALL_REGISTRY_LEN]; char show_oid_column[SMALL_REGISTRY_LEN]; char row_versioning[SMALL_REGISTRY_LEN]; char show_system_tables[SMALL_REGISTRY_LEN]; char translation_dll[MEDIUM_REGISTRY_LEN]; char translation_option[SMALL_REGISTRY_LEN]; char focus_password; } ConnInfo; /* Macro to determine is the connection using 6.2 protocol? */ #define PROTOCOL_62(conninfo_) (strncmp((conninfo_)->protocol, PG62, strlen(PG62)) == 0) /* Macro to determine is the connection using 6.3 protocol? */ #define PROTOCOL_63(conninfo_) (strncmp((conninfo_)->protocol, PG63, strlen(PG63)) == 0) /* * Macros to compare the server's version with a specified version * 1st parameter: pointer to a ConnectionClass object * 2nd parameter: major version number * 3rd parameter: minor version number */ #define SERVER_VERSION_GT(conn, major, minor) \ ((conn)->pg_version_major > major || \ ((conn)->pg_version_major == major && (conn)->pg_version_minor > minor)) #define SERVER_VERSION_GE(conn, major, minor) \ ((conn)->pg_version_major > major || \ ((conn)->pg_version_major == major && (conn)->pg_version_minor >= minor)) #define SERVER_VERSION_EQ(conn, major, minor) \ ((conn)->pg_version_major == major && (conn)->pg_version_minor == minor) #define SERVER_VERSION_LE(conn, major, minor) (! SERVER_VERSION_GT(conn, major, minor)) #define SERVER_VERSION_LT(conn, major, minor) (! SERVER_VERSION_GE(conn, major, minor)) /*#if ! defined(HAVE_CONFIG_H) || defined(HAVE_STRINGIZE)*/ #define STRING_AFTER_DOT(string) (strchr(#string, '.') + 1) /*#else #define STRING_AFTER_DOT(str) (strchr("str", '.') + 1) #endif*/ /* * Simplified macros to compare the server's version with a * specified version * Note: Never pass a variable as the second parameter. * It must be a decimal constant of the form %d.%d . */ #define PG_VERSION_GT(conn, ver) \ (SERVER_VERSION_GT(conn, (int) ver, atoi(STRING_AFTER_DOT(ver)))) #define PG_VERSION_GE(conn, ver) \ (SERVER_VERSION_GE(conn, (int) ver, atoi(STRING_AFTER_DOT(ver)))) #define PG_VERSION_EQ(conn, ver) \ (SERVER_VERSION_EQ(conn, (int) ver, atoi(STRING_AFTER_DOT(ver)))) #define PG_VERSION_LE(conn, ver) (! PG_VERSION_GT(conn, ver)) #define PG_VERSION_LT(conn, ver) (! PG_VERSION_GE(conn, ver)) /* This is used to store cached table information in the connection */ struct col_info { QResultClass *result; char name[MAX_TABLE_LEN+1]; }; /* Translation DLL entry points */ #ifdef WIN32 #define DLLHANDLE HINSTANCE #else #define WINAPI CALLBACK #define DLLHANDLE void * #define HINSTANCE void * #endif typedef BOOL (FAR WINAPI *DataSourceToDriverProc) (UDWORD, SWORD, PTR, SDWORD, PTR, SDWORD, SDWORD FAR *, UCHAR FAR *, SWORD, SWORD FAR *); typedef BOOL (FAR WINAPI *DriverToDataSourceProc) (UDWORD, SWORD, PTR, SDWORD, PTR, SDWORD, SDWORD FAR *, UCHAR FAR *, SWORD, SWORD FAR *); /******* The Connection handle ************/ struct ConnectionClass_ { HENV henv; /* environment this connection was created on */ StatementOptions stmtOptions; char *__error_message; int __error_number; CONN_Status status; ConnInfo connInfo; StatementClass **stmts; int num_stmts; SocketClass *sock; int lobj_type; int ntables; COL_INFO **col_info; long translation_option; HINSTANCE translation_handle; DataSourceToDriverProc DataSourceToDriver; DriverToDataSourceProc DriverToDataSource; Int2 driver_version; /* prepared for ODBC3.0 */ char transact_status; /* Is a transaction is currently in progress */ char errormsg_created; /* has an informative error msg been created? */ char pg_version[MAX_INFO_STRING]; /* Version of PostgreSQL we're connected to - DJP 25-1-2001 */ float pg_version_number; Int2 pg_version_major; Int2 pg_version_minor; char ms_jet; char unicode; char result_uncommitted; char schema_support; char *client_encoding; char *server_encoding; int ccsc; int be_pid; /* pid returned by backend */ int be_key; /* auth code needed to send cancel */ UInt4 isolation; char *current_schema; int num_discardp; char **discardp; #if (ODBCVER >= 0x0300) int num_descs; DescriptorClass **descs; #endif /* ODBCVER */ #if defined(WIN_MULTITHREAD_SUPPORT) CRITICAL_SECTION cs; #elif defined(POSIX_THREADMUTEX_SUPPORT) pthread_mutex_t cs; #endif /* WIN_MULTITHREAD_SUPPORT */ }; /* Accessor functions */ #define CC_get_socket(x) (x->sock) #define CC_get_database(x) (x->connInfo.database) #define CC_get_server(x) (x->connInfo.server) #define CC_get_DSN(x) (x->connInfo.dsn) #define CC_get_username(x) (x->connInfo.username) #define CC_is_onlyread(x) (x->connInfo.onlyread[0] == '1') /* for CC_DSN_info */ #define CONN_DONT_OVERWRITE 0 #define CONN_OVERWRITE 1 /* prototypes */ ConnectionClass *CC_Constructor(void); char CC_Destructor(ConnectionClass *self); int CC_cursor_count(ConnectionClass *self); char CC_cleanup(ConnectionClass *self); char CC_abort(ConnectionClass *self); int CC_set_translation (ConnectionClass *self); char CC_connect(ConnectionClass *self, char password_req, char *salt_para); char CC_add_statement(ConnectionClass *self, StatementClass *stmt); char CC_remove_statement(ConnectionClass *self, StatementClass *stmt); void CC_set_error(ConnectionClass *self, int number, const char *message); void CC_set_errormsg(ConnectionClass *self, const char *message); char CC_get_error(ConnectionClass *self, int *number, char **message); QResultClass *CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi); void CC_clear_error(ConnectionClass *self); char *CC_create_errormsg(ConnectionClass *self); int CC_send_function(ConnectionClass *conn, int fnid, void *result_buf, int *actual_result_len, int result_is_int, LO_ARG *argv, int nargs); char CC_send_settings(ConnectionClass *self); void CC_lookup_lo(ConnectionClass *conn); void CC_lookup_pg_version(ConnectionClass *conn); void CC_initialize_pg_version(ConnectionClass *conn); void CC_log_error(char *func, char *desc, ConnectionClass *self); #endif unixODBC-2.3.9/Drivers/Postgre7.1/options.c0000755000175000017500000003607512262474475015242 00000000000000 /* Module: options.c * * Description: This module contains routines for getting/setting * connection and statement options. * * Classes: n/a * * API functions: SQLSetConnectOption, SQLSetStmtOption, SQLGetConnectOption, * SQLGetStmtOption * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "psqlodbc.h" #include #ifndef WIN32 #include "isql.h" #include "isqlext.h" #else #include #include #include #endif #include "environ.h" #include "connection.h" #include "statement.h" #include "qresult.h" extern GLOBAL_VALUES globals; RETCODE set_statement_option(ConnectionClass *conn, StatementClass *stmt, UWORD fOption, UDWORD vParam); RETCODE set_statement_option(ConnectionClass *conn, StatementClass *stmt, UWORD fOption, UDWORD vParam) { static char* const func="set_statement_option"; char changed = FALSE; switch(fOption) { case SQL_ASYNC_ENABLE:/* ignored */ break; case SQL_BIND_TYPE: /* now support multi-column and multi-row binding */ if (conn) conn->stmtOptions.bind_size = vParam; if (stmt) stmt->options.bind_size = vParam; break; case SQL_CONCURRENCY: /* positioned update isn't supported so cursor concurrency is read-only */ if (conn) conn->stmtOptions.scroll_concurrency = vParam; if (stmt) stmt->options.scroll_concurrency = vParam; break; /* if (globals.lie) { if (conn) conn->stmtOptions.scroll_concurrency = vParam; if (stmt) stmt->options.scroll_concurrency = vParam; } else { if (conn) conn->stmtOptions.scroll_concurrency = SQL_CONCUR_READ_ONLY; if (stmt) stmt->options.scroll_concurrency = SQL_CONCUR_READ_ONLY; if (vParam != SQL_CONCUR_READ_ONLY) changed = TRUE; } break; */ case SQL_CURSOR_TYPE: /* if declare/fetch, then type can only be forward. otherwise, it can only be forward or static. */ mylog("SetStmtOption(): SQL_CURSOR_TYPE = %d\n", vParam); if (globals.lie) { if (conn) conn->stmtOptions.cursor_type = vParam; if (stmt) stmt->options.cursor_type = vParam; } else { if (globals.use_declarefetch) { if (conn) conn->stmtOptions.cursor_type = SQL_CURSOR_FORWARD_ONLY; if (stmt) stmt->options.cursor_type = SQL_CURSOR_FORWARD_ONLY; if (vParam != SQL_CURSOR_FORWARD_ONLY) changed = TRUE; } else { if (vParam == SQL_CURSOR_FORWARD_ONLY || vParam == SQL_CURSOR_STATIC) { if (conn) conn->stmtOptions.cursor_type = vParam; /* valid type */ if (stmt) stmt->options.cursor_type = vParam; /* valid type */ } else { if (conn) conn->stmtOptions.cursor_type = SQL_CURSOR_STATIC; if (stmt) stmt->options.cursor_type = SQL_CURSOR_STATIC; changed = TRUE; } } } break; case SQL_KEYSET_SIZE: /* ignored, but saved and returned */ mylog("SetStmtOption(): SQL_KEYSET_SIZE, vParam = %d\n", vParam); if (conn) conn->stmtOptions.keyset_size = vParam; if (stmt) stmt->options.keyset_size = vParam; break; /* if (globals.lie) stmt->keyset_size = vParam; else { SC_set_error(stmt, STMT_NOT_IMPLEMENTED_ERROR, "Driver does not support keyset size option"); SC_log_error(func, "", stmt); return SQL_ERROR; } */ case SQL_MAX_LENGTH:/* ignored, but saved */ mylog("SetStmtOption(): SQL_MAX_LENGTH, vParam = %d\n", vParam); if (conn) conn->stmtOptions.maxLength = vParam; if (stmt) stmt->options.maxLength = vParam; break; case SQL_MAX_ROWS: /* ignored, but saved */ mylog("SetStmtOption(): SQL_MAX_ROWS, vParam = %d\n", vParam); if (conn) conn->stmtOptions.maxRows = vParam; if (stmt) stmt->options.maxRows = vParam; break; case SQL_NOSCAN: /* ignored */ mylog("SetStmtOption: SQL_NOSCAN, vParam = %d\n", vParam); break; case SQL_QUERY_TIMEOUT: /* ignored */ mylog("SetStmtOption: SQL_QUERY_TIMEOUT, vParam = %d\n", vParam); /* "0" returned in SQLGetStmtOption */ break; case SQL_RETRIEVE_DATA: /* ignored, but saved */ mylog("SetStmtOption(): SQL_RETRIEVE_DATA, vParam = %d\n", vParam); if (conn) conn->stmtOptions.retrieve_data = vParam; if (stmt) stmt->options.retrieve_data = vParam; break; case SQL_ROWSET_SIZE: mylog("SetStmtOption(): SQL_ROWSET_SIZE, vParam = %d\n", vParam); /* Save old rowset size for SQLExtendedFetch purposes If the rowset_size is being changed since the last call to fetch rows. */ if (stmt && stmt->save_rowset_size <= 0 && stmt->last_fetch_count > 0 ) stmt->save_rowset_size = stmt->options.rowset_size; if (vParam < 1) { vParam = 1; changed = TRUE; } if (conn) conn->stmtOptions.rowset_size = vParam; if (stmt) stmt->options.rowset_size = vParam; break; case SQL_SIMULATE_CURSOR: /* NOT SUPPORTED */ if (stmt) { SC_set_error(stmt, STMT_NOT_IMPLEMENTED_ERROR, "Simulated positioned update/delete not supported. Use the cursor library."); SC_log_error(func, "", stmt); } if (conn) { CC_set_error(conn, STMT_NOT_IMPLEMENTED_ERROR, "Simulated positioned update/delete not supported. Use the cursor library."); CC_log_error(func, "", conn); } return SQL_ERROR; case SQL_USE_BOOKMARKS: if (stmt) stmt->options.use_bookmarks = vParam; if (conn) conn->stmtOptions.use_bookmarks = vParam; break; /* * added to be nice to OpenOffice */ case /*SQL_ATTR_CURSOR_SENSITIVITY*/ 65534: break; default: { char option[64]; if (stmt) { SC_set_error(stmt, STMT_NOT_IMPLEMENTED_ERROR, "Unknown statement option (Set)"); sprintf(option, "fOption=%d, vParam=%ld", fOption, (long)vParam); SC_log_error(func, option, stmt); } if (conn) { CC_set_error(conn, STMT_NOT_IMPLEMENTED_ERROR, "Unknown statement option (Set)"); sprintf(option, "fOption=%d, vParam=%ld", fOption, (long)vParam); CC_log_error(func, option, conn); } return SQL_ERROR; } } if (changed) { if (stmt) { SC_set_error(stmt, STMT_OPTION_VALUE_CHANGED, "Requested value changed."); } if (conn) { CC_set_error(conn, STMT_OPTION_VALUE_CHANGED, "Requested value changed."); } return SQL_SUCCESS_WITH_INFO; } else return SQL_SUCCESS; } /* Implements only SQL_AUTOCOMMIT */ RETCODE SQL_API SQLSetConnectOption( HDBC hdbc, UWORD fOption, SQLULEN vParam) { static char* const func="SQLSetConnectOption"; ConnectionClass *conn = (ConnectionClass *) hdbc; char changed = FALSE; RETCODE retval; int i; mylog("%s: entering...\n", func); if ( ! conn) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } switch (fOption) { /* Statement Options (apply to all stmts on the connection and become defaults for new stmts) */ case SQL_ASYNC_ENABLE: case SQL_BIND_TYPE: case SQL_CONCURRENCY: case SQL_CURSOR_TYPE: case SQL_KEYSET_SIZE: case SQL_MAX_LENGTH: case SQL_MAX_ROWS: case SQL_NOSCAN: case SQL_QUERY_TIMEOUT: case SQL_RETRIEVE_DATA: case SQL_ROWSET_SIZE: case SQL_SIMULATE_CURSOR: case SQL_USE_BOOKMARKS: /* Affect all current Statements */ for (i = 0; i < conn->num_stmts; i++) { if ( conn->stmts[i]) { set_statement_option(NULL, conn->stmts[i], fOption, vParam); } } /* Become the default for all future statements on this connection */ retval = set_statement_option(conn, NULL, fOption, vParam); if (retval == SQL_SUCCESS_WITH_INFO) changed = TRUE; else if (retval == SQL_ERROR) return SQL_ERROR; break; /**********************************/ /***** Connection Options *******/ /**********************************/ case SQL_ACCESS_MODE: /* ignored */ break; case SQL_AUTOCOMMIT: if (CC_is_in_trans(conn)) { CC_set_error(conn, CONN_TRANSACT_IN_PROGRES, "Cannot switch commit mode while a transaction is in progress"); CC_log_error(func, "", conn); return SQL_ERROR; } mylog("SQLSetConnectOption: AUTOCOMMIT: transact_status=%d, vparam=%d\n", conn->transact_status, vParam); switch(vParam) { case SQL_AUTOCOMMIT_OFF: CC_set_autocommit_off(conn); break; case SQL_AUTOCOMMIT_ON: CC_set_autocommit_on(conn); break; default: CC_set_error(conn, CONN_INVALID_ARGUMENT_NO, "Illegal parameter value for SQL_AUTOCOMMIT"); CC_log_error(func, "", conn); return SQL_ERROR; } break; case SQL_CURRENT_QUALIFIER: /* ignored */ break; case SQL_LOGIN_TIMEOUT: /* ignored */ break; case SQL_PACKET_SIZE: /* ignored */ break; case SQL_QUIET_MODE: /* ignored */ break; case SQL_TXN_ISOLATION: /* ignored */ break; /* These options should be handled by driver manager */ case SQL_ODBC_CURSORS: case SQL_OPT_TRACE: case SQL_OPT_TRACEFILE: case SQL_TRANSLATE_DLL: case SQL_TRANSLATE_OPTION: CC_log_error(func, "This connect option (Set) is only used by the Driver Manager", conn); break; default: { char option[64]; CC_set_error(conn, CONN_UNSUPPORTED_OPTION, "Unknown connect option (Set)"); sprintf(option, "fOption=%d, vParam=%ld", fOption, vParam); CC_log_error(func, option, conn); return SQL_ERROR; } } if (changed) { CC_set_error(conn, CONN_OPTION_VALUE_CHANGED, "Requested value changed."); return SQL_SUCCESS_WITH_INFO; } else return SQL_SUCCESS; } /* - - - - - - - - - */ /* This function just can tell you whether you are in Autcommit mode or not */ RETCODE SQL_API SQLGetConnectOption( HDBC hdbc, UWORD fOption, PTR pvParam) { static char* const func="SQLGetConnectOption"; ConnectionClass *conn = (ConnectionClass *) hdbc; mylog("%s: entering...\n", func); if (! conn) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } switch (fOption) { case SQL_ACCESS_MODE:/* NOT SUPPORTED */ *((UDWORD *) pvParam) = SQL_MODE_READ_WRITE; break; case SQL_AUTOCOMMIT: *((UDWORD *)pvParam) = (UDWORD)( CC_is_in_autocommit(conn) ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF); break; case SQL_CURRENT_QUALIFIER: /* don't use qualifiers */ if(pvParam) { ((char*)pvParam)[0]='\0'; } break; case SQL_LOGIN_TIMEOUT: /* NOT SUPPORTED */ *((UDWORD *) pvParam) = 0; break; case SQL_PACKET_SIZE: /* NOT SUPPORTED */ *((UDWORD *) pvParam) = globals.socket_buffersize; break; case SQL_QUIET_MODE:/* NOT SUPPORTED */ *((UDWORD *) pvParam) = (UDWORD) NULL; break; case SQL_TXN_ISOLATION:/* NOT SUPPORTED */ *((UDWORD *) pvParam) = SQL_TXN_SERIALIZABLE; break; /* These options should be handled by driver manager */ case SQL_ODBC_CURSORS: case SQL_OPT_TRACE: case SQL_OPT_TRACEFILE: case SQL_TRANSLATE_DLL: case SQL_TRANSLATE_OPTION: CC_log_error(func, "This connect option (Get) is only used by the Driver Manager", conn); break; default: { char option[64]; CC_set_error(conn, CONN_UNSUPPORTED_OPTION, "Unknown connect option (Get)"); sprintf(option, "fOption=%d", fOption); CC_log_error(func, option, conn); return SQL_ERROR; break; } } return SQL_SUCCESS; } /* - - - - - - - - - */ RETCODE SQL_API SQLSetStmtOption( HSTMT hstmt, UWORD fOption, SQLULEN vParam) { static char* const func="SQLSetStmtOption"; StatementClass *stmt = (StatementClass *) hstmt; mylog("%s: entering...\n", func); /* thought we could fake Access out by just returning SQL_SUCCESS */ /* all the time, but it tries to set a huge value for SQL_MAX_LENGTH */ /* and expects the driver to reduce it to the real value */ if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } return set_statement_option(NULL, stmt, fOption, vParam); } /* - - - - - - - - - */ RETCODE SQL_API SQLGetStmtOption( HSTMT hstmt, UWORD fOption, PTR pvParam) { static char* const func="SQLGetStmtOption"; StatementClass *stmt = (StatementClass *) hstmt; QResultClass *res; mylog("%s: entering...\n", func); /* thought we could fake Access out by just returning SQL_SUCCESS */ /* all the time, but it tries to set a huge value for SQL_MAX_LENGTH */ /* and expects the driver to reduce it to the real value */ if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } switch(fOption) { case SQL_GET_BOOKMARK: case SQL_ROW_NUMBER: res = stmt->result; if ( stmt->manual_result || ! globals.use_declarefetch) { /* make sure we're positioned on a valid row */ if((stmt->currTuple < 0) || (stmt->currTuple >= QR_get_num_tuples(res))) { SC_set_error(stmt, STMT_INVALID_CURSOR_STATE_ERROR, "Not positioned on a valid row."); SC_log_error(func, "", stmt); return SQL_ERROR; } } else { if (stmt->currTuple == -1 || ! res || ! res->tupleField) { SC_set_error(stmt, STMT_INVALID_CURSOR_STATE_ERROR, "Not positioned on a valid row."); SC_log_error(func, "", stmt); return SQL_ERROR; } } if (fOption == SQL_GET_BOOKMARK && stmt->options.use_bookmarks == SQL_UB_OFF) { SC_set_error(stmt, STMT_OPERATION_INVALID, "Operation invalid because use bookmarks not enabled."); SC_log_error(func, "", stmt); return SQL_ERROR; } *((UDWORD *) pvParam) = SC_get_bookmark(stmt); break; case SQL_ASYNC_ENABLE: /* NOT SUPPORTED */ *((SDWORD *) pvParam) = SQL_ASYNC_ENABLE_OFF; break; case SQL_BIND_TYPE: *((SDWORD *) pvParam) = stmt->options.bind_size; break; case SQL_CONCURRENCY: /* NOT REALLY SUPPORTED */ mylog("GetStmtOption(): SQL_CONCURRENCY\n"); *((SDWORD *)pvParam) = stmt->options.scroll_concurrency; break; case SQL_CURSOR_TYPE: /* PARTIAL SUPPORT */ mylog("GetStmtOption(): SQL_CURSOR_TYPE\n"); *((SDWORD *)pvParam) = stmt->options.cursor_type; break; case SQL_KEYSET_SIZE: /* NOT SUPPORTED, but saved */ mylog("GetStmtOption(): SQL_KEYSET_SIZE\n"); *((SDWORD *)pvParam) = stmt->options.keyset_size; break; case SQL_MAX_LENGTH: /* NOT SUPPORTED, but saved */ *((SDWORD *)pvParam) = stmt->options.maxLength; break; case SQL_MAX_ROWS: /* NOT SUPPORTED, but saved */ *((SDWORD *)pvParam) = stmt->options.maxRows; mylog("GetSmtOption: MAX_ROWS, returning %d\n", stmt->options.maxRows); break; case SQL_NOSCAN:/* NOT SUPPORTED */ *((SDWORD *) pvParam) = SQL_NOSCAN_ON; break; case SQL_QUERY_TIMEOUT: /* NOT SUPPORTED */ *((SDWORD *) pvParam) = 0; break; case SQL_RETRIEVE_DATA: /* NOT SUPPORTED, but saved */ *((SDWORD *) pvParam) = stmt->options.retrieve_data; break; case SQL_ROWSET_SIZE: *((SDWORD *) pvParam) = stmt->options.rowset_size; break; case SQL_SIMULATE_CURSOR:/* NOT SUPPORTED */ *((SDWORD *) pvParam) = SQL_SC_NON_UNIQUE; break; case SQL_USE_BOOKMARKS: *((SDWORD *) pvParam) = stmt->options.use_bookmarks; break; /* * added to be nice to StarOffice and OpenOffice */ case /*SQL_ATTR_CURSOR_SENSITIVITY*/ 65534: *((SDWORD *) pvParam) = /*SQL_UNSPECIFIED*/ 0; break; default: { char option[64]; SC_set_error(stmt, STMT_NOT_IMPLEMENTED_ERROR, "Unknown statement option (Get)"); sprintf(option, "fOption=%d", fOption); SC_log_error(func, option, stmt); return SQL_ERROR; } } return SQL_SUCCESS; } /* - - - - - - - - - */ unixODBC-2.3.9/Drivers/Postgre7.1/lobj.h0000755000175000017500000000200512262474475014464 00000000000000 /* File: lobj.h * * Description: See "lobj.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __LOBJ_H__ #define __LOBJ_H__ #include "psqlodbc.h" struct lo_arg { int isint; int len; union { int integer; char *ptr; } u; }; #define LO_CREAT 957 #define LO_OPEN 952 #define LO_CLOSE 953 #define LO_READ 954 #define LO_WRITE 955 #define LO_LSEEK 956 #define LO_TELL 958 #define LO_UNLINK 964 #define INV_WRITE 0x00020000 #define INV_READ 0x00040000 Oid odbc_lo_creat(ConnectionClass *conn, int mode); int odbc_lo_open(ConnectionClass *conn, int lobjId, int mode); int odbc_lo_close(ConnectionClass *conn, int fd); int odbc_lo_read(ConnectionClass *conn, int fd, char *buf, int len); int odbc_lo_write(ConnectionClass *conn, int fd, char *buf, int len); int odbc_lo_lseek(ConnectionClass *conn, int fd, int offset, int len); int odbc_lo_tell(ConnectionClass *conn, int fd); int odbc_lo_unlink(ConnectionClass *conn, Oid lobjId); #endif unixODBC-2.3.9/Drivers/Postgre7.1/connection.c0000755000175000017500000012775612262474475015715 00000000000000 /* Module: connection.c * * Description: This module contains routines related to * connecting to and disconnecting from the Postgres DBMS. * * Classes: ConnectionClass (Functions prefix: "CC_") * * API functions: SQLAllocConnect, SQLConnect, SQLDisconnect, SQLFreeConnect, * SQLBrowseConnect(NI) * * Comments: See "notice.txt" for copyright and license information. * */ #include #include "environ.h" #include "connection.h" #include "socket.h" #include "statement.h" #include "qresult.h" #include "lobj.h" #include "dlg_specific.h" #include #include #include #ifdef WIN32 #include #endif #ifdef UNIXODBC #include #ifdef HAVE_CRYPT_H #include #endif #include "md5.h" #endif #define STMT_INCREMENT 16 /* how many statement holders to allocate at a time */ #define PRN_NULLCHECK extern GLOBAL_VALUES globals; RETCODE SQL_API SQLAllocConnect(HENV henv, HDBC FAR *phdbc) { EnvironmentClass *env = (EnvironmentClass *)henv; ConnectionClass *conn; static char* const func="SQLAllocConnect"; mylog( "%s: entering...\n", func); conn = CC_Constructor(); mylog("**** %s: henv = %u, conn = %u\n", func, henv, conn); if( ! conn) { env->errornumber = ENV_ALLOC_ERROR; env->errormsg = "Couldn't allocate memory for Connection object."; *phdbc = SQL_NULL_HDBC; EN_log_error(func, "", env); return SQL_ERROR; } if ( ! EN_add_connection(env, conn)) { env->errornumber = ENV_ALLOC_ERROR; env->errormsg = "Maximum number of connections exceeded."; CC_Destructor(conn); *phdbc = SQL_NULL_HDBC; EN_log_error(func, "", env); return SQL_ERROR; } *phdbc = (HDBC) conn; return SQL_SUCCESS; } /* - - - - - - - - - */ RETCODE SQL_API SQLConnect( HDBC hdbc, UCHAR FAR *szDSN, SWORD cbDSN, UCHAR FAR *szUID, SWORD cbUID, UCHAR FAR *szAuthStr, SWORD cbAuthStr) { ConnectionClass *conn = (ConnectionClass *) hdbc; ConnInfo *ci; static char* const func = "SQLConnect"; mylog( "%s: entering...\n", func); if ( ! conn) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } ci = &conn->connInfo; make_string((char*)szDSN, cbDSN, ci->dsn); /* get the values for the DSN from the registry */ getDSNinfo(ci, CONN_OVERWRITE); /* initialize pg_version from connInfo.protocol */ CC_initialize_pg_version(conn); /* override values from DSN info with UID and authStr(pwd) This only occurs if the values are actually there. */ make_string((char*)szUID, cbUID, ci->username); make_string((char*)szAuthStr, cbAuthStr, ci->password); /* fill in any defaults */ getDSNdefaults(ci); qlog("conn = %u, %s(DSN='%s', UID='%s', PWD='%s')\n", conn, func, ci->dsn, ci->username, ci->password); if ( CC_connect(conn, AUTH_REQ_OK, NULL) <= 0) { /* Error messages are filled in */ CC_log_error(func, "Error on CC_connect", conn); return SQL_ERROR; } mylog( "%s: returning...\n", func); return SQL_SUCCESS; } /* - - - - - - - - - */ RETCODE SQL_API SQLBrowseConnect( HDBC hdbc, UCHAR FAR *szConnStrIn, SWORD cbConnStrIn, UCHAR FAR *szConnStrOut, SWORD cbConnStrOutMax, SWORD FAR *pcbConnStrOut) { static char* const func="SQLBrowseConnect"; mylog( "%s: entering...\n", func); return SQL_SUCCESS; } /* - - - - - - - - - */ /* Drop any hstmts open on hdbc and disconnect from database */ RETCODE SQL_API SQLDisconnect( HDBC hdbc) { ConnectionClass *conn = (ConnectionClass *) hdbc; static char* const func = "SQLDisconnect"; mylog( "%s: entering...\n", func); if ( ! conn) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } qlog("conn=%u, %s\n", conn, func); if (conn->status == CONN_EXECUTING) { CC_set_error(conn, CONN_IN_USE, "A transaction is currently being executed"); CC_log_error(func, "", conn); return SQL_ERROR; } mylog("%s: about to CC_cleanup\n", func); /* Close the connection and free statements */ CC_cleanup(conn); mylog("%s: done CC_cleanup\n", func); mylog("%s: returning...\n", func); return SQL_SUCCESS; } /* - - - - - - - - - */ RETCODE SQL_API SQLFreeConnect( HDBC hdbc) { ConnectionClass *conn = (ConnectionClass *) hdbc; static char* const func = "SQLFreeConnect"; mylog( "%s: entering...\n", func); mylog("**** in %s: hdbc=%u\n", func, hdbc); if ( ! conn) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } /* Remove the connection from the environment */ if ( ! EN_remove_connection((EnvironmentClass*)conn->henv, conn)) { CC_set_error(conn, CONN_IN_USE, "A transaction is currently being executed"); CC_log_error(func, "", conn); return SQL_ERROR; } CC_Destructor(conn); mylog("%s: returning...\n", func); return SQL_SUCCESS; } /* * * IMPLEMENTATION CONNECTION CLASS * */ ConnectionClass *CC_Constructor() { ConnectionClass *rv; rv = (ConnectionClass *)malloc(sizeof(ConnectionClass)); if (rv != NULL) { rv->henv = (HENV)NULL; /* not yet associated with an environment */ CC_clear_error(rv); rv->status = CONN_NOT_CONNECTED; rv->transact_status = CONN_IN_AUTOCOMMIT; /* autocommit by default */ memset(&rv->connInfo, 0, sizeof(ConnInfo)); rv->sock = SOCK_Constructor(); if ( ! rv->sock) return NULL; rv->stmts = (StatementClass **) malloc( sizeof(StatementClass *) * STMT_INCREMENT); if ( ! rv->stmts) return NULL; memset(rv->stmts, 0, sizeof(StatementClass *) * STMT_INCREMENT); rv->num_stmts = STMT_INCREMENT; rv->lobj_type = PG_TYPE_LO; rv->ntables = 0; rv->col_info = NULL; rv->translation_option = 0; rv->translation_handle = NULL; rv->DataSourceToDriver = NULL; rv->DriverToDataSource = NULL; memset(rv->pg_version, 0, sizeof(rv->pg_version)); rv->pg_version_number = .0; rv->pg_version_major = 0; rv->pg_version_minor = 0; /* Initialize statement options to defaults */ /* Statements under this conn will inherit these options */ InitializeStatementOptions(&rv->stmtOptions); } return rv; } char CC_Destructor(ConnectionClass *self) { mylog("enter CC_Destructor, self=%u\n", self); if (self->status == CONN_EXECUTING) return 0; CC_cleanup(self); /* cleanup socket and statements */ mylog("after CC_Cleanup\n"); /* Free up statement holders */ if (self->stmts) { free(self->stmts); self->stmts = NULL; } mylog("after free statement holders\n"); /* Free cached table info */ if (self->col_info) { int i; for (i = 0; i < self->ntables; i++) { if (self->col_info[i]->result) /* Free the SQLColumns result structure */ QR_Destructor(self->col_info[i]->result); free(self->col_info[i]); } CC_set_errormsg(self, NULL); free(self->col_info); } CC_set_errormsg(self, NULL); free(self); mylog("exit CC_Destructor\n"); return 1; } /* Return how many cursors are opened on this connection */ int CC_cursor_count(ConnectionClass *self) { StatementClass *stmt; int i, count = 0; mylog("CC_cursor_count: self=%u, num_stmts=%d\n", self, self->num_stmts); for (i = 0; i < self->num_stmts; i++) { stmt = self->stmts[i]; if (stmt && stmt->result && stmt->result->cursor) count++; } mylog("CC_cursor_count: returning %d\n", count); return count; } void CC_clear_error(ConnectionClass *self) { self->__error_number = 0; self->__error_message = NULL; self->errormsg_created = FALSE; } /* Used to cancel a transaction */ /* We are almost always in the middle of a transaction. */ char CC_abort(ConnectionClass *self) { QResultClass *res; if ( CC_is_in_trans(self)) { res = NULL; mylog("CC_abort: sending ABORT!\n"); res = CC_send_query(self, "ABORT", NULL); CC_set_no_trans(self); if (res != NULL) QR_Destructor(res); else return FALSE; } return TRUE; } /* This is called by SQLDisconnect also */ char CC_cleanup(ConnectionClass *self) { int i; StatementClass *stmt; if (self->status == CONN_EXECUTING) return FALSE; mylog("in CC_Cleanup, self=%u\n", self); /* Cancel an ongoing transaction */ /* We are always in the middle of a transaction, */ /* even if we are in auto commit. */ if (self->sock) CC_abort(self); /* * mimic closePGconn */ if ( self->sock) { SOCK_put_string( self->sock, "X" ); SOCK_flush_output( self->sock ); } mylog("after CC_abort\n"); /* This actually closes the connection to the dbase */ if (self->sock) { SOCK_Destructor(self->sock); self->sock = NULL; } mylog("after SOCK destructor\n"); /* Free all the stmts on this connection */ for (i = 0; i < self->num_stmts; i++) { if ( self->stmts ) { stmt = self->stmts[i]; if (stmt) { stmt->hdbc = NULL; /* prevent any more dbase interactions */ SC_Destructor(stmt); self->stmts[i] = NULL; } } } /* Check for translation dll */ #ifdef WIN32 if ( self->translation_handle) { FreeLibrary (self->translation_handle); self->translation_handle = NULL; } #endif mylog("exit CC_Cleanup\n"); return TRUE; } int CC_set_translation (ConnectionClass *self) { #ifdef WIN32 if (self->translation_handle != NULL) { FreeLibrary (self->translation_handle); self->translation_handle = NULL; } if (self->connInfo.translation_dll[0] == 0) return TRUE; self->translation_option = atoi (self->connInfo.translation_option); self->translation_handle = LoadLibrary (self->connInfo.translation_dll); if (self->translation_handle == NULL) { CC_set_error(self, CONN_UNABLE_TO_LOAD_DLL, "Could not load the translation DLL."); return FALSE; } self->DataSourceToDriver = (DataSourceToDriverProc) GetProcAddress (self->translation_handle, "SQLDataSourceToDriver"); self->DriverToDataSource = (DriverToDataSourceProc) GetProcAddress (self->translation_handle, "SQLDriverToDataSource"); if (self->DataSourceToDriver == NULL || self->DriverToDataSource == NULL) { CC_set_error(self, CONN_UNABLE_TO_LOAD_DLL, "Could not find translation DLL functions."); return FALSE; } #endif return TRUE; } static int md5_auth_send(ConnectionClass *self, const char *salt) { char *pwd1 = NULL, *pwd2 = NULL; ConnInfo *ci = &(self->connInfo); SocketClass *sock = self->sock; if (!(pwd1 = malloc(MD5_PASSWD_LEN + 1))) return 1; if (!EncryptMD5(ci->password, ci->username, strlen(ci->username), pwd1)) { free(pwd1); return 1; } if (!(pwd2 = malloc(MD5_PASSWD_LEN + 1))) { free(pwd1); return 1; } if (!EncryptMD5(pwd1 + strlen("md5"), salt, 4, pwd2)) { free(pwd2); free(pwd1); return 1; } free(pwd1); SOCK_put_int(sock, 4 + strlen(pwd2) + 1, 4); SOCK_put_n_char(sock, pwd2, strlen(pwd2) + 1); SOCK_flush_output(sock); free(pwd2); return 0; } char CC_connect(ConnectionClass *self, char password_req, char *salt_para) { StartupPacket sp; StartupPacket6_2 sp62; QResultClass *res; SocketClass *sock; ConnInfo *ci = &(self->connInfo); int areq = -1; int beresp; char msgbuffer[ERROR_MSG_LENGTH]; char salt[5], notice[512]; static char* const func="CC_connect"; char *encoding; mylog("%s: entering...\n", func); if (password_req != AUTH_REQ_OK) sock = self->sock; /* already connected, just authenticate */ else { qlog("Global Options: Version='%s', fetch=%d, socket=%d, unknown_sizes=%d, max_varchar_size=%d, max_longvarchar_size=%d\n", POSTGRESDRIVERVERSION, globals.fetch_max, globals.socket_buffersize, globals.unknown_sizes, globals.max_varchar_size, globals.max_longvarchar_size); qlog(" disable_optimizer=%d, ksqo=%d, unique_index=%d, use_declarefetch=%d\n", globals.disable_optimizer, globals.ksqo, globals.unique_index, globals.use_declarefetch); qlog(" text_as_longvarchar=%d, unknowns_as_longvarchar=%d, bools_as_char=%d\n", globals.text_as_longvarchar, globals.unknowns_as_longvarchar, globals.bools_as_char); qlog(" extra_systable_prefixes='%s', conn_settings='%s'\n", globals.extra_systable_prefixes, globals.conn_settings); if (self->status != CONN_NOT_CONNECTED) { CC_set_error(self, CONN_OPENDB_ERROR, "Already connected."); return 0; } if ( ci->server[0] == '\0' || ci->port[0] == '\0' || ci->database[0] == '\0') { CC_set_error(self, CONN_INIREAD_ERROR,"Missing server name, port, or database name in call to CC_connect."); return 0; } mylog("CC_connect(): DSN = '%s', server = '%s', port = '%s', database = '%s', username = '%s', password='%s'\n", ci->dsn, ci->server, ci->port, ci->database, ci->username, ci->password); another_version_retry: /* If the socket was closed for some reason (like a SQLDisconnect, but no SQLFreeConnect * then create a socket now. */ if ( ! self->sock) { self->sock = SOCK_Constructor(); if ( ! self->sock) { CC_set_error(self, CONNECTION_SERVER_NOT_REACHED, "Could not open a socket to the server"); return 0; } } sock = self->sock; mylog("connecting to the server socket...\n"); SOCK_connect_to(sock, (short) atoi(ci->port), ci->server, ci->uds); if (SOCK_get_errcode(sock) != 0) { mylog("connection to the server socket failed.\n"); CC_set_error(self, CONNECTION_SERVER_NOT_REACHED, "Could not connect to the server"); return 0; } mylog("connection to the server socket succeeded.\n"); if ( PROTOCOL_62(ci)) { sock->reverse = TRUE; /* make put_int and get_int work for 6.2 */ memset(&sp62, 0, sizeof(StartupPacket6_2)); SOCK_put_int(sock, htonl(4+sizeof(StartupPacket6_2)), 4); sp62.authtype = htonl(NO_AUTHENTICATION); strncpy(sp62.database, ci->database, PATH_SIZE); strncpy(sp62.user, ci->username, NAMEDATALEN); SOCK_put_n_char(sock, (char *) &sp62, sizeof(StartupPacket6_2)); SOCK_flush_output(sock); } else { memset(&sp, 0, sizeof(StartupPacket)); mylog("sizeof startup packet = %d\n", sizeof(StartupPacket)); /* Send length of Authentication Block */ SOCK_put_int(sock, 4+sizeof(StartupPacket), 4); if ( PROTOCOL_63(ci)) sp.protoVersion = (ProtocolVersion) htonl(PG_PROTOCOL_63); else sp.protoVersion = (ProtocolVersion) htonl(PG_PROTOCOL_LATEST); strncpy(sp.database, ci->database, SM_DATABASE); strncpy(sp.user, ci->username, SM_USER); SOCK_put_n_char(sock, (char *) &sp, sizeof(StartupPacket)); SOCK_flush_output(sock); } mylog("sent the authentication block.\n"); if (sock->errornumber != 0) { mylog("couldn't send the authentication block properly.\n"); CC_set_error(self, CONN_INVALID_AUTHENTICATION, "Sending the authentication packet failed"); return 0; } mylog("sent the authentication block successfully.\n"); } mylog("gonna do authentication\n"); /* *************************************************** */ /* Now get the authentication request from backend */ /* *************************************************** */ if (!PROTOCOL_62(ci)) { BOOL before_64 = PG_VERSION_LT(self, 6.4), ReadyForQuery = FALSE; do { if (password_req != AUTH_REQ_OK) beresp = 'R'; else { beresp = SOCK_get_char(sock); mylog("auth got '%c'\n", beresp); } switch (beresp) { case 'E': SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); CC_set_error(self, CONN_INVALID_AUTHENTICATION, msgbuffer); qlog("ERROR from backend during authentication: '%s'\n", msgbuffer); if (strncmp(msgbuffer, "Unsupported frontend protocol", 29) == 0) { /* retry older version */ if (PROTOCOL_63(ci)) strcpy(ci->protocol, PG62); else strcpy(ci->protocol, PG63); SOCK_Destructor(sock); self->sock = (SocketClass *) 0; CC_initialize_pg_version(self); goto another_version_retry; } return 0; case 'R': if (password_req != AUTH_REQ_OK) { mylog("in 'R' password_req=%s\n", ci->password); areq = password_req; if (salt_para) memcpy(salt, salt_para, sizeof(salt)); password_req = AUTH_REQ_OK; } else { areq = SOCK_get_int(sock, 4); if (areq == AUTH_REQ_MD5) SOCK_get_n_char(sock, salt, 4); else if (areq == AUTH_REQ_CRYPT) SOCK_get_n_char(sock, salt, 2); mylog("areq = %d\n", areq); } switch (areq) { case AUTH_REQ_OK: break; case AUTH_REQ_KRB4: CC_set_error(self, CONN_AUTH_TYPE_UNSUPPORTED, "Kerberos 4 authentication not supported"); return 0; case AUTH_REQ_KRB5: CC_set_error(self, CONN_AUTH_TYPE_UNSUPPORTED, "Kerberos 5 authentication not supported"); return 0; case AUTH_REQ_PASSWORD: mylog("in AUTH_REQ_PASSWORD\n"); if (ci->password[0] == '\0') { CC_set_error(self, CONNECTION_NEED_PASSWORD, "A password is required for this connection."); return -areq; /* need password */ } mylog("past need password\n"); SOCK_put_int(sock, 4 + strlen(ci->password) + 1, 4); SOCK_put_n_char(sock, ci->password, strlen(ci->password) + 1); SOCK_flush_output(sock); mylog("past flush\n"); break; case AUTH_REQ_CRYPT: #ifdef HAVE_LIBCRYPT { char *password; mylog("in AUTH_REQ_CRYPT\n"); if (ci->password[0] == '\0') { CC_set_error(self, CONNECTION_NEED_PASSWORD, "A password is required for this connection."); return -1; /* need password */ } mylog("past need password\n"); password = crypt( ci -> password, salt ); SOCK_put_int(sock, 4+strlen(password)+1, 4); SOCK_put_n_char(sock, password, strlen(password) + 1); SOCK_flush_output(sock); mylog("past flush\n"); break; } #else CC_set_error(self, CONN_AUTH_TYPE_UNSUPPORTED, "Password crypt authentication not supported."); #endif return 0; case AUTH_REQ_MD5: mylog("in AUTH_REQ_MD5\n"); if (ci->password[0] == '\0') { CC_set_error(self, CONNECTION_NEED_PASSWORD, "A password is required for this connection."); if (salt_para) memcpy(salt_para, salt, sizeof(salt)); return -areq; /* need password */ } if (md5_auth_send(self, salt)) { CC_set_error(self, CONN_INVALID_AUTHENTICATION, "md5 hashing failed"); return 0; } break; case AUTH_REQ_SCM_CREDS: CC_set_error(self, CONN_AUTH_TYPE_UNSUPPORTED, "Unix socket credential authentication not supported"); return 0; default: CC_set_error(self, CONN_AUTH_TYPE_UNSUPPORTED, "Unknown authentication type"); return 0; } break; case 'K': /* Secret key (6.4 protocol) */ self->be_pid = SOCK_get_int(sock, 4); /* pid */ self->be_key = SOCK_get_int(sock, 4); /* key */ break; case 'Z': /* Backend is ready for new query (6.4) */ ReadyForQuery = TRUE; break; case 'N': /* Notices may come */ while (SOCK_get_string(sock, notice, sizeof(notice) - 1)) ; break; default: CC_set_error(self, CONN_INVALID_AUTHENTICATION, "Unexpected protocol character during authentication"); return 0; } /* * There were no ReadyForQuery responce before 6.4. */ if (before_64 && areq == AUTH_REQ_OK) ReadyForQuery = TRUE; } while (!ReadyForQuery); } CC_set_errormsg(self, NULL); CC_clear_error(self); /* clear any password error */ /* send an empty query in order to find out whether the specified */ /* database really exists on the server machine */ mylog("sending an empty query...\n"); res = CC_send_query(self, " ", NULL); if ( res == NULL || QR_get_status(res) != PGRES_EMPTY_QUERY) { mylog("got no result from the empty query. (probably database does not exist)\n"); CC_set_error(self, CONNECTION_NO_SUCH_DATABASE, "The database does not exist on the server\nor user authentication failed."); if (res != NULL) QR_Destructor(res); if( self->sock ) { SOCK_Destructor(self->sock); self->sock = NULL; } return 0; } if (res) QR_Destructor(res); mylog("empty query seems to be OK.\n"); CC_set_translation (self); /**********************************************/ /******* Send any initial settings *********/ /**********************************************/ /* Since these functions allocate statements, and since the connection is not established yet, it would violate odbc state transition rules. Therefore, these functions call the corresponding local function instead. */ CC_send_settings(self); CC_lookup_lo(self); /* a hack to get the oid of our large object oid type */ CC_lookup_pg_version(self); /* Get PostgreSQL version for SQLGetInfo use */ CC_set_errormsg(self, NULL); CC_clear_error(self); /* clear any initial command errors */ self->status = CONN_CONNECTED; mylog("%s: returning...\n", func); return 1; } char CC_add_statement(ConnectionClass *self, StatementClass *stmt) { int i; mylog("CC_add_statement: self=%u, stmt=%u\n", self, stmt); for (i = 0; i < self->num_stmts; i++) { if ( !self->stmts[i]) { stmt->hdbc = self; self->stmts[i] = stmt; return TRUE; } } /* no more room -- allocate more memory */ self->stmts = (StatementClass **) realloc( self->stmts, sizeof(StatementClass *) * (STMT_INCREMENT + self->num_stmts)); if ( ! self->stmts) return FALSE; memset(&self->stmts[self->num_stmts], 0, sizeof(StatementClass *) * STMT_INCREMENT); stmt->hdbc = self; self->stmts[self->num_stmts] = stmt; self->num_stmts += STMT_INCREMENT; return TRUE; } char CC_remove_statement(ConnectionClass *self, StatementClass *stmt) { int i; for (i = 0; i < self->num_stmts; i++) { if (self->stmts[i] == stmt && stmt->status != STMT_EXECUTING) { self->stmts[i] = NULL; return TRUE; } } return FALSE; } /* Create a more informative error message by concatenating the connection error message with its socket error message. */ char * CC_create_errormsg(ConnectionClass *self) { SocketClass *sock = self->sock; int pos; static char msg[4096]; mylog("enter CC_create_errormsg\n"); msg[0] = '\0'; if (CC_get_errormsg(self)) strncpy(msg, CC_get_errormsg(self), sizeof(msg)); mylog("msg = '%s'\n", msg); if (sock && sock->errormsg && sock->errormsg[0] != '\0') { pos = strlen(msg); sprintf(&msg[pos], ";\n%s", sock->errormsg); } mylog("exit CC_create_errormsg\n"); return msg ? strdup(msg) : NULL; } void CC_set_error(ConnectionClass *self, int number, const char *message) { if (self->__error_message) free(self->__error_message); self->__error_number = number; self->__error_message = message ? strdup(message) : NULL; } void CC_set_errormsg(ConnectionClass *self, const char *message) { if (self->__error_message) free(self->__error_message); self->__error_message = message ? strdup(message) : NULL; } char CC_get_error(ConnectionClass *self, int *number, char **message) { int rv; char *msgcrt; mylog("enter CC_get_error\n"); /* Create a very informative errormsg if it hasn't been done yet. */ if ( ! self->errormsg_created) { msgcrt = CC_create_errormsg(self); if (self->__error_message) free(self->__error_message); self->__error_message = msgcrt; self->errormsg_created = TRUE; } if (CC_get_errornumber(self)) { *number = CC_get_errornumber(self); *message = CC_get_errormsg(self); } rv = (CC_get_errornumber(self) != 0); self->__error_number = 0; /* clear the error */ mylog("exit CC_get_error\n"); return rv; } /* The "result_in" is only used by QR_next_tuple() to fetch another group of rows into the same existing QResultClass (this occurs when the tuple cache is depleted and needs to be re-filled). The "cursor" is used by SQLExecute to associate a statement handle as the cursor name (i.e., C3326857) for SQL select statements. This cursor is then used in future 'declare cursor C3326857 for ...' and 'fetch 100 in C3326857' statements. */ QResultClass * CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi) { QResultClass *result_in, *res = NULL; char swallow; int id; SocketClass *sock = self->sock; static char msgbuffer[MAX_MESSAGE_LEN+1]; char cmdbuffer[MAX_MESSAGE_LEN+1]; /* QR_set_command() dups this string so dont need static */ mylog("send_query(): conn=%u, query='%s'\n", self, query); qlog("conn=%u, query='%s'\n", self, query); /* Indicate that we are sending a query to the backend */ if(strlen(query) > MAX_MESSAGE_LEN-2) { CC_set_error(self, CONNECTION_MSG_TOO_LONG, "Query string is too long"); return NULL; } if ((NULL == query) || (query[0] == '\0')) return NULL; if (SOCK_get_errcode(sock) != 0) { CC_set_error(self, CONNECTION_COULD_NOT_SEND, "Could not send Query to backend"); CC_set_no_trans(self); return NULL; } SOCK_put_char(sock, 'Q'); if (SOCK_get_errcode(sock) != 0) { CC_set_error(self, CONNECTION_COULD_NOT_SEND, "Could not send Query to backend"); CC_set_no_trans(self); return NULL; } SOCK_put_string(sock, query); SOCK_flush_output(sock); if (SOCK_get_errcode(sock) != 0) { CC_set_error(self, CONNECTION_COULD_NOT_SEND, "Could not send Query to backend"); CC_set_no_trans(self); return NULL; } mylog("send_query: done sending query\n"); while(1) { /* what type of message is coming now ? */ id = SOCK_get_char(sock); if ((SOCK_get_errcode(sock) != 0) || (id == EOF)) { CC_set_error(self, CONNECTION_NO_RESPONSE, "No response from the backend"); if (res) QR_Destructor(res); mylog("send_query: 'id' - %s\n", CC_get_errormsg(self)); CC_set_no_trans(self); return NULL; } mylog("send_query: got id = '%c'\n", id); switch (id) { case 'A' : /* Asynchronous Messages are ignored */ (void)SOCK_get_int(sock, 4); /* id of notification */ SOCK_get_string(sock, msgbuffer, MAX_MESSAGE_LEN); /* name of the relation the message comes from */ break; case 'C' : /* portal query command, no tuples returned */ /* read in the return message from the backend */ SOCK_get_string(sock, cmdbuffer, MAX_MESSAGE_LEN); if (SOCK_get_errcode(sock) != 0) { CC_set_error(self, CONNECTION_NO_RESPONSE, "No response from backend while receiving a portal query command"); mylog("send_query: 'C' - %s\n", CC_get_errormsg(self)); CC_set_no_trans(self); if (res) QR_Destructor(res); return NULL; } else { char clear = 0; mylog("send_query: ok - 'C' - %s\n", cmdbuffer); if (res) { QR_Destructor(res); res = NULL; } if (res == NULL) /* allow for "show" style notices */ res = QR_Constructor(); mylog("send_query: setting cmdbuffer = '%s'\n", cmdbuffer); /* Only save the first command */ QR_set_status(res, PGRES_COMMAND_OK); QR_set_command(res, cmdbuffer); /* (Quotation from the original comments) since backend may produce more than one result for some commands we need to poll until clear so we send an empty query, and keep reading out of the pipe until an 'I' is received */ SOCK_put_string(sock, "Q "); SOCK_flush_output(sock); while( ! clear) { id = SOCK_get_char(sock); if ((SOCK_get_errcode(sock) != 0) || (id == EOF)) { CC_set_error(self, CONNECTION_NO_RESPONSE, "No response from the backend"); if (res) { QR_Destructor(res); } mylog("send_query: id=%d error=%s \n", id, "No response from the backend"); CC_set_no_trans(self); return NULL; } switch(id) { case 'I': (void) SOCK_get_char(sock); clear = TRUE; break; case 'Z': break; case 'C': SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH); qlog("Command response: '%s'\n", cmdbuffer); break; case 'N': SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH); qlog("NOTICE from backend during clear: '%s'\n", cmdbuffer); break; case 'E': SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH); qlog("ERROR from backend during clear: '%s'\n", cmdbuffer); /* We must report this type of error as well (practically for reference integrity violation error reporting, from PostgreSQL 7.0). (Zoltan Kovacs, 04/26/2000) */ CC_set_errormsg(self, cmdbuffer); if ( ! strncmp(cmdbuffer, "FATAL", 5)) { CC_set_errornumber(self, CONNECTION_SERVER_REPORTED_ERROR); CC_set_no_trans(self); } else CC_set_errornumber(self, CONNECTION_SERVER_REPORTED_WARNING); QR_set_status(res, PGRES_NONFATAL_ERROR); QR_set_aborted(res, TRUE); break; } } mylog("send_query: returning res = %u\n", res); return res; } case 'K': /* Secret key (6.4 protocol) */ (void)SOCK_get_int(sock, 4); /* pid */ (void)SOCK_get_int(sock, 4); /* key */ break; case 'Z': /* Backend is ready for new query (6.4) */ break; case 'N' : /* NOTICE: */ SOCK_get_string(sock, cmdbuffer, ERROR_MSG_LENGTH); if (res) QR_Destructor(res); res = QR_Constructor(); QR_set_status(res, PGRES_NONFATAL_ERROR); QR_set_notice(res, cmdbuffer); /* will dup this string */ mylog("~~~ NOTICE: '%s'\n", cmdbuffer); qlog("NOTICE from backend during send_query: '%s'\n", cmdbuffer); continue; /* dont return a result -- continue reading */ case 'I' : /* The server sends an empty query */ /* There is a closing '\0' following the 'I', so we eat it */ swallow = SOCK_get_char(sock); if ((swallow != '\0') || SOCK_get_errcode(sock) != 0) { CC_set_error(self, CONNECTION_BACKEND_CRAZY, "Unexpected protocol character from backend (send_query - I)"); if (res) QR_Destructor(res); res = QR_Constructor(); QR_set_status(res, PGRES_FATAL_ERROR); return res; } else { /* We return the empty query */ if (res) QR_Destructor(res); res = QR_Constructor(); QR_set_status(res, PGRES_EMPTY_QUERY); return res; } break; case 'E' : SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); /* Remove a newline */ if (msgbuffer[0] != '\0' && msgbuffer[strlen(msgbuffer)-1] == '\n') msgbuffer[strlen(msgbuffer)-1] = '\0'; CC_set_errormsg(self, msgbuffer); mylog("send_query: 'E' - %s\n", msgbuffer); qlog("ERROR from backend during send_query: '%s'\n", msgbuffer); /* We should report that an error occured. Zoltan */ if (res) QR_Destructor(res); res = QR_Constructor(); if ( ! strncmp(msgbuffer, "FATAL", 5)) { CC_set_errornumber(self, CONNECTION_SERVER_REPORTED_ERROR); CC_set_no_trans(self); QR_set_status(res, PGRES_FATAL_ERROR); } else { CC_set_errornumber(self, CONNECTION_SERVER_REPORTED_WARNING); QR_set_status(res, PGRES_NONFATAL_ERROR); } QR_set_aborted(res, TRUE); return res; /* instead of NULL. Zoltan */ case 'P' : /* get the Portal name */ SOCK_get_string(sock, msgbuffer, MAX_MESSAGE_LEN); break; case 'T': /* Tuple results start here */ result_in = qi ? qi->result_in : NULL; if ( result_in == NULL) { result_in = QR_Constructor(); mylog("send_query: 'T' no result_in: res = %u\n", result_in); if ( ! result_in) { CC_set_error(self, CONNECTION_COULD_NOT_RECEIVE, "Could not create result info in send_query."); if (res) QR_Destructor(res); return NULL; } if (qi) QR_set_cache_size(result_in, qi->row_size); if ( ! QR_fetch_tuples(result_in, self, qi ? qi->cursor : NULL)) { CC_set_errornumber(self, CONNECTION_COULD_NOT_RECEIVE); if (res) QR_Destructor(res); CC_set_errormsg(self, QR_get_message(result_in)); return NULL; } } else { /* next fetch, so reuse an existing result */ if ( ! QR_fetch_tuples(result_in, NULL, NULL)) { CC_set_error(self, CONNECTION_COULD_NOT_RECEIVE, QR_get_message(result_in)); if (res) QR_Destructor(res); return NULL; } } return result_in; case 'D': /* Copy in command began successfully */ if (res) QR_Destructor(res); res = QR_Constructor(); QR_set_status(res, PGRES_COPY_IN); return res; case 'B': /* Copy out command began successfully */ if (res) QR_Destructor(res); res = QR_Constructor(); QR_set_status(res, PGRES_COPY_OUT); return res; default: CC_set_error(self, CONNECTION_BACKEND_CRAZY, "Unexpected protocol character from backend (send_query)"); CC_set_no_trans(self); mylog("send_query: error - %s\n", CC_get_errormsg(self)); if (res) QR_Destructor(res); return NULL; } } } int CC_send_function(ConnectionClass *self, int fnid, void *result_buf, int *actual_result_len, int result_is_int, LO_ARG *args, int nargs) { char id, c, done; SocketClass *sock = self->sock; static char msgbuffer[MAX_MESSAGE_LEN+1]; int i; mylog("send_function(): conn=%u, fnid=%d, result_is_int=%d, nargs=%d\n", self, fnid, result_is_int, nargs); if (SOCK_get_errcode(sock) != 0) { CC_set_error(self, CONNECTION_COULD_NOT_SEND, "Could not send function to backend"); CC_set_no_trans(self); return FALSE; } SOCK_put_string(sock, "F "); if (SOCK_get_errcode(sock) != 0) { CC_set_error(self, CONNECTION_COULD_NOT_SEND, "Could not send function to backend"); CC_set_no_trans(self); return FALSE; } SOCK_put_int(sock, fnid, 4); SOCK_put_int(sock, nargs, 4); mylog("send_function: done sending function\n"); for (i = 0; i < nargs; ++i) { mylog(" arg[%d]: len = %d, isint = %d, integer = %d, ptr = %u\n", i, args[i].len, args[i].isint, args[i].u.integer, args[i].u.ptr); SOCK_put_int(sock, args[i].len, 4); if (args[i].isint) SOCK_put_int(sock, args[i].u.integer, 4); else SOCK_put_n_char(sock, (char *) args[i].u.ptr, args[i].len); } mylog(" done sending args\n"); SOCK_flush_output(sock); mylog(" after flush output\n"); done = FALSE; while ( ! done) { id = SOCK_get_char(sock); mylog(" got id = %c\n", id); switch(id) { case 'V': done = TRUE; break; /* ok */ case 'N': SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); mylog("send_function(V): 'N' - %s\n", msgbuffer); /* continue reading */ break; case 'E': SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); CC_set_errormsg(self, msgbuffer); mylog("send_function(V): 'E' - %s\n", msgbuffer); qlog("ERROR from backend during send_function: '%s'\n", msgbuffer); return FALSE; case 'Z': break; default: CC_set_error(self, CONNECTION_BACKEND_CRAZY, "Unexpected protocol character from backend (send_function, args)"); CC_set_no_trans(self); mylog("send_function: error - %s\n", CC_get_errormsg(self)); return FALSE; } } id = SOCK_get_char(sock); for (;;) { switch (id) { case 'G': /* function returned properly */ mylog(" got G!\n"); *actual_result_len = SOCK_get_int(sock, 4); mylog(" actual_result_len = %d\n", *actual_result_len); if (result_is_int) *((int *) result_buf) = SOCK_get_int(sock, 4); else SOCK_get_n_char(sock, (char *) result_buf, *actual_result_len); mylog(" after get result\n"); c = SOCK_get_char(sock); /* get the last '0' */ mylog(" after get 0\n"); return TRUE; case 'E': SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); CC_set_errormsg(self, msgbuffer); mylog("send_function(G): 'E' - %s\n", msgbuffer); qlog("ERROR from backend during send_function: '%s'\n", msgbuffer); return FALSE; case 'N': SOCK_get_string(sock, msgbuffer, ERROR_MSG_LENGTH); mylog("send_function(G): 'N' - %s\n", msgbuffer); qlog("NOTICE from backend during send_function: '%s'\n", msgbuffer); continue; /* dont return a result -- continue reading */ case '0': /* empty result */ return TRUE; default: CC_set_error(self, CONNECTION_BACKEND_CRAZY, "Unexpected protocol character from backend (send_function, result)"); CC_set_no_trans(self); mylog("send_function: error - %s\n", CC_get_errormsg(self)); return FALSE; } } } char CC_send_settings(ConnectionClass *self) { /* char ini_query[MAX_MESSAGE_LEN]; */ ConnInfo *ci = &(self->connInfo); /* QResultClass *res; */ HSTMT hstmt; StatementClass *stmt; RETCODE result; char status = TRUE; char *cs, *ptr; static char* const func="CC_send_settings"; mylog("%s: entering...\n", func); /* This function must use the local odbc API functions since the odbc state has not transitioned to "connected" yet. */ result = PG_SQLAllocStmt( self, &hstmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { return FALSE; } stmt = (StatementClass *) hstmt; stmt->internal = TRUE; /* ensure no BEGIN/COMMIT/ABORT stuff */ /* Set the Datestyle to the format the driver expects it to be in */ result = PG_SQLExecDirect(hstmt, "set DateStyle to 'ISO'", SQL_NTS); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) status = FALSE; mylog("%s: result %d, status %d from set DateStyle\n", func, result, status); /* Disable genetic optimizer based on global flag */ if (globals.disable_optimizer) { result = PG_SQLExecDirect(hstmt, "set geqo to 'OFF'", SQL_NTS); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) status = FALSE; mylog("%s: result %d, status %d from set geqo\n", func, result, status); } /* KSQO */ if (globals.ksqo) { result = PG_SQLExecDirect(hstmt, "set ksqo to 'ON'", SQL_NTS); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) status = FALSE; mylog("%s: result %d, status %d from set ksqo\n", func, result, status); } /* Global settings */ if (globals.conn_settings[0] != '\0') { cs = strdup(globals.conn_settings); ptr = strtok(cs, ";"); while (ptr) { result = PG_SQLExecDirect(hstmt, ptr, SQL_NTS); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) status = FALSE; mylog("%s: result %d, status %d from '%s'\n", func, result, status, ptr); ptr = strtok(NULL, ";"); } free(cs); } /* Per Datasource settings */ if (ci->conn_settings[0] != '\0') { cs = strdup(ci->conn_settings); ptr = strtok(cs, ";"); while (ptr) { result = PG_SQLExecDirect(hstmt, ptr, SQL_NTS); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) status = FALSE; mylog("%s: result %d, status %d from '%s'\n", func, result, status, ptr); ptr = strtok(NULL, ";"); } free(cs); } PG_SQLFreeStmt(hstmt, SQL_DROP); return status; } /* This function is just a hack to get the oid of our Large Object oid type. If a real Large Object oid type is made part of Postgres, this function will go away and the define 'PG_TYPE_LO' will be updated. */ void CC_lookup_lo(ConnectionClass *self) { HSTMT hstmt; StatementClass *stmt; RETCODE result; static char* const func = "CC_lookup_lo"; mylog( "%s: entering...\n", func); /* This function must use the local odbc API functions since the odbc state has not transitioned to "connected" yet. */ result = PG_SQLAllocStmt( self, &hstmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { return; } stmt = (StatementClass *) hstmt; result = PG_SQLExecDirect(hstmt, "select oid from pg_type where typname='" PG_TYPE_LO_NAME "'", SQL_NTS); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { PG_SQLFreeStmt(hstmt, SQL_DROP); return; } result = PG_SQLFetch(hstmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { PG_SQLFreeStmt(hstmt, SQL_DROP); return; } result = PG_SQLGetData(hstmt, 1, SQL_C_SLONG, &self->lobj_type, sizeof(self->lobj_type), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { PG_SQLFreeStmt(hstmt, SQL_DROP); return; } mylog("Got the large object oid: %d\n", self->lobj_type); qlog(" [ Large Object oid = %d ]\n", self->lobj_type); result = PG_SQLFreeStmt(hstmt, SQL_DROP); } /* This function initializes the version of PostgreSQL from connInfo.protocol that we're connected to. h-inoue 01-2-2001 */ void CC_initialize_pg_version(ConnectionClass *self) { strcpy(self->pg_version, self->connInfo.protocol); if (PROTOCOL_62(&self->connInfo)) { self->pg_version_number = (float) 6.2; self->pg_version_major = 6; self->pg_version_minor = 2; } else if (PROTOCOL_63(&self->connInfo)) { self->pg_version_number = (float) 6.3; self->pg_version_major = 6; self->pg_version_minor = 3; } else { self->pg_version_number = (float) 6.4; self->pg_version_major = 6; self->pg_version_minor = 4; } } /* This function gets the version of PostgreSQL that we're connected to. This is used to return the correct info in SQLGetInfo DJP - 25-1-2001 */ void CC_lookup_pg_version(ConnectionClass *self) { HSTMT hstmt; StatementClass *stmt; RETCODE result; char szVersion[32]; int major, minor; static char* const func = "CC_lookup_pg_version"; mylog( "%s: entering...\n", func); /* This function must use the local odbc API functions since the odbc state has not transitioned to "connected" yet. */ result = PG_SQLAllocStmt( self, &hstmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { return; } stmt = (StatementClass *) hstmt; /* get the server's version if possible */ result = PG_SQLExecDirect(hstmt, "select version()", SQL_NTS); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { PG_SQLFreeStmt(hstmt, SQL_DROP); return; } result = PG_SQLFetch(hstmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { PG_SQLFreeStmt(hstmt, SQL_DROP); return; } result = PG_SQLGetData(hstmt, 1, SQL_C_CHAR, self->pg_version, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { PG_SQLFreeStmt(hstmt, SQL_DROP); return; } /* Extract the Major and Minor numbers from the string. */ /* This assumes the string starts 'Postgresql X.X' */ strcpy(szVersion, "0.0"); if (sscanf(self->pg_version, "%*s %d.%d", &major, &minor) >= 2) { sprintf(szVersion, "%d.%d", major, minor); self->pg_version_major = major; self->pg_version_minor = minor; } self->pg_version_number = (float) atof(szVersion); mylog("Got the PostgreSQL version string: '%s'\n", self->pg_version); mylog("Extracted PostgreSQL version number: '%1.1f'\n", self->pg_version_number); qlog(" [ PostgreSQL version string = '%s' ]\n", self->pg_version); qlog(" [ PostgreSQL version number = '%1.1f' ]\n", self->pg_version_number); result = PG_SQLFreeStmt(hstmt, SQL_DROP); } void CC_log_error(char *func, char *desc, ConnectionClass *self) { #ifdef PRN_NULLCHECK #define nullcheck(a) (a ? a : "(NULL)") #endif if (self) { qlog("CONN ERROR: func=%s, desc='%s', errnum=%d, errmsg='%s'\n", func, desc, self->__error_number, nullcheck (self->__error_message)); mylog("CONN ERROR: func=%s, desc='%s', errnum=%d, errmsg='%s'\n", func, desc, self->__error_number, nullcheck (self->__error_message)); qlog(" ------------------------------------------------------------\n"); qlog(" henv=%u, conn=%u, status=%u, num_stmts=%d\n", self->henv, self, self->status, self->num_stmts); qlog(" sock=%u, stmts=%u, lobj_type=%d\n", self->sock, self->stmts, self->lobj_type); qlog(" ---------------- Socket Info -------------------------------\n"); if (self->sock) { SocketClass *sock = self->sock; qlog(" socket=%d, reverse=%d, errornumber=%d, errormsg='%s'\n", sock->socket, sock->reverse, sock->errornumber, nullcheck(sock->errormsg)); qlog(" buffer_in=%u, buffer_out=%u\n", sock->buffer_in, sock->buffer_out); qlog(" buffer_filled_in=%d, buffer_filled_out=%d, buffer_read_in=%d\n", sock->buffer_filled_in, sock->buffer_filled_out, sock->buffer_read_in); } } else qlog("INVALID CONNECTION HANDLE ERROR: func=%s, desc='%s'\n", func, desc); #undef PRN_NULLCHECK } unixODBC-2.3.9/Drivers/Postgre7.1/isqlext.h0000755000175000017500000000002412262474475015226 00000000000000#include unixODBC-2.3.9/Drivers/Postgre7.1/tuple.h0000755000175000017500000000306312262474475014674 00000000000000 /* File: tuple.h * * Description: See "tuple.c" * * Important NOTE: The TupleField structure is used both to hold backend data and * manual result set data. The "set_" functions and the TupleNode * structure are only used for manual result sets by info routines. * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __TUPLE_H__ #define __TUPLE_H__ #include "psqlodbc.h" /* Used by backend data AND manual result sets */ struct TupleField_ { Int4 len; /* length of the current Tuple */ void *value; /* an array representing the value */ }; /* Used ONLY for manual result sets */ struct TupleNode_ { struct TupleNode_ *prev, *next; TupleField tuple[1]; }; /* These macros are wrappers for the corresponding set_tuplefield functions but these handle automatic NULL determination and call set_tuplefield_null() if appropriate for the datatype (used by SQLGetTypeInfo). */ #define set_nullfield_string(FLD, VAL) ((VAL) ? set_tuplefield_string(FLD, (VAL)) : set_tuplefield_null(FLD)) #define set_nullfield_int2(FLD, VAL) ((VAL) != -1 ? set_tuplefield_int2(FLD, (VAL)) : set_tuplefield_null(FLD)) #define set_nullfield_int4(FLD, VAL) ((VAL) != -1 ? set_tuplefield_int4(FLD, (VAL)) : set_tuplefield_null(FLD)) void set_tuplefield_null(TupleField *tuple_field); void set_tuplefield_string(TupleField *tuple_field, char *string); void set_tuplefield_int2(TupleField *tuple_field, Int2 value); void set_tuplefield_int4(TupleField *tuple_field, Int4 value); #endif unixODBC-2.3.9/Drivers/Postgre7.1/bind.c0000755000175000017500000003043212262474475014452 00000000000000 /* Module: bind.c * * Description: This module contains routines related to binding * columns and parameters. * * Classes: BindInfoClass, ParameterInfoClass * * API functions: SQLBindParameter, SQLBindCol, SQLDescribeParam, SQLNumParams, * SQLParamOptions(NI) * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "bind.h" #include "environ.h" #include "statement.h" #include "qresult.h" #include "pgtypes.h" #include #include #include "sql.h" #include "sqlext.h" /* Bind parameters on a statement handle */ SQLRETURN SQLBindParameter( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, SQLSMALLINT fCType, SQLSMALLINT fSqlType, SQLULEN cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue) { StatementClass *stmt = (StatementClass *) hstmt; static char* const func="SQLBindParameter"; mylog( "%s: entering...\n", func); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if(stmt->parameters_allocated < ipar) { ParameterInfoClass *old_parameters; int i, old_parameters_allocated; old_parameters = stmt->parameters; old_parameters_allocated = stmt->parameters_allocated; stmt->parameters = (ParameterInfoClass *) malloc(sizeof(ParameterInfoClass)*(ipar)); if ( ! stmt->parameters) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Could not allocate memory for statement parameters"); SC_log_error(func, "", stmt); return SQL_ERROR; } stmt->parameters_allocated = ipar; /* copy the old parameters over */ for(i = 0; i < old_parameters_allocated; i++) { /* a structure copy should work */ stmt->parameters[i] = old_parameters[i]; } /* get rid of the old parameters, if there were any */ if(old_parameters) free(old_parameters); /* zero out the newly allocated parameters (in case they skipped some, */ /* so we don't accidentally try to use them later) */ for(; i < stmt->parameters_allocated; i++) { stmt->parameters[i].buflen = 0; stmt->parameters[i].buffer = 0; stmt->parameters[i].used = 0; stmt->parameters[i].paramType = 0; stmt->parameters[i].CType = 0; stmt->parameters[i].SQLType = 0; stmt->parameters[i].precision = 0; stmt->parameters[i].scale = 0; stmt->parameters[i].data_at_exec = FALSE; stmt->parameters[i].lobj_oid = 0; stmt->parameters[i].EXEC_used = NULL; stmt->parameters[i].EXEC_buffer = NULL; } } ipar--; /* use zero based column numbers for the below part */ /* store the given info */ stmt->parameters[ipar].buflen = cbValueMax; stmt->parameters[ipar].buffer = rgbValue; stmt->parameters[ipar].used = pcbValue; stmt->parameters[ipar].paramType = fParamType; stmt->parameters[ipar].CType = fCType; stmt->parameters[ipar].SQLType = fSqlType; stmt->parameters[ipar].precision = cbColDef; stmt->parameters[ipar].scale = ibScale; /* If rebinding a parameter that had data-at-exec stuff in it, then free that stuff */ if (stmt->parameters[ipar].EXEC_used) { free(stmt->parameters[ipar].EXEC_used); stmt->parameters[ipar].EXEC_used = NULL; } if (stmt->parameters[ipar].EXEC_buffer) { if (stmt->parameters[ipar].SQLType != SQL_LONGVARBINARY) free(stmt->parameters[ipar].EXEC_buffer); stmt->parameters[ipar].EXEC_buffer = NULL; } /* Data at exec macro only valid for C char/binary data */ if ((fSqlType == SQL_LONGVARBINARY || fSqlType == SQL_LONGVARCHAR) && pcbValue && (*pcbValue <= SQL_LEN_DATA_AT_EXEC_OFFSET || *pcbValue == SQL_DATA_AT_EXEC )) stmt->parameters[ipar].data_at_exec = TRUE; else stmt->parameters[ipar].data_at_exec = FALSE; mylog("SQLBindParamater: ipar=%d, paramType=%d, fCType=%d, fSqlType=%d, cbColDef=%d, ibScale=%d, rgbValue=%d, *pcbValue = %d, data_at_exec = %d\n", ipar, fParamType, fCType, fSqlType, cbColDef, ibScale, rgbValue, pcbValue ? *pcbValue: -777, stmt->parameters[ipar].data_at_exec); return SQL_SUCCESS; } /* - - - - - - - - - */ /* Associate a user-supplied buffer with a database column. */ RETCODE SQL_API PG_SQLBindCol( HSTMT hstmt, UWORD icol, SWORD fCType, PTR rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue) { StatementClass *stmt = (StatementClass *) hstmt; static char* const func="SQLBindCol"; mylog( "%s: entering...\n", func); mylog("**** SQLBindCol: stmt = %u, icol = %d\n", stmt, icol); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } SC_clear_error(stmt); if( stmt->status == STMT_EXECUTING) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Can't bind columns while statement is still executing."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* If the bookmark column is being bound, then just save it */ if (icol == 0) { if (rgbValue == NULL) { stmt->bookmark.buffer = NULL; stmt->bookmark.used = NULL; } else { /* Make sure it is the bookmark data type */ if ( fCType != SQL_C_BOOKMARK && fCType != SQL_C_BINARY ) { SC_set_error(stmt, STMT_PROGRAM_TYPE_OUT_OF_RANGE, "Column 0 is not of type SQL_C_BOOKMARK"); SC_log_error(func, "", stmt); return SQL_ERROR; } stmt->bookmark.buffer = rgbValue; stmt->bookmark.used = pcbValue; } return SQL_SUCCESS; } /* allocate enough bindings if not already done */ /* Most likely, execution of a statement would have setup the */ /* necessary bindings. But some apps call BindCol before any */ /* statement is executed. */ if ( icol > stmt->bindings_allocated) extend_bindings(stmt, icol); /* check to see if the bindings were allocated */ if ( ! stmt->bindings) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Could not allocate memory for bindings."); SC_log_error(func, "", stmt); return SQL_ERROR; } icol--; /* use zero based col numbers from here out */ /* Reset for SQLGetData */ stmt->bindings[icol].data_left = -1; if (rgbValue == NULL) { /* we have to unbind the column */ stmt->bindings[icol].buflen = 0; stmt->bindings[icol].buffer = NULL; stmt->bindings[icol].used = NULL; stmt->bindings[icol].returntype = SQL_C_CHAR; } else { /* ok, bind that column */ stmt->bindings[icol].buflen = cbValueMax; stmt->bindings[icol].buffer = rgbValue; stmt->bindings[icol].used = pcbValue; stmt->bindings[icol].returntype = fCType; mylog(" bound buffer[%d] = %u\n", icol, stmt->bindings[icol].buffer); } return SQL_SUCCESS; } SQLRETURN SQLBindCol(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLSMALLINT fCType, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue) { return PG_SQLBindCol( hstmt, icol, fCType, rgbValue, cbValueMax, pcbValue ); } /* - - - - - - - - - */ /* Returns the description of a parameter marker. */ /* This function is listed as not being supported by SQLGetFunctions() because it is */ /* used to describe "parameter markers" (not bound parameters), in which case, */ /* the dbms should return info on the markers. Since Postgres doesn't support that, */ /* it is best to say this function is not supported and let the application assume a */ /* data type (most likely varchar). */ RETCODE SQL_API SQLDescribeParam( HSTMT hstmt, UWORD ipar, SWORD FAR *pfSqlType, SQLULEN *pcbColDef, SWORD FAR *pibScale, SWORD FAR *pfNullable) { StatementClass *stmt = (StatementClass *) hstmt; static char* const func = "SQLDescribeParam"; mylog( "%s: entering...\n", func); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if( (ipar < 1) || (ipar > stmt->parameters_allocated) ) { SC_set_error(stmt, STMT_BAD_PARAMETER_NUMBER_ERROR, "Invalid parameter number for SQLDescribeParam."); SC_log_error(func, "", stmt); return SQL_ERROR; } ipar--; /* This implementation is not very good, since it is supposed to describe */ /* parameter markers, not bound parameters. */ if(pfSqlType) *pfSqlType = stmt->parameters[ipar].SQLType; if(pcbColDef) *pcbColDef = stmt->parameters[ipar].precision; if(pibScale) *pibScale = stmt->parameters[ipar].scale; if(pfNullable) *pfNullable = pgtype_nullable(stmt, stmt->parameters[ipar].paramType); return SQL_SUCCESS; } /* - - - - - - - - - */ /* Sets multiple values (arrays) for the set of parameter markers. */ RETCODE SQL_API SQLParamOptions( HSTMT hstmt, SQLULEN crow, SQLULEN FAR *pirow) { static char* const func = "SQLParamOptions"; mylog( "%s: entering...\n", func); SC_log_error(func, "Function not implemented", (StatementClass *) hstmt); return SQL_ERROR; } /* - - - - - - - - - */ /* This function should really talk to the dbms to determine the number of */ /* "parameter markers" (not bound parameters) in the statement. But, since */ /* Postgres doesn't support that, the driver should just count the number of markers */ /* and return that. The reason the driver just can't say this function is unsupported */ /* like it does for SQLDescribeParam is that some applications don't care and try */ /* to call it anyway. */ /* If the statement does not have parameters, it should just return 0. */ RETCODE SQL_API SQLNumParams( HSTMT hstmt, SWORD FAR *pcpar) { StatementClass *stmt = (StatementClass *) hstmt; char in_quote = FALSE; unsigned int i; static char* const func = "SQLNumParams"; mylog( "%s: entering...\n", func); if(!stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if (pcpar) *pcpar = 0; else { SC_log_error(func, "pcpar was null", stmt); return SQL_ERROR; } if(!stmt->statement) { /* no statement has been allocated */ SC_set_error(stmt, STMT_SEQUENCE_ERROR, "SQLNumParams called with no statement ready."); SC_log_error(func, "", stmt); return SQL_ERROR; } else { size_t stlen=strlen(stmt->statement); for(i=0; i < stlen; i++) { if(stmt->statement[i] == '?' && !in_quote) (*pcpar)++; else { if (stmt->statement[i] == '\'') in_quote = (in_quote ? FALSE : TRUE); } } return SQL_SUCCESS; } } /******************************************************************** * Bindings Implementation */ BindInfoClass * create_empty_bindings(int num_columns) { BindInfoClass *new_bindings; int i; new_bindings = (BindInfoClass *)malloc(num_columns * sizeof(BindInfoClass)); if(!new_bindings) { return 0; } for(i=0; i < num_columns; i++) { new_bindings[i].buflen = 0; new_bindings[i].buffer = NULL; new_bindings[i].used = NULL; new_bindings[i].data_left = -1; } return new_bindings; } void extend_bindings(StatementClass *stmt, int num_columns) { static char* const func="extend_bindings"; BindInfoClass *new_bindings; int i; mylog("%s: entering ... stmt=%u, bindings_allocated=%d, num_columns=%d\n", func, stmt, stmt->bindings_allocated, num_columns); /* if we have too few, allocate room for more, and copy the old */ /* entries into the new structure */ if(stmt->bindings_allocated < num_columns) { new_bindings = create_empty_bindings(num_columns); if ( ! new_bindings) { mylog("%s: unable to create %d new bindings from %d old bindings\n", func, num_columns, stmt->bindings_allocated); if (stmt->bindings) { free(stmt->bindings); stmt->bindings = NULL; } stmt->bindings_allocated = 0; return; } if(stmt->bindings) { for(i=0; ibindings_allocated; i++) new_bindings[i] = stmt->bindings[i]; free(stmt->bindings); } stmt->bindings = new_bindings; stmt->bindings_allocated = num_columns; } /* There is no reason to zero out extra bindings if there are */ /* more than needed. If an app has allocated extra bindings, */ /* let it worry about it by unbinding those columns. */ /* SQLBindCol(1..) ... SQLBindCol(10...) # got 10 bindings */ /* SQLExecDirect(...) # returns 5 cols */ /* SQLExecDirect(...) # returns 10 cols (now OK) */ mylog("exit extend_bindings\n"); } unixODBC-2.3.9/Drivers/Postgre7.1/info.c0000755000175000017500000030732612262474475014502 00000000000000 /* Module: info.c * * Description: This module contains routines related to * ODBC informational functions. * * Classes: n/a * * API functions: SQLGetInfo, SQLGetTypeInfo, SQLGetFunctions, * SQLTables, SQLColumns, SQLStatistics, SQLSpecialColumns, * SQLPrimaryKeys, SQLForeignKeys, * SQLProcedureColumns(NI), SQLProcedures(NI), * SQLTablePrivileges(NI), SQLColumnPrivileges(NI) * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "psqlodbc.h" #ifndef WIN32 #include "isql.h" #include "isqlext.h" #include #else #include #include #include #endif #include "tuple.h" #include "pgtypes.h" #include "environ.h" #include "connection.h" #include "statement.h" #include "qresult.h" #include "bind.h" #include "misc.h" #include "pgtypes.h" /* Trigger related stuff for SQLForeign Keys */ #define TRIGGER_SHIFT 3 #define TRIGGER_MASK 0x03 #define TRIGGER_DELETE 0x01 #define TRIGGER_UPDATE 0x02 extern GLOBAL_VALUES globals; /* - - - - - - - - - */ RETCODE SQL_API SQLGetInfo( HDBC hdbc, UWORD fInfoType, PTR rgbInfoValue, SWORD cbInfoValueMax, SWORD FAR *pcbInfoValue) { static char* const func = "SQLGetInfo"; ConnectionClass *conn = (ConnectionClass *) hdbc; ConnInfo *ci; char *p = NULL, tmp[MAX_INFO_STRING]; int len = 0, value = 0; RETCODE result; mylog( "%s: entering...fInfoType=%d\n", func, fInfoType); if ( ! conn) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } ci = &conn->connInfo; switch (fInfoType) { case SQL_ACCESSIBLE_PROCEDURES: /* ODBC 1.0 */ p = "N"; break; case SQL_ACCESSIBLE_TABLES: /* ODBC 1.0 */ p = "N"; break; case SQL_ACTIVE_CONNECTIONS: /* ODBC 1.0 */ len = 2; value = MAX_CONNECTIONS; break; case SQL_ACTIVE_STATEMENTS: /* ODBC 1.0 */ len = 2; value = 0; break; case SQL_ALTER_TABLE: /* ODBC 2.0 */ len = 4; value = SQL_AT_ADD_COLUMN; break; case SQL_BOOKMARK_PERSISTENCE: /* ODBC 2.0 */ /* very simple bookmark support */ len = 4; value = globals.use_declarefetch ? 0 : (SQL_BP_SCROLL); break; case SQL_COLUMN_ALIAS: /* ODBC 2.0 */ p = "N"; break; case SQL_CONCAT_NULL_BEHAVIOR: /* ODBC 1.0 */ len = 2; value = SQL_CB_NON_NULL; break; case SQL_CONVERT_BIGINT: case SQL_CONVERT_BINARY: case SQL_CONVERT_BIT: case SQL_CONVERT_CHAR: case SQL_CONVERT_DATE: case SQL_CONVERT_DECIMAL: case SQL_CONVERT_DOUBLE: case SQL_CONVERT_FLOAT: case SQL_CONVERT_INTEGER: case SQL_CONVERT_LONGVARBINARY: case SQL_CONVERT_LONGVARCHAR: case SQL_CONVERT_NUMERIC: case SQL_CONVERT_REAL: case SQL_CONVERT_SMALLINT: case SQL_CONVERT_TIME: case SQL_CONVERT_TIMESTAMP: case SQL_CONVERT_TINYINT: case SQL_CONVERT_VARBINARY: case SQL_CONVERT_VARCHAR: /* ODBC 1.0 */ len = 4; value = fInfoType; break; case SQL_CONVERT_FUNCTIONS: /* ODBC 1.0 */ len = 4; value = 0; break; case SQL_CORRELATION_NAME: /* ODBC 1.0 */ /* Saying no correlation name makes Query not work right. value = SQL_CN_NONE; */ len = 2; value = SQL_CN_ANY; break; case SQL_CURSOR_COMMIT_BEHAVIOR: /* ODBC 1.0 */ len = 2; value = SQL_CB_CLOSE; break; case SQL_CURSOR_ROLLBACK_BEHAVIOR: /* ODBC 1.0 */ len = 2; value = SQL_CB_CLOSE; break; case SQL_DATA_SOURCE_NAME: /* ODBC 1.0 */ p = CC_get_DSN(conn); break; case SQL_DATA_SOURCE_READ_ONLY: /* ODBC 1.0 */ p = CC_is_onlyread(conn) ? "Y" : "N"; break; case SQL_DATABASE_NAME: /* Support for old ODBC 1.0 Apps */ /* Returning the database name causes problems in MS Query. It generates query like: "SELECT DISTINCT a FROM byronncrap3 crap3" p = CC_get_database(conn); */ p = ""; break; case SQL_DBMS_NAME: /* ODBC 1.0 */ p = DBMS_NAME; break; case SQL_DBMS_VER: /* ODBC 1.0 */ /* The ODBC spec wants ##.##.#### ...whatever... so prepend the driver */ /* version number to the dbms version string */ #ifdef HAVE_SNPRINTF snprintf(tmp, sizeof( tmp ), "%s %s", POSTGRESDRIVERVERSION, conn->pg_version); #else sprintf(tmp, "%s %s", POSTGRESDRIVERVERSION, conn->pg_version); #endif p = tmp; break; case SQL_DEFAULT_TXN_ISOLATION: /* ODBC 1.0 */ len = 4; value = SQL_TXN_READ_COMMITTED; /*SQL_TXN_SERIALIZABLE; */ break; case SQL_DRIVER_NAME: /* ODBC 1.0 */ p = DRIVER_FILE_NAME; break; case SQL_DRIVER_ODBC_VER: p = DRIVER_ODBC_VER; break; case SQL_DRIVER_VER: /* ODBC 1.0 */ p = POSTGRESDRIVERVERSION; break; case SQL_EXPRESSIONS_IN_ORDERBY: /* ODBC 1.0 */ p = "N"; break; case SQL_FETCH_DIRECTION: /* ODBC 1.0 */ len = 4; value = globals.use_declarefetch ? (SQL_FD_FETCH_NEXT) : (SQL_FD_FETCH_NEXT | SQL_FD_FETCH_FIRST | SQL_FD_FETCH_LAST | SQL_FD_FETCH_PRIOR | SQL_FD_FETCH_ABSOLUTE | SQL_FD_FETCH_RELATIVE | SQL_FD_FETCH_BOOKMARK); break; case SQL_FILE_USAGE: /* ODBC 2.0 */ len = 2; value = SQL_FILE_NOT_SUPPORTED; break; case SQL_GETDATA_EXTENSIONS: /* ODBC 2.0 */ len = 4; value = (SQL_GD_ANY_COLUMN | SQL_GD_ANY_ORDER | SQL_GD_BOUND | SQL_GD_BLOCK); break; case SQL_GROUP_BY: /* ODBC 2.0 */ len = 2; value = SQL_GB_GROUP_BY_EQUALS_SELECT; break; case SQL_IDENTIFIER_CASE: /* ODBC 1.0 */ /* are identifiers case-sensitive (yes, but only when quoted. If not quoted, they default to lowercase) */ len = 2; value = SQL_IC_LOWER; break; case SQL_IDENTIFIER_QUOTE_CHAR: /* ODBC 1.0 */ /* the character used to quote "identifiers" */ p = PG_VERSION_LE(conn, 6.2) ? " " : "\""; break; case SQL_KEYWORDS: /* ODBC 2.0 */ p = ""; break; case SQL_LIKE_ESCAPE_CLAUSE: /* ODBC 2.0 */ /* is there a character that escapes '%' and '_' in a LIKE clause? not as far as I can tell */ p = "N"; break; case SQL_LOCK_TYPES: /* ODBC 2.0 */ len = 4; value = globals.lie ? (SQL_LCK_NO_CHANGE | SQL_LCK_EXCLUSIVE | SQL_LCK_UNLOCK) : SQL_LCK_NO_CHANGE; break; case SQL_MAX_BINARY_LITERAL_LEN: /* ODBC 2.0 */ len = 4; value = 0; break; case SQL_MAX_CHAR_LITERAL_LEN: /* ODBC 2.0 */ len = 4; value = 0; break; case SQL_MAX_COLUMN_NAME_LEN: /* ODBC 1.0 */ len = 2; value = MAX_COLUMN_LEN; break; case SQL_MAX_COLUMNS_IN_GROUP_BY: /* ODBC 2.0 */ len = 2; value = 0; break; case SQL_MAX_COLUMNS_IN_INDEX: /* ODBC 2.0 */ len = 2; value = 0; break; case SQL_MAX_COLUMNS_IN_ORDER_BY: /* ODBC 2.0 */ len = 2; value = 0; break; case SQL_MAX_COLUMNS_IN_SELECT: /* ODBC 2.0 */ len = 2; value = 0; break; case SQL_MAX_COLUMNS_IN_TABLE: /* ODBC 2.0 */ len = 2; value = 0; break; case SQL_MAX_CURSOR_NAME_LEN: /* ODBC 1.0 */ len = 2; value = MAX_CURSOR_LEN; break; case SQL_MAX_INDEX_SIZE: /* ODBC 2.0 */ len = 4; value = 0; break; case SQL_MAX_OWNER_NAME_LEN: /* ODBC 1.0 */ len = 2; value = 0; break; case SQL_MAX_PROCEDURE_NAME_LEN: /* ODBC 1.0 */ len = 2; value = 0; break; case SQL_MAX_QUALIFIER_NAME_LEN: /* ODBC 1.0 */ len = 2; value = 0; break; case SQL_MAX_ROW_SIZE: /* ODBC 2.0 */ len = 4; if (PG_VERSION_GE(conn, 7.1)) { /* Large Rowa in 7.1+ */ value = MAX_ROW_SIZE; } else { /* Without the Toaster we're limited to the blocksize */ value = BLCKSZ; } break; case SQL_MAX_ROW_SIZE_INCLUDES_LONG: /* ODBC 2.0 */ /* does the preceding value include LONGVARCHAR and LONGVARBINARY fields? Well, it does include longvarchar, but not longvarbinary. */ p = "Y"; break; case SQL_MAX_STATEMENT_LEN: /* ODBC 2.0 */ /* maybe this should be 0? */ len = 4; if (PG_VERSION_GE(conn, 7.0)) { /* Long Queries in 7.0+ */ value = MAX_STATEMENT_LEN; } else if (PG_VERSION_GE(conn, 6.5)) /* Prior to 7.0 we used 2*BLCKSZ */ value = (2*BLCKSZ); else /* Prior to 6.5 we used BLCKSZ */ value = BLCKSZ; break; case SQL_MAX_TABLE_NAME_LEN: /* ODBC 1.0 */ len = 2; value = MAX_TABLE_LEN; break; case SQL_MAX_TABLES_IN_SELECT: /* ODBC 2.0 */ len = 2; value = 0; break; case SQL_MAX_USER_NAME_LEN: len = 2; value = 0; break; case SQL_MULT_RESULT_SETS: /* ODBC 1.0 */ /* Don't support multiple result sets but say yes anyway? */ p = "Y"; break; case SQL_MULTIPLE_ACTIVE_TXN: /* ODBC 1.0 */ p = "Y"; break; case SQL_NEED_LONG_DATA_LEN: /* ODBC 2.0 */ /* Dont need the length, SQLPutData can handle any size and multiple calls */ p = "N"; break; case SQL_NON_NULLABLE_COLUMNS: /* ODBC 1.0 */ len = 2; value = SQL_NNC_NON_NULL; break; case SQL_NULL_COLLATION: /* ODBC 2.0 */ /* where are nulls sorted? */ len = 2; value = SQL_NC_END; break; case SQL_NUMERIC_FUNCTIONS: /* ODBC 1.0 */ len = 4; value = 0; break; case SQL_ODBC_API_CONFORMANCE: /* ODBC 1.0 */ len = 2; value = SQL_OAC_LEVEL1; break; case SQL_ODBC_SAG_CLI_CONFORMANCE: /* ODBC 1.0 */ len = 2; value = SQL_OSCC_NOT_COMPLIANT; break; case SQL_ODBC_SQL_CONFORMANCE: /* ODBC 1.0 */ len = 2; value = SQL_OSC_CORE; break; case SQL_ODBC_SQL_OPT_IEF: /* ODBC 1.0 */ p = "N"; break; case SQL_OJ_CAPABILITIES: /* ODBC 2.01 */ case 115: len = 4; if (PG_VERSION_GE(conn, 7.1)) { /* OJs in 7.1+ */ value = (SQL_OJ_LEFT | SQL_OJ_RIGHT | SQL_OJ_FULL | SQL_OJ_NESTED | SQL_OJ_NOT_ORDERED | SQL_OJ_INNER | SQL_OJ_ALL_COMPARISON_OPS); } else { /* OJs not in <7.1 */ value = 0; } break; case SQL_ORDER_BY_COLUMNS_IN_SELECT: /* ODBC 2.0 */ p = (PG_VERSION_LE(conn, 6.3)) ? "Y" : "N"; break; case SQL_OUTER_JOINS: /* ODBC 1.0 */ if (PG_VERSION_GE(conn, 7.1)) { /* OJs in 7.1+ */ p = "Y"; } else { /* OJs not in <7.1 */ p = "N"; } break; case SQL_OWNER_TERM: /* ODBC 1.0 */ p = "owner"; break; case SQL_OWNER_USAGE: /* ODBC 2.0 */ len = 4; value = 0; break; case SQL_POS_OPERATIONS: /* ODBC 2.0 */ len = 4; value = globals.lie ? (SQL_POS_POSITION | SQL_POS_REFRESH | SQL_POS_UPDATE | SQL_POS_DELETE | SQL_POS_ADD) : (SQL_POS_POSITION | SQL_POS_REFRESH); break; case SQL_POSITIONED_STATEMENTS: /* ODBC 2.0 */ len = 4; value = globals.lie ? (SQL_PS_POSITIONED_DELETE | SQL_PS_POSITIONED_UPDATE | SQL_PS_SELECT_FOR_UPDATE) : 0; break; case SQL_PROCEDURE_TERM: /* ODBC 1.0 */ p = "procedure"; break; case SQL_PROCEDURES: /* ODBC 1.0 */ p = "Y"; break; case SQL_QUALIFIER_LOCATION: /* ODBC 2.0 */ len = 2; value = SQL_QL_START; break; case SQL_QUALIFIER_NAME_SEPARATOR: /* ODBC 1.0 */ p = ""; break; case SQL_QUALIFIER_TERM: /* ODBC 1.0 */ p = ""; break; case SQL_QUALIFIER_USAGE: /* ODBC 2.0 */ len = 4; value = 0; break; case SQL_QUOTED_IDENTIFIER_CASE: /* ODBC 2.0 */ /* are "quoted" identifiers case-sensitive? YES! */ len = 2; value = SQL_IC_SENSITIVE; break; case SQL_ROW_UPDATES: /* ODBC 1.0 */ /* Driver doesn't support keyset-driven or mixed cursors, so not much point in saying row updates are supported */ p = globals.lie ? "Y" : "N"; break; case SQL_SCROLL_CONCURRENCY: /* ODBC 1.0 */ len = 4; value = globals.lie ? (SQL_SCCO_READ_ONLY | SQL_SCCO_LOCK | SQL_SCCO_OPT_ROWVER | SQL_SCCO_OPT_VALUES) : (SQL_SCCO_READ_ONLY); break; case SQL_SCROLL_OPTIONS: /* ODBC 1.0 */ len = 4; value = globals.lie ? (SQL_SO_FORWARD_ONLY | SQL_SO_STATIC | SQL_SO_KEYSET_DRIVEN | SQL_SO_DYNAMIC | SQL_SO_MIXED) : (globals.use_declarefetch ? SQL_SO_FORWARD_ONLY : (SQL_SO_FORWARD_ONLY | SQL_SO_STATIC)); break; case SQL_SEARCH_PATTERN_ESCAPE: /* ODBC 1.0 */ p = ""; break; case SQL_SERVER_NAME: /* ODBC 1.0 */ p = CC_get_server(conn); break; case SQL_SPECIAL_CHARACTERS: /* ODBC 2.0 */ p = "_"; break; case SQL_STATIC_SENSITIVITY: /* ODBC 2.0 */ len = 4; value = globals.lie ? (SQL_SS_ADDITIONS | SQL_SS_DELETIONS | SQL_SS_UPDATES) : 0; break; case SQL_STRING_FUNCTIONS: /* ODBC 1.0 */ len = 4; value = (SQL_FN_STR_CONCAT | SQL_FN_STR_LCASE | SQL_FN_STR_LENGTH | SQL_FN_STR_LOCATE | SQL_FN_STR_LTRIM | SQL_FN_STR_RTRIM | SQL_FN_STR_SUBSTRING | SQL_FN_STR_UCASE); break; case SQL_SUBQUERIES: /* ODBC 2.0 */ /* postgres 6.3 supports subqueries */ len = 4; value = (SQL_SQ_QUANTIFIED | SQL_SQ_IN | SQL_SQ_EXISTS | SQL_SQ_COMPARISON); break; case SQL_SYSTEM_FUNCTIONS: /* ODBC 1.0 */ len = 4; value = 0; break; case SQL_TABLE_TERM: /* ODBC 1.0 */ p = "table"; break; case SQL_TIMEDATE_ADD_INTERVALS: /* ODBC 2.0 */ len = 4; value = 0; break; case SQL_TIMEDATE_DIFF_INTERVALS: /* ODBC 2.0 */ len = 4; value = 0; break; case SQL_TIMEDATE_FUNCTIONS: /* ODBC 1.0 */ len = 4; value = (SQL_FN_TD_NOW); break; case SQL_TXN_CAPABLE: /* ODBC 1.0 */ /* Postgres can deal with create or drop table statements in a transaction */ len = 2; value = SQL_TC_ALL; break; case SQL_TXN_ISOLATION_OPTION: /* ODBC 1.0 */ len = 4; value = SQL_TXN_READ_COMMITTED; /* SQL_TXN_SERIALIZABLE; */ break; case SQL_UNION: /* ODBC 2.0 */ /* unions with all supported in postgres 6.3 */ len = 4; value = (SQL_U_UNION | SQL_U_UNION_ALL); break; case SQL_USER_NAME: /* ODBC 1.0 */ p = CC_get_username(conn); break; /* * These have been added even though they are ODBC 3 attributes to enable * StarOffice 6.0 and OpenOffice to work, its a problem in the app, but * we do what we can... */ case /*SQL_CREATE_VIEW*/ 134: len = 4; value = SQL_CV_CREATE_VIEW; break; case /*SQL_STATIC_CURSOR_ATTRIBUTES1*/ 167: len = 4; /*value = SQL_CA1_NEXT | SQL_CA1_ABSOLUTE | SQL_CA1_RELATIVE | SQL_CA1_BOOKMARK;*/ value = 0x00000001L | 0x00000002L | 0x00000004L | 0x00000008L; break; default: /* unrecognized key */ CC_set_error(conn, CONN_NOT_IMPLEMENTED_ERROR, "Unrecognized key passed to SQLGetInfo."); CC_log_error(func, "", conn); return SQL_ERROR; } result = SQL_SUCCESS; mylog("SQLGetInfo: p='%s', len=%d, value=%d, cbMax=%d\n", p?p:"", len, value, cbInfoValueMax); /* NOTE, that if rgbInfoValue is NULL, then no warnings or errors should result and just pcbInfoValue is returned, which indicates what length would be required if a real buffer had been passed in. */ if (p) { /* char/binary data */ len = strlen(p); if (rgbInfoValue) { strncpy_null((char *)rgbInfoValue, p, (size_t)cbInfoValueMax); if (len >= cbInfoValueMax) { result = SQL_SUCCESS_WITH_INFO; CC_set_error(conn, STMT_TRUNCATED, "The buffer was too small for the result."); } } } else { /* numeric data */ if (rgbInfoValue) { if (len == 2 ) *((WORD *)rgbInfoValue) = (WORD) value; else if (len == 4) *((DWORD *)rgbInfoValue) = (DWORD) value; } } if (pcbInfoValue) *pcbInfoValue = len; return result; } /* - - - - - - - - - */ RETCODE SQL_API SQLGetTypeInfo( HSTMT hstmt, SWORD fSqlType) { static char* const func = "SQLGetTypeInfo"; StatementClass *stmt = (StatementClass *) hstmt; TupleNode *row; int i; /* Int4 type; */ Int4 pgType; Int2 sqlType; mylog("%s: entering...fSqlType = %d\n", func, fSqlType); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } stmt->manual_result = TRUE; stmt->result = QR_Constructor(); if( ! stmt->result) { SC_log_error(func, "Error creating result.", stmt); return SQL_ERROR; } extend_bindings(stmt, 15); QR_set_num_fields(stmt->result, 15); QR_set_field_info(stmt->result, 0, "TYPE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 1, "DATA_TYPE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 2, "PRECISION", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 3, "LITERAL_PREFIX", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 4, "LITERAL_SUFFIX", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 5, "CREATE_PARAMS", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 6, "NULLABLE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 7, "CASE_SENSITIVE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 8, "SEARCHABLE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 9, "UNSIGNED_ATTRIBUTE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 10, "MONEY", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 11, "AUTO_INCREMENT", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 12, "LOCAL_TYPE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 13, "MINIMUM_SCALE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 14, "MAXIMUM_SCALE", PG_TYPE_INT2, 2); for(i=0, sqlType = sqlTypes[0]; sqlType; sqlType = sqlTypes[++i]) { pgType = sqltype_to_pgtype(sqlType); if (fSqlType == SQL_ALL_TYPES || fSqlType == sqlType) { row = (TupleNode *)malloc(sizeof(TupleNode) + (15 - 1)*sizeof(TupleField)); /* These values can't be NULL */ set_tuplefield_string(&row->tuple[0], pgtype_to_name(stmt, pgType)); set_tuplefield_int2(&row->tuple[1], (Int2) sqlType); set_tuplefield_int2(&row->tuple[6], pgtype_nullable(stmt, pgType)); set_tuplefield_int2(&row->tuple[7], pgtype_case_sensitive(stmt, pgType)); set_tuplefield_int2(&row->tuple[8], pgtype_searchable(stmt, pgType)); set_tuplefield_int2(&row->tuple[10], pgtype_money(stmt, pgType)); /* Localized data-source dependent data type name (always NULL) */ set_tuplefield_null(&row->tuple[12]); /* These values can be NULL */ set_nullfield_int4(&row->tuple[2], pgtype_precision(stmt, pgType, PG_STATIC, PG_STATIC)); set_nullfield_string(&row->tuple[3], pgtype_literal_prefix(stmt, pgType)); set_nullfield_string(&row->tuple[4], pgtype_literal_suffix(stmt, pgType)); set_nullfield_string(&row->tuple[5], pgtype_create_params(stmt, pgType)); set_nullfield_int2(&row->tuple[9], pgtype_unsigned(stmt, pgType)); set_nullfield_int2(&row->tuple[11], pgtype_auto_increment(stmt, pgType)); set_nullfield_int2(&row->tuple[13], pgtype_scale(stmt, pgType, PG_STATIC)); set_nullfield_int2(&row->tuple[14], pgtype_scale(stmt, pgType, PG_STATIC)); QR_add_tuple(stmt->result, row); } } stmt->status = STMT_FINISHED; stmt->currTuple = -1; stmt->rowset_start = -1; stmt->current_col = -1; return SQL_SUCCESS; } /* - - - - - - - - - */ RETCODE SQL_API SQLGetFunctions( HDBC hdbc, UWORD fFunction, UWORD FAR *pfExists) { static char* const func="SQLGetFunctions"; mylog( "%s: entering...\n", func); if (fFunction == SQL_API_ALL_FUNCTIONS) { if (globals.lie) { int i; memset(pfExists, 0, sizeof(UWORD)*100); pfExists[SQL_API_SQLALLOCENV] = TRUE; pfExists[SQL_API_SQLFREEENV] = TRUE; for (i = SQL_API_SQLALLOCCONNECT; i <= SQL_NUM_FUNCTIONS; i++) pfExists[i] = TRUE; for (i = SQL_EXT_API_START; i <= SQL_EXT_API_LAST; i++) pfExists[i] = TRUE; } else { memset(pfExists, 0, sizeof(UWORD)*100); /* ODBC core functions */ pfExists[SQL_API_SQLALLOCCONNECT] = TRUE; pfExists[SQL_API_SQLALLOCENV] = TRUE; pfExists[SQL_API_SQLALLOCSTMT] = TRUE; pfExists[SQL_API_SQLBINDCOL] = TRUE; pfExists[SQL_API_SQLCANCEL] = TRUE; pfExists[SQL_API_SQLCOLATTRIBUTES] = TRUE; pfExists[SQL_API_SQLCONNECT] = TRUE; pfExists[SQL_API_SQLDESCRIBECOL] = TRUE; /* partial */ pfExists[SQL_API_SQLDISCONNECT] = TRUE; pfExists[SQL_API_SQLERROR] = TRUE; pfExists[SQL_API_SQLEXECDIRECT] = TRUE; pfExists[SQL_API_SQLEXECUTE] = TRUE; pfExists[SQL_API_SQLFETCH] = TRUE; pfExists[SQL_API_SQLFREECONNECT] = TRUE; pfExists[SQL_API_SQLFREEENV] = TRUE; pfExists[SQL_API_SQLFREESTMT] = TRUE; pfExists[SQL_API_SQLGETCURSORNAME] = TRUE; pfExists[SQL_API_SQLNUMRESULTCOLS] = TRUE; pfExists[SQL_API_SQLPREPARE] = TRUE; /* complete? */ pfExists[SQL_API_SQLROWCOUNT] = TRUE; pfExists[SQL_API_SQLSETCURSORNAME] = TRUE; pfExists[SQL_API_SQLSETPARAM] = FALSE; /* odbc 1.0 */ pfExists[SQL_API_SQLTRANSACT] = TRUE; /* ODBC level 1 functions */ pfExists[SQL_API_SQLBINDPARAMETER] = TRUE; pfExists[SQL_API_SQLCOLUMNS] = TRUE; pfExists[SQL_API_SQLDRIVERCONNECT] = TRUE; pfExists[SQL_API_SQLGETCONNECTOPTION] = TRUE; /* partial */ pfExists[SQL_API_SQLGETDATA] = TRUE; pfExists[SQL_API_SQLGETFUNCTIONS] = TRUE; pfExists[SQL_API_SQLGETINFO] = TRUE; pfExists[SQL_API_SQLGETSTMTOPTION] = TRUE; /* partial */ pfExists[SQL_API_SQLGETTYPEINFO] = TRUE; pfExists[SQL_API_SQLPARAMDATA] = TRUE; pfExists[SQL_API_SQLPUTDATA] = TRUE; pfExists[SQL_API_SQLSETCONNECTOPTION] = TRUE; /* partial */ pfExists[SQL_API_SQLSETSTMTOPTION] = TRUE; pfExists[SQL_API_SQLSPECIALCOLUMNS] = TRUE; pfExists[SQL_API_SQLSTATISTICS] = TRUE; pfExists[SQL_API_SQLTABLES] = TRUE; /* ODBC level 2 functions */ pfExists[SQL_API_SQLBROWSECONNECT] = FALSE; pfExists[SQL_API_SQLCOLUMNPRIVILEGES] = FALSE; pfExists[SQL_API_SQLDATASOURCES] = FALSE; /* only implemented by DM */ pfExists[SQL_API_SQLDESCRIBEPARAM] = FALSE; /* not properly implemented */ pfExists[SQL_API_SQLDRIVERS] = FALSE; /* only implemented by DM */ pfExists[SQL_API_SQLEXTENDEDFETCH] = TRUE; pfExists[SQL_API_SQLFOREIGNKEYS] = TRUE; pfExists[SQL_API_SQLMORERESULTS] = TRUE; pfExists[SQL_API_SQLNATIVESQL] = TRUE; pfExists[SQL_API_SQLNUMPARAMS] = TRUE; pfExists[SQL_API_SQLPARAMOPTIONS] = FALSE; pfExists[SQL_API_SQLPRIMARYKEYS] = TRUE; pfExists[SQL_API_SQLPROCEDURECOLUMNS] = FALSE; pfExists[SQL_API_SQLPROCEDURES] = FALSE; pfExists[SQL_API_SQLSETPOS] = TRUE; pfExists[SQL_API_SQLSETSCROLLOPTIONS] = TRUE; /* odbc 1.0 */ pfExists[SQL_API_SQLTABLEPRIVILEGES] = FALSE; } } else { if (globals.lie) *pfExists = TRUE; else { switch(fFunction) { case SQL_API_SQLALLOCCONNECT: *pfExists = TRUE; break; case SQL_API_SQLALLOCENV: *pfExists = TRUE; break; case SQL_API_SQLALLOCSTMT: *pfExists = TRUE; break; case SQL_API_SQLBINDCOL: *pfExists = TRUE; break; case SQL_API_SQLCANCEL: *pfExists = TRUE; break; case SQL_API_SQLCOLATTRIBUTES: *pfExists = TRUE; break; case SQL_API_SQLCONNECT: *pfExists = TRUE; break; case SQL_API_SQLDESCRIBECOL: *pfExists = TRUE; break; /* partial */ case SQL_API_SQLDISCONNECT: *pfExists = TRUE; break; case SQL_API_SQLERROR: *pfExists = TRUE; break; case SQL_API_SQLEXECDIRECT: *pfExists = TRUE; break; case SQL_API_SQLEXECUTE: *pfExists = TRUE; break; case SQL_API_SQLFETCH: *pfExists = TRUE; break; case SQL_API_SQLFREECONNECT: *pfExists = TRUE; break; case SQL_API_SQLFREEENV: *pfExists = TRUE; break; case SQL_API_SQLFREESTMT: *pfExists = TRUE; break; case SQL_API_SQLGETCURSORNAME: *pfExists = TRUE; break; case SQL_API_SQLNUMRESULTCOLS: *pfExists = TRUE; break; case SQL_API_SQLPREPARE: *pfExists = TRUE; break; case SQL_API_SQLROWCOUNT: *pfExists = TRUE; break; case SQL_API_SQLSETCURSORNAME: *pfExists = TRUE; break; case SQL_API_SQLSETPARAM: *pfExists = FALSE; break; /* odbc 1.0 */ case SQL_API_SQLTRANSACT: *pfExists = TRUE; break; /* ODBC level 1 functions */ case SQL_API_SQLBINDPARAMETER: *pfExists = TRUE; break; case SQL_API_SQLCOLUMNS: *pfExists = TRUE; break; case SQL_API_SQLDRIVERCONNECT: *pfExists = TRUE; break; case SQL_API_SQLGETCONNECTOPTION: *pfExists = TRUE; break; /* partial */ case SQL_API_SQLGETDATA: *pfExists = TRUE; break; case SQL_API_SQLGETFUNCTIONS: *pfExists = TRUE; break; case SQL_API_SQLGETINFO: *pfExists = TRUE; break; case SQL_API_SQLGETSTMTOPTION: *pfExists = TRUE; break; /* partial */ case SQL_API_SQLGETTYPEINFO: *pfExists = TRUE; break; case SQL_API_SQLPARAMDATA: *pfExists = TRUE; break; case SQL_API_SQLPUTDATA: *pfExists = TRUE; break; case SQL_API_SQLSETCONNECTOPTION: *pfExists = TRUE; break; /* partial */ case SQL_API_SQLSETSTMTOPTION: *pfExists = TRUE; break; case SQL_API_SQLSPECIALCOLUMNS: *pfExists = TRUE; break; case SQL_API_SQLSTATISTICS: *pfExists = TRUE; break; case SQL_API_SQLTABLES: *pfExists = TRUE; break; /* ODBC level 2 functions */ case SQL_API_SQLBROWSECONNECT: *pfExists = FALSE; break; case SQL_API_SQLCOLUMNPRIVILEGES: *pfExists = FALSE; break; case SQL_API_SQLDATASOURCES: *pfExists = FALSE; break; /* only implemented by DM */ case SQL_API_SQLDESCRIBEPARAM: *pfExists = FALSE; break; /* not properly implemented */ case SQL_API_SQLDRIVERS: *pfExists = FALSE; break; /* only implemented by DM */ case SQL_API_SQLEXTENDEDFETCH: *pfExists = TRUE; break; case SQL_API_SQLFOREIGNKEYS: *pfExists = TRUE; break; case SQL_API_SQLMORERESULTS: *pfExists = TRUE; break; case SQL_API_SQLNATIVESQL: *pfExists = TRUE; break; case SQL_API_SQLNUMPARAMS: *pfExists = TRUE; break; case SQL_API_SQLPARAMOPTIONS: *pfExists = FALSE; break; case SQL_API_SQLPRIMARYKEYS: *pfExists = TRUE; break; case SQL_API_SQLPROCEDURECOLUMNS: *pfExists = FALSE; break; case SQL_API_SQLPROCEDURES: *pfExists = FALSE; break; case SQL_API_SQLSETPOS: *pfExists = TRUE; break; case SQL_API_SQLSETSCROLLOPTIONS: *pfExists = TRUE; break; /* odbc 1.0 */ case SQL_API_SQLTABLEPRIVILEGES: *pfExists = FALSE; break; } } } return SQL_SUCCESS; } RETCODE SQL_API SQLTables( HSTMT hstmt, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szTableType, SWORD cbTableType) { static char* const func = "SQLTables"; StatementClass *stmt = (StatementClass *) hstmt; StatementClass *tbl_stmt; TupleNode *row; HSTMT htbl_stmt; RETCODE result; char *tableType; char tables_query[STD_STATEMENT_LEN]; char table_name[MAX_INFO_STRING], table_owner[MAX_INFO_STRING], relkind_or_hasrules[MAX_INFO_STRING]; ConnectionClass *conn; ConnInfo *ci; char *prefix[32], prefixes[MEDIUM_REGISTRY_LEN]; char *table_type[32], table_types[MAX_INFO_STRING]; char show_system_tables, show_regular_tables, show_views; char regular_table, view, systable; int i; mylog("%s: entering...stmt=%u\n", func, stmt); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } stmt->manual_result = TRUE; stmt->errormsg_created = TRUE; conn = (ConnectionClass *) (stmt->hdbc); ci = &stmt->hdbc->connInfo; result = PG_SQLAllocStmt( stmt->hdbc, &htbl_stmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate statement for SQLTables result."); SC_log_error(func, "", stmt); return SQL_ERROR; } tbl_stmt = (StatementClass *) htbl_stmt; /* ********************************************************************** */ /* Create the query to find out the tables */ /* ********************************************************************** */ if (PG_VERSION_GE(conn, 7.1)) { /* view is represented by its relkind since 7.1 */ strcpy(tables_query, "select relname, usename, relkind from pg_class, pg_user"); strcat(tables_query, " where relkind in ('r', 'v')"); } else { strcpy(tables_query, "select relname, usename, relhasrules from pg_class, pg_user"); strcat(tables_query, " where relkind = 'r'"); } my_strcat(tables_query, " and usename like '%.*s'", (char*)szTableOwner, cbTableOwner); my_strcat(tables_query, " and relname like '%.*s'", (char*)szTableName, cbTableName); /* Parse the extra systable prefix */ strcpy(prefixes, globals.extra_systable_prefixes); i = 0; prefix[i] = strtok(prefixes, ";"); while (prefix[i] && ishow_system_tables) && ! show_system_tables) { strcat(tables_query, " and relname !~ '^" POSTGRES_SYS_PREFIX); /* Also filter out user-defined system table types */ i = 0; while(prefix[i]) { strcat(tables_query, "|^"); strcat(tables_query, prefix[i]); i++; } strcat(tables_query, "'"); } /* match users */ if (PG_VERSION_LT(conn, 7.1)) /* filter out large objects in older versions */ strcat(tables_query, " and relname !~ '^xinv[0-9]+'"); strcat(tables_query, " and usesysid = relowner"); strcat(tables_query, " order by relname"); /* ********************************************************************** */ result = PG_SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query)); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_create_errormsg((StatementClass *)htbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 1, SQL_C_CHAR, table_name, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 2, SQL_C_CHAR, table_owner, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 3, SQL_C_CHAR, relkind_or_hasrules, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } stmt->result = QR_Constructor(); if(!stmt->result) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate memory for SQLTables result."); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } /* the binding structure for a statement is not set up until */ /* a statement is actually executed, so we'll have to do this ourselves. */ extend_bindings(stmt, 5); /* set the field names */ QR_set_num_fields(stmt->result, 5); QR_set_field_info(stmt->result, 0, "TABLE_QUALIFIER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 1, "TABLE_OWNER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 2, "TABLE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 3, "TABLE_TYPE", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 4, "REMARKS", PG_TYPE_TEXT, 254); /* add the tuples */ result = PG_SQLFetch(htbl_stmt); while((result == SQL_SUCCESS) || (result == SQL_SUCCESS_WITH_INFO)) { /* Determine if this table name is a system table. If treating system tables as regular tables, then no need to do this test. */ systable = FALSE; if( ! atoi(ci->show_system_tables)) { if ( strncmp(table_name, POSTGRES_SYS_PREFIX, strlen(POSTGRES_SYS_PREFIX)) == 0) systable = TRUE; else { /* Check extra system table prefixes */ i = 0; while (prefix[i]) { mylog("table_name='%s', prefix[%d]='%s'\n", table_name, i, prefix[i]); if (strncmp(table_name, prefix[i], strlen(prefix[i])) == 0) { systable = TRUE; break; } i++; } } } /* Determine if the table name is a view */ if (PG_VERSION_GE(conn, 7.1)) /* view is represented by its relkind since 7.1 */ view = (relkind_or_hasrules[0] == 'v'); else view = (relkind_or_hasrules[0] == '1'); /* It must be a regular table */ regular_table = ( ! systable && ! view); /* Include the row in the result set if meets all criteria */ /* NOTE: Unsupported table types (i.e., LOCAL TEMPORARY, ALIAS, etc) will return nothing */ if ( (systable && show_system_tables) || (view && show_views) || (regular_table && show_regular_tables)) { row = (TupleNode *)malloc(sizeof(TupleNode) + (5 - 1) * sizeof(TupleField)); set_tuplefield_string(&row->tuple[0], ""); /* I have to hide the table owner from Access, otherwise it */ /* insists on referring to the table as 'owner.table'. */ /* (this is valid according to the ODBC SQL grammar, but */ /* Postgres won't support it.) */ /* set_tuplefield_string(&row->tuple[1], table_owner); */ mylog("SQLTables: table_name = '%s'\n", table_name); set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], table_name); set_tuplefield_string(&row->tuple[3], systable ? "SYSTEM TABLE" : (view ? "VIEW" : "TABLE")); set_tuplefield_string(&row->tuple[4], ""); QR_add_tuple(stmt->result, row); } result = PG_SQLFetch(htbl_stmt); } if(result != SQL_NO_DATA_FOUND) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_create_errormsg((StatementClass *)htbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } /* also, things need to think that this statement is finished so */ /* the results can be retrieved. */ stmt->status = STMT_FINISHED; /* set up the current tuple pointer for SQLFetch */ stmt->currTuple = -1; stmt->rowset_start = -1; stmt->current_col = -1; PG_SQLFreeStmt(htbl_stmt, SQL_DROP); mylog("SQLTables(): EXIT, stmt=%u\n", stmt); return SQL_SUCCESS; } RETCODE SQL_API PG_SQLColumns( HSTMT hstmt, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szColumnName, SWORD cbColumnName) { static char* const func = "SQLColumns"; StatementClass *stmt = (StatementClass *) hstmt; TupleNode *row; HSTMT hcol_stmt; StatementClass *col_stmt; char columns_query[STD_STATEMENT_LEN]; RETCODE result; char table_owner[MAX_INFO_STRING], table_name[MAX_INFO_STRING], field_name[MAX_INFO_STRING], field_type_name[MAX_INFO_STRING]; Int2 field_number, result_cols, scale; Int4 field_type, the_type, field_length, mod_length, precision; char useStaticPrecision; char not_null[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING]; ConnInfo *ci; ConnectionClass *conn; mylog("%s: entering...stmt=%u\n", func, stmt); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } stmt->manual_result = TRUE; stmt->errormsg_created = TRUE; conn = (ConnectionClass *) (stmt->hdbc); ci = &stmt->hdbc->connInfo; /* ********************************************************************** */ /* Create the query to find out the columns (Note: pre 6.3 did not have the atttypmod field) */ /* ********************************************************************** */ sprintf(columns_query, "select u.usename, c.relname, a.attname, a.atttypid" ", t.typname, a.attnum, a.attlen, %s, a.attnotnull, c.relhasrules" " from pg_user u, pg_class c, pg_attribute a, pg_type t" " where u.usesysid = c.relowner" " and c.oid= a.attrelid and a.atttypid = t.oid and (a.attnum > 0)", PG_VERSION_LE(conn, 6.2) ? "a.attlen" : "a.atttypmod"); my_strcat(columns_query, " and c.relname like '%.*s'", (char*)szTableName, cbTableName); my_strcat(columns_query, " and u.usename like '%.*s'", (char*)szTableOwner, cbTableOwner); my_strcat(columns_query, " and a.attname like '%.*s'", (char*)szColumnName, cbColumnName); /* give the output in the order the columns were defined */ /* when the table was created */ strcat(columns_query, " order by attnum"); /* ********************************************************************** */ result = PG_SQLAllocStmt( stmt->hdbc, &hcol_stmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate statement for SQLColumns result."); SC_log_error(func, "", stmt); return SQL_ERROR; } col_stmt = (StatementClass *) hcol_stmt; mylog("SQLColumns: hcol_stmt = %u, col_stmt = %u\n", hcol_stmt, col_stmt); result = PG_SQLExecDirect(hcol_stmt, columns_query, strlen(columns_query)); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_create_errormsg((StatementClass *)hcol_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 1, SQL_C_CHAR, table_owner, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 2, SQL_C_CHAR, table_name, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 3, SQL_C_CHAR, field_name, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 4, SQL_C_LONG, &field_type, 4, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 5, SQL_C_CHAR, field_type_name, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 6, SQL_C_SHORT, &field_number, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 7, SQL_C_LONG, &field_length, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 8, SQL_C_LONG, &mod_length, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 9, SQL_C_CHAR, not_null, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 10, SQL_C_CHAR, relhasrules, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } stmt->result = QR_Constructor(); if(!stmt->result) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate memory for SQLColumns result."); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } /* the binding structure for a statement is not set up until */ /* a statement is actually executed, so we'll have to do this ourselves. */ result_cols = 14; extend_bindings(stmt, result_cols); /* set the field names */ QR_set_num_fields(stmt->result, result_cols); QR_set_field_info(stmt->result, 0, "TABLE_QUALIFIER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 1, "TABLE_OWNER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 2, "TABLE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 3, "COLUMN_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 4, "DATA_TYPE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 5, "TYPE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 6, "PRECISION", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 7, "LENGTH", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 8, "SCALE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 9, "RADIX", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 10, "NULLABLE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 11, "REMARKS", PG_TYPE_TEXT, 254); /* User defined fields */ QR_set_field_info(stmt->result, 12, "DISPLAY_SIZE", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 13, "FIELD_TYPE", PG_TYPE_INT4, 4); result = PG_SQLFetch(hcol_stmt); /* Only show oid if option AND there are other columns AND it's not being called by SQLStatistics . Always show OID if it's a system table */ if (result != SQL_ERROR && ! stmt->internal) { if (relhasrules[0] != '1' && (atoi(ci->show_oid_column) || strncmp(table_name, POSTGRES_SYS_PREFIX, strlen(POSTGRES_SYS_PREFIX)) == 0)) { /* For OID fields */ the_type = PG_TYPE_OID; row = (TupleNode *)malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField)); set_tuplefield_string(&row->tuple[0], ""); /* see note in SQLTables() */ /* set_tuplefield_string(&row->tuple[1], table_owner); */ set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], table_name); set_tuplefield_string(&row->tuple[3], "oid"); set_tuplefield_int2(&row->tuple[4], pgtype_to_sqltype(stmt, the_type)); set_tuplefield_string(&row->tuple[5], "OID"); set_tuplefield_int4(&row->tuple[7], pgtype_length(stmt, the_type, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[6], pgtype_precision(stmt, the_type, PG_STATIC, PG_STATIC)); set_nullfield_int2(&row->tuple[8], pgtype_scale(stmt, the_type, PG_STATIC)); set_nullfield_int2(&row->tuple[9], pgtype_radix(stmt, the_type)); set_tuplefield_int2(&row->tuple[10], SQL_NO_NULLS); set_tuplefield_string(&row->tuple[11], ""); set_tuplefield_int4(&row->tuple[12], pgtype_display_size(stmt, the_type, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[13], the_type); QR_add_tuple(stmt->result, row); } } while((result == SQL_SUCCESS) || (result == SQL_SUCCESS_WITH_INFO)) { row = (TupleNode *)malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField)); set_tuplefield_string(&row->tuple[0], ""); /* see note in SQLTables() */ /* set_tuplefield_string(&row->tuple[1], table_owner); */ set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], table_name); set_tuplefield_string(&row->tuple[3], field_name); set_tuplefield_int2(&row->tuple[4], pgtype_to_sqltype(stmt, field_type)); set_tuplefield_string(&row->tuple[5], field_type_name); /* Some Notes about Postgres Data Types: VARCHAR - the length is stored in the pg_attribute.atttypmod field BPCHAR - the length is also stored as varchar is NUMERIC - the scale is stored in atttypmod as follows: precision = ((atttypmod - VARHDRSZ) >> 16) & 0xffff scale = (atttypmod - VARHDRSZ) & 0xffff */ qlog("SQLColumns: table='%s',field_name='%s',type=%d,sqltype=%d,name='%s'\n", table_name,field_name,field_type,pgtype_to_sqltype,field_type_name); useStaticPrecision = TRUE; if (field_type == PG_TYPE_NUMERIC) { if (mod_length >= 4) mod_length -= 4; /* the length is in atttypmod - 4 */ if (mod_length >= 0) { useStaticPrecision = FALSE; precision = (mod_length >> 16) & 0xffff; scale = mod_length & 0xffff; mylog("SQLColumns: field type is NUMERIC: field_type = %d, mod_length=%d, precision=%d, scale=%d\n", field_type, mod_length, precision, scale ); set_tuplefield_int4(&row->tuple[7], precision + 2); /* sign+dec.point */ set_tuplefield_int4(&row->tuple[6], precision); set_tuplefield_int4(&row->tuple[12], precision + 2); /* sign+dec.point */ set_nullfield_int2(&row->tuple[8], scale); } } if((field_type == PG_TYPE_VARCHAR) || (field_type == PG_TYPE_BPCHAR)) { useStaticPrecision = FALSE; if (mod_length >= 4) mod_length -= 4; /* the length is in atttypmod - 4 */ if (mod_length > globals.max_varchar_size || mod_length <= 0) mod_length = globals.max_varchar_size; mylog("SQLColumns: field type is VARCHAR,BPCHAR: field_type = %d, mod_length = %d\n", field_type, mod_length); set_tuplefield_int4(&row->tuple[7], mod_length); set_tuplefield_int4(&row->tuple[6], mod_length); set_tuplefield_int4(&row->tuple[12], mod_length); set_nullfield_int2(&row->tuple[8], pgtype_scale(stmt, field_type, PG_STATIC)); } if (useStaticPrecision) { mylog("SQLColumns: field type is OTHER: field_type = %d, pgtype_length = %d\n", field_type, pgtype_length(stmt, field_type, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[7], pgtype_length(stmt, field_type, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[6], pgtype_precision(stmt, field_type, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[12], pgtype_display_size(stmt, field_type, PG_STATIC, PG_STATIC)); set_nullfield_int2(&row->tuple[8], pgtype_scale(stmt, field_type, PG_STATIC)); } set_nullfield_int2(&row->tuple[9], pgtype_radix(stmt, field_type)); set_tuplefield_int2(&row->tuple[10], (Int2) (not_null[0] == '1' ? SQL_NO_NULLS : pgtype_nullable(stmt, field_type))); set_tuplefield_string(&row->tuple[11], ""); set_tuplefield_int4(&row->tuple[13], field_type); QR_add_tuple(stmt->result, row); result = PG_SQLFetch(hcol_stmt); } if(result != SQL_NO_DATA_FOUND) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_create_errormsg((StatementClass *)hcol_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } /* Put the row version column at the end so it might not be */ /* mistaken for a key field. */ if ( relhasrules[0] != '1' && ! stmt->internal && atoi(ci->row_versioning)) { /* For Row Versioning fields */ the_type = PG_TYPE_INT4; row = (TupleNode *)malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField)); set_tuplefield_string(&row->tuple[0], ""); set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], table_name); set_tuplefield_string(&row->tuple[3], "xmin"); set_tuplefield_int2(&row->tuple[4], pgtype_to_sqltype(stmt, the_type)); set_tuplefield_string(&row->tuple[5], pgtype_to_name(stmt, the_type)); set_tuplefield_int4(&row->tuple[6], pgtype_precision(stmt, the_type, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[7], pgtype_length(stmt, the_type, PG_STATIC, PG_STATIC)); set_nullfield_int2(&row->tuple[8], pgtype_scale(stmt, the_type, PG_STATIC)); set_nullfield_int2(&row->tuple[9], pgtype_radix(stmt, the_type)); set_tuplefield_int2(&row->tuple[10], SQL_NO_NULLS); set_tuplefield_string(&row->tuple[11], ""); set_tuplefield_int4(&row->tuple[12], pgtype_display_size(stmt, the_type, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[13], the_type); QR_add_tuple(stmt->result, row); } /* also, things need to think that this statement is finished so */ /* the results can be retrieved. */ stmt->status = STMT_FINISHED; /* set up the current tuple pointer for SQLFetch */ stmt->currTuple = -1; stmt->rowset_start = -1; stmt->current_col = -1; PG_SQLFreeStmt(hcol_stmt, SQL_DROP); mylog("SQLColumns(): EXIT, stmt=%u\n", stmt); return SQL_SUCCESS; } RETCODE SQL_API SQLColumns( HSTMT hstmt, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szColumnName, SWORD cbColumnName) { return PG_SQLColumns( hstmt, szTableQualifier, cbTableQualifier, szTableOwner, cbTableOwner, szTableName, cbTableName, szColumnName, cbColumnName ); } RETCODE SQL_API SQLSpecialColumns( HSTMT hstmt, UWORD fColType, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName, UWORD fScope, UWORD fNullable) { static char* const func = "SQLSpecialColumns"; TupleNode *row; StatementClass *stmt = (StatementClass *) hstmt; ConnInfo *ci; HSTMT hcol_stmt; StatementClass *col_stmt; char columns_query[STD_STATEMENT_LEN]; RETCODE result; char relhasrules[MAX_INFO_STRING]; mylog("%s: entering...stmt=%u\n", func, stmt); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } ci = &stmt->hdbc->connInfo; stmt->manual_result = TRUE; /* ********************************************************************** */ /* Create the query to find out if this is a view or not... */ /* ********************************************************************** */ sprintf(columns_query, "select c.relhasrules " "from pg_user u, pg_class c where " "u.usesysid = c.relowner"); my_strcat(columns_query, " and c.relname like '%.*s'", (char*)szTableName, cbTableName); my_strcat(columns_query, " and u.usename like '%.*s'", (char*)szTableOwner, cbTableOwner); result = PG_SQLAllocStmt( stmt->hdbc, &hcol_stmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate statement for SQLSpecialColumns result."); SC_log_error(func, "", stmt); return SQL_ERROR; } col_stmt = (StatementClass *) hcol_stmt; mylog("SQLSpecialColumns: hcol_stmt = %u, col_stmt = %u\n", hcol_stmt, col_stmt); result = PG_SQLExecDirect(hcol_stmt, columns_query, strlen(columns_query)); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_create_errormsg((StatementClass *)hcol_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(hcol_stmt, 1, SQL_C_CHAR, relhasrules, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLFetch(hcol_stmt); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); stmt->result = QR_Constructor(); extend_bindings(stmt, 8); QR_set_num_fields(stmt->result, 8); QR_set_field_info(stmt->result, 0, "SCOPE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 1, "COLUMN_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 2, "DATA_TYPE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 3, "TYPE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 4, "PRECISION", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 5, "LENGTH", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 6, "SCALE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 7, "PSEUDO_COLUMN", PG_TYPE_INT2, 2); if ( relhasrules[0] != '1' ) { /* use the oid value for the rowid */ if(fColType == SQL_BEST_ROWID) { row = (TupleNode *)malloc(sizeof(TupleNode) + (8 - 1) * sizeof(TupleField)); set_tuplefield_int2(&row->tuple[0], SQL_SCOPE_SESSION); set_tuplefield_string(&row->tuple[1], "oid"); set_tuplefield_int2(&row->tuple[2], pgtype_to_sqltype(stmt, PG_TYPE_OID)); set_tuplefield_string(&row->tuple[3], "OID"); set_tuplefield_int4(&row->tuple[4], pgtype_precision(stmt, PG_TYPE_OID, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[5], pgtype_length(stmt, PG_TYPE_OID, PG_STATIC, PG_STATIC)); set_tuplefield_int2(&row->tuple[6], pgtype_scale(stmt, PG_TYPE_OID, PG_STATIC)); set_tuplefield_int2(&row->tuple[7], SQL_PC_PSEUDO); QR_add_tuple(stmt->result, row); } else if(fColType == SQL_ROWVER) { Int2 the_type = PG_TYPE_INT4; if (atoi(ci->row_versioning)) { row = (TupleNode *)malloc(sizeof(TupleNode) + (8 - 1) * sizeof(TupleField)); set_tuplefield_null(&row->tuple[0]); set_tuplefield_string(&row->tuple[1], "xmin"); set_tuplefield_int2(&row->tuple[2], pgtype_to_sqltype(stmt, the_type)); set_tuplefield_string(&row->tuple[3], pgtype_to_name(stmt, the_type)); set_tuplefield_int4(&row->tuple[4], pgtype_precision(stmt, the_type, PG_STATIC, PG_STATIC)); set_tuplefield_int4(&row->tuple[5], pgtype_length(stmt, the_type, PG_STATIC, PG_STATIC)); set_tuplefield_int2(&row->tuple[6], pgtype_scale(stmt, the_type, PG_STATIC)); set_tuplefield_int2(&row->tuple[7], SQL_PC_PSEUDO); QR_add_tuple(stmt->result, row); } } } stmt->status = STMT_FINISHED; stmt->currTuple = -1; stmt->rowset_start = -1; stmt->current_col = -1; mylog("SQLSpecialColumns(): EXIT, stmt=%u\n", stmt); return SQL_SUCCESS; } RETCODE SQL_API SQLStatistics( HSTMT hstmt, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName, UWORD fUnique, UWORD fAccuracy) { static char* const func="SQLStatistics"; StatementClass *stmt = (StatementClass *) hstmt; char index_query[STD_STATEMENT_LEN]; HSTMT hindx_stmt; RETCODE result; char *table_name; char index_name[MAX_INFO_STRING]; short fields_vector[8]; char isunique[10], isclustered[10]; SDWORD index_name_len, fields_vector_len; TupleNode *row; int i; HSTMT hcol_stmt; StatementClass *col_stmt, *indx_stmt; char column_name[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING]; char **column_names = 0; Int4 column_name_len; int total_columns = 0; char error = TRUE; ConnInfo *ci; char buf[256]; mylog("%s: entering...stmt=%u\n", func, stmt); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } stmt->manual_result = TRUE; stmt->errormsg_created = TRUE; ci = &stmt->hdbc->connInfo; stmt->result = QR_Constructor(); if(!stmt->result) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate memory for SQLStatistics result."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* the binding structure for a statement is not set up until */ /* a statement is actually executed, so we'll have to do this ourselves. */ extend_bindings(stmt, 13); /* set the field names */ QR_set_num_fields(stmt->result, 13); QR_set_field_info(stmt->result, 0, "TABLE_QUALIFIER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 1, "TABLE_OWNER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 2, "TABLE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 3, "NON_UNIQUE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 4, "INDEX_QUALIFIER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 5, "INDEX_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 6, "TYPE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 7, "SEQ_IN_INDEX", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 8, "COLUMN_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 9, "COLLATION", PG_TYPE_CHAR, 1); QR_set_field_info(stmt->result, 10, "CARDINALITY", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 11, "PAGES", PG_TYPE_INT4, 4); QR_set_field_info(stmt->result, 12, "FILTER_CONDITION", PG_TYPE_TEXT, MAX_INFO_STRING); /* only use the table name... the owner should be redundant, and */ /* we never use qualifiers. */ table_name = make_string((char*)szTableName, cbTableName, NULL); if ( ! table_name) { SC_set_error(stmt, STMT_INTERNAL_ERROR, "No table name passed to SQLStatistics."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* we need to get a list of the field names first, */ /* so we can return them later. */ result = PG_SQLAllocStmt( stmt->hdbc, &hcol_stmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "SQLAllocStmt failed in SQLStatistics for columns."); goto SEEYA; } col_stmt = (StatementClass *) hcol_stmt; /* "internal" prevents SQLColumns from returning the oid if it is being shown. This would throw everything off. */ col_stmt->internal = TRUE; result = PG_SQLColumns(hcol_stmt, (SQLCHAR*)"", 0, (SQLCHAR*)"", 0, (SQLCHAR*)table_name, (SWORD) strlen(table_name), (SQLCHAR*)"", 0); col_stmt->internal = FALSE; if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); goto SEEYA; } result = PG_SQLBindCol(hcol_stmt, 4, SQL_C_CHAR, column_name, MAX_INFO_STRING, &column_name_len); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_get_errormsg(col_stmt)); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); goto SEEYA; } result = PG_SQLFetch(hcol_stmt); while((result == SQL_SUCCESS) || (result == SQL_SUCCESS_WITH_INFO)) { total_columns++; column_names = (char **)realloc(column_names, total_columns * sizeof(char *)); column_names[total_columns-1] = (char *)malloc(strlen(column_name)+1); strcpy(column_names[total_columns-1], column_name); mylog("SQLStatistics: column_name = '%s'\n", column_name); result = PG_SQLFetch(hcol_stmt); } if(result != SQL_NO_DATA_FOUND || total_columns == 0) { SC_set_error(stmt, SC_get_errornumber(col_stmt), SC_create_errormsg((StatementClass *)hcol_stmt)); PG_SQLFreeStmt(hcol_stmt, SQL_DROP); goto SEEYA; } PG_SQLFreeStmt(hcol_stmt, SQL_DROP); /* get a list of indexes on this table */ result = PG_SQLAllocStmt( stmt->hdbc, &hindx_stmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "SQLAllocStmt failed in SQLStatistics for indices."); goto SEEYA; } indx_stmt = (StatementClass *) hindx_stmt; sprintf(index_query, "select c.relname, i.indkey, i.indisunique" ", i.indisclustered, c.relhasrules" " from pg_index i, pg_class c, pg_class d" " where c.oid = i.indexrelid and d.relname = '%s'" " and d.oid = i.indrelid", table_name); result = PG_SQLExecDirect(hindx_stmt, index_query, strlen(index_query)); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(indx_stmt), SC_create_errormsg((StatementClass *)hindx_stmt)); PG_SQLFreeStmt(hindx_stmt, SQL_DROP); goto SEEYA; } /* bind the index name column */ result = PG_SQLBindCol(hindx_stmt, 1, SQL_C_CHAR, index_name, MAX_INFO_STRING, &index_name_len); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(indx_stmt), SC_get_errormsg(indx_stmt)); PG_SQLFreeStmt(hindx_stmt, SQL_DROP); goto SEEYA; } /* bind the vector column */ result = PG_SQLBindCol(hindx_stmt, 2, SQL_C_DEFAULT, fields_vector, 16, &fields_vector_len); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(indx_stmt), SC_get_errormsg(indx_stmt)); PG_SQLFreeStmt(hindx_stmt, SQL_DROP); goto SEEYA; } /* bind the "is unique" column */ result = PG_SQLBindCol(hindx_stmt, 3, SQL_C_CHAR, isunique, sizeof(isunique), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(indx_stmt), SC_get_errormsg(indx_stmt)); PG_SQLFreeStmt(hindx_stmt, SQL_DROP); goto SEEYA; } /* bind the "is clustered" column */ result = PG_SQLBindCol(hindx_stmt, 4, SQL_C_CHAR, isclustered, sizeof(isclustered), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(indx_stmt), SC_get_errormsg(indx_stmt)); PG_SQLFreeStmt(hindx_stmt, SQL_DROP); goto SEEYA; } result = PG_SQLBindCol(hindx_stmt, 5, SQL_C_CHAR, relhasrules, MAX_INFO_STRING, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(indx_stmt), SC_get_errormsg(indx_stmt)); PG_SQLFreeStmt(hindx_stmt, SQL_DROP); goto SEEYA; } /* fake index of OID */ if ( relhasrules[0] != '1' && atoi(ci->show_oid_column) && atoi(ci->fake_oid_index)) { row = (TupleNode *)malloc(sizeof(TupleNode) + (13 - 1) * sizeof(TupleField)); /* no table qualifier */ set_tuplefield_string(&row->tuple[0], ""); /* don't set the table owner, else Access tries to use it */ set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], table_name); /* non-unique index? */ set_tuplefield_int2(&row->tuple[3], (Int2) (globals.unique_index ? FALSE : TRUE)); /* no index qualifier */ set_tuplefield_string(&row->tuple[4], ""); sprintf(buf, "%s_idx_fake_oid", table_name); set_tuplefield_string(&row->tuple[5], buf); /* Clustered index? I think non-clustered should be type OTHER not HASHED */ set_tuplefield_int2(&row->tuple[6], (Int2) SQL_INDEX_OTHER); set_tuplefield_int2(&row->tuple[7], (Int2) 1); set_tuplefield_string(&row->tuple[8], "oid"); set_tuplefield_string(&row->tuple[9], "A"); set_tuplefield_null(&row->tuple[10]); set_tuplefield_null(&row->tuple[11]); set_tuplefield_null(&row->tuple[12]); QR_add_tuple(stmt->result, row); } result = PG_SQLFetch(hindx_stmt); while((result == SQL_SUCCESS) || (result == SQL_SUCCESS_WITH_INFO)) { /* If only requesting unique indexs, then just return those. */ if (fUnique == SQL_INDEX_ALL || (fUnique == SQL_INDEX_UNIQUE && atoi(isunique))) { i = 0; /* add a row in this table for each field in the index */ while(i < 8 && fields_vector[i] != 0) { row = (TupleNode *)malloc(sizeof(TupleNode) + (13 - 1) * sizeof(TupleField)); /* no table qualifier */ set_tuplefield_string(&row->tuple[0], ""); /* don't set the table owner, else Access tries to use it */ set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], table_name); /* non-unique index? */ if (globals.unique_index) set_tuplefield_int2(&row->tuple[3], (Int2) (atoi(isunique) ? FALSE : TRUE)); else set_tuplefield_int2(&row->tuple[3], TRUE); /* no index qualifier */ set_tuplefield_string(&row->tuple[4], ""); set_tuplefield_string(&row->tuple[5], index_name); /* Clustered index? I think non-clustered should be type OTHER not HASHED */ set_tuplefield_int2(&row->tuple[6], (Int2) (atoi(isclustered) ? SQL_INDEX_CLUSTERED : SQL_INDEX_OTHER)); set_tuplefield_int2(&row->tuple[7], (Int2) (i+1)); if(fields_vector[i] == OID_ATTNUM) { set_tuplefield_string(&row->tuple[8], "oid"); mylog("SQLStatistics: column name = oid\n"); } else if(fields_vector[i] < 0 || fields_vector[i] > total_columns) { set_tuplefield_string(&row->tuple[8], "UNKNOWN"); mylog("SQLStatistics: column name = UNKNOWN\n"); } else { set_tuplefield_string(&row->tuple[8], column_names[fields_vector[i]-1]); mylog("SQLStatistics: column name = '%s'\n", column_names[fields_vector[i]-1]); } set_tuplefield_string(&row->tuple[9], "A"); set_tuplefield_null(&row->tuple[10]); set_tuplefield_null(&row->tuple[11]); set_tuplefield_null(&row->tuple[12]); QR_add_tuple(stmt->result, row); i++; } } result = PG_SQLFetch(hindx_stmt); } if(result != SQL_NO_DATA_FOUND) { SC_set_error(stmt, SC_get_errornumber(indx_stmt), SC_create_errormsg((StatementClass *)hindx_stmt)); PG_SQLFreeStmt(hindx_stmt, SQL_DROP); goto SEEYA; } PG_SQLFreeStmt(hindx_stmt, SQL_DROP); /* also, things need to think that this statement is finished so */ /* the results can be retrieved. */ stmt->status = STMT_FINISHED; /* set up the current tuple pointer for SQLFetch */ stmt->currTuple = -1; stmt->rowset_start = -1; stmt->current_col = -1; error = FALSE; SEEYA: /* These things should be freed on any error ALSO! */ free(table_name); for(i = 0; i < total_columns; i++) { free(column_names[i]); } free(column_names); mylog("SQLStatistics(): EXIT, %s, stmt=%u\n", error ? "error" : "success", stmt); if (error) { SC_log_error(func, "", stmt); return SQL_ERROR; } else return SQL_SUCCESS; } RETCODE SQL_API SQLColumnPrivileges( HSTMT hstmt, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szColumnName, SWORD cbColumnName) { static char* const func="SQLColumnPrivileges"; mylog("%s: entering...\n", func); /* Neither Access or Borland care about this. */ SC_log_error(func, "Function not implemented", (StatementClass *) hstmt); return SQL_ERROR; } /* SQLPrimaryKeys() * Retrieve the primary key columns for the specified table. */ RETCODE SQL_API PG_SQLPrimaryKeys( HSTMT hstmt, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName) { static char* const func = "SQLPrimaryKeys"; StatementClass *stmt = (StatementClass *) hstmt; TupleNode *row; RETCODE result; int seq = 0; HSTMT htbl_stmt; StatementClass *tbl_stmt; char tables_query[STD_STATEMENT_LEN]; char attname[MAX_INFO_STRING]; SDWORD attname_len; char pktab[MAX_TABLE_LEN + 1]; Int2 result_cols; mylog("%s: entering...stmt=%u\n", func, stmt); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } stmt->manual_result = TRUE; stmt->errormsg_created = TRUE; stmt->result = QR_Constructor(); if(!stmt->result) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate memory for SQLPrimaryKeys result."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* the binding structure for a statement is not set up until */ /* a statement is actually executed, so we'll have to do this ourselves. */ result_cols = 6; extend_bindings(stmt, result_cols); /* set the field names */ QR_set_num_fields(stmt->result, result_cols); QR_set_field_info(stmt->result, 0, "TABLE_QUALIFIER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 1, "TABLE_OWNER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 2, "TABLE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 3, "COLUMN_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 4, "KEY_SEQ", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 5, "PK_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); result = PG_SQLAllocStmt( stmt->hdbc, &htbl_stmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate statement for Primary Key result."); SC_log_error(func, "", stmt); return SQL_ERROR; } tbl_stmt = (StatementClass *) htbl_stmt; pktab[0] = '\0'; make_string((char*)szTableName, cbTableName, pktab); if ( pktab[0] == '\0') { SC_set_error(stmt, STMT_INTERNAL_ERROR, "No Table specified to SQLPrimaryKeys."); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } #if 0 sprintf(tables_query, "select distinct on (attnum) a2.attname, a2.attnum from pg_attribute a1, pg_attribute a2, pg_class c, pg_index i where c.relname = '%s_pkey' AND c.oid = i.indexrelid AND a1.attrelid = c.oid AND a2.attrelid = c.oid AND (i.indkey[0] = a1.attnum OR i.indkey[1] = a1.attnum OR i.indkey[2] = a1.attnum OR i.indkey[3] = a1.attnum OR i.indkey[4] = a1.attnum OR i.indkey[5] = a1.attnum OR i.indkey[6] = a1.attnum OR i.indkey[7] = a1.attnum) order by a2.attnum", pktab); #else /* Simplified query to remove assumptions about * number of possible index columns. * Courtesy of Tom Lane - thomas 2000-03-21 */ sprintf(tables_query, "select ta.attname, ia.attnum" " from pg_attribute ta, pg_attribute ia, pg_class c, pg_index i" " where c.relname = '%s_pkey'" " AND c.oid = i.indexrelid" " AND ia.attrelid = i.indexrelid" " AND ta.attrelid = i.indrelid" " AND ta.attnum = i.indkey[ia.attnum-1]" " order by ia.attnum", pktab); #endif mylog("SQLPrimaryKeys: tables_query='%s'\n", tables_query); result = PG_SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query)); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_create_errormsg((StatementClass *)htbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 1, SQL_C_CHAR, attname, MAX_INFO_STRING, &attname_len); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLFetch(htbl_stmt); while((result == SQL_SUCCESS) || (result == SQL_SUCCESS_WITH_INFO)) { row = (TupleNode *)malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField)); set_tuplefield_null(&row->tuple[0]); /* I have to hide the table owner from Access, otherwise it * insists on referring to the table as 'owner.table'. * (this is valid according to the ODBC SQL grammar, but * Postgres won't support it.) */ set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], pktab); set_tuplefield_string(&row->tuple[3], attname); set_tuplefield_int2(&row->tuple[4], (Int2) (++seq)); set_tuplefield_null(&row->tuple[5]); QR_add_tuple(stmt->result, row); mylog(">> primaryKeys: pktab = '%s', attname = '%s', seq = %d\n", pktab, attname, seq); result = PG_SQLFetch(htbl_stmt); } if(result != SQL_NO_DATA_FOUND) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_create_errormsg((StatementClass *)htbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } PG_SQLFreeStmt(htbl_stmt, SQL_DROP); /* also, things need to think that this statement is finished so */ /* the results can be retrieved. */ stmt->status = STMT_FINISHED; /* set up the current tuple pointer for SQLFetch */ stmt->currTuple = -1; stmt->rowset_start = -1; stmt->current_col = -1; mylog("SQLPrimaryKeys(): EXIT, stmt=%u\n", stmt); return SQL_SUCCESS; } RETCODE SQL_API SQLPrimaryKeys( HSTMT hstmt, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName) { return PG_SQLPrimaryKeys( hstmt, szTableQualifier, cbTableQualifier, szTableOwner, cbTableOwner, szTableName, cbTableName ); } RETCODE SQL_API SQLForeignKeys( HSTMT hstmt, UCHAR FAR * szPkTableQualifier, SWORD cbPkTableQualifier, UCHAR FAR * szPkTableOwner, SWORD cbPkTableOwner, UCHAR FAR * szPkTableName, SWORD cbPkTableName, UCHAR FAR * szFkTableQualifier, SWORD cbFkTableQualifier, UCHAR FAR * szFkTableOwner, SWORD cbFkTableOwner, UCHAR FAR * szFkTableName, SWORD cbFkTableName) { static char* const func = "SQLForeignKeys"; StatementClass *stmt = (StatementClass *) hstmt; TupleNode *row; HSTMT htbl_stmt, hpkey_stmt; StatementClass *tbl_stmt; RETCODE result, keyresult; char tables_query[STD_STATEMENT_LEN]; char trig_deferrable[2]; char trig_initdeferred[2]; char trig_args[1024]; char upd_rule[MAX_TABLE_LEN], del_rule[MAX_TABLE_LEN]; char pk_table_needed[MAX_TABLE_LEN + 1]; char fk_table_needed[MAX_TABLE_LEN + 1]; char *pkey_ptr, *fkey_ptr, *pk_table, *fk_table; int i, j, k, num_keys; SWORD trig_nargs, upd_rule_type=0, del_rule_type=0; #if (ODBCVER >= 0x0300) SWORD defer_type; #endif char pkey[MAX_INFO_STRING]; Int2 result_cols; mylog("%s: entering...stmt=%u\n", func, stmt); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } stmt->manual_result = TRUE; stmt->errormsg_created = TRUE; stmt->result = QR_Constructor(); if(!stmt->result) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate memory for SQLForeignKeys result."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* the binding structure for a statement is not set up until */ /* a statement is actually executed, so we'll have to do this ourselves. */ result_cols = 14; extend_bindings(stmt, result_cols); /* set the field names */ QR_set_num_fields(stmt->result, result_cols); QR_set_field_info(stmt->result, 0, "PKTABLE_QUALIFIER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 1, "PKTABLE_OWNER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 2, "PKTABLE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 3, "PKCOLUMN_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 4, "FKTABLE_QUALIFIER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 5, "FKTABLE_OWNER", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 6, "FKTABLE_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 7, "FKCOLUMN_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 8, "KEY_SEQ", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 9, "UPDATE_RULE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 10, "DELETE_RULE", PG_TYPE_INT2, 2); QR_set_field_info(stmt->result, 11, "FK_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 12, "PK_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); QR_set_field_info(stmt->result, 13, "TRIGGER_NAME", PG_TYPE_TEXT, MAX_INFO_STRING); #if (ODBCVER >= 0x0300) QR_set_field_info(stmt->result, 14, "DEFERRABILITY", PG_TYPE_INT2, 2); #endif /* ODBCVER >= 0x0300 */ /* also, things need to think that this statement is finished so */ /* the results can be retrieved. */ stmt->status = STMT_FINISHED; /* set up the current tuple pointer for SQLFetch */ stmt->currTuple = -1; stmt->rowset_start = -1; stmt->current_col = -1; result = PG_SQLAllocStmt( stmt->hdbc, &htbl_stmt); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate statement for SQLForeignKeys result."); SC_log_error(func, "", stmt); return SQL_ERROR; } tbl_stmt = (StatementClass *) htbl_stmt; pk_table_needed[0] = '\0'; fk_table_needed[0] = '\0'; make_string((char*)szPkTableName, cbPkTableName, pk_table_needed); make_string((char*)szFkTableName, cbFkTableName, fk_table_needed); /* Case #2 -- Get the foreign keys in the specified table (fktab) that refer to the primary keys of other table(s). */ if (fk_table_needed[0] != '\0') { mylog("%s: entering Foreign Key Case #2", func); sprintf(tables_query, "SELECT pt.tgargs, " " pt.tgnargs, " " pt.tgdeferrable, " " pt.tginitdeferred, " " pg_proc.proname, " " pg_proc_1.proname " "FROM pg_class pc, " " pg_proc pg_proc, " " pg_proc pg_proc_1, " " pg_trigger pg_trigger, " " pg_trigger pg_trigger_1, " " pg_proc pp, " " pg_trigger pt " "WHERE pt.tgrelid = pc.oid " "AND pp.oid = pt.tgfoid " "AND pg_trigger.tgconstrrelid = pc.oid " "AND pg_proc.oid = pg_trigger.tgfoid " "AND pg_trigger_1.tgfoid = pg_proc_1.oid " "AND pg_trigger_1.tgconstrrelid = pc.oid " "AND ((pc.relname='%s') " "AND (pp.proname LIKE '%%ins') " "AND (pg_proc.proname LIKE '%%upd') " "AND (pg_proc_1.proname LIKE '%%del') " "AND (pg_trigger.tgrelid=pt.tgconstrrelid) " "AND (pg_trigger.tgconstrname=pt.tgconstrname) " "AND (pg_trigger_1.tgrelid=pt.tgconstrrelid) " "AND (pg_trigger_1.tgconstrname=pt.tgconstrname))", fk_table_needed); result = PG_SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query)); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_create_errormsg((StatementClass *)htbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 1, SQL_C_BINARY, trig_args, sizeof(trig_args), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 2, SQL_C_SHORT, &trig_nargs, 0, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 3, SQL_C_CHAR, trig_deferrable, sizeof(trig_deferrable), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 4, SQL_C_CHAR, trig_initdeferred, sizeof(trig_initdeferred), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 5, SQL_C_CHAR, upd_rule, sizeof(upd_rule), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 6, SQL_C_CHAR, del_rule, sizeof(del_rule), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLFetch(htbl_stmt); if (result == SQL_NO_DATA_FOUND) return SQL_SUCCESS; if(result != SQL_SUCCESS) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_create_errormsg((StatementClass *)htbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } keyresult = PG_SQLAllocStmt( stmt->hdbc, &hpkey_stmt); if((keyresult != SQL_SUCCESS) && (keyresult != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't allocate statement for SQLForeignKeys (pkeys) result."); SC_log_error(func, "", stmt); return SQL_ERROR; } keyresult = PG_SQLBindCol(hpkey_stmt, 4, SQL_C_CHAR, pkey, sizeof(pkey), NULL); if (keyresult != SQL_SUCCESS) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't bindcol for primary keys for SQLForeignKeys result."); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hpkey_stmt, SQL_DROP); return SQL_ERROR; } while (result == SQL_SUCCESS) { /* Compute the number of keyparts. */ num_keys = (trig_nargs - 4) / 2; mylog("Foreign Key Case#2: trig_nargs = %d, num_keys = %d\n", trig_nargs, num_keys); pk_table = trig_args; /* Get to the PK Table Name */ for (k = 0; k < 2; k++) pk_table += strlen(pk_table) + 1; /* If there is a pk table specified, then check it. */ if (pk_table_needed[0] != '\0') { /* If it doesn't match, then continue */ if ( strcmp(pk_table, pk_table_needed)) { result = PG_SQLFetch(htbl_stmt); continue; } } keyresult = PG_SQLPrimaryKeys(hpkey_stmt, NULL, 0, NULL, 0, (SQLCHAR*)pk_table, SQL_NTS); if (keyresult != SQL_SUCCESS) { SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "Couldn't get primary keys for SQLForeignKeys result."); SC_log_error(func, "", stmt); PG_SQLFreeStmt(hpkey_stmt, SQL_DROP); return SQL_ERROR; } /* Check that the key listed is the primary key */ keyresult = PG_SQLFetch(hpkey_stmt); /* Get to first primary key */ pkey_ptr = trig_args; for (i = 0; i < 5; i++) pkey_ptr += strlen(pkey_ptr) + 1; for (k = 0; k < num_keys; k++) { mylog("%s: pkey_ptr='%s', pkey='%s'\n", func, pkey_ptr, pkey); if ( keyresult != SQL_SUCCESS || strcmp(pkey_ptr, pkey)) { num_keys = 0; break; } /* Get to next primary key */ for (k = 0; k < 2; k++) pkey_ptr += strlen(pkey_ptr) + 1; keyresult = PG_SQLFetch(hpkey_stmt); } /* Set to first fk column */ fkey_ptr = trig_args; for (k = 0; k < 4; k++) fkey_ptr += strlen(fkey_ptr) + 1; /* Set update and delete actions for foreign keys */ if (!strcmp(upd_rule, "RI_FKey_cascade_upd")) { upd_rule_type = SQL_CASCADE; } else if (!strcmp(upd_rule, "RI_FKey_noaction_upd")) { upd_rule_type = SQL_NO_ACTION; } else if (!strcmp(upd_rule, "RI_FKey_restrict_upd")) { upd_rule_type = SQL_NO_ACTION; } else if (!strcmp(upd_rule, "RI_FKey_setdefault_upd")) { upd_rule_type = SQL_SET_DEFAULT; } else if (!strcmp(upd_rule, "RI_FKey_setnull_upd")) { upd_rule_type = SQL_SET_NULL; } if (!strcmp(upd_rule, "RI_FKey_cascade_del")) { del_rule_type = SQL_CASCADE; } else if (!strcmp(upd_rule, "RI_FKey_noaction_del")) { del_rule_type = SQL_NO_ACTION; } else if (!strcmp(upd_rule, "RI_FKey_restrict_del")) { del_rule_type = SQL_NO_ACTION; } else if (!strcmp(upd_rule, "RI_FKey_setdefault_del")) { del_rule_type = SQL_SET_DEFAULT; } else if (!strcmp(upd_rule, "RI_FKey_setnull_del")) { del_rule_type = SQL_SET_NULL; } #if (ODBCVER >= 0x0300) /* Set deferrability type */ if (!strcmp(trig_initdeferred, "y")) { defer_type = SQL_INITIALLY_DEFERRED; } else if (!strcmp(trig_deferrable, "y")) { defer_type = SQL_INITIALLY_IMMEDIATE; } else { defer_type = SQL_NOT_DEFERRABLE; } #endif /* ODBCVER >= 0x0300 */ /* Get to first primary key */ pkey_ptr = trig_args; for (i = 0; i < 5; i++) pkey_ptr += strlen(pkey_ptr) + 1; for (k = 0; k < num_keys; k++) { row = (TupleNode *)malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField)); mylog("%s: pk_table = '%s', pkey_ptr = '%s'\n", func, pk_table, pkey_ptr); set_tuplefield_null(&row->tuple[0]); set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], pk_table); set_tuplefield_string(&row->tuple[3], pkey_ptr); mylog("%s: fk_table_needed = '%s', fkey_ptr = '%s'\n", func, fk_table_needed, fkey_ptr); set_tuplefield_null(&row->tuple[4]); set_tuplefield_string(&row->tuple[5], ""); set_tuplefield_string(&row->tuple[6], fk_table_needed); set_tuplefield_string(&row->tuple[7], fkey_ptr); mylog("%s: upd_rule_type = '%i', del_rule_type = '%i'\n, trig_name = '%s'", func, upd_rule_type, del_rule_type, trig_args); set_tuplefield_int2(&row->tuple[8], (Int2) (k + 1)); set_tuplefield_int2(&row->tuple[9], (Int2) upd_rule_type); set_tuplefield_int2(&row->tuple[10], (Int2) del_rule_type); set_tuplefield_null(&row->tuple[11]); set_tuplefield_null(&row->tuple[12]); set_tuplefield_string(&row->tuple[13], trig_args); #if (ODBCVER >= 0x0300) set_tuplefield_int2(&row->tuple[14], defer_type); #endif /* ODBCVER >= 0x0300 */ QR_add_tuple(stmt->result, row); /* next primary/foreign key */ for (i = 0; i < 2; i++) { fkey_ptr += strlen(fkey_ptr) + 1; pkey_ptr += strlen(pkey_ptr) + 1; } } result = PG_SQLFetch(htbl_stmt); } PG_SQLFreeStmt(hpkey_stmt, SQL_DROP); } /* Case #1 -- Get the foreign keys in other tables that refer to the primary key in the specified table (pktab). i.e., Who points to me? */ else if (pk_table_needed[0] != '\0') { sprintf(tables_query, "SELECT pg_trigger.tgargs, " " pg_trigger.tgnargs, " " pg_trigger.tgdeferrable, " " pg_trigger.tginitdeferred, " " pg_proc.proname, " " pg_proc_1.proname " "FROM pg_class pg_class, " " pg_class pg_class_1, " " pg_class pg_class_2, " " pg_proc pg_proc, " " pg_proc pg_proc_1, " " pg_trigger pg_trigger, " " pg_trigger pg_trigger_1, " " pg_trigger pg_trigger_2 " "WHERE pg_trigger.tgconstrrelid = pg_class.oid " " AND pg_trigger.tgrelid = pg_class_1.oid " " AND pg_trigger_1.tgfoid = pg_proc_1.oid " " AND pg_trigger_1.tgconstrrelid = pg_class_1.oid " " AND pg_trigger_2.tgconstrrelid = pg_class_2.oid " " AND pg_trigger_2.tgfoid = pg_proc.oid " " AND pg_class_2.oid = pg_trigger.tgrelid " " AND (" " (pg_class.relname='%s') " " AND (pg_proc.proname Like '%%upd') " " AND (pg_proc_1.proname Like '%%del')" " AND (pg_trigger_1.tgrelid = pg_trigger.tgconstrrelid) " " AND (pg_trigger_2.tgrelid = pg_trigger.tgconstrrelid) " " )", pk_table_needed); result = PG_SQLExecDirect(htbl_stmt, tables_query, strlen(tables_query)); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_create_errormsg((StatementClass *)htbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 1, SQL_C_BINARY, trig_args, sizeof(trig_args), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 2, SQL_C_SHORT, &trig_nargs, 0, NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 3, SQL_C_CHAR, trig_deferrable, sizeof(trig_deferrable), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 4, SQL_C_CHAR, trig_initdeferred, sizeof(trig_initdeferred), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 5, SQL_C_CHAR, upd_rule, sizeof(upd_rule), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLBindCol(htbl_stmt, 6, SQL_C_CHAR, del_rule, sizeof(del_rule), NULL); if((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_get_errormsg(tbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } result = PG_SQLFetch(htbl_stmt); if (result == SQL_NO_DATA_FOUND) return SQL_SUCCESS; if(result != SQL_SUCCESS) { SC_set_error(stmt, SC_get_errornumber(tbl_stmt), SC_create_errormsg((StatementClass *)htbl_stmt)); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } while (result == SQL_SUCCESS) { /* Calculate the number of key parts */ num_keys = (trig_nargs - 4) / 2;; /* Handle action (i.e., 'cascade', 'restrict', 'setnull') */ if (!strcmp(upd_rule, "RI_FKey_cascade_upd")) { upd_rule_type = SQL_CASCADE; } else if (!strcmp(upd_rule, "RI_FKey_noaction_upd")) { upd_rule_type = SQL_NO_ACTION; } else if (!strcmp(upd_rule, "RI_FKey_restrict_upd")) { upd_rule_type = SQL_NO_ACTION; } else if (!strcmp(upd_rule, "RI_FKey_setdefault_upd")) { upd_rule_type = SQL_SET_DEFAULT; } else if (!strcmp(upd_rule, "RI_FKey_setnull_upd")) { upd_rule_type = SQL_SET_NULL; } if (!strcmp(upd_rule, "RI_FKey_cascade_del")) { del_rule_type = SQL_CASCADE; } else if (!strcmp(upd_rule, "RI_FKey_noaction_del")) { del_rule_type = SQL_NO_ACTION; } else if (!strcmp(upd_rule, "RI_FKey_restrict_del")) { del_rule_type = SQL_NO_ACTION; } else if (!strcmp(upd_rule, "RI_FKey_setdefault_del")) { del_rule_type = SQL_SET_DEFAULT; } else if (!strcmp(upd_rule, "RI_FKey_setnull_del")) { del_rule_type = SQL_SET_NULL; } #if (ODBCVER >= 0x0300) /* Set deferrability type */ if (!strcmp(trig_initdeferred, "y")) { defer_type = SQL_INITIALLY_DEFERRED; } else if (!strcmp(trig_deferrable, "y")) { defer_type = SQL_INITIALLY_IMMEDIATE; } else { defer_type = SQL_NOT_DEFERRABLE; } #endif /* ODBCVER >= 0x0300 */ mylog("Foreign Key Case#1: trig_nargs = %d, num_keys = %d\n", trig_nargs, num_keys); /* Get to first primary key */ pkey_ptr = trig_args; for (i = 0; i < 5; i++) pkey_ptr += strlen(pkey_ptr) + 1; /* Get to first foreign table */ fk_table = trig_args; fk_table += strlen(fk_table) + 1; /* Get to first foreign key */ fkey_ptr = trig_args; for (k = 0; k < 4; k++) fkey_ptr += strlen(fkey_ptr) + 1; for (k = 0; k < num_keys; k++) { mylog("pkey_ptr = '%s', fk_table = '%s', fkey_ptr = '%s'\n", pkey_ptr, fk_table, fkey_ptr); row = (TupleNode *)malloc(sizeof(TupleNode) + (result_cols - 1) * sizeof(TupleField)); mylog("pk_table_needed = '%s', pkey_ptr = '%s'\n", pk_table_needed, pkey_ptr); set_tuplefield_null(&row->tuple[0]); set_tuplefield_string(&row->tuple[1], ""); set_tuplefield_string(&row->tuple[2], pk_table_needed); set_tuplefield_string(&row->tuple[3], pkey_ptr); mylog("fk_table = '%s', fkey_ptr = '%s'\n", fk_table, fkey_ptr); set_tuplefield_null(&row->tuple[4]); set_tuplefield_string(&row->tuple[5], ""); set_tuplefield_string(&row->tuple[6], fk_table); set_tuplefield_string(&row->tuple[7], fkey_ptr); set_tuplefield_int2(&row->tuple[8], (Int2) (k + 1)); mylog("upd_rule = %d, del_rule= %d", upd_rule_type, del_rule_type); set_nullfield_int2(&row->tuple[9], (Int2) upd_rule_type); set_nullfield_int2(&row->tuple[10], (Int2) del_rule_type); set_tuplefield_null(&row->tuple[11]); set_tuplefield_null(&row->tuple[12]); set_tuplefield_string(&row->tuple[13], trig_args); #if (ODBCVER >= 0x0300) mylog("defer_type = '%s'", defer_type); set_tuplefield_int2(&row->tuple[14], defer_type); #endif /* ODBCVER >= 0x0300 */ QR_add_tuple(stmt->result, row); /* next primary/foreign key */ for (j = 0; j < 2; j++) { pkey_ptr += strlen(pkey_ptr) + 1; fkey_ptr += strlen(fkey_ptr) + 1; } } result = PG_SQLFetch(htbl_stmt); } } else { SC_set_error(stmt, STMT_INTERNAL_ERROR, "No tables specified to SQLForeignKeys."); SC_log_error(func, "", stmt); PG_SQLFreeStmt(htbl_stmt, SQL_DROP); return SQL_ERROR; } PG_SQLFreeStmt(htbl_stmt, SQL_DROP); mylog("SQLForeignKeys(): EXIT, stmt=%u\n", stmt); return SQL_SUCCESS; } RETCODE SQL_API SQLProcedureColumns( HSTMT hstmt, UCHAR FAR * szProcQualifier, SWORD cbProcQualifier, UCHAR FAR * szProcOwner, SWORD cbProcOwner, UCHAR FAR * szProcName, SWORD cbProcName, UCHAR FAR * szColumnName, SWORD cbColumnName) { static char* const func="SQLProcedureColumns"; mylog("%s: entering...\n", func); SC_log_error(func, "Function not implemented", (StatementClass *) hstmt); return SQL_ERROR; } RETCODE SQL_API SQLProcedures( HSTMT hstmt, UCHAR FAR * szProcQualifier, SWORD cbProcQualifier, UCHAR FAR * szProcOwner, SWORD cbProcOwner, UCHAR FAR * szProcName, SWORD cbProcName) { static char* const func="SQLProcedures"; mylog("%s: entering...\n", func); SC_log_error(func, "Function not implemented", (StatementClass *) hstmt); return SQL_ERROR; } RETCODE SQL_API SQLTablePrivileges( HSTMT hstmt, UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, SWORD cbTableName) { static char* const func="SQLTablePrivileges"; mylog("%s: entering...\n", func); SC_log_error(func, "Function not implemented", (StatementClass *) hstmt); return SQL_ERROR; } unixODBC-2.3.9/Drivers/Postgre7.1/isql.h0000755000175000017500000000002112262474475014502 00000000000000#include unixODBC-2.3.9/Drivers/Postgre7.1/results.c0000755000175000017500000007647112262474475015254 00000000000000 /* Module: results.c * * Description: This module contains functions related to * retrieving result information through the ODBC API. * * Classes: n/a * * API functions: SQLRowCount, SQLNumResultCols, SQLDescribeCol, SQLColAttributes, * SQLGetData, SQLFetch, SQLExtendedFetch, * SQLMoreResults(NI), SQLSetPos, SQLSetScrollOptions(NI), * SQLSetCursorName, SQLGetCursorName * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "psqlodbc.h" #include "dlg_specific.h" #include "environ.h" #include "connection.h" #include "statement.h" #include "bind.h" #include "qresult.h" #include "convert.h" #include "pgtypes.h" #include #ifndef WIN32 #include "isqlext.h" #else #include #include #endif extern GLOBAL_VALUES globals; SQLRETURN SQLRowCount(SQLHSTMT hstmt, SQLLEN *pcrow) { static char* const func="SQLRowCount"; StatementClass *stmt = (StatementClass *) hstmt; QResultClass *res; char *msg, *ptr; if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if (stmt->manual_result) { if (pcrow) *pcrow = -1; return SQL_SUCCESS; } if(stmt->statement_type == STMT_TYPE_SELECT) { if (stmt->status == STMT_FINISHED) { res = SC_get_Result(stmt); if(res && pcrow) { *pcrow = globals.use_declarefetch ? -1 : QR_get_num_tuples(res); return SQL_SUCCESS; } } } else { res = SC_get_Result(stmt); if (res && pcrow) { msg = QR_get_command(res); mylog("*** msg = '%s'\n", msg); trim(msg); /* get rid of trailing spaces */ ptr = strrchr(msg, ' '); if (ptr) { *pcrow = atoi(ptr+1); mylog("**** SQLRowCount(): THE ROWS: *pcrow = %d\n", *pcrow); } else { *pcrow = -1; mylog("**** SQLRowCount(): NO ROWS: *pcrow = %d\n", *pcrow); } return SQL_SUCCESS; } } SC_log_error(func, "Bad return value", stmt); return SQL_ERROR; } /* This returns the number of columns associated with the database */ /* attached to "hstmt". */ RETCODE SQL_API SQLNumResultCols( HSTMT hstmt, SWORD FAR *pccol) { static char* const func="SQLNumResultCols"; StatementClass *stmt = (StatementClass *) hstmt; QResultClass *result; char parse_ok; if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } SC_clear_error(stmt); parse_ok = FALSE; if (globals.parse && stmt->statement_type == STMT_TYPE_SELECT) { if (stmt->parse_status == STMT_PARSE_NONE) { mylog("SQLNumResultCols: calling parse_statement on stmt=%u\n", stmt); parse_statement(stmt); } if (stmt->parse_status != STMT_PARSE_FATAL) { parse_ok = TRUE; *pccol = stmt->nfld; mylog("PARSE: SQLNumResultCols: *pccol = %d\n", *pccol); } } if ( ! parse_ok) { SC_pre_execute(stmt); result = SC_get_Result(stmt); mylog("SQLNumResultCols: result = %u, status = %d, numcols = %d\n", result, stmt->status, result != NULL ? QR_NumResultCols(result) : -1); if (( ! result) || ((stmt->status != STMT_FINISHED) && (stmt->status != STMT_PREMATURE)) ) { /* no query has been executed on this statement */ SC_set_error(stmt, STMT_SEQUENCE_ERROR, "No query has been executed with that handle"); SC_log_error(func, "", stmt); return SQL_ERROR; } *pccol = QR_NumResultCols(result); } return SQL_SUCCESS; } /* - - - - - - - - - */ /* Return information about the database column the user wants */ /* information about. */ RETCODE SQL_API SQLDescribeCol( HSTMT hstmt, UWORD icol, UCHAR FAR *szColName, SWORD cbColNameMax, SWORD FAR *pcbColName, SWORD FAR *pfSqlType, SQLULEN FAR *pcbColDef, SWORD FAR *pibScale, SWORD FAR *pfNullable) { static char* const func="SQLDescribeCol"; /* gets all the information about a specific column */ StatementClass *stmt = (StatementClass *) hstmt; QResultClass *res; char *col_name = NULL; Int4 fieldtype = 0; int precision = 0; ConnInfo *ci; char parse_ok; char buf[255]; int len = 0; RETCODE result; mylog("%s: entering...\n", func); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } ci = &(stmt->hdbc->connInfo); SC_clear_error(stmt); /* Dont check for bookmark column. This is the responsibility of the driver manager. */ icol--; /* use zero based column numbers */ parse_ok = FALSE; if (globals.parse && stmt->statement_type == STMT_TYPE_SELECT) { if (stmt->parse_status == STMT_PARSE_NONE) { mylog("SQLDescribeCol: calling parse_statement on stmt=%u\n", stmt); parse_statement(stmt); } mylog("PARSE: DescribeCol: icol=%d, stmt=%u, stmt->nfld=%d, stmt->fi=%u\n", icol, stmt, stmt->nfld, stmt->fi); if (stmt->parse_status != STMT_PARSE_FATAL && stmt->fi && stmt->fi[icol]) { if (icol >= stmt->nfld) { SC_set_error(stmt, STMT_INVALID_COLUMN_NUMBER_ERROR, "Invalid column number in DescribeCol."); SC_log_error(func, "", stmt); return SQL_ERROR; } mylog("DescribeCol: getting info for icol=%d\n", icol); fieldtype = stmt->fi[icol]->type; col_name = stmt->fi[icol]->name; precision = stmt->fi[icol]->precision; mylog("PARSE: fieldtype=%d, col_name='%s', precision=%d\n", fieldtype, col_name, precision); if (fieldtype > 0) parse_ok = TRUE; } } /* If couldn't parse it OR the field being described was not parsed (i.e., because it was a function or expression, etc, then do it the old fashioned way. */ if ( ! parse_ok) { SC_pre_execute(stmt); res = SC_get_Result(stmt); mylog("**** SQLDescribeCol: res = %u, stmt->status = %d, !finished=%d, !premature=%d\n", res, stmt->status, stmt->status != STMT_FINISHED, stmt->status != STMT_PREMATURE); if ( (NULL == res) || ((stmt->status != STMT_FINISHED) && (stmt->status != STMT_PREMATURE))) { /* no query has been executed on this statement */ SC_set_error(stmt, STMT_SEQUENCE_ERROR, "No query has been assigned to this statement."); SC_log_error(func, "", stmt); return SQL_ERROR; } if (icol >= QR_NumResultCols(res)) { SC_set_error(stmt, STMT_INVALID_COLUMN_NUMBER_ERROR, "Invalid column number in DescribeCol."); sprintf(buf, "Col#=%d, #Cols=%d", icol, QR_NumResultCols(res)); SC_log_error(func, buf, stmt); return SQL_ERROR; } col_name = QR_get_fieldname(res, icol); fieldtype = QR_get_field_type(res, icol); precision = pgtype_precision(stmt, fieldtype, icol, globals.unknown_sizes); /* atoi(ci->unknown_sizes) */ } mylog("describeCol: col %d fieldname = '%s'\n", icol, col_name); mylog("describeCol: col %d fieldtype = %d\n", icol, fieldtype); mylog("describeCol: col %d precision = %d\n", icol, precision); result = SQL_SUCCESS; /************************/ /* COLUMN NAME */ /************************/ len = strlen(col_name); if (pcbColName) *pcbColName = len; if (szColName) { strncpy_null((char*)szColName, col_name, cbColNameMax); if (len >= cbColNameMax) { result = SQL_SUCCESS_WITH_INFO; SC_set_error(stmt, STMT_TRUNCATED, "The buffer was too small for the result."); } } /************************/ /* SQL TYPE */ /************************/ if (pfSqlType) { *pfSqlType = pgtype_to_sqltype(stmt, fieldtype); mylog("describeCol: col %d *pfSqlType = %d\n", icol, *pfSqlType); } /************************/ /* PRECISION */ /************************/ if (pcbColDef) { if ( precision < 0) precision = 0; /* "I dont know" */ *pcbColDef = precision; mylog("describeCol: col %d *pcbColDef = %d\n", icol, *pcbColDef); } /************************/ /* SCALE */ /************************/ if (pibScale) { Int2 scale; scale = pgtype_scale(stmt, fieldtype, icol); if(scale == -1) { scale = 0; } *pibScale = scale; mylog("describeCol: col %d *pibScale = %d\n", icol, *pibScale); } /************************/ /* NULLABILITY */ /************************/ if (pfNullable) { *pfNullable = (parse_ok) ? stmt->fi[icol]->nullable : pgtype_nullable(stmt, fieldtype); mylog("describeCol: col %d *pfNullable = %d\n", icol, *pfNullable); } return result; } /* Returns result column descriptor information for a result set. */ SQLRETURN SQLColAttributes( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, SQLLEN *pfDesc) { static char* const func = "SQLColAttributes"; StatementClass *stmt = (StatementClass *) hstmt; Int4 field_type = 0; ConnInfo *ci; int unknown_sizes; int cols = 0; char parse_ok; RETCODE result; char *p = NULL; int len = 0, value = 0; mylog("%s: entering...\n", func); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } ci = &(stmt->hdbc->connInfo); /* Dont check for bookmark column. This is the responsibility of the driver manager. For certain types of arguments, the column number is ignored anyway, so it may be 0. */ icol--; unknown_sizes = globals.unknown_sizes; /* atoi(ci->unknown_sizes); */ if (unknown_sizes == UNKNOWNS_AS_DONTKNOW) /* not appropriate for SQLColAttributes() */ unknown_sizes = UNKNOWNS_AS_MAX; parse_ok = FALSE; if (globals.parse && stmt->statement_type == STMT_TYPE_SELECT) { if (stmt->parse_status == STMT_PARSE_NONE) { mylog("SQLColAttributes: calling parse_statement\n"); parse_statement(stmt); } cols = stmt->nfld; /* Column Count is a special case. The Column number is ignored in this case. */ if (fDescType == SQL_COLUMN_COUNT) { if (pfDesc) *pfDesc = cols; return SQL_SUCCESS; } if (stmt->parse_status != STMT_PARSE_FATAL && stmt->fi && stmt->fi[icol]) { if (icol >= cols) { SC_set_error(stmt, STMT_INVALID_COLUMN_NUMBER_ERROR, "Invalid column number in DescribeCol."); SC_log_error(func, "", stmt); return SQL_ERROR; } field_type = stmt->fi[icol]->type; if (field_type > 0) parse_ok = TRUE; } } if ( ! parse_ok) { SC_pre_execute(stmt); mylog("**** SQLColAtt: result = %u, status = %d, numcols = %d\n", stmt->result, stmt->status, stmt->result != NULL ? QR_NumResultCols(stmt->result) : -1); if ( (NULL == stmt->result) || ((stmt->status != STMT_FINISHED) && (stmt->status != STMT_PREMATURE)) ) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Can't get column attributes: no result found."); SC_log_error(func, "", stmt); return SQL_ERROR; } cols = QR_NumResultCols(stmt->result); /* Column Count is a special case. The Column number is ignored in this case. */ if (fDescType == SQL_COLUMN_COUNT) { if (pfDesc) *pfDesc = cols; return SQL_SUCCESS; } if (icol >= cols) { SC_set_error(stmt, STMT_INVALID_COLUMN_NUMBER_ERROR, "Invalid column number in DescribeCol."); SC_log_error(func, "", stmt); return SQL_ERROR; } field_type = QR_get_field_type(stmt->result, icol); } mylog("colAttr: col %d field_type = %d\n", icol, field_type); switch(fDescType) { case SQL_COLUMN_AUTO_INCREMENT: value = pgtype_auto_increment(stmt, field_type); if (value == -1) /* non-numeric becomes FALSE (ODBC Doc) */ value = FALSE; break; case SQL_COLUMN_CASE_SENSITIVE: value = pgtype_case_sensitive(stmt, field_type); break; /* This special case is handled above. case SQL_COLUMN_COUNT: */ case SQL_COLUMN_DISPLAY_SIZE: value = (parse_ok) ? stmt->fi[icol]->display_size : pgtype_display_size(stmt, field_type, icol, unknown_sizes); mylog("SQLColAttributes: col %d, display_size= %d\n", icol, value); break; case SQL_COLUMN_LABEL: if (parse_ok && stmt->fi[icol]->alias[0] != '\0') { p = stmt->fi[icol]->alias; mylog("SQLColAttr: COLUMN_LABEL = '%s'\n", p); break; } /* otherwise same as column name -- FALL THROUGH!!! */ case SQL_COLUMN_NAME: p = (parse_ok) ? stmt->fi[icol]->name : QR_get_fieldname(stmt->result, icol); mylog("SQLColAttr: COLUMN_NAME = '%s'\n", p); break; case SQL_COLUMN_LENGTH: value = (parse_ok) ? stmt->fi[icol]->length : pgtype_length(stmt, field_type, icol, unknown_sizes); mylog("SQLColAttributes: col %d, length = %d\n", icol, value); break; case SQL_COLUMN_MONEY: value = pgtype_money(stmt, field_type); break; case SQL_COLUMN_NULLABLE: value = (parse_ok) ? stmt->fi[icol]->nullable : pgtype_nullable(stmt, field_type); break; case SQL_COLUMN_OWNER_NAME: p = ""; break; case SQL_COLUMN_PRECISION: value = (parse_ok) ? stmt->fi[icol]->precision : pgtype_precision(stmt, field_type, icol, unknown_sizes); mylog("SQLColAttributes: col %d, precision = %d\n", icol, value); break; case SQL_COLUMN_QUALIFIER_NAME: p = ""; break; case SQL_COLUMN_SCALE: value = pgtype_scale(stmt, field_type, icol); break; case SQL_COLUMN_SEARCHABLE: value = pgtype_searchable(stmt, field_type); break; case SQL_COLUMN_TABLE_NAME: p = (parse_ok && stmt->fi[icol]->ti) ? stmt->fi[icol]->ti->name : ""; mylog("SQLColAttr: TABLE_NAME = '%s'\n", p); break; case SQL_COLUMN_TYPE: value = pgtype_to_sqltype(stmt, field_type); break; case SQL_COLUMN_TYPE_NAME: p = pgtype_to_name(stmt, field_type); break; case SQL_COLUMN_UNSIGNED: value = pgtype_unsigned(stmt, field_type); if(value == -1) /* non-numeric becomes TRUE (ODBC Doc) */ value = TRUE; break; case SQL_COLUMN_UPDATABLE: /* Neither Access or Borland care about this. if (field_type == PG_TYPE_OID) *pfDesc = SQL_ATTR_READONLY; else */ value = SQL_ATTR_WRITE; mylog("SQLColAttr: UPDATEABLE = %d\n", value); break; } result = SQL_SUCCESS; if (p) { /* char/binary data */ len = strlen(p); if (rgbDesc) { strncpy_null((char *)rgbDesc, p, (size_t)cbDescMax); if (len >= cbDescMax) { result = SQL_SUCCESS_WITH_INFO; SC_set_error(stmt, STMT_TRUNCATED, "The buffer was too small for the result."); } } if (pcbDesc) *pcbDesc = len; } else { /* numeric data */ if (pfDesc) *pfDesc = value; } return result; } /* Returns result data for a single column in the current row. */ RETCODE SQL_API PG_SQLGetData( HSTMT hstmt, UWORD icol, SWORD fCType, PTR rgbValue, SDWORD cbValueMax, SDWORD FAR *pcbValue) { static char* const func="SQLGetData"; QResultClass *res; StatementClass *stmt = (StatementClass *) hstmt; int num_cols, num_rows; Int4 field_type; void *value = NULL; int result; char get_bookmark = FALSE; mylog("SQLGetData: enter, stmt=%u\n", stmt); if( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } res = stmt->result; if (STMT_EXECUTING == stmt->status) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Can't get data while statement is still executing."); SC_log_error(func, "", stmt); return SQL_ERROR; } if (stmt->status != STMT_FINISHED) { SC_set_error(stmt, STMT_STATUS_ERROR, "GetData can only be called after the successful execution on a SQL statement"); SC_log_error(func, "", stmt); return SQL_ERROR; } if (icol == 0) { if (stmt->options.use_bookmarks == SQL_UB_OFF) { SC_set_error(stmt, STMT_COLNUM_ERROR, "Attempt to retrieve bookmark with bookmark usage disabled"); SC_log_error(func, "", stmt); return SQL_ERROR; } /* Make sure it is the bookmark data type */ if (fCType != SQL_C_BOOKMARK && fCType != SQL_C_BINARY ) { SC_set_error(stmt, STMT_PROGRAM_TYPE_OUT_OF_RANGE, "Column 0 is not of type SQL_C_BOOKMARK"); SC_log_error(func, "", stmt); return SQL_ERROR; } get_bookmark = TRUE; } else { /* use zero-based column numbers */ icol--; /* make sure the column number is valid */ num_cols = QR_NumResultCols(res); if (icol >= num_cols) { SC_set_error(stmt, STMT_INVALID_COLUMN_NUMBER_ERROR, "Invalid column number."); SC_log_error(func, "", stmt); return SQL_ERROR; } } if ( stmt->manual_result || ! globals.use_declarefetch) { /* make sure we're positioned on a valid row */ num_rows = QR_get_num_tuples(res); if((stmt->currTuple < 0) || (stmt->currTuple >= num_rows)) { SC_set_error(stmt, STMT_INVALID_CURSOR_STATE_ERROR, "Not positioned on a valid row for GetData."); SC_log_error(func, "", stmt); return SQL_ERROR; } mylog(" num_rows = %d\n", num_rows); if ( ! get_bookmark) { if ( stmt->manual_result) { value = QR_get_value_manual(res, stmt->currTuple, icol); } else { value = QR_get_value_backend_row(res, stmt->currTuple, icol); } mylog(" value = '%s'\n", value); } } else { /* it's a SOCKET result (backend data) */ if (stmt->currTuple == -1 || ! res || ! res->tupleField) { SC_set_error(stmt, STMT_INVALID_CURSOR_STATE_ERROR, "Not positioned on a valid row for GetData."); SC_log_error(func, "", stmt); return SQL_ERROR; } if ( ! get_bookmark) value = QR_get_value_backend(res, icol); mylog(" socket: value = '%s'\n", value); } if ( get_bookmark) { *((UDWORD *) rgbValue) = SC_get_bookmark(stmt); if (pcbValue) *pcbValue = 4; return SQL_SUCCESS; } field_type = QR_get_field_type(res, icol); mylog("**** SQLGetData: icol = %d, fCType = %d, field_type = %d, value = '%s'\n", icol, fCType, field_type, value); stmt->current_col = icol; result = copy_and_convert_field(stmt, field_type, value, fCType, rgbValue, cbValueMax, (SQLLEN*)pcbValue); stmt->current_col = -1; switch(result) { case COPY_OK: return SQL_SUCCESS; case COPY_UNSUPPORTED_TYPE: SC_set_error(stmt, STMT_RESTRICTED_DATA_TYPE_ERROR, "Received an unsupported type from Postgres."); SC_log_error(func, "", stmt); return SQL_ERROR; case COPY_UNSUPPORTED_CONVERSION: SC_set_error(stmt, STMT_RESTRICTED_DATA_TYPE_ERROR, "Couldn't handle the necessary data type conversion."); SC_log_error(func, "", stmt); return SQL_ERROR; case COPY_RESULT_TRUNCATED: SC_set_error(stmt, STMT_TRUNCATED, "The buffer was too small for the result."); return SQL_SUCCESS_WITH_INFO; case COPY_GENERAL_ERROR: /* error msg already filled in */ SC_log_error(func, "", stmt); return SQL_ERROR; case COPY_NO_DATA_FOUND: /* SC_log_error(func, "no data found", stmt); */ return SQL_NO_DATA_FOUND; default: SC_set_error(stmt, STMT_INTERNAL_ERROR, "Unrecognized return value from copy_and_convert_field."); SC_log_error(func, "", stmt); return SQL_ERROR; } } SQLRETURN SQLGetData(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLSMALLINT fCType, SQLPOINTER rgbValue, SQLLEN cbValueMax, SQLLEN *pcbValue) { return PG_SQLGetData( hstmt, icol, fCType, rgbValue, cbValueMax, (SDWORD FAR *)pcbValue ); } /* Returns data for bound columns in the current row ("hstmt->iCursor"), */ /* advances the cursor. */ RETCODE SQL_API PG_SQLFetch( HSTMT hstmt) { static char* const func = "SQLFetch"; StatementClass *stmt = (StatementClass *) hstmt; QResultClass *res; mylog("SQLFetch: stmt = %u, stmt->result= %u\n", stmt, stmt->result); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } SC_clear_error(stmt); if ( ! (res = stmt->result)) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Null statement result in SQLFetch."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* Not allowed to bind a bookmark column when using SQLFetch. */ if ( stmt->bookmark.buffer) { SC_set_error(stmt, STMT_COLNUM_ERROR, "Not allowed to bind a bookmark column when using SQLFetch"); SC_log_error(func, "", stmt); return SQL_ERROR; } if (stmt->status == STMT_EXECUTING) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Can't fetch while statement is still executing."); SC_log_error(func, "", stmt); return SQL_ERROR; } if (stmt->status != STMT_FINISHED) { SC_set_error(stmt, STMT_STATUS_ERROR, "Fetch can only be called after the successful execution on a SQL statement"); SC_log_error(func, "", stmt); return SQL_ERROR; } if (stmt->bindings == NULL) { /* just to avoid a crash if the user insists on calling this */ /* function even if SQL_ExecDirect has reported an Error */ SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Bindings were not allocated properly."); SC_log_error(func, "", stmt); return SQL_ERROR; } QR_set_rowset_size(res, 1); QR_inc_base(res, stmt->last_fetch_count); return SC_fetch(stmt); } RETCODE SQL_API SQLFetch( HSTMT hstmt) { return PG_SQLFetch( hstmt ); } /* This fetchs a block of data (rowset). */ SQLRETURN SQLExtendedFetch( SQLHSTMT hstmt, SQLUSMALLINT fFetchType, SQLLEN irow, SQLULEN *pcrow, SQLUSMALLINT *rgfRowStatus) { static char* const func = "SQLExtendedFetch"; StatementClass *stmt = (StatementClass *) hstmt; QResultClass *res; int num_tuples, i, save_rowset_size; RETCODE result; char truncated, error; mylog("SQLExtendedFetch: stmt=%u\n", stmt); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if ( globals.use_declarefetch && ! stmt->manual_result) { if ( fFetchType != SQL_FETCH_NEXT) { SC_set_error(stmt, STMT_NOT_IMPLEMENTED_ERROR, "Unsupported fetch type for SQLExtendedFetch with UseDeclareFetch option."); return SQL_ERROR; } } SC_clear_error(stmt); if ( ! (res = stmt->result)) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Null statement result in SQLExtendedFetch."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* If a bookmark colunmn is bound but bookmark usage is off, then error */ if (stmt->bookmark.buffer && stmt->options.use_bookmarks == SQL_UB_OFF) { SC_set_error(stmt, STMT_COLNUM_ERROR, "Attempt to retrieve bookmark with bookmark usage disabled"); SC_log_error(func, "", stmt); return SQL_ERROR; } if (stmt->status == STMT_EXECUTING) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Can't fetch while statement is still executing."); SC_log_error(func, "", stmt); return SQL_ERROR; } if (stmt->status != STMT_FINISHED) { SC_set_error(stmt, STMT_STATUS_ERROR, "ExtendedFetch can only be called after the successful execution on a SQL statement"); SC_log_error(func, "", stmt); return SQL_ERROR; } if (stmt->bindings == NULL) { /* just to avoid a crash if the user insists on calling this */ /* function even if SQL_ExecDirect has reported an Error */ SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Bindings were not allocated properly."); SC_log_error(func, "", stmt); return SQL_ERROR; } /* Initialize to no rows fetched */ if (rgfRowStatus) for (i = 0; i < stmt->options.rowset_size; i++) *(rgfRowStatus + i) = SQL_ROW_NOROW; if (pcrow) *pcrow = 0; num_tuples = QR_get_num_tuples(res); /* Save and discard the saved rowset size */ save_rowset_size = stmt->save_rowset_size; stmt->save_rowset_size = -1; switch (fFetchType) { case SQL_FETCH_NEXT: /* From the odbc spec... If positioned before the start of the RESULT SET, then this should be equivalent to SQL_FETCH_FIRST. */ if (stmt->rowset_start < 0) stmt->rowset_start = 0; else { stmt->rowset_start += (save_rowset_size > 0 ? save_rowset_size : stmt->options.rowset_size); } mylog("SQL_FETCH_NEXT: num_tuples=%d, currtuple=%d\n", num_tuples, stmt->currTuple); break; case SQL_FETCH_PRIOR: mylog("SQL_FETCH_PRIOR: num_tuples=%d, currtuple=%d\n", num_tuples, stmt->currTuple); /* From the odbc spec... If positioned after the end of the RESULT SET, then this should be equivalent to SQL_FETCH_LAST. */ if (stmt->rowset_start >= num_tuples) { stmt->rowset_start = num_tuples <= 0 ? 0 : (num_tuples - stmt->options.rowset_size); } else { stmt->rowset_start -= stmt->options.rowset_size; } break; case SQL_FETCH_FIRST: mylog("SQL_FETCH_FIRST: num_tuples=%d, currtuple=%d\n", num_tuples, stmt->currTuple); stmt->rowset_start = 0; break; case SQL_FETCH_LAST: mylog("SQL_FETCH_LAST: num_tuples=%d, currtuple=%d\n", num_tuples, stmt->currTuple); stmt->rowset_start = num_tuples <= 0 ? 0 : (num_tuples - stmt->options.rowset_size) ; break; case SQL_FETCH_ABSOLUTE: mylog("SQL_FETCH_ABSOLUTE: num_tuples=%d, currtuple=%d, irow=%d\n", num_tuples, stmt->currTuple, irow); /* Position before result set, but dont fetch anything */ if (irow == 0) { stmt->rowset_start = -1; stmt->currTuple = -1; return SQL_NO_DATA_FOUND; } /* Position before the desired row */ else if (irow > 0) { stmt->rowset_start = irow - 1; } /* Position with respect to the end of the result set */ else { stmt->rowset_start = num_tuples + irow; } break; case SQL_FETCH_RELATIVE: /* Refresh the current rowset -- not currently implemented, but lie anyway */ if (irow == 0) { break; } stmt->rowset_start += irow; break; case SQL_FETCH_BOOKMARK: stmt->rowset_start = irow - 1; break; default: SC_log_error(func, "Unsupported SQLExtendedFetch Direction", stmt); return SQL_ERROR; } /***********************************/ /* CHECK FOR PROPER CURSOR STATE */ /***********************************/ /* Handle Declare Fetch style specially because the end is not really the end... */ if ( globals.use_declarefetch && ! stmt->manual_result) { if (QR_end_tuples(res)) { return SQL_NO_DATA_FOUND; } } else { /* If *new* rowset is after the result_set, return no data found */ if (stmt->rowset_start >= num_tuples) { stmt->rowset_start = num_tuples; return SQL_NO_DATA_FOUND; } } /* If *new* rowset is prior to result_set, return no data found */ if (stmt->rowset_start < 0) { if (stmt->rowset_start + stmt->options.rowset_size <= 0) { stmt->rowset_start = -1; return SQL_NO_DATA_FOUND; } else { /* overlap with beginning of result set, so get first rowset */ stmt->rowset_start = 0; } } /* currTuple is always 1 row prior to the rowset */ stmt->currTuple = stmt->rowset_start - 1; /* increment the base row in the tuple cache */ QR_set_rowset_size(res, stmt->options.rowset_size); QR_inc_base(res, stmt->last_fetch_count); /* Physical Row advancement occurs for each row fetched below */ mylog("SQLExtendedFetch: new currTuple = %d\n", stmt->currTuple); truncated = error = FALSE; for (i = 0; i < stmt->options.rowset_size; i++) { stmt->bind_row = i; /* set the binding location */ result = SC_fetch(stmt); /* Determine Function status */ if (result == SQL_NO_DATA_FOUND) break; else if (result == SQL_SUCCESS_WITH_INFO) truncated = TRUE; else if (result == SQL_ERROR) error = TRUE; /* Determine Row Status */ if (rgfRowStatus) { if (result == SQL_ERROR) *(rgfRowStatus + i) = SQL_ROW_ERROR; else *(rgfRowStatus + i)= SQL_ROW_SUCCESS; } } /* Save the fetch count for SQLSetPos */ stmt->last_fetch_count= i; /* Reset next binding row */ stmt->bind_row = 0; /* Move the cursor position to the first row in the result set. */ stmt->currTuple = stmt->rowset_start; /* For declare/fetch, need to reset cursor to beginning of rowset */ if (globals.use_declarefetch && ! stmt->manual_result) { QR_set_position(res, 0); } /* Set the number of rows retrieved */ if (pcrow) *pcrow = i; if (i == 0) return SQL_NO_DATA_FOUND; /* Only DeclareFetch should wind up here */ else if (error) return SQL_ERROR; else if (truncated) return SQL_SUCCESS_WITH_INFO; else return SQL_SUCCESS; } /* This determines whether there are more results sets available for */ /* the "hstmt". */ /* CC: return SQL_NO_DATA_FOUND since we do not support multiple result sets */ RETCODE SQL_API SQLMoreResults( HSTMT hstmt) { return SQL_NO_DATA_FOUND; } /* This positions the cursor within a rowset, that was positioned using SQLExtendedFetch. */ /* This will be useful (so far) only when using SQLGetData after SQLExtendedFetch. */ RETCODE SQL_API SQLSetPos( HSTMT hstmt, SQLSETPOSIROW irow, UWORD fOption, UWORD fLock) { static char* const func = "SQLSetPos"; StatementClass *stmt = (StatementClass *) hstmt; QResultClass *res; int num_cols, i; BindInfoClass *bindings = stmt->bindings; if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if (fOption != SQL_POSITION && fOption != SQL_REFRESH) { SC_set_error(stmt, STMT_NOT_IMPLEMENTED_ERROR, "Only SQL_POSITION/REFRESH is supported for SQLSetPos"); SC_log_error(func, "", stmt); return SQL_ERROR; } if ( ! (res = stmt->result)) { SC_set_error(stmt, STMT_SEQUENCE_ERROR, "Null statement result in SQLSetPos."); SC_log_error(func, "", stmt); return SQL_ERROR; } num_cols = QR_NumResultCols(res); if (irow == 0) { SC_set_error(stmt, STMT_ROW_OUT_OF_RANGE, "Driver does not support Bulk operations."); SC_log_error(func, "", stmt); return SQL_ERROR; } if (irow > stmt->last_fetch_count) { SC_set_error(stmt, STMT_ROW_OUT_OF_RANGE, "Row value out of range"); SC_log_error(func, "", stmt); return SQL_ERROR; } irow--; /* Reset for SQLGetData */ for (i = 0; i < num_cols; i++) bindings[i].data_left = -1; QR_set_position(res, irow); stmt->currTuple = stmt->rowset_start + irow; return SQL_SUCCESS; } /* Sets options that control the behavior of cursors. */ SQLRETURN SQLSetScrollOptions( /* Use SQLSetStmtOptions */ SQLHSTMT hstmt, SQLUSMALLINT fConcurrency, SQLLEN crowKeyset, SQLUSMALLINT crowRowset) { static char* const func = "SQLSetScrollOptions"; SC_log_error(func, "Function not implemented", (StatementClass *) hstmt); return SQL_ERROR; } /* Set the cursor name on a statement handle */ RETCODE SQL_API SQLSetCursorName( HSTMT hstmt, UCHAR FAR *szCursor, SWORD cbCursor) { static char* const func="SQLSetCursorName"; StatementClass *stmt = (StatementClass *) hstmt; int len; mylog("SQLSetCursorName: hstmt=%u, szCursor=%u, cbCursorMax=%d\n", hstmt, szCursor, cbCursor); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } len = (cbCursor == SQL_NTS) ? strlen((char*)szCursor) : cbCursor; if (len <= 0 || len > sizeof(stmt->cursor_name) - 1) { SC_set_error(stmt, STMT_INVALID_CURSOR_NAME, "Invalid Cursor Name"); SC_log_error(func, "", stmt); return SQL_ERROR; } strncpy_null((char*)stmt->cursor_name, (char*)szCursor, len+1); return SQL_SUCCESS; } /* Return the cursor name for a statement handle */ RETCODE SQL_API SQLGetCursorName( HSTMT hstmt, UCHAR FAR *szCursor, SWORD cbCursorMax, SWORD FAR *pcbCursor) { static char* const func="SQLGetCursorName"; StatementClass *stmt = (StatementClass *) hstmt; int len = 0; RETCODE result; mylog("SQLGetCursorName: hstmt=%u, szCursor=%u, cbCursorMax=%d, pcbCursor=%u\n", hstmt, szCursor, cbCursorMax, pcbCursor); if ( ! stmt) { SC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } if ( stmt->cursor_name[0] == '\0') { SC_set_error(stmt, STMT_NO_CURSOR_NAME, "No Cursor name available"); SC_log_error(func, "", stmt); return SQL_ERROR; } result = SQL_SUCCESS; len = strlen(stmt->cursor_name); if (szCursor) { strncpy_null((char*)szCursor, (char*)stmt->cursor_name, cbCursorMax); if (len >= cbCursorMax) { result = SQL_SUCCESS_WITH_INFO; SC_set_error(stmt, STMT_TRUNCATED, "The buffer was too small for the result."); } } if (pcbCursor) *pcbCursor = len; return result; } unixODBC-2.3.9/Drivers/Postgre7.1/pgtypes.h0000755000175000017500000000612012262474475015233 00000000000000 /* File: pgtypes.h * * Description: See "pgtypes.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __PGTYPES_H__ #define __PGTYPES_H__ #include "psqlodbc.h" /* the type numbers are defined by the OID's of the types' rows */ /* in table pg_type */ #if 0 #define PG_TYPE_LO ???? /* waiting for permanent type */ #endif #define PG_TYPE_BOOL 16 #define PG_TYPE_BYTEA 17 #define PG_TYPE_CHAR 18 #define PG_TYPE_NAME 19 #define PG_TYPE_INT8 20 #define PG_TYPE_INT2 21 #define PG_TYPE_INT2VECTOR 22 #define PG_TYPE_INT4 23 #define PG_TYPE_REGPROC 24 #define PG_TYPE_TEXT 25 #define PG_TYPE_OID 26 #define PG_TYPE_TID 27 #define PG_TYPE_XID 28 #define PG_TYPE_CID 29 #define PG_TYPE_OIDVECTOR 30 #define PG_TYPE_SET 32 #define PG_TYPE_CHAR2 409 #define PG_TYPE_CHAR4 410 #define PG_TYPE_CHAR8 411 #define PG_TYPE_POINT 600 #define PG_TYPE_LSEG 601 #define PG_TYPE_PATH 602 #define PG_TYPE_BOX 603 #define PG_TYPE_POLYGON 604 #define PG_TYPE_FILENAME 605 #define PG_TYPE_FLOAT4 700 #define PG_TYPE_FLOAT8 701 #define PG_TYPE_ABSTIME 702 #define PG_TYPE_RELTIME 703 #define PG_TYPE_TINTERVAL 704 #define PG_TYPE_UNKNOWN 705 #define PG_TYPE_MONEY 790 #define PG_TYPE_OIDINT2 810 #define PG_TYPE_OIDINT4 910 #define PG_TYPE_OIDNAME 911 #define PG_TYPE_BPCHAR 1042 #define PG_TYPE_VARCHAR 1043 #define PG_TYPE_DATE 1082 #define PG_TYPE_TIME 1083 #define PG_TYPE_DATETIME 1184 #define PG_TYPE_TIMESTAMP 1296 #define PG_TYPE_NUMERIC 1700 #define PG_TYPE_TIMESTAMP_NO_TMZONE 1114 /* extern Int4 pgtypes_defined[]; */ extern Int2 sqlTypes[]; /* Defines for pgtype_precision */ #define PG_STATIC -1 Int4 sqltype_to_pgtype(Int2 fSqlType); Int2 pgtype_to_sqltype(StatementClass *stmt, Int4 type); Int2 pgtype_to_ctype(StatementClass *stmt, Int4 type); char *pgtype_to_name(StatementClass *stmt, Int4 type); /* These functions can use static numbers or result sets(col parameter) */ Int4 pgtype_precision(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as); Int4 pgtype_display_size(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as); Int4 pgtype_length(StatementClass *stmt, Int4 type, int col, int handle_unknown_size_as); Int2 pgtype_scale(StatementClass *stmt, Int4 type, int col); Int2 pgtype_radix(StatementClass *stmt, Int4 type); Int2 pgtype_nullable(StatementClass *stmt, Int4 type); Int2 pgtype_auto_increment(StatementClass *stmt, Int4 type); Int2 pgtype_case_sensitive(StatementClass *stmt, Int4 type); Int2 pgtype_money(StatementClass *stmt, Int4 type); Int2 pgtype_searchable(StatementClass *stmt, Int4 type); Int2 pgtype_unsigned(StatementClass *stmt, Int4 type); char *pgtype_literal_prefix(StatementClass *stmt, Int4 type); char *pgtype_literal_suffix(StatementClass *stmt, Int4 type); char *pgtype_create_params(StatementClass *stmt, Int4 type); Int2 sqltype_to_default_ctype(Int2 sqltype); #endif unixODBC-2.3.9/Drivers/Postgre7.1/tuplelist.h0000755000175000017500000000156212262474475015572 00000000000000 /* File: tuplelist.h * * Description: See "tuplelist.c" * * Important Note: This structure and its functions are ONLY used in building manual result * sets for info functions (SQLTables, SQLColumns, etc.) * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __TUPLELIST_H__ #define __TUPLELIST_H__ #include "psqlodbc.h" struct TupleListClass_ { Int4 num_fields; Int4 num_tuples; TupleNode *list_start, *list_end, *lastref; Int4 last_indexed; }; #define TL_get_num_tuples(x) (x->num_tuples) /* Create a TupleList. Each tuple consits of fieldcnt columns */ TupleListClass *TL_Constructor(UInt4 fieldcnt); void TL_Destructor(TupleListClass *self); void *TL_get_fieldval(TupleListClass *self, Int4 tupleno, Int2 fieldno); char TL_add_tuple(TupleListClass *self, TupleNode *new_field); #endif unixODBC-2.3.9/Drivers/Postgre7.1/Makefile.in0000664000175000017500000005760613725127174015446 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = Drivers/Postgre7.1 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = am_libodbcpsql_la_OBJECTS = bind.lo columninfo.lo connection.lo \ convert.lo dlg_specific.lo drvconn.lo environ.lo execute.lo \ info.lo lobj.lo md5.lo misc.lo options.lo parse.lo pgtypes.lo \ psqlodbc.lo qresult.lo results.lo socket.lo statement.lo \ tuple.lo tuplelist.lo libodbcpsql_la_OBJECTS = $(am_libodbcpsql_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbcpsql_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libodbcpsql_la_LDFLAGS) $(LDFLAGS) -o \ $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbcpsql_la_SOURCES) DIST_SOURCES = $(libodbcpsql_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbcpsql.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcpsql_la_LDFLAGS = \ -version-info 2:0:0 \ -no-undefined \ $(LIBSOCKET) $(LIBNSL) \ -export-dynamic \ -export-symbols @srcdir@/driver.exp \ -module EXTRA_DIST = \ bind.h \ columninfo.h \ connection.h \ convert.h \ dlg_specific.h \ environ.h \ isql.h \ isqlext.h \ lobj.h \ md5.h \ misc.h \ pgtypes.h \ psqlodbc.h \ qresult.h \ resource.h \ socket.h \ statement.h \ tuple.h \ tuplelist.h \ notice.txt \ driver.exp libodbcpsql_la_LIBADD = \ ../../lst/liblstlc.la \ ../../log/libloglc.la \ ../../ini/libinilc.la \ ../../odbcinst/libodbcinstlc.la \ $(LIBLTDL) \ $(LIBADD_CRYPT) $(LIBADD_POW) libodbcpsql_la_DEPENDENCIES = \ ../../lst/liblstlc.la \ ../../log/libloglc.la \ ../../ini/libinilc.la \ ../../odbcinst/libodbcinstlc.la \ ../../extras/libodbcextraslc.la \ $(LTDLDEPS) libodbcpsql_la_SOURCES = \ bind.c \ columninfo.c \ connection.c \ convert.c \ dlg_specific.c \ drvconn.c \ environ.c \ execute.c \ info.c \ lobj.c \ md5.c \ misc.c \ options.c \ parse.c \ pgtypes.c \ psqlodbc.c \ qresult.c \ results.c \ socket.c \ statement.c \ tuple.c \ tuplelist.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Drivers/Postgre7.1/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Drivers/Postgre7.1/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbcpsql.la: $(libodbcpsql_la_OBJECTS) $(libodbcpsql_la_DEPENDENCIES) $(EXTRA_libodbcpsql_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbcpsql_la_LINK) -rpath $(libdir) $(libodbcpsql_la_OBJECTS) $(libodbcpsql_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bind.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/columninfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlg_specific.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drvconn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environ.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lobj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgtypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psqlodbc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qresult.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/results.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tuple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tuplelist.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/Drivers/Postgre7.1/notice.txt0000755000175000017500000000226212262474475015414 00000000000000 /******************************************************************** PSQLODBC.DLL - A library to talk to the PostgreSQL DBMS using ODBC. Copyright (C) 1998; Insight Distribution Systems The code contained in this library is based on code written by Christian Czezatke and Dan McGuirk, (C) 1996. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library (see "license.txt"); if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. How to contact the author: email: byronn@insightdist.com (Byron Nikolaidis) ***********************************************************************/ unixODBC-2.3.9/Drivers/Postgre7.1/environ.h0000755000175000017500000000166012262474475015224 00000000000000 /* File: environ.h * * Description: See "environ.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __ENVIRON_H__ #define __ENVIRON_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "psqlodbc.h" #ifndef WIN32 #include "isql.h" #include "isqlext.h" #else #include #include #include #endif #define ENV_ALLOC_ERROR 1 /********** Environment Handle *************/ struct EnvironmentClass_ { char *errormsg; int errornumber; }; /* Environment prototypes */ EnvironmentClass *EN_Constructor(void); char EN_Destructor(EnvironmentClass *self); char EN_get_error(EnvironmentClass *self, int *number, char **message); char EN_add_connection(EnvironmentClass *self, ConnectionClass *conn); char EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn); void EN_log_error(char *func, char *desc, EnvironmentClass *self); #endif unixODBC-2.3.9/Drivers/Postgre7.1/drvconn.c0000755000175000017500000002171112262474475015207 00000000000000 /* Module: drvconn.c * * Description: This module contains only routines related to * implementing SQLDriverConnect. * * Classes: n/a * * API functions: SQLDriverConnect * * Comments: See "notice.txt" for copyright and license information. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "psqlodbc.h" #include "connection.h" #ifndef WIN32 #include #include #define NEAR #else #include #include #endif #include #ifndef WIN32 #define stricmp(s1,s2) strcasecmp(s1,s2) #define strnicmp(s1,s2,n) strncasecmp(s1,s2,n) #else #include #include #include #include "resource.h" #endif #ifndef TRUE #define TRUE (BOOL)1 #endif #ifndef FALSE #define FALSE (BOOL)0 #endif #include "dlg_specific.h" /* prototypes */ void dconn_get_connect_attributes(UCHAR FAR *connect_string, ConnInfo *ci); #ifdef WIN32 BOOL FAR PASCAL dconn_FDriverConnectProc(HWND hdlg, UINT wMsg, WPARAM wParam, LPARAM lParam); RETCODE dconn_DoDialog(HWND hwnd, ConnInfo *ci); extern HINSTANCE NEAR s_hModule; /* Saved module handle. */ #endif extern GLOBAL_VALUES globals; RETCODE SQL_API SQLDriverConnect( HDBC hdbc, HWND hwnd, UCHAR FAR *szConnStrIn, SWORD cbConnStrIn, UCHAR FAR *szConnStrOut, SWORD cbConnStrOutMax, SWORD FAR *pcbConnStrOut, UWORD fDriverCompletion) { static char* const func = "SQLDriverConnect"; ConnectionClass *conn = (ConnectionClass *) hdbc; ConnInfo *ci; #ifdef WIN32 RETCODE dialog_result; #endif RETCODE result; char connStrIn[MAX_CONNECT_STRING]; char connStrOut[MAX_CONNECT_STRING]; int retval; char salt[5]; char password_required = AUTH_REQ_OK; int len = 0; mylog("%s: entering...\n", func); if ( ! conn) { CC_log_error(func, "", NULL); return SQL_INVALID_HANDLE; } make_string((char*)szConnStrIn, cbConnStrIn, connStrIn); mylog("**** SQLDriverConnect: fDriverCompletion=%d, connStrIn='%s'\n", fDriverCompletion, connStrIn); qlog("conn=%u, SQLDriverConnect( in)='%s', fDriverCompletion=%d\n", conn, connStrIn, fDriverCompletion); ci = &(conn->connInfo); /* Parse the connect string and fill in conninfo for this hdbc. */ dconn_get_connect_attributes((SQLCHAR*)connStrIn, ci); /* If the ConnInfo in the hdbc is missing anything, */ /* this function will fill them in from the registry (assuming */ /* of course there is a DSN given -- if not, it does nothing!) */ getDSNinfo(ci, CONN_DONT_OVERWRITE); /* Fill in any default parameters if they are not there. */ getDSNdefaults(ci); /* initialize pg_version */ CC_initialize_pg_version(conn); salt[0] = '\0'; #ifdef WIN32 dialog: #endif ci->focus_password = password_required; switch(fDriverCompletion) { #ifdef WIN32 case SQL_DRIVER_PROMPT: dialog_result = dconn_DoDialog(hwnd, ci); if(dialog_result != SQL_SUCCESS) { return dialog_result; } break; case SQL_DRIVER_COMPLETE_REQUIRED: /* Fall through */ case SQL_DRIVER_COMPLETE: /* Password is not a required parameter. */ if( ci->username[0] == '\0' || ci->server[0] == '\0' || ci->database[0] == '\0' || ci->port[0] == '\0' || password_required) { dialog_result = dconn_DoDialog(hwnd, ci); if(dialog_result != SQL_SUCCESS) { return dialog_result; } } break; #else case SQL_DRIVER_PROMPT: case SQL_DRIVER_COMPLETE: case SQL_DRIVER_COMPLETE_REQUIRED: #endif case SQL_DRIVER_NOPROMPT: break; } /* Password is not a required parameter unless authentication asks for it. For now, I think it's better to just let the application ask over and over until a password is entered (the user can always hit Cancel to get out) */ if( ci->username[0] == '\0' || ci->server[0] == '\0' || ci->database[0] == '\0' || ci->port[0] == '\0') { /* (password_required && ci->password[0] == '\0')) */ return SQL_NO_DATA_FOUND; } /* do the actual connect */ retval = CC_connect(conn, password_required, salt); if (retval < 0) { /* need a password */ if (fDriverCompletion == SQL_DRIVER_NOPROMPT) { CC_log_error(func, "Need password but Driver_NoPrompt", conn); return SQL_ERROR; /* need a password but not allowed to prompt so error */ } else { #ifdef WIN32 password_required = TRUE; goto dialog; #else return SQL_ERROR; /* until a better solution is found. */ #endif } } else if (retval == 0) { /* error msg filled in above */ CC_log_error(func, "Error from CC_Connect", conn); return SQL_ERROR; } /*********************************************/ /* Create the Output Connection String */ /*********************************************/ result = SQL_SUCCESS; makeConnectString(connStrOut, ci); len = strlen(connStrOut); if(szConnStrOut) { /* Return the completed string to the caller. The correct method is to only construct the connect string if a dialog was put up, otherwise, it should just copy the connection input string to the output. However, it seems ok to just always construct an output string. There are possible bad side effects on working applications (Access) by implementing the correct behavior, anyway. */ strncpy_null((char*)szConnStrOut, connStrOut, cbConnStrOutMax); if (len >= cbConnStrOutMax) { result = SQL_SUCCESS_WITH_INFO; CC_set_error(conn, CONN_TRUNCATED, "The buffer was too small for the result."); } } if(pcbConnStrOut) *pcbConnStrOut = len; mylog("szConnStrOut = '%s'\n", szConnStrOut); qlog("conn=%u, SQLDriverConnect(out)='%s'\n", conn, szConnStrOut); mylog("SQLDRiverConnect: returning %d\n", result); return result; } #ifdef WIN32 RETCODE dconn_DoDialog(HWND hwnd, ConnInfo *ci) { int dialog_result; mylog("dconn_DoDialog: ci = %u\n", ci); if(hwnd) { dialog_result = DialogBoxParam(s_hModule, MAKEINTRESOURCE(DLG_CONFIG), hwnd, dconn_FDriverConnectProc, (LPARAM) ci); if(!dialog_result || (dialog_result == -1)) { return SQL_NO_DATA_FOUND; } else { return SQL_SUCCESS; } } return SQL_ERROR; } BOOL FAR PASCAL dconn_FDriverConnectProc( HWND hdlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { ConnInfo *ci; switch (wMsg) { case WM_INITDIALOG: ci = (ConnInfo *) lParam; /* Change the caption for the setup dialog */ SetWindowText(hdlg, "PostgreSQL Connection"); SetWindowText(GetDlgItem(hdlg, IDC_DATASOURCE), "Connection"); /* Hide the DSN and description fields */ ShowWindow(GetDlgItem(hdlg, IDC_DSNAMETEXT), SW_HIDE); ShowWindow(GetDlgItem(hdlg, IDC_DSNAME), SW_HIDE); ShowWindow(GetDlgItem(hdlg, IDC_DESCTEXT), SW_HIDE); ShowWindow(GetDlgItem(hdlg, IDC_DESC), SW_HIDE); SetWindowLong(hdlg, DWL_USER, lParam);/* Save the ConnInfo for the "OK" */ SetDlgStuff(hdlg, ci); if (ci->database[0] == '\0') ; /* default focus */ else if (ci->server[0] == '\0') SetFocus(GetDlgItem(hdlg, IDC_SERVER)); else if (ci->port[0] == '\0') SetFocus(GetDlgItem(hdlg, IDC_PORT)); else if (ci->username[0] == '\0') SetFocus(GetDlgItem(hdlg, IDC_USER)); else if (ci->focus_password) SetFocus(GetDlgItem(hdlg, IDC_PASSWORD)); break; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { case IDOK: ci = (ConnInfo *) GetWindowLong(hdlg, DWL_USER); GetDlgStuff(hdlg, ci); case IDCANCEL: EndDialog(hdlg, GET_WM_COMMAND_ID(wParam, lParam) == IDOK); return TRUE; case IDC_DRIVER: DialogBoxParam(s_hModule, MAKEINTRESOURCE(DLG_OPTIONS_DRV), hdlg, driver_optionsProc, (LPARAM) NULL); break; case IDC_DATASOURCE: ci = (ConnInfo *) GetWindowLong(hdlg, DWL_USER); DialogBoxParam(s_hModule, MAKEINTRESOURCE(DLG_OPTIONS_DS), hdlg, ds_optionsProc, (LPARAM) ci); break; } } return FALSE; } #endif /* WIN32 */ void dconn_get_connect_attributes(UCHAR FAR *connect_string, ConnInfo *ci) { char *our_connect_string; char *pair, *attribute, *value, *equals; char *strtok_arg; memset(ci, 0, sizeof(ConnInfo)); our_connect_string = strdup((char*)connect_string); strtok_arg = our_connect_string; mylog("our_connect_string = '%s'\n", our_connect_string); while(1) { pair = strtok(strtok_arg, ";"); if(strtok_arg) { strtok_arg = 0; } if(!pair) { break; } equals = strchr(pair, '='); if ( ! equals) continue; *equals = '\0'; attribute = pair; /* ex. DSN */ value = equals + 1; /* ex. 'CEO co1' */ mylog("attribute = '%s', value = '%s'\n", attribute, value); if( !attribute || !value) continue; /* Copy the appropriate value to the conninfo */ copyAttributes(ci, attribute, value); } free(our_connect_string); } unixODBC-2.3.9/Drivers/Postgre7.1/driver.exp0000755000175000017500000000137512262474475015407 00000000000000SQLAllocConnect SQLAllocEnv SQLAllocStmt SQLBindCol SQLBindParameter SQLBrowseConnect SQLCancel SQLColAttributes SQLColumnPrivileges SQLColumns SQLConnect SQLDescribeCol SQLDescribeParam SQLDisconnect SQLDriverConnect SQLError SQLExecDirect SQLExecute SQLExtendedFetch SQLFetch SQLForeignKeys SQLFreeConnect SQLFreeEnv SQLFreeStmt SQLGetConnectOption SQLGetCursorName SQLGetData SQLGetFunctions SQLGetInfo SQLGetStmtOption SQLGetTypeInfo SQLMoreResults SQLNativeSql SQLNumParams SQLNumResultCols SQLParamData SQLParamOptions SQLPrepare SQLPrimaryKeys SQLProcedureColumns SQLProcedures SQLPutData SQLRowCount SQLSetConnectOption SQLSetCursorName SQLSetPos SQLSetScrollOptions SQLSetStmtOption SQLSpecialColumns SQLStatistics SQLTablePrivileges SQLTables SQLTransact unixODBC-2.3.9/Drivers/Postgre7.1/columninfo.c0000755000175000017500000000765012262474475015715 00000000000000 /* Module: columninfo.c * * Description: This module contains routines related to * reading and storing the field information from a query. * * Classes: ColumnInfoClass (Functions prefix: "CI_") * * API functions: none * * Comments: See "notice.txt" for copyright and license information. * */ #include #include "columninfo.h" #include "connection.h" #include "socket.h" #include #include ColumnInfoClass * CI_Constructor() { ColumnInfoClass *rv; rv = (ColumnInfoClass *) malloc(sizeof(ColumnInfoClass)); if (rv) { rv->num_fields = 0; rv->name = NULL; rv->adtid = NULL; rv->adtsize = NULL; rv->display_size = NULL; rv->atttypmod = NULL; } return rv; } void CI_Destructor(ColumnInfoClass *self) { if ( self ) { CI_free_memory(self); free(self); } } /* Read in field descriptions. If self is not null, then also store the information. If self is null, then just read, don't store. */ char CI_read_fields(ColumnInfoClass *self, ConnectionClass *conn) { Int2 lf; int new_num_fields; Oid new_adtid; Int2 new_adtsize; Int4 new_atttypmod = -1; char new_field_name[MAX_MESSAGE_LEN+1]; SocketClass *sock; ConnInfo *ci; sock = CC_get_socket(conn); ci = &conn->connInfo; /* at first read in the number of fields that are in the query */ new_num_fields = (Int2) SOCK_get_int(sock, sizeof(Int2)); mylog("num_fields = %d\n", new_num_fields); if (self) { /* according to that allocate memory */ CI_set_num_fields(self, new_num_fields); } /* now read in the descriptions */ for(lf = 0; lf < new_num_fields; lf++) { SOCK_get_string(sock, new_field_name, MAX_MESSAGE_LEN); new_adtid = (Oid) SOCK_get_int(sock, 4); new_adtsize = (Int2) SOCK_get_int(sock, 2); /* If 6.4 protocol, then read the atttypmod field */ if (PG_VERSION_GE(conn, 6.4)) { mylog("READING ATTTYPMOD\n"); new_atttypmod = (Int4) SOCK_get_int(sock, 4); /* Subtract the header length */ new_atttypmod -= 4; if (new_atttypmod < 0) new_atttypmod = -1; } mylog("CI_read_fields: fieldname='%s', adtid=%d, adtsize=%d, atttypmod=%d\n", new_field_name, new_adtid, new_adtsize, new_atttypmod); if (self) CI_set_field_info(self, lf, new_field_name, new_adtid, new_adtsize, new_atttypmod); } return (SOCK_get_errcode(sock) == 0); } void CI_free_memory(ColumnInfoClass *self) { register Int2 lf; int num_fields = self->num_fields; for (lf = 0; lf < num_fields; lf++) { if (self->name[lf]) { free(self->name[lf]); self->name[lf] = NULL; } } /* Safe to call even if null */ self->num_fields = 0; if (self->name) free(self->name); self->name = NULL; if (self->adtid) free(self->adtid); self->adtid = NULL; if (self->adtsize) free(self->adtsize); self->adtsize = NULL; if (self->display_size) free(self->display_size); self->display_size = NULL; if (self->atttypmod) free(self->atttypmod); self->atttypmod = NULL; } void CI_set_num_fields(ColumnInfoClass *self, int new_num_fields) { CI_free_memory(self); /* always safe to call */ self->num_fields = new_num_fields; self->name = (char **) malloc (sizeof(char *) * self->num_fields); self->adtid = (Oid *) malloc (sizeof(Oid) * self->num_fields); self->adtsize = (Int2 *) malloc (sizeof(Int2) * self->num_fields); self->display_size = (Int2 *) malloc(sizeof(Int2) * self->num_fields); self->atttypmod = (Int4 *) malloc(sizeof(Int4) * self->num_fields); } void CI_set_field_info(ColumnInfoClass *self, int field_num, char *new_name, Oid new_adtid, Int2 new_adtsize, Int4 new_atttypmod) { /* check bounds */ if((field_num < 0) || (field_num >= self->num_fields)) { return; } /* store the info */ self->name[field_num] = strdup(new_name); self->adtid[field_num] = new_adtid; self->adtsize[field_num] = new_adtsize; self->atttypmod[field_num] = new_atttypmod; self->display_size[field_num] = 0; } unixODBC-2.3.9/Drivers/Postgre7.1/convert.h0000755000175000017500000000300612262474475015220 00000000000000 /* File: convert.h * * Description: See "convert.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __CONVERT_H__ #define __CONVERT_H__ #include "psqlodbc.h" /* copy_and_convert results */ #define COPY_OK 0 #define COPY_UNSUPPORTED_TYPE 1 #define COPY_UNSUPPORTED_CONVERSION 2 #define COPY_RESULT_TRUNCATED 3 #define COPY_GENERAL_ERROR 4 #define COPY_NO_DATA_FOUND 5 typedef struct { int m; int d; int y; int hh; int mm; int ss; } SIMPLE_TIME; int copy_and_convert_field_bindinfo(StatementClass *stmt, Int4 field_type, void *value, int col); int copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 fCType, PTR rgbValue, SDWORD cbValueMax, SQLLEN *pcbValue); int copy_statement_with_parameters(StatementClass *stmt); char *convert_escape(char *value); char *convert_money(char *s); char parse_datetime(char *buf, SIMPLE_TIME *st); int convert_linefeeds(char *s, char *dst, size_t max); char *convert_special_chars(char *si, char *dst, int used); int convert_pgbinary_to_char(char *value, char *rgbValue, int cbValueMax); int convert_from_pgbinary(unsigned char *value, unsigned char *rgbValue, int cbValueMax); int convert_to_pgbinary(unsigned char *in, char *out, int len); void encode(char *in, char *out); void decode(char *in, char *out); int convert_lo(StatementClass *stmt, void *value, Int2 fCType, PTR rgbValue, SDWORD cbValueMax, SDWORD *pcbValue); #endif unixODBC-2.3.9/Drivers/Postgre7.1/Makefile.am0000755000175000017500000000230412262756061015415 00000000000000lib_LTLIBRARIES = libodbcpsql.la AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) libodbcpsql_la_LDFLAGS = \ -version-info 2:0:0 \ -no-undefined \ $(LIBSOCKET) $(LIBNSL) \ -export-dynamic \ -export-symbols @srcdir@/driver.exp \ -module EXTRA_DIST = \ bind.h \ columninfo.h \ connection.h \ convert.h \ dlg_specific.h \ environ.h \ isql.h \ isqlext.h \ lobj.h \ md5.h \ misc.h \ pgtypes.h \ psqlodbc.h \ qresult.h \ resource.h \ socket.h \ statement.h \ tuple.h \ tuplelist.h \ notice.txt \ driver.exp libodbcpsql_la_LIBADD = \ ../../lst/liblstlc.la \ ../../log/libloglc.la \ ../../ini/libinilc.la \ ../../odbcinst/libodbcinstlc.la \ $(LIBLTDL) \ $(LIBADD_CRYPT) $(LIBADD_POW) libodbcpsql_la_DEPENDENCIES = \ ../../lst/liblstlc.la \ ../../log/libloglc.la \ ../../ini/libinilc.la \ ../../odbcinst/libodbcinstlc.la \ ../../extras/libodbcextraslc.la \ $(LTDLDEPS) libodbcpsql_la_SOURCES = \ bind.c \ columninfo.c \ connection.c \ convert.c \ dlg_specific.c \ drvconn.c \ environ.c \ execute.c \ info.c \ lobj.c \ md5.c \ misc.c \ options.c \ parse.c \ pgtypes.c \ psqlodbc.c \ qresult.c \ results.c \ socket.c \ statement.c \ tuple.c \ tuplelist.c unixODBC-2.3.9/Drivers/Postgre7.1/misc.h0000755000175000017500000000466212262474475014504 00000000000000 /* File: misc.h * * Description: See "misc.c" * * Comments: See "notice.txt" for copyright and license information. * */ #ifndef __MISC_H__ #define __MISC_H__ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef WIN32 #ifdef UNIXODBC # include #else # include "gpps.h" # define SQLGetPrivateProfileString(a,b,c,d,e,f) GetPrivateProfileString(a,b,c,d,e,f) # endif #endif #include /* Uncomment MY_LOG define to compile in the mylog() statements. Then, debug logging will occur if 'Debug' is set to 1 in the ODBCINST.INI portion of the registry. You may have to manually add this key. This logfile is intended for development use, not for an end user! */ #define MY_LOG /* Uncomment Q_LOG to compile in the qlog() statements (Communications log, i.e. CommLog). This logfile contains serious log statements that are intended for an end user to be able to read and understand. It is controlled by the 'CommLog' flag in the ODBCINST.INI portion of the registry (see above), which is manipulated on the setup/connection dialog boxes. */ #define Q_LOG #ifdef MY_LOG #define MYLOGFILE "mylog_" #ifndef WIN32 #define MYLOGDIR "/tmp" #else #define MYLOGDIR "c:" #endif extern void mylog(char * fmt, ...); #else #ifndef WIN32 #define mylog(args...) /* GNU convention for variable arguments */ #else #define mylog /* mylog */ #endif #endif #ifdef Q_LOG #define QLOGFILE "psqlodbc_" #ifndef WIN32 #define QLOGDIR "/tmp" #else #define QLOGDIR "c:" #endif extern void qlog(char * fmt, ...); #else #ifndef WIN32 #define qlog(args...) /* GNU convention for variable arguments */ #else #define qlog /* qlog */ #endif #endif #ifndef WIN32 #define DIRSEPARATOR "/" #else #define DIRSEPARATOR "\\" #endif #ifdef WIN32 #define PG_BINARY O_BINARY #define PG_BINARY_R "rb" #define PG_BINARY_W "wb" #else #define PG_BINARY 0 #define PG_BINARY_R "r" #define PG_BINARY_W "w" #endif void remove_newlines(char *string); char *strncpy_null(char *dst, const char *src, int len); char *trim(char *string); char *make_string(char *s, int len, char *buf); char *my_strcat(char *buf, char *fmt, char *s, int len); int my_strlen(char *s, int len); /* defines for return value of my_strcpy */ #define STRCPY_SUCCESS 1 #define STRCPY_FAIL 0 #define STRCPY_TRUNCATED -1 #define STRCPY_NULL -2 int my_strcpy(char *dst, int dst_len, char *src, int src_len); #endif unixODBC-2.3.9/Drivers/Makefile.in0000664000175000017500000004673713725127174013600 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = Drivers ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = Postgre7.1 template MiniSQL nn am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \ README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @DRIVERS_TRUE@SUBDIRS = \ @DRIVERS_TRUE@ Postgre7.1 \ @DRIVERS_TRUE@ template \ @DRIVERS_TRUE@ MiniSQL \ @DRIVERS_TRUE@ nn all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Drivers/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Drivers/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/Drivers/nn/0000775000175000017500000000000013725127521012201 500000000000000unixODBC-2.3.9/Drivers/nn/SQLNumResultCols.c0000755000175000017500000000172212262474475015437 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLNumResultCols( HSTMT hstmt, SWORD* pccol ) { stmt_t* pstmt = hstmt; UNSET_ERROR( pstmt->herr ); if ( pccol ) { int ncol; ncol = nnsql_getcolnum(((stmt_t*)hstmt)->yystmt); *pccol = (ncol)? ncol-1:0; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/nntp.h0000755000175000017500000000525012262474475013264 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _NNTP_H # define _NNTP_H /* part of useful nntp response code */ # define NNTP_POST_CONN_OK 200 # define NNTP_READ_CONN_OK 201 # define NNTP_SLAVE_CONN_OK 202 # define NNTP_QUIT_OK 205 # define NNTP_GROUP_OK 211 # define NNTP_LIST_OK 215 # define NNTP_ARTICLE_OK 220 # define NNTP_HEAD_OK 221 # define NNTP_XHDR_OK NNTP_HEAD_OK # define NNTP_BODY_OK 222 # define NNTP_NEXT_OK 223 # define NNTP_LAST_OK NNTP_NEXT_OK # define NNTP_NEWMSG_OK 230 # define NNTP_NEWGRP_OK 231 # define NNTP_POST_OK 240 # define NNTP_POSTING 340 # define NNTP_SERVICE_DOWN 400 # define NNTP_INVALID_GROUP 411 # define NNTP_NOT_IN_GROUP 412 # define NNTP_NOT_IN_ARTICLE 420 # define NNTP_END_OF_GROUP 421 # define NNTP_TOP_OF_GROUP 422 # define NNTP_INVALID_MSGNUM 423 # define NNTP_INVALID_MSGID 430 # define NNTP_UNWANTED_MSG 435 # define NNTP_REJECTED_MSG 437 # define NNTP_CANNOT_POST 440 # define NNTP_POSTING_FAILED 441 # define BODY_CHUNK_SIZE 4096 # define XHDR_CHUNK_SIZE 4096 # define NNTP_HEADER_CHUNK 128 extern void* nntp_connect ( char* server ); extern void nntp_close ( void* hcndes ); extern int nntp_group ( void* hcndes, char* grp); extern int nntp_next ( void* hcndes ); extern int nntp_last ( void* hcndes ); extern int nntp_errcode ( void* hcndes ); extern char* nntp_errmsg ( void* hcndes ); extern void* nntp_openheader ( void* hcndes, char* header, long* tmin, long* tmax ); extern int nntp_fetchheader( void* hhead, long* article_num, long* data, void* hrh ); extern void nntp_closeheader( void* hhead ); extern char* nntp_body ( void* hcndes, long artnum, char* artid); extern int nntp_start_post ( void* hcndes ); extern int nntp_send_head ( void* hcndes, char* header_name, char* header ); extern int nntp_end_head ( void* hcndes ); extern int nntp_send_body ( void* hcndes, char* body); extern int nntp_end_post ( void* hcndes ); extern int nntp_cancel ( void* hcndes, char* group, char* sender, char* from, char* msgid); extern int nntp_getaccmode( void* hcndes ); extern void nntp_setaccmode( void* hcndes, int mode ); #endif unixODBC-2.3.9/Drivers/nn/nncol.c0000755000175000017500000000342312262474475013411 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include #include #include "nncol.ci" int nnsql_getcolidxbyname( char* col_name ) { int i; for( i= 0; nncol_info_tab[i].idx != en_sql_count; i++ ) { if(upper_strneq( col_name, nncol_info_tab[i].name, 16)) return nncol_info_tab[i].idx; } return -1; } char* nnsql_getcolnamebyidx( int idx ) { int i; if( nncol_info_tab[idx].idx == idx ) return nncol_info_tab[idx].name; for(i=0; nncol_info_tab[i].idx != en_sql_count;i++) { if( nncol_info_tab[i].idx == idx ) return nncol_info_tab[i].name; } return 0; } void* nnsql_getcoldescbyidx( int idx ) { int i; if( nncol_info_tab[idx].idx == idx ) return &(nncol_info_tab[idx]); for(i=0; iname; } int nnsql_getcoldatatypebydesc( void* hdesc ) { col_desc_t* desc = hdesc; return desc->datatype; } int nnsql_getcolnullablebydesc( void* hdesc ) { col_desc_t* desc = hdesc; return desc->nullable; } unixODBC-2.3.9/Drivers/nn/yyerr.c0000755000175000017500000000266112262474475013455 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include #include "driver.h" #include "yyerr.ci" int nnsql_errcode(void* yystmt) { if( ! yystmt ) return -1; return ((yystmt_t*)yystmt)->errcode; } char* nnsql_errmsg(void* yystmt) { yystmt_t* pstmt = yystmt; int i, errcode; errcode = nnsql_errcode( yystmt ); switch( errcode ) { case 0: return nntp_errmsg(pstmt->hcndes); case -1: if( nntp_errcode(pstmt->hcndes) ) return nntp_errmsg(pstmt->hcndes); else return strerror( errno ); case PARSER_ERROR: return ((yystmt_t*)yystmt)->msgbuf; default: break; } for(i=0; ierrpos; } unixODBC-2.3.9/Drivers/nn/prepare.c0000755000175000017500000000401012262474475013727 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" void* nnodbc_getstmterrstack(void* hstmt) { return ((stmt_t*)hstmt)->herr; } int nnodbc_sqlfreestmt( void* hstmt, int fOption) { stmt_t* pstmt = hstmt; int i, max; switch( fOption ) { case SQL_DROP: nnodbc_detach_stmt(pstmt->hdbc, hstmt); /* free all resources */ MEM_FREE(pstmt->pcol); MEM_FREE(pstmt->ppar); CLEAR_ERROR(pstmt->herr); MEM_FREE(hstmt); break; case SQL_CLOSE: nnsql_close_cursor(hstmt); break; case SQL_UNBIND: max = nnsql_max_column(); for(i=0; pstmt->pcol && i < max + 1; i++ ) (pstmt->pcol)[i].userbuf = 0; break; case SQL_RESET_PARAMS: max = nnsql_max_param(); for(i=1;pstmt->ppar && i < max + 1; i++ ) { nnsql_yyunbindpar( pstmt->yystmt, i); (pstmt->ppar)[i-1].bind = 0; } break; default: /* this error will be caught by driver manager */ return SQL_ERROR; } return SQL_SUCCESS; } int nnodbc_sqlprepare ( void* hstmt, char* szSqlStr, int cbSqlStr ) { stmt_t* pstmt = hstmt; int len; len = (cbSqlStr == SQL_NTS )? STRLEN(szSqlStr):cbSqlStr; if ( nnsql_prepare(pstmt->yystmt, szSqlStr, len ) ) { int code; code = nnsql_errcode(pstmt->yystmt); if ( code == -1 ) code = errno; PUSHSYSERR( pstmt->herr, code, nnsql_errmsg(pstmt->yystmt) ); return SQL_ERROR; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLSetParam.c0000755000175000017500000000225412262474475014375 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLSetParam ( HSTMT hstmt, UWORD ipar, SWORD fCType, SWORD fSqlType, UDWORD cbColDef, SWORD ibScale, PTR rgbValue, SDWORD FAR *pcbValue) { return SQLBindParameter(hstmt, ipar, (SWORD)SQL_PARAM_INPUT_OUTPUT, fCType, fSqlType, cbColDef, ibScale, rgbValue, SQL_SETPARAM_VALUE_MAX, pcbValue ); } unixODBC-2.3.9/Drivers/nn/connect.h0000755000175000017500000000177112262474475013742 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _CONNECT_H # define _CONNECT_H extern int nnodbc_attach_stmt(void* hdbc, void* hstmt); extern int nnodbc_detach_stmt(void* hdbc, void* hstmt); extern void* nnodbc_getenverrstack(void* henv); extern void* nnodbc_getdbcerrstack(void* hdbc); extern void nnodbc_pushdbcerr(void* hdbc, int code, char* msg); extern void* nnodbc_getnntpcndes(void* hdbc); #endif unixODBC-2.3.9/Drivers/nn/nndate.h0000755000175000017500000000161012262474475013552 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _NN_DATE_H # define _NN_DATE_H typedef struct { int year; int month; int day; } date_t; extern int nnsql_odbcdatestr2date(char*, date_t*); extern int nnsql_nndatestr2date(char*, date_t*); extern int nnsql_datecmp(date_t*, date_t*); #endif unixODBC-2.3.9/Drivers/nn/execute.c0000755000175000017500000000624212262474475013744 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" int sqlputdata ( stmt_t* pstmt, int ipar, char* data ) { param_t* ppar; ppar = pstmt->ppar + ipar - 1; switch( ppar->sqltype ) { case SQL_CHAR: case SQL_VARCHAR: case SQL_LONGVARCHAR: if( ! data ) nnsql_putnull(pstmt->yystmt, ipar ); else nnsql_putstr(pstmt->yystmt, ipar, (char*)data); break; case SQL_TINYINT: case SQL_SMALLINT: case SQL_INTEGER: nnsql_putnum(pstmt->yystmt, ipar, (long)data); break; case SQL_DATE: if(!data ) nnsql_putnull(pstmt->yystmt, ipar ); else nnsql_putdate(pstmt->yystmt, ipar, (date_t*)data); break; default: return -1; } return 0; } int sqlexecute ( stmt_t* pstmt) { param_t* ppar = pstmt->ppar; int i, npar, flag = 0; long csize; pstmt->refetch = 0; pstmt->ndelay = 0; npar = nnsql_getparnum(pstmt->yystmt); for( i = 0; ppar && i< npar; i++ ) /* general check */ { ppar = pstmt->ppar + i; if( ! ppar->bind ) { PUSHSQLERR( pstmt->herr, en_07001 ); return SQL_ERROR; } if( ( ! ppar->userbuf && ppar->pdatalen ) || ( ppar->userbuf && ppar->pdatalen && *ppar->pdatalen < 0 && *ppar->pdatalen != SQL_NTS ) ) { if( *ppar->pdatalen || *ppar->pdatalen == (long)SQL_NULL_DATA || *ppar->pdatalen == (long)SQL_DATA_AT_EXEC || *ppar->pdatalen <= (long)SQL_LEN_DATA_AT_EXEC(0) ) continue; PUSHSQLERR( pstmt->herr, en_S1090 ); return SQL_ERROR; } } for( i = 0; ppar && i< npar; i++ ) { char* (*cvt)(); date_t date; char* data; ppar = pstmt->ppar + i; if( ! ppar->pdatalen ) csize = 0; else csize = *(ppar->pdatalen); if( csize == (long)SQL_NULL_DATA ) { nnsql_putnull(pstmt->yystmt, i+1); continue; } if( csize == (long)SQL_DATA_AT_EXEC || csize <= (long)SQL_LEN_DATA_AT_EXEC(0) ) /* delated parameter */ { pstmt->ndelay ++; ppar->need = 1; continue; } cvt = ppar->cvt; data= cvt(ppar->userbuf, csize, &date ); if( data == (char*)(-1) ) { PUSHSQLERR(pstmt->herr, en_S1000 ); return SQL_ERROR; } sqlputdata(pstmt, i+1, data); } if( pstmt->ndelay ) return SQL_NEED_DATA; if( nnsql_execute(pstmt->yystmt) ) { int code; code = nnsql_errcode( pstmt->yystmt ); if( code == -1 ) code = errno; PUSHSYSERR( pstmt->herr, code, nnsql_errmsg(pstmt->yystmt)); return SQL_ERROR; } if( ! nnsql_getcolnum(pstmt->yystmt) && nnsql_getrowcount(pstmt->yystmt) > 1 ) { PUSHSQLERR( pstmt->herr, en_01S04); return SQL_SUCCESS_WITH_INFO; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLExecute.c0000755000175000017500000000150212262474475014256 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLExecute ( HSTMT hstmt ) { stmt_t* pstmt = hstmt; UNSET_ERROR( pstmt->herr ); return sqlexecute(hstmt); } unixODBC-2.3.9/Drivers/nn/yyerr.ci0000755000175000017500000000357312262474475013631 00000000000000#include static struct { int errcode; char* msg; } yy_errmsg[] = { PARSER_ERROR, 0, INVALID_COLUMN_NAME, NNSQL_ERRHEAD "Invalid column name", NOT_SUPPORT_UPDATEABLE_CURSOR, NNSQL_ERRHEAD "Don't support update cursor", NOT_SUPPORT_DISTINCT_SELECT, NNSQL_ERRHEAD "Don't support distinct select", NOT_SUPPORT_MULTITABLE_QUERY, NNSQL_ERRHEAD "Don't support multi-table query", NOT_SUPPORT_GROUP_CLAUSE, NNSQL_ERRHEAD "Don't support GROUP clause", NOT_SUPPORT_HAVING_CLAUSE, NNSQL_ERRHEAD "Don't support HAVING condition", NOT_SUPPORT_ORDER_CLAUSE, NNSQL_ERRHEAD "Don't support ORDER clause", NOT_SUPPORT_DDL_DCL, NNSQL_ERRHEAD "Don't support DDL and DCL", NOT_SUPPORT_UPDATE, NNSQL_ERRHEAD "Don't support UPDATE", NOT_SUPPORT_POSITION_DELETE, NNSQL_ERRHEAD "Don't support position DELETE", TOO_MANY_COLUMNS, NNSQL_ERRHEAD "Too many columns in select list", NOT_SUPPORT_SPROC, NNSQL_ERRHEAD "Don't support stored procedure feature", VARIABLE_IN_SELECT_LIST, NNSQL_ERRHEAD "A variable was used in select list", VARIABLE_IN_TABLE_LIST, NNSQL_ERRHEAD "A variable was used in table list", UNSEARCHABLE_ATTR, NNSQL_ERRHEAD "Unsearchable column was used in " "searching condition", INSERT_VALUE_LESS, NNSQL_ERRHEAD "Number of values less than number of " "columns in insert statement", INSERT_VALUE_MORE, NNSQL_ERRHEAD "Number of values more than number of " "columns in insert statement", POST_WITHOUT_BODY, NNSQL_ERRHEAD "Try to post a article without body", NO_POST_PRIVILEGE, NNSQL_ERRHEAD "No INSERT and DELETE privilege as " "server not accept POST", NO_INSERT_PRIVILEGE, NNSQL_ERRHEAD "No INSERT privilege", NO_DELETE_PRIVILEGE, NNSQL_ERRHEAD "No DELETE privilege on any groups", NO_DELETE_ANY_PRIVILEGE, NNSQL_ERRHEAD "No DELETE privilege on non-test groups", TYPE_VIOLATION, NNSQL_ERRHEAD "Restricted data type attribute violation" }; unixODBC-2.3.9/Drivers/nn/SQLNumParams.c0000755000175000017500000000163212262474475014563 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLNumParams( HSTMT hstmt, SWORD *pcpar ) { stmt_t* pstmt = hstmt; UNSET_ERROR( pstmt->herr ); if ( pcpar ) *pcpar = nnsql_getparnum( ((stmt_t*)hstmt)->yystmt ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/yyenv.h0000755000175000017500000000245312262474475013461 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _YYENV_H # define _YYENV_H # include typedef struct { int extlevel; /* {} block nest level */ int errpos; /* error position */ int scanpos; /* current position */ char* texts_bufptr; int dummy_npar; /* total number of dummy parameters */ yystmt_t* pstmt; } yyenv_t; /* it is unlikely we will exceed bison's default init stack depth YYINITDEPTH, * i.e. 200. Thus, for system/compiler which not support alloca(), we simply * set it to null and make a bit larger init stack depth for more safty. */ # if defined(__hpux) && !defined (alloca) && !defined(__GNUC__) # define alloca(size) (0) # define YYINITDEPTH (512) # endif #endif unixODBC-2.3.9/Drivers/nn/SQLConnect.c0000755000175000017500000000251112262474475014246 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLConnect( HDBC hdbc, UCHAR* szDSN, SWORD cbDSN, UCHAR* szUID, SWORD cbUID, UCHAR* szAuthStr, SWORD cbAuthStr) { dbc_t* pdbc = hdbc; char* ptr; char buf[64]; UNSET_ERROR( pdbc->herr ); ptr = (char*)getkeyvalbydsn( (char*)szDSN, cbDSN, "Server", buf, sizeof(buf)); if ( ! ptr ) { PUSHSQLERR( pdbc->herr, en_IM002 ); return SQL_ERROR; } pdbc->hcndes = nntp_connect(ptr); if ( ! pdbc->hcndes ) { PUSHSQLERR( pdbc->herr, en_08001 ); PUSHSYSERR( pdbc->herr, errno, nntp_errmsg(0)); return SQL_ERROR; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/yyparse.tab.h0000755000175000017500000000247312262474475014552 00000000000000typedef union { char* qstring; char* name; long number; int ipar; /* parameter index */ int cmpop; /* for comparsion operators */ char esc; int flag; /* for not_opt and case_opt */ int idx; void* offset; /* actually, it is used as a 'int' offset */ node_t node; /* a node haven't add to tree */ } YYSTYPE; #define kwd_select 258 #define kwd_all 259 #define kwd_news 260 #define kwd_xnews 261 #define kwd_distinct 262 #define kwd_count 263 #define kwd_from 264 #define kwd_where 265 #define kwd_in 266 #define kwd_between 267 #define kwd_like 268 #define kwd_escape 269 #define kwd_group 270 #define kwd_by 271 #define kwd_having 272 #define kwd_order 273 #define kwd_for 274 #define kwd_insert 275 #define kwd_into 276 #define kwd_values 277 #define kwd_delete 278 #define kwd_update 279 #define kwd_create 280 #define kwd_alter 281 #define kwd_drop 282 #define kwd_table 283 #define kwd_column 284 #define kwd_view 285 #define kwd_index 286 #define kwd_of 287 #define kwd_current 288 #define kwd_grant 289 #define kwd_revoke 290 #define kwd_is 291 #define kwd_null 292 #define kwd_call 293 #define kwd_uncase 294 #define kwd_case 295 #define kwd_fn 296 #define kwd_d 297 #define QSTRING 298 #define NUM 299 #define NAME 300 #define PARAM 301 #define kwd_or 302 #define kwd_and 303 #define kwd_not 304 #define CMPOP 305 unixODBC-2.3.9/Drivers/nn/nnconfig.h0000644000175000017500000000705013273041464014072 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _NNCONFIG_H #define _NNCONFIG_H # if !defined(WINDOWS) && !defined(WIN32_SYSTEM) # define _UNIX_ # include # include # include # include # define MEM_ALLOC(size) (malloc((size_t)(size))) # define MEM_FREE(ptr) {if(ptr) free(ptr);} # define MEM_REALLOC(ptr, size) (ptr? realloc(ptr, size):malloc(size)) # define STRCPY(t, s) (strcpy((char*)(t), (char*)(s))) # define STRNCPY(t,s,n) (strncpy((char*)(t), (char*)(s), (size_t)(n))) # define STRCAT(t, s) (strcat((char*)(t), (char*)(s))) # define STRNCAT(t,s,n) (strncat((char*)(t), (char*)(s), (size_t)(n))) # define STRCMP(a, b) strcmp((char*)(a), (char*)(b)) # define STRNCMP(a,b,n) strncmp((char*)(a), (char*)(b), n) # define STREQ(a, b) (strcmp((char*)(a), (char*)(b)) == 0) # define STRNEQ(a,b,n) (strncmp((char*)(a), (char*)(b), n)==0) # define STRLEN(str) ((str)? strlen((char*)(str)):0) # define MEM_SET(p,c,n) (memset((char*)p, (int)c, (int)n)) # define EXPORT # define CALLBACK # define FAR typedef signed short SSHORT; typedef short WORD; typedef long DWORD; typedef WORD WPARAM; typedef DWORD LPARAM; typedef void* HWND; typedef int BOOL; # endif /* _UNIX_ */ /* for nntp driver */ # ifdef WINSOCK # define SOCK_CLOSE(sd) closesocket(sock) # define SOCK_FDOPEN(fd, mode) wsa_fdopen(fd, mode) # define SOCK_FCLOSE(stream) wsa_fclose(stream) # define SOCK_FGETS(buf, size, stream) wsa_fgets(buf, size, stream) # define SOCK_FPUTS(str, stream) wsa_fputs(str, stream) # define SOCK_FPRINTF wsa_fprintf # define SOCK_FFLUSH(stream) wsa_fflush(stream) # else # include # define SOCK_CLOSE(sd) close(sd) # define SOCK_FDOPEN(fd, mode) fdopen(fd, mode) # define SOCK_FCLOSE(stream) fclose(stream) # define SOCK_FGETS(buf, size, stream) fgets(buf, size, stream) # define SOCK_FPUTS(str, stream) fputs(str, stream) # define SOCK_FPRINTF fprintf # define SOCK_FFLUSH(stream) fflush(stream) # endif # if defined(WINDOWS) || defined(WIN32_SYSTEM) # include # include # ifdef _MSVC_ # define MEM_ALLOC(size) (fmalloc((size_t)(size))) # define MEM_FREE(ptr) ((ptr)? ffree((PTR)(ptr)):0)) # define STRCPY(t, s) (fstrcpy((char FAR*)(t), (char FAR*)(s))) # define STRNCPY(t,s,n) (fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) # define STRLEN(str) ((str)? fstrlen((char FAR*)(str)):0) # define STREQ(a, b) (fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) # endif # ifdef _BORLAND_ # define MEM_ALLOC(size) (farmalloc((unsigned long)(size)) # define MEM_FREE(ptr) ((ptr)? farfree((void far*)(ptr)):0) # define STRCPY(t, s) (_fstrcpy((char FAR*)(t), (char FAR*)(s))) # define STRNCPY(t,s,n) (_fstrncpy((char FAR*)(t), (char FAR*)(s), (size_t)(n))) # define STRLEN(str) ((str)? _fstrlen((char FAR*)(str)):0) # define STREQ(a, b) (_fstrcmp((char FAR*)(a), (char FAR*)(b) == 0) # endif # endif /* WINDOWS */ #endif unixODBC-2.3.9/Drivers/nn/nntp.c0000755000175000017500000003411512262474475013261 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include #include #include #include # include "nntp.ci" #ifndef WINSOCK # include # include # include # include #else # include #endif #include typedef struct { long article_num; long data; } nntp_xhdridx_t; typedef struct { char* header; long start; long end; int count; nntp_xhdridx_t* idxs; char* buf; } nntp_xhdrinfo_t; typedef struct { void* sin; void* sout; int postok; int code; /* group info */ long start; long end; int count; /* access mode */ int mode; } nntp_cndes_t; void* nntp_connect( char* server ) { int sock, err; char msgbuf[128]; struct sockaddr_in srvaddr; nntp_cndes_t* cndes; #ifdef WINSOCK WSADATA winsock_data; # ifndef WINSOCKVERSION # define WINSOCKVERSION ( 0x0101 ) /* default version 1.1 */ # endif if( WSAStartup((WORD)WINSOCKVERSION, &winsock_data) ) return 0; /* fail to init winsock */ #endif if( atoi(server) > 0 ) /* an IP address */ { srvaddr.sin_family = AF_INET; srvaddr.sin_addr.s_addr = inet_addr(server); } else /* a domain name */ { struct hostent* ph; if( ! (ph = gethostbyname( server )) ) return 0; srvaddr.sin_family = ph->h_addrtype; memcpy( (char*)&srvaddr.sin_addr, (char*)ph->h_addr, ph->h_length); } cndes = (nntp_cndes_t*)MEM_ALLOC(sizeof(nntp_cndes_t)); if( ! cndes ) return 0; srvaddr.sin_port = htons(119); if( (sock = socket( AF_INET, SOCK_STREAM, 0)) == -1 ) { MEM_FREE(cndes); return 0; } if( connect( sock, (struct sockaddr*)&srvaddr, sizeof(srvaddr) ) == -1 ) { SOCK_CLOSE( sock ); MEM_FREE(cndes); return 0; } if( ! (cndes->sin = SOCK_FDOPEN( sock, "r")) ) { SOCK_CLOSE( sock ); MEM_FREE(cndes); return 0; } if( ! (cndes->sout = SOCK_FDOPEN( sock, "w")) ) { SOCK_FCLOSE( cndes->sin ); MEM_FREE(cndes); return 0; } if( ! SOCK_FGETS(msgbuf, sizeof(msgbuf), cndes->sin ) ) { SOCK_FCLOSE( cndes->sin ); SOCK_FCLOSE( cndes->sout ); MEM_FREE(cndes); return 0; } /* a patch from Julia Anne Case */ SOCK_FPUTS("MODE READER\r\n", cndes->sout); if( SOCK_FFLUSH(cndes->sout) == EOF ) return 0; if( ! SOCK_FGETS(msgbuf, sizeof(msgbuf), cndes->sin ) ) { SOCK_FCLOSE( cndes->sin ); SOCK_FCLOSE( cndes->sout ); MEM_FREE(cndes); return 0; } switch( atoi( msgbuf ) ) { case NNTP_POST_CONN_OK: cndes->postok = 1; break; case NNTP_READ_CONN_OK: cndes->postok = 0; break; default: SOCK_FCLOSE( cndes->sin ); SOCK_FCLOSE( cndes->sout ); MEM_FREE(cndes); return 0; } cndes->code = 0; /* group info */ cndes->start= 0L; cndes->end = 0L; cndes->count= 0; cndes->mode = 0; return (void*)cndes; } void nntp_close(void* hcndes) { nntp_cndes_t* pcndes = (nntp_cndes_t*)hcndes; char msgbuf[128]; SOCK_FPUTS( "QUIT\r\n", pcndes->sout ); SOCK_FFLUSH( pcndes->sout ); SOCK_FGETS(msgbuf, sizeof(msgbuf), pcndes->sin ); SOCK_FCLOSE( pcndes->sin ); SOCK_FCLOSE( pcndes->sout ); MEM_FREE( hcndes ); #ifdef WINSOCK WSACleanup(); #endif } int nntp_errcode( void* hcndes ) { if( ! hcndes ) return -1; return ((nntp_cndes_t*)hcndes)->code; } char* nntp_errmsg( void* hcndes ) { int i, errcode; errcode = nntp_errcode( hcndes ); switch( errcode ) { case 0: return 0; case -1: return strerror( errno ); default: break; } for(i=0;ipostok; } int nntp_group( void* hcndes, char* grpnam ) { nntp_cndes_t* pcndes = hcndes; char response[64]; int code; pcndes->code = -1; /* system error */ SOCK_FPRINTF( pcndes->sout, "GROUP %s\r\n", grpnam); if( SOCK_FFLUSH( pcndes->sout ) == EOF ) return -1; if( ! SOCK_FGETS( response, sizeof( response ), pcndes->sin ) ) return -1; code = atoi(response); if( code != NNTP_GROUP_OK ) { pcndes->code = code; return -1; } sscanf( response, "%d%d%ld%ld", &code, &(pcndes->count), &(pcndes->start), &(pcndes->end)); pcndes->code = 0; return 0; } char* nntp_body( void* hcndes, long msgnum, char* msgid) { nntp_cndes_t* pcndes = hcndes; char tmsgbuf[128]; int code; char* body; int totsize, freesize, offset; pcndes->code = -1; if( msgnum > 0 ) SOCK_FPRINTF(pcndes->sout, "BODY %ld\r\n", msgnum ); else if( msgid ) SOCK_FPRINTF(pcndes->sout, "BODY %s\r\n", msgid ); else { SOCK_FPUTS("BODY\r\n", pcndes->sout); } if( SOCK_FFLUSH( pcndes->sout ) == EOF ) return 0; if( ! SOCK_FGETS(tmsgbuf, sizeof(tmsgbuf), pcndes->sin ) ) return 0; code = atoi(tmsgbuf); if( code != NNTP_BODY_OK ) { pcndes->code = code; return 0; } body = MEM_ALLOC(BODY_CHUNK_SIZE); if( !body ) abort(); totsize = freesize = BODY_CHUNK_SIZE; offset = 0; for(;;) { if( freesize <= BODY_CHUNK_SIZE/2 ) { totsize += BODY_CHUNK_SIZE; freesize += BODY_CHUNK_SIZE; body = MEM_REALLOC(body, totsize); if( ! body ) abort(); } if( ! SOCK_FGETS( body + offset, freesize, pcndes->sin ) ) return 0; if( STREQ( body+offset, ".\r\n") ) { *(body+offset) = 0; break; } /* strip off CR i.e '\r' */ offset += STRLEN(body+offset) - 1; freesize = totsize - offset; body[offset-1] = '\n'; } return body; } int nntp_next( void* hcndes ) { nntp_cndes_t* pcndes = hcndes; char tmsgbuf[128]; int code; pcndes->code = -1; SOCK_FPUTS("NEXT\r\n", pcndes->sout); if( SOCK_FFLUSH( pcndes->sout ) == EOF ) return -1; if( ! SOCK_FGETS( tmsgbuf, sizeof(tmsgbuf), pcndes->sin) ) return -1; pcndes->code = atoi(tmsgbuf); switch( pcndes->code ) { case NNTP_END_OF_GROUP: return 100; case NNTP_NEXT_OK: return 0; default: break; } return -1; } int nntp_last( void* hcndes ) { nntp_cndes_t* pcndes = hcndes; char tmsgbuf[128]; int code, sock; char* body; int size; pcndes->code = -1; SOCK_FPUTS("LAST\r\n", pcndes->sout); if( SOCK_FFLUSH( pcndes->sout ) == EOF ) return -1; if( ! SOCK_FGETS( tmsgbuf, sizeof(tmsgbuf), pcndes->sin) ) return -1; pcndes->code = atoi(tmsgbuf); switch( pcndes->code ) { case NNTP_TOP_OF_GROUP: return 100; case NNTP_LAST_OK: return 0; default: break; } return -1; } static int nntp_xhdr( void* hcndes, nntp_xhdrinfo_t* xhdr_data) { nntp_cndes_t* pcndes = hcndes; char tbuf[128]; int totsize, freesize; int flag; char* ptr; pcndes->code = -1; xhdr_data->count = 0; SOCK_FPRINTF( pcndes->sout, "XHDR %s %ld-%ld\r\n", xhdr_data->header, xhdr_data->start, xhdr_data->end ); if( SOCK_FFLUSH( pcndes->sout ) == EOF ) return -1; if( ! SOCK_FGETS( tbuf, sizeof(tbuf), pcndes->sin ) ) return -1; pcndes->code = atoi(tbuf); if( pcndes->code != NNTP_XHDR_OK ) return -1; flag = upper_strneq(xhdr_data->header, "lines", 6); if( flag ) { xhdr_data->buf = 0; } else { totsize = freesize = XHDR_CHUNK_SIZE; xhdr_data->buf = MEM_ALLOC(totsize); if( ! xhdr_data->buf ) return -1; ptr = xhdr_data->buf; } for(xhdr_data->count=0;;xhdr_data->count++) { int num; if( flag ) { if( ! SOCK_FGETS(tbuf, sizeof(tbuf), pcndes->sin) ) return -1; if( STRNEQ(tbuf, ".\r\n", 3) ) break; sscanf(tbuf, "%ld%ld", &(xhdr_data->idxs[xhdr_data->count].article_num), &(xhdr_data->idxs[xhdr_data->count].data) ); } else { if( freesize < XHDR_CHUNK_SIZE/2 ) { int offset; totsize += XHDR_CHUNK_SIZE; freesize += XHDR_CHUNK_SIZE; offset = (int)(ptr - xhdr_data->buf); xhdr_data->buf = MEM_REALLOC( xhdr_data->buf, totsize ); if( ! xhdr_data->buf ) return -1; ptr = xhdr_data->buf + offset; } if( ! SOCK_FGETS(ptr, freesize, pcndes->sin ) ) return -1; if( STRNEQ(ptr, ".\r\n", 3) ) break; sscanf( ptr, "%ld%n", &(xhdr_data->idxs[xhdr_data->count].article_num), &num); if( STREQ( ptr + num + 1, "(none)\r\n") ) { xhdr_data->idxs[xhdr_data->count].data = 0; ptr += (num + 1); } else { xhdr_data->idxs[xhdr_data->count].data = ptr - xhdr_data->buf + num + 1; ptr += (STRLEN(ptr) - 1); } ptr[-1] = 0; freesize = totsize - (int)(ptr - xhdr_data->buf); } } return 0; } typedef struct { void* hcndes; char header[20]; nntp_xhdrinfo_t* hdrinfo; long position; long last; } nntp_header_t; void* nntp_openheader(void* hcndes, char* header, long* tmin, long* tmax) { nntp_cndes_t* pcndes = hcndes; nntp_header_t* hd; long start; pcndes->code = -1; hd = (nntp_header_t*)MEM_ALLOC(sizeof(nntp_header_t)); if( !hd ) return 0; hd->hcndes = hcndes; STRCPY(hd->header, header); hd->last = pcndes->end; hd->hdrinfo = (nntp_xhdrinfo_t*)MEM_ALLOC(sizeof(nntp_xhdrinfo_t)); if( !hd->hdrinfo ) { MEM_FREE( hd ); return 0; } start = pcndes->start; if( *tmax < *tmin ) { #ifndef MAX_SIGNED_LONG # define MAX_SIGNED_LONG ( (-1UL) >> 1 ) #endif if( start < *tmax || start > *tmin ) *tmin = start; *tmax = MAX_SIGNED_LONG; } if( *tmin < start ) *tmin = start; if( *tmin == MAX_SIGNED_LONG ) *tmin = *tmax = 0L; hd->hdrinfo->header = hd->header; hd->hdrinfo->start = 0L; hd->hdrinfo->end = *tmin - 1L; hd->hdrinfo->count = 0; hd->hdrinfo->idxs = (nntp_xhdridx_t*)MEM_ALLOC( sizeof(nntp_xhdridx_t)*NNTP_HEADER_CHUNK); if( ! hd->hdrinfo->idxs ) { MEM_FREE( hd->hdrinfo ); MEM_FREE( hd ); return 0; } hd->hdrinfo->buf = 0; hd->position = 0; return hd; } void nntp_closeheader(void* hh) { nntp_header_t* ph = hh; if( !hh ) return; if( ph->hdrinfo ) { MEM_FREE( ph->hdrinfo->idxs ); MEM_FREE( ph->hdrinfo->buf ); MEM_FREE( ph->hdrinfo ); } MEM_FREE( hh ); } int nntp_fetchheader( void* hh, long* artnum, long* data, void* hrh) { nntp_header_t* ph = hh; nntp_header_t* prh= hrh; /* reference header */ nntp_cndes_t* pcndes; long position; long ldata; if(! hh ) return -1; pcndes = ph->hcndes; position = ph->position; pcndes->code = -1; if( ph->hdrinfo->start >= ph->last ) return 100; if( prh ) { if( ph->hdrinfo->end != prh->hdrinfo->end ) { MEM_FREE(ph->hdrinfo->buf); ph->hdrinfo->buf = 0; ph->hdrinfo->start = prh->hdrinfo->start; ph->hdrinfo->end = prh->hdrinfo->end; if( nntp_xhdr( pcndes, ph->hdrinfo ) ) return -1; } position = ph->position = prh->position-1; } else if( ph->hdrinfo->count == position ) { MEM_FREE(ph->hdrinfo->buf); ph->hdrinfo->buf = 0; for(;;) { ph->hdrinfo->start = ph->hdrinfo->end + 1; ph->hdrinfo->end = ph->hdrinfo->end + NNTP_HEADER_CHUNK; ph->hdrinfo->count = 0; position = ph->position = 0; if( ph->hdrinfo->start > ph->last ) return 100; if( nntp_xhdr( pcndes, ph->hdrinfo ) ) return -1; if( ph->hdrinfo->count ) break; } } if( artnum ) *artnum = (ph->hdrinfo->idxs)[position].article_num; ldata = (ph->hdrinfo->idxs)[position].data; if( ldata ) ldata = (long)(ph->hdrinfo->buf) + ldata; if( data ) *data = ldata; ph->position ++; return 0; } int nntp_start_post(void* hcndes) { nntp_cndes_t* pcndes = hcndes; char msgbuf[128]; int i; pcndes->code = -1; if( ! nntp_postok(hcndes) ) { pcndes->code = NNTP_CANNOT_POST; return -1; } SOCK_FPUTS( "POST\r\n", pcndes->sout ); if( SOCK_FFLUSH( pcndes->sout ) == EOF ) return -1; if( ! SOCK_FGETS(msgbuf, sizeof(msgbuf), pcndes->sin) ) return -1; pcndes->code = atoi(msgbuf); if(pcndes->code != NNTP_POSTING ) return -1; return 0; } int nntp_send_head(void* hcndes, char* head_name, char* head) { nntp_cndes_t* pcndes = hcndes; int i; for(i=0;head[i];i++) /* to make sure there is no new line char in a head string * here, head must be pointed to a writeable area and don't * care whether it will be overwritten after posting */ { if( head[i] == '\n' ) { head[i] = 0; break; } } SOCK_FPRINTF( pcndes->sout, "%s: %s\n", head_name, head); return 0; } int nntp_end_head(void* hcndes) { nntp_cndes_t* pcndes = hcndes; SOCK_FPUTS("\n", pcndes->sout); return 0; } int nntp_send_body(void* hcndes, char* body) { nntp_cndes_t* pcndes = hcndes; char* ptr; for(ptr=body;*ptr;ptr++) /* we require the article body buffer is located in a * writeable area and can be overwritten during the * post action. */ { if( *ptr == '\n' ) { if( STRNEQ( ptr, "\n.\n", 3) || STRNEQ( ptr, "\n.\r\n", 4 ) ) { *ptr = 0; break; } } } SOCK_FPUTS(body, pcndes->sout); return 0; } int nntp_end_post(void* hcndes) { nntp_cndes_t* pcndes = hcndes; char msgbuf[128]; pcndes->code = -1; SOCK_FPUTS("\r\n.\r\n", pcndes->sout); if( SOCK_FFLUSH(pcndes->sout) == EOF ) return -1; if( ! SOCK_FGETS(msgbuf, sizeof(msgbuf), pcndes->sin) ) return -1; pcndes->code = atoi(msgbuf); if( pcndes->code != NNTP_POST_OK ) return -1; return 0; } int nntp_cancel( void* hcndes, char* group, char* sender, char* from, char* msgid ) { char msgbuf[128]; if( ! from ) from = "(none)"; sprintf( msgbuf, "cancel %s", msgid); if( nntp_start_post(hcndes) || nntp_send_head(hcndes, "Newsgroups", group) || ( sender && nntp_send_head(hcndes, "Sender", sender) ) || nntp_send_head(hcndes, "From", from) || nntp_send_head(hcndes, "Control", msgbuf) || nntp_end_head(hcndes) || nntp_end_post(hcndes) ) return -1; return 0; } void nntp_setaccmode(void* hcndes, int mode) { nntp_cndes_t* pcndes = hcndes; pcndes->mode = mode; } int nntp_getaccmode(void* hcndes ) { nntp_cndes_t* pcndes = hcndes; return pcndes->mode; } unixODBC-2.3.9/Drivers/nn/nnsql.h0000755000175000017500000002144112262474475013440 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _NN_SQL_H # define _NN_SQL_H # include "nndate.h" # include "nncol.h" /* interface of nnsql layer */ /* basic statement handle object */ extern void* nnsql_allocyystmt(void* hcndes); /* Allocating and initiating a statement * handle on a given connection. On success, * a statement handle is returned or null on * failure */ extern void nnsql_dropyystmt(void* hstmt); /* Drop(i.e free and detach from the * connection) it */ extern void nnsql_close_cursor(void* hstmt); /* Close a result set, terminate the * fetching process. */ /* open table(i.e. group) */ extern int nnsql_opentable(void* hstmt, char* table); /* Set the active table(i.e. netnews group). * It returns 0 on success, -1 on failure.*/ /* prepare (i.e. parsing and accessing mode check) */ extern int nnsql_prepare(void* hstmt, char* sqlstmt, int len); /* Parsing the SQL statement and check the * accessing mode for INSERT and DELETE * statement. It returns 0 on success, * -1 on failure. */ /* open table(i.e. group), type check, do insert, search delete */ extern int nnsql_execute(void* hstmt); /* Execute a prepared statement(i.e. commit * the INSERT or DELETE, type check, * set active table or open a result set. * It returns 0 on success, -1 on failure.*/ /* fetch result */ extern int nnsql_fetch(void* hstmt); /* Fetching result from a opened result set. * It returns 0 on success, -1 on failure, 100 * on hitting the end of the result set. * The fetched result at the 'th column * in the current row can be gotten with * nnsql_getxxx(hstmt, icol) calls. The * properties(i.e. null, datatype, etc.) of * the 'th column in the result set can * be gotten with nnsql_isxxxcol(hstmt,icol) * calls. */ /* get column describor id */ extern int nnsql_column_descid(void* hstmt, int icol); /* Getting column describator id(i.e en_subject, * en_from, en_msgid, en_body, etc.) for the * the 'th column of a prepared or * executed statement if a result set will or * already been opened. It returns the * describator id or -1 on failure. Note, the * user column index starts from 1 and * column index 0 is always used as a hidden * internal column, the article number. */ /* max number of parameters/columns */ extern int nnsql_max_param(); /* Return the up limit of parameter number(32)*/ extern int nnsql_max_column(); /* Return the up limit of column number (32)*/ /* get value from column */ extern long nnsql_getnum(void* hstmt, int icol); /* Return a long integer from the 'th * column of the current row of the result set. * If the datatype of this column is not INTEGER * (i.e. NUMBER), this function will return 0. * Using nnsql_isnumcol() to check this before * getting the long integer. */ extern char* nnsql_getstr(void* hstmt, int icol); /* Return an null terminated string at the * 'th column of current row of the result * set. If datatype of this column is STRING, * this function will return an null pointer. * Using nnsql_isstrcol() to check this before * getting a string. The string itself is placed * in an internal buffer. It may be overwritten * by the result of later(if not next) * nnsql_fetch() call. Thus, it is your duty to * keep a copy of it when necessary. */ extern date_t* nnsql_getdate(void* hstmt, int icol); /* Return a pointer point to an internal date * datatype structure from the 'th column * of the current row of the result set. If the * datatype of this column is not DATE, this * function will return a null pointer. Using * nnsql_isdatecol() to check this before * getting a date pointer. The date structure * is place in an internal buffer. It may be * overwritten by the result of later(if not * next) nnsql_fetch() call. It is your job to * keep a copy of it when necessary. */ /* get total number of columns and parameters */ extern int nnsql_getcolnum(void* hstmt); /* Return total column number of a prepared or * executed statement, if a result set has been * opened or will be opened after the prepared * statement been executed. It return 0 if there * is no result set will or already been opened. * Unlike ODBC, the column number returned from * this function will be, if it is not 0, equal * or large than 2 to include the hidden internal * column -- the article-num column(it is always * the 0'th column). */ extern int nnsql_getparnum(void* hstmt); /* return total parameter number(i.e. number of * outstanding ? marks) of a prepared SQL * statement.*/ extern int nnsql_getrowcount(void* hstmt); /* For a DELETE statement, this function returns * the total deleted rows(i.e. articles). * For an INSERT statement, this function * returns 0(i.e. insert unsuccess) or 1(i.e. * successed inserted or posted). * For a SELECT statement, this function returns * the current cursor location(i.e. current row * number) which equals to the total number of * successful nnsql_fetch(). */ /* get type of column */ extern int nnsql_isnullcol(void* hstmt, int icol); /* Return TRUE if the 'th column at current * row is null or return FAIL if not */ extern int nnsql_isstrcol(void* hstmt, int icol); /* Return TRUE if datatype of the 'th column * is STRING or return FAIL if not */ extern int nnsql_isnumcol(void* hstmt, int icol); /* Return TRUE if datatype of the 'th column * is INTEGER(i.e NUMBER) or return FAIL if not */ extern int nnsql_isdatecol(void* hstmt, int icol); /* Return TRUE if datatype of the 'th column * is DATE or return FAIL if not */ extern int nnsql_iscountcol(void* hstmt, int icol);/* Return TRUE if the 'th column is a count * column or return FAIL if not */ extern int nnsql_isnullablecol(void* hstmt, int icol); /* Return TRUE if the 'th column is an * nullable one(i.e. not necessary specified in * INSERT statement. return FAIL if not */ /* unbind dummy variable(s) */ extern int nnsql_yyunbindpar(void* hstmt, int ipar); /* Unbinding the 'th parameter * (corrosponding to the value previouse bound * for the 'th outstanding ? mark. This * will free the *user* buffer(if an user string * was previously bound) from the statement * handle.*/ /* put data for dummy variable(s) */ extern int nnsql_putnum(void* hstmt, int ipar, long num); /* Binding an integer as the 'th parameter * (i.e. its value and type will be used in * place of the 'th outstanding ? mark in * the prepared SQL statement. Same as ODBC, here * the index start from 1. */ extern int nnsql_putstr(void* hstmt, int ipar, char* str); /* Binding a string(keep a pointer of the user * string location) as the 'th parameter.*/ extern int nnsql_putdate(void* hstmt, int ipar, date_t* date); /* Binding a date(copy the date struct to an * internal recyclable buffer) as the 'th * parameter */ extern int nnsql_putnull(void* hstmt, int ipar); /* Binding a null as the 'th parameter */ /* error report function */ extern int nnsql_errcode(void* hstmt); /* Return the current errcode or 0 */ extern char* nnsql_errmsg(void* hstmt); /* Return the current errmsg(null terminate * string) or null */ extern int nnsql_errpos(void* hstmt); /* Return parsing position of error in the sql * statement */ /* nntp connection access mode flag. used in nntp_accmode() */ # define ACCESS_MODE_SELECT 0 /* Allow SELECT only */ # define ACCESS_MODE_INSERT 1 /* Allow INSERT and SELECT */ # define ACCESS_MODE_DELETE_TEST 2 /* Allow SELECT, INSERT, DELETE(from *.test * groups) */ # define ACCESS_MODE_DELETE_ANY 3 /* Allow SELECT, INSERT, DELETE(from all groups)*/ #endif unixODBC-2.3.9/Drivers/nn/SQLRowCount.c0000755000175000017500000000163312262474475014441 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLRowCount( HSTMT hstmt, SDWORD* pcrow ) { stmt_t* pstmt = hstmt; UNSET_ERROR( pstmt->herr ); if ( pcrow ) *pcrow = nnsql_getrowcount( ((stmt_t*)hstmt)->yystmt ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/yylex.c0000644000175000017500000001247713245016417013446 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include #include #include #include #include #include "yylex.ci" # define YYERRCODE 256 #include #include static int getcmpopidxbyname(char* name) { int i, size; size = sizeof(cmpop_tab)/sizeof(cmpop_tab[0]); for(i=0; ipstmt->sqlexpr)[(penv->scanpos)]; (penv->errpos) = (penv->scanpos); (penv->scanpos) ++; return c; } static void unputc(char c, yyenv_t* penv) { (penv->errpos) = (--(penv->scanpos)); if( (penv->pstmt->sqlexpr)[(penv->scanpos)] != c ) (penv->pstmt->sqlexpr)[(penv->scanpos)] = c; } static long getnum(yyenv_t* penv) { long a; char c; int i, errpos = (penv->scanpos); a = atol((penv->pstmt->sqlexpr) + (penv->scanpos)); for(i=0;;i++) { c = popc(penv); if( ! isdigit(c) ) { unputc(c, penv); break; } } (penv->errpos) = errpos; return a; } static int getqstring(char* buf, int len, yyenv_t* penv, char term) { char c, c1; int i, errpos = (penv->scanpos); for(i=0; len == -1 || ierrpos) = errpos; return i; } static int getname(char* buf, int len, yyenv_t* penv) { int i = 0; char c; int errpos = (penv->scanpos); for(i=0; len == -1 || ierrpos) = errpos; return i; } static int getcmpop(yyenv_t* penv) { char opname[3]; char c, c1; int errpos = (penv->scanpos); opname[0] = c = popc(penv); opname[1] = c1= popc(penv); opname[2] = 0; if( c1 != '=' && c1 != '>' && c1 != '<' ) { opname[1] = 0; unputc(c1, penv); } (penv->errpos) = errpos; return getcmpopidxbyname(opname); } int nnsql_yylex(YYSTYPE* pyylval, yyenv_t* penv) { int len, cmpop; char c; do { c = popc(penv); } while( c == ' ' || c == '\t' || c == '\n' ); if( isalpha(c) ) { int keywdidx; unputc(c, penv); len = getname(penv->texts_bufptr, -1, penv); if( len == YYERRCODE ) return len; if( penv->extlevel ) keywdidx = getxkeywdidxbyname( penv->texts_bufptr ); else keywdidx = YYERRCODE; if( keywdidx == YYERRCODE ) keywdidx = getkeywdidxbyname( penv->texts_bufptr); if( keywdidx != YYERRCODE ) return keywdidx; pyylval->name = penv->texts_bufptr; (penv->texts_bufptr) += (len + 1); return NAME; } if( isdigit(c) ) { unputc(c, penv); pyylval->number = getnum(penv); return NUM; } switch( c ) { case ';': case '\0': return ';'; case '\'': case '"': len = getqstring(penv->texts_bufptr, -1, penv, c); if( len == YYERRCODE ) return len; if( c == '\'' ) { pyylval->qstring = penv->texts_bufptr; penv->texts_bufptr += (len + 1); return QSTRING; } pyylval->name = penv->texts_bufptr; (penv->texts_bufptr) += (len + 1); return NAME; case '=': case '<': case '>': case '!': unputc(c, penv); cmpop = getcmpop( penv ); if(cmpop == YYERRCODE ) return cmpop; pyylval->cmpop = cmpop; return CMPOP; case '?': pyylval->ipar = (++(penv->dummy_npar)); return PARAM; case '{': penv->extlevel ++; break; case '}': penv->extlevel --; break; default: break; } return c; } void nnsql_yyinit(yyenv_t* penv, yystmt_t* yystmt) { penv->extlevel = 0; penv->dummy_npar = penv->errpos = penv->scanpos = 0; penv->pstmt = yystmt; penv->texts_bufptr = yystmt->texts_buf; } unixODBC-2.3.9/Drivers/nn/README0000755000175000017500000000263212262474475013015 00000000000000*************************************************************** * This code is GPL. * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | Driver for internet News Servers | +-------------------------------------------------------------+ This is Ke Jin's NN ODBC driver, adapted for unixODBC. Ke Jin's original README is in README.orig. This is a first pass at the effort to integrate it into unixODBC. It works, in its current state, but much more needs to be done (see the TODO). THIS CODE IS FUNCTIONAL BUT IS IN MID-HACK; ONLY THE MOST ADVENTUROUS SHOULD EVEN TRY TO FIGURE THIS OUT IN ITS CURRENT STATE. - PAH The basic concept is that a news server is like a SERVER/DATABASE, a news group is like a TABLE, and data such as Subject is a COLUMN. A useful subset of SQL is supported in the driver. Check out Ke Jins original README (README.orig). This driver can be quite usefull so I hope someone volunteers to tackle some of the items in the TODO list. +-------------------------------------------------------------+ | Peter Harvey pharvey@codebydesign.com | | http://www.unixodbc.org | +-------------------------------------------------------------+ unixODBC-2.3.9/Drivers/nn/SQLFreeConnect.c0000755000175000017500000000216112262474475015051 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLFreeConnect( HDBC hdbc) { dbc_t* tpdbc; dbc_t* pdbc = hdbc; env_t* penv = pdbc->henv; UNSET_ERROR( pdbc->herr ); for ( tpdbc = penv->hdbc; tpdbc; tpdbc = tpdbc->next ) { if ( pdbc == tpdbc ) { penv->hdbc = pdbc->next; break; } if ( pdbc == tpdbc->next ) { tpdbc->next = pdbc->next; break; } } CLEAR_ERROR( pdbc->herr ); MEM_FREE( pdbc ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/nntp.ci0000755000175000017500000000140512262474475013426 00000000000000#include # define MSGHEAD "[INN][NNRP server]" static struct { int code; char* msg; } nntp_msg[] = { NNTP_POSTING, MSGHEAD "Article in posting", NNTP_SERVICE_DOWN, MSGHEAD "NNTP Server down", NNTP_INVALID_GROUP, MSGHEAD "No such news group on this server", NNTP_NOT_IN_GROUP, MSGHEAD "Not in a news group", NNTP_NOT_IN_ARTICLE, MSGHEAD "Not in a article", NNTP_END_OF_GROUP, MSGHEAD "End of news group", NNTP_TOP_OF_GROUP, MSGHEAD "Top of news group", NNTP_INVALID_MSGNUM, MSGHEAD "Invalid article number", NNTP_INVALID_MSGID, MSGHEAD "Invalid article ID", NNTP_UNWANTED_MSG, MSGHEAD "Unwanted article", NNTP_REJECTED_MSG, MSGHEAD "Article rejected", NNTP_CANNOT_POST, MSGHEAD "Can't post", NNTP_POSTING_FAILED, MSGHEAD "NNTP Posting failed" }; unixODBC-2.3.9/Drivers/nn/nndate.c0000755000175000017500000000563512262474475013560 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include #include static char* month_name[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; static int nndate2date(char* str, date_t* date) { int i; char buf[4]; date_t dt; if( STRLEN(str) < STRLEN("yyyy m d") ) return -1; sscanf(str, "%d %s %d", &(dt.day), buf, &(dt.year)); if( dt.year < 100 && dt.year > 0 ) dt.year += 1900; if( dt.day <= 0 || dt.day > 31 ) return -1; if(i = atoi(buf)) { dt.month = i; if( i <= 0 || i > 12 ) return -1; *date = dt; date->month = i; return 0; } for(i=0;i<12;i++) { if( upper_strneq(buf, month_name[i], 3) ) { *date = dt; date->month = i+1; return 0; } } return -1; } int nnsql_nndatestr2date(char* str, date_t* date) /* convert 'dd mm year' or 'week, dd mm year' to date struct */ { int r; date_t dt; if( !str ) { if(date) date->day = 0; return 0; } if(atoi(str)) r = nndate2date(str, &dt); /* a 'dd mm year' string */ else r = nndate2date(str+5, &dt); /* a 'week, dd mm year' string */ if( r ) dt.day = 0; if( date ) *date = dt; return r; } int nnsql_datecmp(date_t* a, date_t* b) { int r; if( (r = a->year - b->year) ) return r; if( (r = a->month- b->month) ) return r; return (a->day - b->day); } int nnsql_odbcdatestr2date(char* str, date_t* date) /* convert 'yyyy-m-d', 'yyyy-mm-dd' or 'yyyy-mmm-dd' or even 'yyyy/mm/dd' * string to date struct */ { date_t dt; int i; if( ! str ) { if( date ) date->day = 0; return 0; } if( STRLEN(str) < STRLEN("yyyy-m-d") ) { if( date ) date->day = 0; return -1; } dt.day = 0; dt.year = atoi(str); str += 5; dt.month = atoi(str); if( dt.month < 0 || dt.month > 12 ) { if(date) date->day = 0; return -1; } if(! dt.month) /* jan to dec */ { for(i=0;i<12;i++) { if( upper_strneq(str, month_name[i], 3) ) { dt.month = i+1; break; } } if( ! dt.month ) { if(date) date->day = 0; return -1; } str += 4; } else { if( *str == '0' || dt.month > 9 ) /* 01 to 12 */ str += 3; else /* 1 to 9 */ str += 2; } dt.day = atoi(str); if( dt.day <= 0 || dt.day > 31 ) { if(date) date->day = 0; return -1; } if(date) *date = dt; return 0; } unixODBC-2.3.9/Drivers/nn/convert.c0000755000175000017500000001704212262474475013762 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" /* It looks silly to use a MEM_ALLOC() in function char2str(), etc, * for converting C data type into STRING SQL data type. Esspecially * for char2str(), simply return the C data buffer address seems can * do the same thing. However, all these 'to STRING' functions are * assumed to be invoked in SQLExecute(), etc. According to ODBC, after * that, user buffers are detached from the statement been executed. * For example, for a statement: * * "SELECT FROM comp.databases WHERE subject LIKE ?" * * You may bind a SQL_C_CHAR data to it as the pattern for the * LIKE condition. After SQLExecute(), the user buffer should be * detached from the statement. You can change the data in that * buffer without worry about the SQLFetch() results will be * affected. If we don't use a separate buffer to keep the user * data at SQLExecute() time but only keep a pointer of user buffer, * then when user changes data in user buffer after SQLExecute() * but before or during SQLFetch()s, the SQLFetch()'s result will * be affected as a result of the change of LIKE condition. * * These allocated memory will be released by SQL layer. */ typedef DATE_STRUCT odbc_date_t; char* char2str( char* buf, int size ) { char* ptr; int len; if( size < 0 ) size = STRLEN(buf); ptr = (char*)MEM_ALLOC(size + 1); if( ! ptr ) return (char*)(-1); STRNCPY(ptr, buf, size+1); ptr[size] = 0; return ptr; } char* char2num( char* buf, int size) { char tbuf[16]; if( size < 0 ) size = strlen(buf); if( size>15 ) size = 15; STRNCPY(tbuf, buf, size); tbuf[15] = 0; return (char*)atol(tbuf); } char* char2date( char* buf, int size, date_t* dt) { char tbuf[16]; if( size < 0 ) size = strlen(buf); if( size > 15 ) size = 15; STRNCPY( tbuf, buf, size); tbuf[15] = 0; if( nnsql_odbcdatestr2date(tbuf, dt) ) return (char*)(-1); return (char*)dt; } char* date2str( odbc_date_t* dt ) { char* ptr; if( dt->year < 0 || dt->year > 9999 || dt->month< 1 || dt->month> 12 || dt->day < 1 || dt->day > 31 || !( ptr = (char*)MEM_ALLOC(12)) ) return (char*)(-1); sprintf(ptr, "%04d-%02d-%02d", dt->year, dt->month, dt->day); return ptr; } char* odate2date( odbc_date_t* odt, int size, date_t* dt ) { if( dt->year < 0 || dt->year > 9999 || dt->month< 1 || dt->month> 12 || dt->day < 1 || dt->day > 31 ) return (char*)(-1); dt->year = odt->year; dt->month= odt->month; dt->day = odt->day; return (char*)dt; } char* tint2num( char* d ) { long num = *d; return (char*)num; } char* short2num( short* d ) { long num = *d; return (char*)num; } char* long2num( long* d ) { return (char*)*d; } char* tint2str( char* d ) { int c = *d; char* ptr; if( ! (ptr = MEM_ALLOC(5)) ) return (char*)(-1); sprintf(ptr, "%d", c); return ptr; } char* short2str( short* d ) { int c = *d; char* ptr; if( ! (ptr = MEM_ALLOC(32)) ) return (char*)(-1); sprintf(ptr, "%d", c); return ptr; } char* long2str( long* d ) { long l = *d; char* ptr; if( ! (ptr = MEM_ALLOC(64)) ) return (char*)(-1); sprintf(ptr, "%ld", l); return ptr; } static fptr_t c2sql_cvt_tab[5][3] = { char2str, char2num, char2date, tint2str, tint2num, 0, short2str, short2num,0, long2str, long2num, 0, date2str, 0, odate2date }; static struct { int ctype; int idx; } ctype_idx_tab[] = { SQL_C_CHAR, 0, SQL_C_TINYINT, 1, SQL_C_STINYINT, 1, SQL_C_UTINYINT, 1, SQL_C_SHORT, 2, SQL_C_SSHORT, 2, SQL_C_USHORT, 2, SQL_C_LONG, 3, SQL_C_SLONG, 3, SQL_C_ULONG, 3, SQL_C_DATE, 4 }; static struct { int sqltype; int idx; } sqltype_idx_tab[] = { SQL_CHAR, 0, SQL_VARCHAR, 0, SQL_LONGVARCHAR,0, SQL_TINYINT, 1, SQL_SMALLINT, 1, SQL_INTEGER, 1, SQL_DATE, 2 }; fptr_t nnodbc_get_c2sql_cvt(int ctype, int sqltype) { int i, cidx = -1, sqlidx = -1; for(i=0; i< sizeof(ctype_idx_tab) / sizeof(ctype_idx_tab[ 0 ]); i++ ) { if( ctype_idx_tab[i].ctype == ctype ) { cidx = ctype_idx_tab[i].idx; break; } } if( cidx == -1 ) return 0; for(i=0; i< sizeof(sqltype_idx_tab) / sizeof(sqltype_idx_tab[ 0 ]); i++ ) { if( sqltype_idx_tab[i].sqltype == sqltype ) { sqlidx = sqltype_idx_tab[i].idx; break; } } if( sqlidx == -1 ) return 0; return c2sql_cvt_tab[cidx][sqlidx]; } static char* str2char( char* ptr, char* buf, long size, long* psize) { long len; len = STRLEN(ptr) + 1; if( len > size ) len = size; if( len ) { STRNCPY( buf, ptr, len ); buf[len - 1] = 0; } *psize = len; return 0; } static char* str2tint( char* ptr, char* buf, long size, long* psize ) { unsigned long a, b = (unsigned char)(-1); a = (unsigned long)atol(ptr); if( a > b ) { *psize = a; return (char*)(-1); } *buf = (char)a; return 0; } static char* str2short( char* ptr, short* buf, long size, long* psize) { unsigned long a, b = (unsigned short)(-1); a = atoi(ptr); if( a > b ) { *psize = a; return (char*)(-1); } *buf = (short)a; return 0; } static char* str2long( char* ptr, long* buf) { *buf = atol(ptr); return 0; } static char* str2date( char* ptr, odbc_date_t* buf ) { date_t dt; if( nnsql_nndatestr2date(ptr, &dt) ) return (char*)(-1); buf->year = dt.year; buf->month= dt.month; buf->day = dt.day; return 0; } static char* num2char( long x, char* buf, long size, long* psize) { char tbuf[48]; sprintf(tbuf, "%ld", x); *psize = STRLEN(buf) + 1; if(*psize > size ) return (char*)(-1); STRCPY(buf, tbuf); return 0; } static char* num2tint(long x, char* buf, long size, long* psize) { unsigned long a = x, b = (unsigned char)(-1); if( a > b ) { *psize = x; return (char*)(-1); } *buf = (char)x; return 0; } static char* num2short(long x, short* buf, long size, long* psize) { unsigned long a = x, b = (unsigned short)(-1); if( a > b) { *psize = x; return (char*)(-1); } *buf = (short)x; return 0; } static char* num2long(long x, long* buf ) { *buf = x; return 0; } static char* date2char(date_t* dt, char* buf, long size, long* psize) { *psize = 11; if(size < 11) return (char*)(-1); sprintf(buf, "%04d-%02d-%02d", dt->year, dt->month, dt->day); return 0; } static char* date2odate(date_t* dt, odbc_date_t* buf) { buf->year = dt->year; buf->month= dt->month; buf->day = dt->day; return 0; } static fptr_t sql2c_cvt_tab[3][5] = { str2char, str2tint, str2short, str2long, str2date, num2char, num2tint, num2short, num2long, 0, date2char, 0, 0, 0, date2odate }; fptr_t nnodbc_get_sql2c_cvt(int sqltype, int ctype) { int i, cidx = -1, sqlidx = -1; for(i=0; i< sizeof(ctype_idx_tab) / sizeof(ctype_idx_tab[ 0 ]); i++ ) { if( ctype_idx_tab[i].ctype == ctype ) { cidx = ctype_idx_tab[i].idx; break; } } if( cidx == -1 ) return 0; for(i=0; i< sizeof(sqltype_idx_tab) / sizeof(sqltype_idx_tab[ 0 ]); i++ ) { if( sqltype_idx_tab[i].sqltype == sqltype ) { sqlidx = sqltype_idx_tab[i].idx; break; } } if( sqlidx == -1 ) return 0; return sql2c_cvt_tab[sqlidx][cidx]; } unixODBC-2.3.9/Drivers/nn/herr.c0000755000175000017500000000575312262474475013250 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include #include #include "herr.ci" typedef struct { int code; /* sqlstat(if msg == null) or native code */ char* msg; } err_t; # define ERRSTACK_DEPTH 3 typedef struct { err_t stack[ERRSTACK_DEPTH]; int top; /* top free slot */ } err_stack_t; void* nnodbc_pusherr(void* stack, int code, char* msg) { err_stack_t* err_stack = stack; if( ! err_stack ) { err_stack = (err_stack_t*)MEM_ALLOC( sizeof(err_stack_t)); if( ! err_stack ) return 0; err_stack->top = 0; } if( err_stack->top < ERRSTACK_DEPTH - 1) err_stack->top ++; (err_stack->stack)[err_stack->top - 1].code = code; (err_stack->stack)[err_stack->top - 1].msg = msg; return err_stack; } int nnodbc_errstkempty(void* stack) { err_stack_t* err_stack = stack; if( ! err_stack || ! err_stack->top ) return 1; return 0; } void nnodbc_errstkunset(void* stack) { if( stack ) ((err_stack_t*)stack)->top = 0; } void nnodbc_poperr(void* stack ) { err_stack_t* err_stack = stack; if( ! nnodbc_errstkempty( err_stack ) ) err_stack->top --; return; } static int is_sqlerr(err_t* err) { return !(err->msg); } int nnodbc_getsqlstatcode(void* stack) { err_stack_t* err_stack = stack; err_t* err; err = err_stack->stack + err_stack->top - 1; if( ! is_sqlerr(err) ) return 0; return err->code; } char* nnodbc_getsqlstatstr(void* stack) { err_stack_t* err_stack = stack; err_t* err; int i; err = err_stack->stack + err_stack->top - 1; if( ! is_sqlerr(err) ) return 0; for(i=0;sqlerrmsg_tab[i].stat;i++) { if( sqlerrmsg_tab[i].code == err->code ) return sqlerrmsg_tab[i].stat; } return 0; } char* nnodbc_getsqlstatmsg(void* stack) { err_stack_t* err_stack = stack; err_t* err; int i; err = err_stack->stack + err_stack->top - 1; if( ! is_sqlerr(err) ) return 0; for(i=0;sqlerrmsg_tab[i].stat;i++) { if( sqlerrmsg_tab[i].code == err->code ) return sqlerrmsg_tab[i].msg; } return 0; } int nnodbc_getnativcode(void* stack) { err_stack_t* err_stack = stack; err_t* err; err = err_stack->stack + err_stack->top - 1; if( is_sqlerr(err) ) return 0; return err->code; } char* nnodbc_getnativemsg(void* stack) { err_stack_t* err_stack = stack; err_t* err; err = err_stack->stack + err_stack->top - 1; return err->msg; } void* nnodbc_clearerr(void* stack) { MEM_FREE(stack); return 0; } unixODBC-2.3.9/Drivers/nn/TODO0000755000175000017500000000046312262474475012625 00000000000000TODO ---- 0. standardize makefile(s) 1. modularize to the function level 2. get all sources to reside in one dir 3. replace redundent code with unixODBC libs such as odbcinst 4. update function declares to ODBC 3.5.1 standard 5. implement catalog functions ( SQLTables, SQLColumns... ) - Peter Harvey unixODBC-2.3.9/Drivers/nn/yystmt.h0000755000175000017500000000633512262474475013663 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _YYSTMT_H # define _YYSTMT_H # define MAX_COLUMN_NUMBER 32 # define MAX_PARAM_NUMBER 32 # include # include # include typedef enum { en_nt_cmpop, /* en_cmpop_eq, */ en_nt_logop, /* kwd_and, kwd_or, kwd_not */ en_nt_attr, en_nt_qstr, en_nt_num, en_nt_date, en_nt_param, en_nt_null, en_nt_like, en_nt_between, en_nt_in, en_nt_caselike, en_nt_isnull } node_type; typedef struct tnode { int type; /* compare operator, * logical operator, * column value, * literal value, * dummy parameter */ union { int cmpop; /* en_cmpop_eq, en_cmpop_ne, ... */ int logop; /* kwd_or, kwd_and, kwd_not */ int iattr; /* attribute index */ int ipar; /* parameter idx */ char* qstr; long num; date_t date; char esc; /* escape for like pattern match */ } value; struct tnode* left; struct tnode* right; } node_t; typedef struct { int iattr; char* table; /* table name from yyparse */ union { long num; char* qstr; date_t date; } value; } yycol_t; typedef struct { int stat; /* 0 don't needed(either by select list or by where tree) 1 needed */ int wstat; /* 0 if don't need by where tree, 1 if need */ int article;/* article number */ union { char* location; long number; date_t date; } value; void* nntp_hand; /* create with nntp_openheader() * freed with nntp_closeheader() * fetch with nntp_fetchheader() */ } yyattr_t; typedef struct { int type; /* can only be en_nt_qstr, en_nt_num and en_nt_null */ union { char* location; long number; date_t date; } value; } yypar_t; enum { en_stmt_alloc = 0, /* only in allocated stat */ en_stmt_select, en_stmt_insert, en_stmt_srch_delete, en_stmt_fetch_count = 100 }; typedef struct { void* hcndes; /* nntp cndes */ int type; int errcode; int errpos; yycol_t* pcol; /* column descriptor */ yyattr_t* pattr; /* fetched required column */ yypar_t* ppar; /* user parameter area */ char* table; /* table name from yyparse */ int ncol; int npar; int count; /* num. of record has been fetched. */ char* sqlexpr; /* point to sqlexpr in hstmt_t */ char* texts_buf; char msgbuf[64]; /* buf to hold message string passed to * nnsql_yyerror() */ /* search tree */ node_t* srchtree; /* root of search tree */ node_t* node_buf; /* address of array */ int srchtreesize; /* search tree array size */ int srchtreenum; /* number of nodes in tree */ /* insert headers and values */ char** ins_heads; node_t* ins_values; /* article-num range */ long artnum_min; long artnum_max; } yystmt_t; #endif unixODBC-2.3.9/Drivers/nn/yylex.ci0000755000175000017500000000226412262474475013625 00000000000000static keywd_ent_t keywd_tab[] = { kwd_select, "select", kwd_all, "all", kwd_news, "news", kwd_xnews, "xnews", kwd_distinct, "distinct", kwd_count, "count", kwd_from, "from", kwd_where, "where", kwd_group, "group", kwd_by, "by", kwd_having, "having", kwd_order, "order", kwd_insert, "insert", kwd_into, "into", kwd_values, "values", kwd_delete, "delete", kwd_is, "is", kwd_null, "null", kwd_update, "update", kwd_create, "create", kwd_alter, "alter", kwd_drop, "drop", kwd_for, "for", kwd_of, "of", kwd_current, "current", kwd_grant, "grant", kwd_revoke, "revoke", kwd_in, "in", kwd_like, "like", kwd_escape, "escape", kwd_between, "between", kwd_call, "call", kwd_or, "or", kwd_and, "and", kwd_not, "not", kwd_index, "index", kwd_view, "view", kwd_table, "table", kwd_column, "column", kwd_case, "case", kwd_uncase, "uncase" }; static keywd_ent_t xkeywd_tab[] = /* keyword which scope in an extersion block -- { extension } */ { kwd_fn, "fn", kwd_d, "d" }; static keywd_ent_t cmpop_tab[] = { en_cmpop_eq, "=", en_cmpop_eq, "==", en_cmpop_ne, "<>", en_cmpop_ne, "!=", en_cmpop_gt, ">", en_cmpop_ge, ">=", en_cmpop_lt, "<", en_cmpop_le, "<=" }; unixODBC-2.3.9/Drivers/nn/herr.h0000755000175000017500000000472312262474475013251 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _HERR_H # define _HERR_H enum { en_00000 = 0, en_01000, en_01002, en_01004, en_01006, en_01S00, en_01S01, en_01S02, en_01S03, en_01S04, en_07001, en_07006, en_08001, en_08002, en_08003, en_08004, en_08007, en_08S01, en_0A000, en_21S01, en_21S02, en_22001, en_22003, en_22005, en_22008, en_22012, en_22026, en_23000, en_24000, en_25000, en_28000, en_34000, en_37000, en_3C000, en_40001, en_42000, en_70100, en_IM001, en_IM002, en_IM003, en_IM004, en_IM005, en_IM006, en_IM007, en_IM008, en_IM009, en_IM010, en_IM011, en_IM012, en_IM013, en_IM014, en_S0001, en_S0002, en_S0011, en_S0012, en_S0021, en_S0022, en_S0023, en_S1000, en_S1001, en_S1002, en_S1003, en_S1004, en_S1008, en_S1009, en_S1010, en_S1011, en_S1012, en_S1015, en_S1090, en_S1091, en_S1092, en_S1093, en_S1094, en_S1095, en_S1096, en_S1097, en_S1098, en_S1099, en_S1100, en_S1101, en_S1103, en_S1104, en_S1105, en_S1106, en_S1107, en_S1108, en_S1109, en_S1110, en_S1111, en_S1C00, en_S1T00 }; extern void* nnodbc_pusherr (void* stack, int code, char* msg); extern void nnodbc_poperr (void* stack); extern int nnodbc_errstkempty (void* stack); extern int nnodbc_getsqlstatcode (void* stack); extern char* nnodbc_getsqlstatstr (void* stack); extern char* nnodbc_getsqlstatmsg (void* stack); extern int nnodbc_getnativcode (void* stack); extern char* nnodbc_getnativemsg (void* stack); extern void* nnodbc_clearerr (void* stack); # define PUSHSQLERR(stack, stat) \ stack = nnodbc_pusherr(stack, stat, 0) # define PUSHSYSERR(stack, code, msg) \ stack = nnodbc_pusherr(stack, code, msg) # define UNSET_ERROR(stack) \ nnodbc_errstkunset(stack) # define CLEAR_ERROR(stack) \ stack = nnodbc_clearerr(stack) # define NNODBC_ERRHEAD "[NetNews ODBC][NNODBC driver]" #endif /* _HERR_H */ unixODBC-2.3.9/Drivers/nn/misc.c0000755000175000017500000000213512262474475013232 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include int upper_strneq( char* s1, char* s2, int n ) { int i; char c1, c2; for(i=0;i= 'a' && c1 <= 'z' ) c1 += ('A' - 'a'); else if( c1 == '\n' ) c1 = '\0'; if( c2 >= 'a' && c2 <= 'z' ) c2 += ('A' - 'a'); else if( c2 == '\n' ) c2 = '\0'; if( (c1 - c2) || !c1 || !c2 ) break; } return (int)!(c1 - c2); } int nnodbc_conndialog() { return -1; } unixODBC-2.3.9/Drivers/nn/SQLDriverConnect.c0000755000175000017500000000434512262474475015431 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLDriverConnect( HDBC hdbc, HWND hwnd, UCHAR* szConnStrIn, SWORD cbConnStrIn, UCHAR* szConnStrOut, SWORD cbConnStrOutMax, SWORD* pcbConnStrOut, UWORD fDriverCompletion) { dbc_t* pdbc = hdbc; char *dsn, *server; char buf[64]; int sqlstat = en_00000; UNSET_ERROR( pdbc->herr ); server = getkeyvalinstr((char*)szConnStrIn, cbConnStrIn, "Server", buf, sizeof(buf)); if ( ! server ) { dsn = getkeyvalinstr((char*)szConnStrIn, cbConnStrIn, "DSN", buf, sizeof(buf)); if ( !dsn ) dsn = "default"; server = getkeyvalbydsn((char*)dsn, SQL_NTS, "Server", buf, sizeof(buf)); } if ( ! server ) buf[0] = 0; switch ( fDriverCompletion ) { case SQL_DRIVER_NOPROMPT: break; case SQL_DRIVER_COMPLETE: case SQL_DRIVER_COMPLETE_REQUIRED: if ( ! server ) break; /* to next case */ case SQL_DRIVER_PROMPT: if ( nnodbc_conndialog( hwnd, buf, sizeof(buf)) ) { sqlstat = en_IM008; break; } server = buf; break; default: sqlstat = en_S1110; break; } if ( sqlstat != en_00000 ) { PUSHSQLERR( pdbc->herr, sqlstat ); return SQL_ERROR; } if ( !server ) { PUSHSYSERR( pdbc->herr, en_S1000, NNODBC_ERRHEAD "server name or address not specified" ); return SQL_ERROR; } pdbc->hcndes = nntp_connect(server); if ( ! pdbc->hcndes ) { PUSHSQLERR( pdbc->herr, en_08001 ); PUSHSYSERR( pdbc->herr, errno, nntp_errmsg(0)); return SQL_ERROR; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/hstmt.h0000755000175000017500000000153612262474475013447 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _HSTMT_H # define _HSTMT_H extern int nnodbc_sqlfreestmt(void* hstmt, int flag); extern int nnodbc_sqlprepare(void* hstmt, char* str, int len); extern void* nnodbc_getstmterrstack(void* hstmt); #endif unixODBC-2.3.9/Drivers/nn/stmt.h0000755000175000017500000000134012262474475013270 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _STMT_H # define _STMT_H # include # include #endif unixODBC-2.3.9/Drivers/nn/SQLFreeEnv.c0000755000175000017500000000147412262474475014216 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLFreeEnv( HENV henv) { CLEAR_ERROR( ((env_t*)henv)->herr ); MEM_FREE( henv ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLExecDirect.c0000755000175000017500000000210112262474475014667 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLExecDirect( HSTMT hstmt, UCHAR* szSqlStr, SDWORD cbSqlStr ) { stmt_t* pstmt = hstmt; int sqlcode; UNSET_ERROR( pstmt->herr ); sqlcode = nnodbc_sqlprepare( hstmt, (char*)szSqlStr, cbSqlStr); if ( sqlcode != SQL_SUCCESS && sqlcode != SQL_SUCCESS_WITH_INFO ) return sqlcode; sqlcode |= sqlexecute(hstmt); return sqlcode; } unixODBC-2.3.9/Drivers/nn/ChangeLog0000755000175000017500000000045512262474475013710 000000000000001999-05-15 Peter Harvey * All: Started code resconstruction to unixODBC framework. 1999-05-13 Peter Harvey * All: adapted Ke Jin's NN ODBC driver for unixODBC (1st clean compile and successfull query) * ChangeLog: Started ChangeLog unixODBC-2.3.9/Drivers/nn/yyevl.c0000755000175000017500000002643612262474475013461 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include #include #include #include #include typedef struct { int type; /* can only be en_nt_qstr, en_nt_num and en_nt_null */ union { char* qstr; long num; date_t date; } value; } leaf_t; static int getleaf(yystmt_t* yystmt, node_t* nd, leaf_t* lf) { yypar_t* par; yyattr_t* attr; switch( nd->type ) { case en_nt_attr: attr = yystmt->pattr + (nd->value).iattr; if( (nd->value).iattr == en_lines || (nd->value).iattr == en_article_num ) { lf->type = en_nt_num; (lf->value).num = (attr->value).number; break; } if( (nd->value).iattr == en_date ) { if( (attr->value).date.day ) { lf->type = en_nt_date; (lf->value).date = (attr->value).date; } else lf->type = en_nt_null; break; } if( (attr->value).location ) { lf->type = en_nt_qstr; (lf->value).qstr = (attr->value).location; } else lf->type = en_nt_null; break; case en_nt_param: par = yystmt->ppar + (nd->value).ipar - 1; if( par->type == en_nt_null ) { lf->type = en_nt_null; break; } if( par->type == en_nt_num ) { lf->type = en_nt_num; (lf->value).num = (par->value).number; break; } if( par->type == en_nt_qstr) { if( (par->value).location ) { lf->type = en_nt_qstr; (lf->value).qstr = (par->value).location; break; } lf->type = en_nt_null; break; } if( par->type == en_nt_date) { if( (par->value).date.day ) { lf->type = en_nt_date; (lf->value).date = (par->value).date; break; } lf->type = en_nt_null; } return -1; case en_nt_num: lf->type = en_nt_num; (lf->value).num = (nd->value).num; break; case en_nt_qstr: lf->type = en_nt_qstr; if( (nd->value).qstr ) { lf->type = en_nt_qstr; (lf->value).qstr = (nd->value).qstr; break; } lf->type = en_nt_null; break; case en_nt_date: lf->type = en_nt_date; (lf->value).date = (nd->value).date; break; case en_nt_null: lf->type = en_nt_null; break; default: return -1; } return 0; } #ifndef MAX_SIGNED_LONG # define MAX_SIGNED_LONG ((-1UL) >> 1) #endif # define AREA ( MAX_SIGNED_LONG + 1UL ) # define RANGE_ALL { 0, 1UL, MAX_SIGNED_LONG } # define RANGE_EMPTY { 1, 0UL, 0UL } # define ALL_RANGE(r) { r.flag = 0; \ r.min = 1UL; \ r.max = MAX_SIGNED_LONG; } # define EMPTY_RANGE(r) { r.flag = 1;\ r.min = r.max = 0UL; } # define IS_EMPTY_RANGE(r) \ (((r.min == 0UL) && (r.max==0UL))? 1:0) # define RANGE_MIN(a, b) ((((unsigned long)(a)) < ((unsigned long)(b)))? a:b) # define RANGE_MAX(a, b) ((((unsigned long)(a)) > ((unsigned long)(b)))? a:b) typedef struct { int flag; unsigned long min; unsigned long max; } range_t; static range_t range_and(range_t r1, range_t r2) { range_t r = RANGE_EMPTY; if( !(r.flag = r1.flag || r2.flag) ) return r; if( r1.min > r2.max || r1.max < r2.min ) return r; r.min = (RANGE_MAX(r1.min, r2.min))%AREA; r.max = (RANGE_MIN(r1.max, r2.max))%AREA; return r; } static range_t range_or(range_t r1, range_t r2) { range_t r = RANGE_ALL; if( !(r.flag = r1.flag || r2.flag) ) return r; if( !(r1.max/AREA) || !(r2.max/AREA) ) /* at least one of the rangion does not cross cell */ { unsigned long c1, c2; c1 = (r1.max/2) + (r1.min/2); /* central of rangion 1 */ c2 = (r2.max/2) + (r2.min/2); /* central of rangion 2 */ if( c1 > c2 && (c1 - c2) > (AREA/2) ) { /* shift it to the second cell */ r2.min += AREA; r2.max += AREA; } else if( c2 > c1 && (c2 - c1) > (AREA/2) ) { /* shift it to the second cell */ r1.min += AREA; r1.max += AREA; } } r.min = (RANGE_MIN(r1.min, r2.min))%AREA; r.max = (RANGE_MAX(r1.max, r2.max))%AREA; return r; } static range_t getrange(yystmt_t* yystmt, node_t* pnd) { range_t r = RANGE_ALL, r1, r2; node_t* tpnd = 0; leaf_t a, b; int flag = 0; if( !pnd ) return r; if( pnd->left && pnd->left->type == en_nt_attr && (pnd->left->value).iattr == en_article_num ) { r.flag = 1; switch( pnd->type ) { case en_nt_between: getleaf(yystmt, pnd->right->left, &a); getleaf(yystmt, pnd->right->right, &b); if( a.type == en_nt_null || b.type == en_nt_null ) break; r.min = RANGE_MIN(a.value.num, b.value.num); r.max = RANGE_MAX(a.value.num, b.value.num); break; case en_nt_in: EMPTY_RANGE(r); for(tpnd = pnd->right; tpnd; tpnd=tpnd->right) { getleaf(yystmt, tpnd, &a); if( a.type == en_nt_null ) continue; if( IS_EMPTY_RANGE(r) ) r.min = r.max = a.value.num; else { r.min = RANGE_MIN(r.min, a.value.num); r.max = RANGE_MAX(r.max, a.value.num); } } break; case en_nt_cmpop: getleaf(yystmt, pnd->right, &a); if( a.type == en_nt_null ) break; switch((pnd->value).cmpop) { case en_cmpop_eq: r.min = r.max = a.value.num; break; case en_cmpop_ne: r.min = (a.value.num + 1UL )%AREA; r.max = (a.value.num - 1UL + AREA)%AREA; break; case en_cmpop_gt: r.min = (a.value.num + 1UL)%AREA; break; case en_cmpop_lt: r.max = (a.value.num - 1UL + AREA)%AREA; r.min = (r.max)? 1UL:0UL; break; case en_cmpop_ge: r.min = a.value.num; break; case en_cmpop_le: r.max = a.value.num; r.min = (r.max)? 1UL:0UL; break; default: EMPTY_RANGE(r); break; } break; default: break; } return r; } if( pnd->type != en_nt_logop ) return r; switch( (pnd->value).logop ) { case en_logop_not: r1 = getrange(yystmt, pnd->right); if( r1.flag ) { r.min = (r1.max + 1UL)%AREA; r.max = (r1.min - 1UL + AREA)%AREA; } break; case en_logop_or: flag = 1; case en_logop_and: r1 = getrange(yystmt, pnd->left); r2 = getrange(yystmt, pnd->right); if( !(r1.flag || r2.flag ) ) break; if( r1.min > r1.max ) r1.max = r1.max + AREA; if( r2.min > r2.max ) r2.max = r2.max + AREA; if( flag ) r = range_or ( r1, r2 ); else r = range_and( r1, r2 ); break; default: EMPTY_RANGE(r); break; } return r; } void nnsql_getrange(void* hstmt, long* pmin, long* pmax) { yystmt_t* yystmt = hstmt; range_t r; r = getrange(hstmt, yystmt->srchtree); if( !r.flag ) { *pmin = 1UL; *pmax = MAX_SIGNED_LONG; } else { *pmin = r.min; *pmax = r.max; } } static int is_sql_null(yystmt_t* yystmt, node_t* a) { leaf_t lf; if( getleaf(yystmt, a, &lf) ) return -1; return (lf.type == en_nt_null); } static int compare(yystmt_t* yystmt, node_t* a, node_t* b, int op) { leaf_t la, lb; int diff, r; if( getleaf( yystmt, a, &la ) || getleaf( yystmt, b, &lb ) ) return -1; if( la.type == en_nt_date && lb.type == en_nt_qstr ) { lb.type = en_nt_date; if( nnsql_odbcdatestr2date(lb.value.qstr, &(lb.value.date)) ) return -1; } if( la.type != lb.type || la.type == en_nt_null || lb.type == en_nt_null ) return 0; switch( la.type ) { case en_nt_qstr: diff = STRCMP(la.value.qstr, lb.value.qstr); break; case en_nt_num: diff = la.value.num - lb.value.num; break; case en_nt_date: diff = nnsql_datecmp(&(la.value.date), &(lb.value.date)); break; default: abort(); return -1; } switch(op) { case en_cmpop_eq: r = !diff; break; case en_cmpop_ne: r = !!diff; break; case en_cmpop_gt: r = (diff>0)? 1:0; break; case en_cmpop_ge: r = (diff>=0)? 1:0; break; case en_cmpop_lt: r = (diff<0)? 1:0; break; case en_cmpop_le: r = (diff<=0)? 1:0; break; default: r = -1; break; } return r; } static int ch_case_cmp(char a, char b) { if( a >= 'a' && a <= 'z' ) a += ('A' - 'a'); if( b >= 'a' && b <= 'z' ) b += ('A' - 'a'); return (a - b); } static int strlike( char* str, char* pattern, char esc, int flag ) /* flag = 0: case sensitive */ { char c, cp; for(;;str++, pattern++) { c = *str; cp= *pattern; if( esc && cp == esc ) { cp = *pattern++; if( (!flag && (c - cp) ) || ( flag && ch_case_cmp(c, cp) ) ) return 0; if( !c ) return 1; continue; } switch(cp) { case 0: return !c; case '_': if(!c) return 0; break; case '%': if(! *(pattern + 1) ) return 1; for(;*str;str++) { if(strlike(str, pattern + 1, esc, flag)) return 1; } return 0; default: if( (!flag && (c - cp) ) || ( flag && ch_case_cmp(c, cp) ) ) return 0; break; } } } int nnsql_strlike(char* str, char* pattern, char esc, int flag) { return strlike(str, pattern, esc, flag); } static int evl_like(yystmt_t* yystmt, node_t* a, node_t* b, char esc, int flag) { leaf_t la, lb; if( getleaf(yystmt, a, &la ) || getleaf(yystmt, b, &lb ) ) return -1; if( la.type != en_nt_qstr || lb.type != en_nt_qstr ) return 0; return strlike(la.value.qstr, lb.value.qstr, esc, flag); } static int srchtree_evl(yystmt_t* yystmt, node_t* node) /* return -1: syserr, 0: fail, 1: true */ { int r, s, flag = 0; node_t* ptr; if( ! node ) return 1; switch( node->type ) { case en_nt_cmpop: return compare(yystmt, node->left, node->right, (node->value).cmpop); case en_nt_logop: switch( (node->value).logop ) { case en_logop_not: r = srchtree_evl(yystmt, node->right); if( r == -1 ) return -1; return ( ! r ); case en_logop_and: flag = 1; case en_logop_or: r = srchtree_evl(yystmt, node->left); s = srchtree_evl(yystmt, node->right); if( r == -1 || s == -1 ) return -1; if( flag ) return ( r && s ); else return ( r || s ); default: abort(); break; /* just for turn off the warning */ } break; /* just for turn off the warning */ case en_nt_isnull: return is_sql_null(yystmt, node->left); case en_nt_between: r = compare(yystmt, node->left, node->right->left, en_cmpop_ge); s = compare(yystmt, node->left, node->right->right, en_cmpop_le); if( r == -1 || s == -1 ) return -1; return ( r && s ); case en_nt_in: for(ptr=node->right; ptr; ptr=ptr->right) { r = compare(yystmt, node->left, ptr, en_cmpop_eq); if( r ) /* -1 or 1 */ return r; } return 0; case en_nt_caselike: flag = 1; case en_nt_like: return evl_like( yystmt, node->left, node->right, (node->value).esc, flag ); default: abort(); break; /* turn off the warning */ } return -1; /* just for turn off the warning */ } int nnsql_srchtree_evl(void* hstmt) { yystmt_t* yystmt = hstmt; return srchtree_evl(yystmt, yystmt->srchtree); } unixODBC-2.3.9/Drivers/nn/SQLError.c0000755000175000017500000000333512262474475013753 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLError( HENV henv, HDBC hdbc, HSTMT hstmt, UCHAR* szSqlStat, SDWORD* pNativeCode, UCHAR* szMsg, SWORD cbMsgMax, SWORD* pcbMsg ) { void* herr; char* ststr; if ( hstmt ) herr = nnodbc_getstmterrstack(hstmt); else if ( hdbc ) herr = nnodbc_getdbcerrstack(hdbc); else if ( henv ) herr = nnodbc_getenverrstack(henv); if ( nnodbc_errstkempty(herr) ) return SQL_NO_DATA_FOUND; ststr = nnodbc_getsqlstatstr(herr); if (!ststr) ststr = "S1000"; if ( szSqlStat ) STRCPY( szSqlStat, ststr ); if ( pNativeCode ) *pNativeCode = nnodbc_getnativcode(herr); if ( szMsg ) { char buf[128]; char* msg; msg = nnodbc_getsqlstatmsg(herr); if ( !msg ) msg = nnodbc_getnativemsg( herr ); if ( !msg ) msg = "(null)"; sprintf(buf, NNODBC_ERRHEAD "%s", msg); STRNCPY( szMsg, buf, cbMsgMax ); szMsg[cbMsgMax-1]=0; if ( pcbMsg ) *pcbMsg = STRLEN(szMsg); } else if (pcbMsg) *pcbMsg = 0; nnodbc_poperr(herr); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/driver.h0000755000175000017500000000412512262474475013600 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _H_DRIVER #define _H_DRIVER #include "nnconfig.h" #include "isql.h" #include "isqlext.h" #include "convert.h" #include "yystmt.h" #include "yyerr.h" #include "yyenv.h" #include "hstmt.h" #include "herr.h" typedef struct GSTMT { void* hdbc; void* hstmt; struct GSTMT* next; } gstmt_t; typedef struct DBC { void* hcndes; void* henv; gstmt_t* stmt; void* herr; struct DBC* next; } dbc_t; typedef struct { void* hdbc; void* herr; } env_t; typedef struct { int bind; short type; unsigned long coldef; short scale; char* userbuf; long userbufsize; long* pdatalen; int ctype; int sqltype; fptr_t cvt; /* c to sql type convert function */ /* for SQLPutData() on SQL_CHAR, SQL_VARCHAR, SQL_LONGVARCHAR */ char* putdtbuf; int putdtlen; int need; } param_t; typedef struct { short ctype; char* userbuf; long userbufsize; long* pdatalen; long offset; /* getdata offset */ } column_t; typedef struct { void* herr; void* hdbc; column_t* pcol; /* user bound columns */ param_t* ppar; /* user bound parameters */ int ndelay; /* number of delay parameters */ void* yystmt; /* sql layer object handle */ int refetch; /* need refetch */ int putipar; } stmt_t; #include "connect.h" #include "nnsql.h" #include "nntp.h" char* getkeyvalbydsn( char* dsn, int dsnlen, char* keywd, char* value, int size ); char* getkeyvalinstr( char* cnstr, int cnlen, char* keywd, char* value, int size ); #endif unixODBC-2.3.9/Drivers/nn/isqlext.h0000755000175000017500000002076612262474475014007 00000000000000#ifndef _INTRINSIC_SQLEXT_H # define _INTRINSIC_SQLEXT_H # include # define SQL_STILL_EXECUTING 2 # define SQL_NEED_DATA 99 /* extend SQL datatypes */ # define SQL_DATE 9 # define SQL_TIME 10 # define SQL_TIMESTAMP 11 # define SQL_LONGVARCHAR (-1) # define SQL_BINARY (-2) # define SQL_VARBINARY (-3) # define SQL_LONGVARBINARY (-4) # define SQL_BIGINT (-5) # define SQL_TINYINT (-6) # define SQL_BIT (-7) /* conflict with SQL3 ??? */ # define SQL_TYPE_DRIVER_START (-80) /* C to SQL datatype mapping */ # define SQL_C_DATE SQL_DATE # define SQL_C_TIME SQL_TIME # define SQL_C_TIMESTAMP SQL_TIMESTAMP # define SQL_C_BINARY SQL_BINARY # define SQL_C_BIT SQL_BIT # define SQL_C_TINYINT SQL_TINYINT # define SQL_SIGNED_OFFSET (-20) # define SQL_UNSIGNED_OFFSET (-22) # define SQL_C_SLONG (SQL_C_LONG + SQL_SIGNED_OFFSET) # define SQL_C_SSHORT (SQL_C_SHORT + SQL_SIGNED_OFFSET) # define SQL_C_STINYINT (SQL_TINYINT + SQL_SIGNED_OFFSET) # define SQL_C_ULONG (SQL_C_LONG + SQL_UNSIGNED_OFFSET) # define SQL_C_USHORT (SQL_C_SHORT + SQL_UNSIGNED_OFFSET) # define SQL_C_UTINYINT (SQL_TINYINT + SQL_UNSIGNED_OFFSET) # define SQL_C_BOOKMARK SQL_C_ULONG # if defined(SQL_TYPE_MIN) # undef SQL_TYPE_MIN # define SQL_TYPE_MIN SQL_BIT /* Note:If SQL_BIT uses SQL3 value (i.e. 14) then, * SQL_TYPE_MIN need to be defined as SQL_TINYINT * (i.e. -6). */ # endif # define SQL_ALL_TYPES 0 /* SQLDriverConnect flag values */ # define SQL_DRIVER_NOPROMPT 0 # define SQL_DRIVER_COMPLETE 1 # define SQL_DRIVER_PROMPT 2 # define SQL_DRIVER_COMPLETE_REQUIRED 3 # define SQL_NO_TOTAL (-4) /* SQLSetParam extensions */ # define SQL_DEFAULT_PARAM (-5) # define SQL_IGNORE (-6) # define SQL_LEN_DATA_AT_EXEC_OFFSET (-100) # define SQL_LEN_DATA_AT_EXEC(length) ( SQL_LEN_DATA_AT_EXEC_OFFSET - length ) /* function number for SQLGetFunctions */ # define SQL_API_SQLALLOCCONNECT 1 # define SQL_API_SQLALLOCENV 2 # define SQL_API_SQLALLOCSTMT 3 # define SQL_API_SQLBINDCOL 4 # define SQL_API_SQLCANCEL 5 # define SQL_API_SQLCOLATTRIBUTES 6 # define SQL_API_SQLCONNECT 7 # define SQL_API_SQLDESCRIBECOL 8 # define SQL_API_SQLDISCONNECT 9 # define SQL_API_SQLERROR 10 # define SQL_API_SQLEXECDIRECT 11 # define SQL_API_SQLEXECUTE 12 # define SQL_API_SQLFETCH 13 # define SQL_API_SQLFREECONNECT 14 # define SQL_API_SQLFREEENV 15 # define SQL_API_SQLFREESTMT 16 # define SQL_API_SQLGETCURSORNAME 17 # define SQL_API_SQLNUMRESULTCOLS 18 # define SQL_API_SQLPREPARE 19 # define SQL_API_SQLROWCOUNT 20 # define SQL_API_SQLSETCURSORNAME 21 # define SQL_API_SQLSETPARAM 22 # define SQL_API_SQLTRANSACT 23 # define SQL_NUM_FUNCTIONS 23 # define SQL_EXT_API_START 40 # define SQL_API_SQLCOLUMNS 40 # define SQL_API_SQLDRIVERCONNECT 41 # define SQL_API_SQLGETCONNECTOPTION 42 # define SQL_API_SQLGETDATA 43 # define SQL_API_SQLGETFUNCTIONS 44 # define SQL_API_SQLGETINFO 45 # define SQL_API_SQLGETSTMTOPTION 46 # define SQL_API_SQLGETTYPEINFO 47 # define SQL_API_SQLPARAMDATA 48 # define SQL_API_SQLPUTDATA 49 # define SQL_API_SQLSETCONNECTOPTION 50 # define SQL_API_SQLSETSTMTOPTION 51 # define SQL_API_SQLSPECIALCOLUMNS 52 # define SQL_API_SQLSTATISTICS 53 # define SQL_API_SQLTABLES 54 # define SQL_API_SQLBROWSECONNECT 55 # define SQL_API_SQLCOLUMNPRIVILEGES 56 # define SQL_API_SQLDATASOURCES 57 # define SQL_API_SQLDESCRIBEPARAM 58 # define SQL_API_SQLEXTENDEDFETCH 59 # define SQL_API_SQLFOREIGNKEYS 60 # define SQL_API_SQLMORERESULTS 61 # define SQL_API_SQLNATIVESQL 62 # define SQL_API_SQLNUMPARAMS 63 # define SQL_API_SQLPARAMOPTIONS 64 # define SQL_API_SQLPRIMARYKEYS 65 # define SQL_API_SQLPROCEDURECOLUMNS 66 # define SQL_API_SQLPROCEDURES 67 # define SQL_API_SQLSETPOS 68 # define SQL_API_SQLSETSCROLLOPTIONS 69 # define SQL_API_SQLTABLEPRIVILEGES 70 # define SQL_API_SQLDRIVERS 71 # define SQL_API_SQLBINDPARAMETER 72 # define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER # define SQL_API_ALL_FUNCTIONS 0 /* SQLGetInfo infor number */ # define SQL_INFO_FIRST 0 # define SQL_DRIVER_HDBC 3 # define SQL_DRIVER_HENV 4 # define SQL_DRIVER_HSTMT 5 # define SQL_DRIVER_NAME 6 # define SQL_ODBC_VER 10 # define SQL_CURSOR_COMMIT_BEHAVIOR 23 # define SQL_CURSOR_ROLLBACK_BEHAVIOR 24 # define SQL_DEFAULT_TXN_ISOLATION 26 # define SQL_TXN_ISOLATION_OPTION 72 # define SQL_NON_NULLABLE_COLUMNS 75 # define SQL_DRIVER_HLIB 76 # define SQL_DRIVER_ODBC_VER 77 # define SQL_QUALIFIER_LOCATION 114 # define SQL_INFO_LAST SQL_QUALIFIER_LOCATION # define SQL_INFO_DRIVER_START 1000 /* SQL_TXN_ISOLATION_OPTION masks */ # define SQL_TXN_READ_UNCOMMITTED 0x00000001L # define SQL_TXN_READ_COMMITTED 0x00000002L # define SQL_TXN_REPEATABLE_READ 0x00000004L # define SQL_TXN_SERIALIZABLE 0x00000008L # define SQL_TXN_VERSIONING 0x00000010L /* SQL_CURSOR_COMMIT_BEHAVIOR and SQL_CURSOR_ROLLBACK_BEHAVIOR values */ # define SQL_CB_DELETE 0x0000 # define SQL_CB_CLOSE 0x0001 # define SQL_CB_PRESERVE 0x0002 /* options for SQLGetStmtOption/SQLSetStmtOption */ # define SQL_QUERY_TIMEOUT 0 # define SQL_MAX_ROWS 1 # define SQL_NOSCAN 2 # define SQL_MAX_LENGTH 3 # define SQL_ASYNC_ENABLE 4 # define SQL_BIND_TYPE 5 # define SQL_CURSOR_TYPE 6 # define SQL_CONCURRENCY 7 # define SQL_KEYSET_SIZE 8 # define SQL_ROWSET_SIZE 9 # define SQL_SIMULATE_CURSOR 10 # define SQL_RETRIEVE_DATA 11 # define SQL_USE_BOOKMARKS 12 # define SQL_GET_BOOKMARK 13 /* GetStmtOption Only */ # define SQL_ROW_NUMBER 14 /* GetStmtOption Only */ # define SQL_STMT_OPT_MAX SQL_ROW_NUMBER # define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT /* SQL_QUERY_TIMEOUT options */ # define SQL_QUERY_TIMEOUT_DEFAULT 0UL /* SQL_MAX_ROWS options */ # define SQL_MAX_ROWS_DEFAULT 0UL /* SQL_MAX_LENGTH options */ # define SQL_MAX_LENGTH_DEFAULT 0UL /* SQL_CONCURRENCY options */ # define SQL_CONCUR_READ_ONLY 1 # define SQL_CONCUR_LOCK 2 # define SQL_CONCUR_ROWVER 3 # define SQL_CONCUR_VALUES 4 /* options for SQLSetConnectOption/SQLGetConnectOption */ # define SQL_ACCESS_MODE 101 # define SQL_AUTOCOMMIT 102 # define SQL_LOGIN_TIMEOUT 103 # define SQL_OPT_TRACE 104 # define SQL_OPT_TRACEFILE 105 # define SQL_TRANSLATE_DLL 106 # define SQL_TRANSLATE_OPTION 107 # define SQL_TXN_ISOLATION 108 # define SQL_CURRENT_QUALIFIER 109 # define SQL_ODBC_CURSORS 110 # define SQL_QUIET_MODE 111 # define SQL_PACKET_SIZE 112 # define SQL_CONN_OPT_MAX SQL_PACKET_SIZE # define SQL_CONNECT_OPT_DRVR_START 1000 # define SQL_CONN_OPT_MIN SQL_ACCESS_MODE /* SQL_ACCESS_MODE options */ # define SQL_MODE_READ_WRITE 0UL # define SQL_MODE_READ_ONLY 1UL # define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE /* SQL_AUTOCOMMIT options */ # define SQL_AUTOCOMMIT_OFF 0UL # define SQL_AUTOCOMMIT_ON 1UL # define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON /* SQL_LOGIN_TIMEOUT options */ # define SQL_LOGIN_TIMEOUT_DEFAULT 15UL /* SQL_OPT_TRACE options */ # define SQL_OPT_TRACE_OFF 0UL # define SQL_OPT_TRACE_ON 1UL # define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF # define SQL_OPT_TRACE_FILE_DEFAULT "odbc.log" /* SQL_ODBC_CURSORS options */ # define SQL_CUR_USE_IF_NEEDED 0UL # define SQL_CUR_USE_ODBC 1UL # define SQL_CUR_USE_DRIVER 2UL # define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER /* Column types and scopes in SQLSpecialColumns. */ # define SQL_BEST_ROWID 1 # define SQL_ROWVER 2 # define SQL_SCOPE_CURROW 0 # define SQL_SCOPE_TRANSACTION 1 # define SQL_SCOPE_SESSION 2 /* Operations in SQLSetPos */ # define SQL_ADD 4 /* Lock options in SQLSetPos */ # define SQL_LOCK_NO_CHANGE 0 # define SQL_LOCK_EXCLUSIVE 1 # define SQL_LOCK_UNLOCK 2 /* SQLExtendedFetch flag values */ # define SQL_FETCH_NEXT 1 # define SQL_FETCH_FIRST 2 # define SQL_FETCH_LAST 3 # define SQL_FETCH_PRIOR 4 # define SQL_FETCH_ABSOLUTE 5 # define SQL_FETCH_RELATIVE 6 # define SQL_FETCH_BOOKMARK 8 /* Defines for SQLBindParameter/SQLProcedureColumns */ # define SQL_PARAM_TYPE_UNKNOWN 0 # define SQL_PARAM_INPUT 1 # define SQL_PARAM_INPUT_OUTPUT 2 # define SQL_RESULT_COL 3 # define SQL_PARAM_OUTPUT 4 /* Defines used by Driver Manager for mapping SQLSetParam to SQLBindParameter */ # define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT # define SQL_SETPARAM_VALUE_MAX (-1L) /* SQLStatistics flag values */ # define SQL_INDEX_UNIQUE 0 # define SQL_INDEX_ALL 1 # define SQL_QUICK 0 # define SQL_ENSURE 1 /* SQLSetScrollOption flag values */ # define SQL_SCROLL_FORWARD_ONLY 0L # define SQL_SCROLL_KEYSET_DRIVEN (-1L) # define SQL_SCROLL_DYNAMIC (-2L) # define SQL_SCROLL_STATIC (-3L) typedef struct { SWORD year; UWORD month; UWORD day; } DATE_STRUCT; #endif unixODBC-2.3.9/Drivers/nn/isql.h0000755000175000017500000000427112262474475013257 00000000000000#ifndef _INTRINSIC_SQL_H #define _INTRINSIC_SQL_H typedef unsigned char UCHAR; #if (SIZEOF_LONG_INT == 4) typedef long int SDWORD; typedef unsigned long int UDWORD; #else typedef int SDWORD; typedef unsigned int UDWORD; #endif typedef short int SWORD; typedef unsigned short int UWORD; typedef void FAR* PTR; typedef void FAR* HENV; typedef void FAR* HDBC; typedef void FAR* HSTMT; typedef signed short RETCODE; #ifdef WIN32 #define SQL_API __stdcall #else #define SQL_API EXPORT CALLBACK #endif #define ODBCVER 0x0200 #define SQL_MAX_MESSAGE_LENGTH 512 #define SQL_MAX_DSN_LENGTH 32 /* return code */ #define SQL_INVALID_HANDLE (-2) #define SQL_ERROR (-1) #define SQL_SUCCESS 0 #define SQL_SUCCESS_WITH_INFO 1 #define SQL_NO_DATA_FOUND 100 /* standard SQL datatypes (agree with ANSI type numbering) */ #define SQL_CHAR 1 #define SQL_NUMERIC 2 #define SQL_DECIMAL 3 #define SQL_INTEGER 4 #define SQL_SMALLINT 5 #define SQL_FLOAT 6 #define SQL_REAL 7 #define SQL_DOUBLE 8 #define SQL_VARCHAR 12 #define SQL_TYPE_MIN SQL_CHAR #define SQL_TYPE_NULL 0 #define SQL_TYPE_MAX SQL_VARCHAR /* C to SQL datatype mapping */ #define SQL_C_CHAR SQL_CHAR #define SQL_C_LONG SQL_INTEGER #define SQL_C_SHORT SQL_SMALLINT #define SQL_C_FLOAT SQL_REAL #define SQL_C_DOUBLE SQL_DOUBLE #define SQL_C_DEFAULT 99 #define SQL_NO_NULLS 0 #define SQL_NULLABLE 1 #define SQL_NULLABLE_UNKNOWN 2 /* some special length values */ #define SQL_NULL_DATA (-1) #define SQL_DATA_AT_EXEC (-2) #define SQL_NTS (-3) /* SQLFreeStmt flag values */ #define SQL_CLOSE 0 #define SQL_DROP 1 #define SQL_UNBIND 2 #define SQL_RESET_PARAMS 3 /* SQLTransact flag values */ #define SQL_COMMIT 0 #define SQL_ROLLBACK 1 /* SQLColAttributes flag values */ #define SQL_COLUMN_COUNT 0 #define SQL_COLUMN_LABEL 18 #define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL #define SQL_COLUMN_DRIVER_START 1000 #define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT /* Null handles */ #define SQL_NULL_HENV 0 #define SQL_NULL_HDBC 0 #define SQL_NULL_HSTMT 0 #endif unixODBC-2.3.9/Drivers/nn/yystmt.c0000755000175000017500000004020112262474475013644 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" static char sccsid[] = "@(#)NNSQL(NetNews SQL) v0.5, Copyright(c) 1995, 1996 by Ke Jin"; static int yyunbindpar(yystmt_t* yystmt, int ipar); void* nnsql_allocyystmt(void* hcndes) { yystmt_t* yystmt; yystmt = (yystmt_t*)MEM_ALLOC(sizeof(yystmt_t)); if( ! yystmt ) return 0; MEM_SET(yystmt, 0, sizeof(yystmt_t)); yystmt->hcndes = hcndes; return yystmt; } void nnsql_close_cursor(void* hstmt) { yystmt_t* yystmt = hstmt; yyattr_t* pattr; int i; if( !hstmt ) return; for(pattr = yystmt->pattr, i=0; pattr && i<=en_body; pattr++, i++) { pattr->stat = 0; /* not needed */ pattr->wstat= 0; nntp_closeheader(pattr->nntp_hand); pattr->nntp_hand = 0; } } void nnsql_dropyystmt(void* hstmt) { yystmt_t* yystmt = hstmt; int i; if(! hstmt ) return; /* allocated for any statement */ MEM_FREE( yystmt->texts_buf ); MEM_FREE( yystmt->sqlexpr ); /* allocated for SELECT statement */ MEM_FREE( yystmt->node_buf ); MEM_FREE( yystmt->pcol ); nnsql_close_cursor(hstmt); if( yystmt->pattr ) { MEM_FREE( (yystmt->pattr)[en_body].value.location ); MEM_FREE( yystmt->pattr ); } /* allocated for yybindpar(). i.e. nnsql_put{date, str, num}() */ for(i=1;;i++) { if( yyunbindpar(yystmt, i) ) break; } MEM_FREE( yystmt->ppar ); /* allocated for INSERT statement */ MEM_FREE( yystmt->ins_heads ); MEM_FREE( yystmt->ins_values); /* the statement object itself */ MEM_FREE( hstmt ); } static void nnsql_resetyystmt(void* hstmt) { yystmt_t* yystmt = hstmt; int i; if( ! hstmt ) return; yystmt->type = en_stmt_alloc; /* clear result from any statement */ MEM_FREE( yystmt->sqlexpr ); MEM_FREE( yystmt->texts_buf ); yystmt->sqlexpr = 0; yystmt->texts_buf = 0; yystmt->table = 0; yystmt->ncol = 0; yystmt->npar = 0; yystmt->count = 0; /* reset the search tree (but not free the buffer of it) */ yystmt->srchtree = 0; yystmt->srchtreenum = 0; /* clear fetched result */ nnsql_close_cursor(hstmt); /* clear result of bindpar() */ for(i=1; ;i++ ) { if( yyunbindpar(yystmt, i) ) break; } /* clear result of insert statement */ MEM_FREE( yystmt->ins_heads ); MEM_FREE( yystmt->ins_values ); yystmt->ins_heads = 0; yystmt->ins_values= 0; } static int yyfetch(void* hstmt, int wstat) { int i, j, nattr; yystmt_t* yystmt = hstmt; if( ! hstmt || ! yystmt->pattr ) return -1; for(i=en_article_num + 1, nattr=0; i<= en_body; i++) { yyattr_t* pattr; yyattr_t* tpattr; void* hrh = 0; pattr = yystmt->pattr + i; if(i == en_body ) { if( nattr ) break; i = en_lines; /* use lines to retrive article number */ pattr = yystmt->pattr; nattr --; } if( pattr->stat && pattr->wstat == wstat ) { char* header; long data; int r; nattr++; if( ! (header = nnsql_getcolnamebyidx(i)) ) return -1; if( !wstat && !hrh ) { for(j = 0, tpattr = yystmt->pattr; j < en_body; j++) { tpattr++; if( tpattr->wstat ) { hrh = tpattr->nntp_hand; break; } } if( !hrh && yystmt->pattr->wstat ) hrh = yystmt->pattr->nntp_hand; } if( ! pattr->nntp_hand ) { nnsql_getrange(yystmt, &(yystmt->artnum_min), &(yystmt->artnum_max)); pattr->nntp_hand = nntp_openheader( yystmt->hcndes, header, &(yystmt->artnum_min), &(yystmt->artnum_max) ); if( ! pattr->nntp_hand ) return -1; } if( yystmt->artnum_max ) r = nntp_fetchheader( pattr->nntp_hand, &((yystmt->pattr->value).number), &data, hrh ); else r = 100; if( !r && !i ) { data = (yystmt->pattr->value).number; if(data > yystmt->artnum_max) r = 100; } switch(r) { case 100: (yystmt->pattr->value).number = 0; case -1: nntp_closeheader(pattr->nntp_hand); pattr->nntp_hand = 0; return r; case 0: break; default: abort(); break; } switch(i) { case en_lines: if( nattr ) (pattr->value).number = (long)(data); else return 0; break; case en_date: nnsql_nndatestr2date((char*)data, &((pattr->value).date) ); break; default: (pattr->value).location = (char*)(data); break; } } } return 0; } #include int nnsql_fetch(void* hstmt) { int r, i; yystmt_t* pstmt = hstmt; yyattr_t* pattr = pstmt->pattr + en_body; for(;;) { switch( pstmt->type ) { case en_stmt_fetch_count: pstmt->type = en_stmt_alloc; return 100; case en_stmt_select: break; default: return -1; } r = yyfetch(hstmt, 1); switch(r) { case 100: for(i=1; incol; i++) { if( (pstmt->pcol + i)->iattr == en_sql_count ) { pstmt->type = en_stmt_fetch_count; return 0; } } pstmt->type = en_stmt_alloc; return 100; case -1: pstmt->type = en_stmt_alloc; return -1; case 0: r = nnsql_srchtree_evl(hstmt); switch(r) { case -1: pstmt->type = en_stmt_alloc; return r; case 1: pstmt->count++; if( pstmt->ncol == 2 && (pstmt->pcol + 1)->iattr == en_sql_count ) continue; if( (r = yyfetch(hstmt, 0)) == -1 ) { pstmt->type = en_stmt_alloc; return -1; } if( pattr->stat ) /* pattr has already init to point * to the en_body attr */ { MEM_FREE( (pattr->value).location ); (pattr->value).location = nntp_body( pstmt->hcndes, (pstmt->pattr->value).number, 0); } return 0; case 0: continue; default: abort(); break; } break; default: abort(); break; } break; } abort(); return -1; } int nnsql_opentable(void* hstmt, char* table) { yystmt_t* yystmt = hstmt; if(! hstmt ) return -1; if( !table ) table = yystmt->table; return nntp_group( yystmt->hcndes, table ); } int nnsql_yyunbindpar(void* yystmt, int ipar) { return yyunbindpar(yystmt, ipar); } static int yyunbindpar(yystmt_t* yystmt, int ipar) { int i; yypar_t* par; if( yystmt || ipar <= 0 || ipar > MAX_PARAM_NUMBER || yystmt->ppar ) return -1; par = yystmt->ppar + ipar - 1; switch( par->type ) { case -1: case en_nt_num: case en_nt_null: break; case en_nt_qstr: MEM_FREE( par->value.location ); break; default: abort(); break; } yystmt->ppar->type = -1; return 0; } static int yybindpar(yystmt_t* yystmt, int ipar, long data, int type) { int i; ipar --; if( ! yystmt->ppar ) { yystmt->ppar = (yypar_t*)MEM_ALLOC( sizeof(yypar_t)*MAX_PARAM_NUMBER); if( ! yystmt->ppar ) { yystmt->errcode = -1; return -1; } for(i=0; ippar)[i].type = -1; /* unbind */ } yyunbindpar( yystmt, ipar + 1); (yystmt->ppar)[ipar].type = type; switch(type) { case en_nt_null: return 0; case en_nt_qstr: (yystmt->ppar)[ipar].value.location = (char*)data; break; case en_nt_num: (yystmt->ppar)[ipar].value.number = (long)data; break; case en_nt_date: (yystmt->ppar)[ipar].value.date = *((date_t*)data); break; default: abort(); break; } return 0; } int nnsql_putnull(void* hstmt, int ipar ) { return yybindpar((yystmt_t*)hstmt, ipar, 0, en_nt_null); } int nnsql_putstr(void* hstmt, int ipar, char* str) { return yybindpar((yystmt_t*)hstmt, ipar, (long)str, en_nt_qstr); } int nnsql_putnum(void* hstmt, int ipar, long num) { return yybindpar((yystmt_t*)hstmt, ipar, num, en_nt_num); } int nnsql_putdate(void* hstmt, int ipar, date_t* date) { return yybindpar((yystmt_t*)hstmt, ipar, (long)(date), en_nt_date); } int nnsql_max_param() { return MAX_PARAM_NUMBER; } int nnsql_max_column() { return MAX_COLUMN_NUMBER; } static int access_mode_chk( yystmt_t* pstmt ) { int mode; pstmt->errcode = 0; mode = nntp_getaccmode(pstmt->hcndes); switch( pstmt->type ) { case en_stmt_insert: if( mode < ACCESS_MODE_INSERT ) pstmt->errcode = NO_INSERT_PRIVILEGE; break; case en_stmt_srch_delete: if( nnsql_strlike( pstmt->table, "%.test", 0, 0) ) { if( mode < ACCESS_MODE_DELETE_TEST ) pstmt->errcode = NO_DELETE_PRIVILEGE; } else { if( mode < ACCESS_MODE_DELETE_ANY ) pstmt->errcode = NO_DELETE_ANY_PRIVILEGE; } if( nnsql_opentable(pstmt, 0) ) return -1; break; case en_stmt_select: if( nnsql_opentable(pstmt, 0) ) return -1; return 0; default: pstmt->errcode = -1; break; } if( ! pstmt->errcode && ! nntp_postok( pstmt->hcndes ) ) pstmt->errcode = NO_POST_PRIVILEGE; if( pstmt->errcode ) { nnsql_resetyystmt(pstmt); return -1; } return 0; } int nnsql_prepare(void* hstmt, char* expr, int len) { yyenv_t yyenv; yystmt_t* pstmt = hstmt; int r; if( ! hstmt || ! expr || len < 0 ) return -1; nnsql_resetyystmt(hstmt); pstmt->errcode = -1; pstmt->sqlexpr = MEM_ALLOC(len + 1); if( ! pstmt->sqlexpr ) return -1; pstmt->texts_buf = MEM_ALLOC( len + 1 ); if( ! pstmt->texts_buf ) { MEM_FREE( pstmt->sqlexpr ); pstmt->sqlexpr = 0; return -1; } STRNCPY(pstmt->sqlexpr, expr, len); (pstmt->sqlexpr)[len] = 0; nnsql_yyinit(&yyenv, pstmt); if( nnsql_yyparse(&yyenv) || access_mode_chk( pstmt ) ) { nnsql_resetyystmt(pstmt); return -1; } return 0; } int nnsql_column_descid(void* hstmt, int icol) { if( icol < 0 || icol > MAX_COLUMN_NUMBER ) return -1; return (((yystmt_t*)hstmt)->pcol)[icol].iattr; } static int do_insert(void* hstmt) { yystmt_t* pstmt = hstmt; char *body, *head, *value; node_t* node; int i, attridx; yypar_t* par; int subj_set = 0, from_set = 0; pstmt->count = 0; if( nntp_start_post( pstmt->hcndes) || nntp_send_head( pstmt->hcndes, "X-Newsreader", "NetNews SQL Agent v0.5") || nntp_send_head( pstmt->hcndes, "Newsgroups", pstmt->table ) ) return -1; for(i=0; ;i++) { head = (pstmt->ins_heads)[i]; if( ! head ) break; if( ! *head ) continue; attridx = nnsql_getcolidxbyname( head ); switch( attridx ) { case en_article_num: case en_x_newsreader: case en_newsgroups: case en_xref: case en_host: case en_date: case en_path: case en_lines: case en_msgid: /* better to let srv set id */ continue; case en_subject: subj_set = 1; break; case en_from: from_set = 1; break; case -1: /* an extended header */ break; default: /* any normal header */ head = nnsql_getcolnamebyidx(attridx); /* use stand representation */ break; } node = pstmt->ins_values + i; switch(node->type) { case en_nt_qstr: value = node->value.qstr; break; case en_nt_null: continue; case en_nt_param: par = pstmt->ppar + (node->value).ipar - 1; if(par->type != en_nt_qstr ) continue; value = (par->value).location; break; default: continue; } if( attridx == en_body ) { body = value; continue; } nntp_send_head(pstmt->hcndes, head, value); } if( !subj_set ) nntp_send_head(pstmt->hcndes, "Subject", "(none)"); if( !from_set ) nntp_send_head(pstmt->hcndes, "From", "(none)"); if( nntp_end_head (pstmt->hcndes) || nntp_send_body(pstmt->hcndes, body) || nntp_end_post (pstmt->hcndes) ) return -1; pstmt->count = 1; return 0; } int do_srch_delete(void* hstmt) { int r, i, rcnt; yystmt_t* pstmt = hstmt; yyattr_t* pattr = pstmt->pattr; pstmt->count = 0; for(;;) { r = yyfetch(hstmt, 1); switch(r) { case 100: pstmt->type = en_stmt_alloc; return 0; case -1: pstmt->type = en_stmt_alloc; return -1; case 0: r = nnsql_srchtree_evl(hstmt); switch(r) { case -1: pstmt->type = en_stmt_alloc; return -1; case 1: for(rcnt=0; r && rcnt<6; rcnt++) /* retry 6 times */ { if(rcnt && pstmt->count ) sleep(1 + rcnt); /* give server time to * finish previous DELETE */ r = nntp_cancel( pstmt->hcndes, pstmt->table, pattr[en_sender].value.location, pattr[en_from].value.location, pattr[en_msgid].value.location); } if( r ) return -1; pstmt->count++; continue; case 0: continue; default: abort(); break; } break; default: abort(); break; } break; } abort(); return -1; } int nnsql_execute(void* hstmt) { yystmt_t* pstmt = hstmt; yypar_t* par; int i; par = pstmt->ppar; if( !par && pstmt->npar ) return 99; for(i=0;inpar;i++) { par = pstmt->ppar + i; if(par->type == -1) return 99; } switch(pstmt->type) { case en_stmt_insert: return do_insert(hstmt); case en_stmt_srch_delete: case en_stmt_select: if( nnsql_srchtree_tchk(hstmt) || nnsql_opentable(hstmt, 0) ) break; if( pstmt->type == en_stmt_srch_delete ) return do_srch_delete(hstmt); return 0; default: break; } return -1; } int nnsql_isnullablecol( void* hstmt, int icol ) { switch( (((yystmt_t*)hstmt)->pcol + icol)->iattr ) { case en_subject: case en_from: case en_body: return 0; default: break; } return 1; } int nnsql_isnumcol(void* hstmt, int icol ) { switch( (((yystmt_t*)hstmt)->pcol + icol)->iattr ) { case en_lines: case en_article_num: case en_sql_count: case en_sql_num: return 1; default: break; } return 0; } int nnsql_isdatecol(void* hstmt, int icol) { switch( (((yystmt_t*)hstmt)->pcol + icol)->iattr ) { case en_date: case en_sql_date: return 1; default: break; } return 0; } long nnsql_getnum(void* hstmt, int icol ) { yystmt_t* pstmt = hstmt; yycol_t* pcol; pcol = ((yystmt_t*)hstmt)->pcol + icol; switch( pcol->iattr ) { case en_lines: case en_article_num: return ((pstmt->pattr + pcol->iattr)->value).number; case en_sql_num: return (pcol->value).num; case en_sql_count: return (pstmt->count); default: break; } return 0; } int nnsql_isstrcol(void* hstmt, int icol ) { return ! nnsql_isnumcol(hstmt, icol) && ! nnsql_isdatecol(hstmt, icol); } char* nnsql_getstr(void* hstmt, int icol ) { yystmt_t* pstmt = hstmt; yycol_t* pcol; pcol = ((yystmt_t*)hstmt)->pcol + icol; switch( pcol->iattr ) { case en_lines: case en_article_num: case en_sql_count: case en_sql_num: return 0; case en_sql_qstr: return (pcol->value).qstr; default: break; } return ((pstmt->pattr + pcol->iattr)->value).location; } date_t* nnsql_getdate(void* hstmt, int icol ) { yystmt_t* pstmt = hstmt; yycol_t* pcol; pcol = ((yystmt_t*)hstmt)->pcol + icol; switch( pcol->iattr ) { case en_date: return &(((pstmt->pattr + pcol->iattr)->value).date); case en_sql_date: return &((pcol->value).date); default: break; } return 0; } int nnsql_iscountcol(void* hstmt, int icol ) { return ( (((yystmt_t*)hstmt)->pcol + icol)->iattr == en_sql_count ); } int nnsql_isnullcol(void* hstmt, int icol ) { yystmt_t* pstmt = hstmt; yycol_t* pcol; long artnum; date_t* date; artnum = (pstmt->pattr->value).number; pcol = ((yystmt_t*)hstmt)->pcol + icol; switch( pcol->iattr ) { case en_sql_count: return !!artnum; case en_sql_num: case en_sql_qstr: case en_sql_date: case en_lines: case en_article_num: return !artnum; case en_date: date = nnsql_getdate(hstmt, icol); return !artnum || !date || !date->day; default: break; } return !artnum || !nnsql_getstr(hstmt, icol); } int nnsql_getcolnum(void* hstmt) { return ((yystmt_t*)hstmt)->ncol; } int nnsql_getparnum(void* hstmt) { return ((yystmt_t*)hstmt)->npar; } int nnsql_getrowcount(void* hstmt) { return ((yystmt_t*)hstmt)->count; } unixODBC-2.3.9/Drivers/nn/SQLFetch.c0000755000175000017500000000604412262474475013713 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLFetch( HSTMT hstmt ) { stmt_t* pstmt = hstmt; column_t* pcol = pstmt->pcol; int ncol, i; long len, clen; char* ptr; int sqltype, sqlstat, dft_ctype, flag = 0, err; fptr_t cvt; char* ret; UNSET_ERROR( pstmt->herr ); ncol = nnsql_getcolnum(pstmt->yystmt); if ( !pstmt->refetch && (err = nnsql_fetch(pstmt->yystmt)) ) { int code; if ( err == 100 ) return SQL_NO_DATA_FOUND; code = nnsql_errcode(pstmt->yystmt); if ( code == -1 ) code = errno; PUSHSYSERR( pstmt->herr, code, nnsql_errmsg(pstmt->yystmt)); return SQL_ERROR; } if ( !pcol ) { int max; max = nnsql_max_column(); pcol = pstmt->pcol = (column_t*)MEM_ALLOC( sizeof(column_t)*(max+1) ); if ( ! pcol ) { PUSHSQLERR( pstmt->herr, en_S1001 ); return SQL_ERROR; } MEM_SET(pcol, 0, sizeof(column_t)*(max+1) ); return SQL_SUCCESS; } for (i=0;ioffset = 0; if ( ! pcol->userbuf ) continue; if ( nnsql_isnullcol(pstmt->yystmt, i) ) { if ( pcol->pdatalen ) *(pcol->pdatalen) = SQL_NULL_DATA; continue; } if ( pcol->pdatalen ) *(pcol->pdatalen ) = 0L; if ( nnsql_isstrcol(pstmt->yystmt, i) ) { ptr = nnsql_getstr(pstmt->yystmt, i); len = STRLEN(ptr) + 1; sqltype = SQL_CHAR; dft_ctype = SQL_C_CHAR; } else if ( nnsql_isnumcol(pstmt->yystmt, i) ) { ptr = (char*)nnsql_getnum(pstmt->yystmt, i); sqltype = SQL_INTEGER; dft_ctype = SQL_C_LONG; } else if ( nnsql_isdatecol(pstmt->yystmt, i) ) { ptr = (char*)nnsql_getdate(pstmt->yystmt, i); sqltype = SQL_DATE; dft_ctype = SQL_C_DATE; } else abort(); if ( pcol->ctype == SQL_C_DEFAULT ) pcol->ctype = dft_ctype; cvt = nnodbc_get_sql2c_cvt(sqltype, pcol->ctype); if ( ! cvt ) { pstmt->refetch = 1; PUSHSQLERR(pstmt->herr, en_07006); return SQL_ERROR; } ret = cvt( ptr, pcol->userbuf, pcol->userbufsize, &clen); if ( ret ) { pstmt->refetch = 1; if ( clen ) sqlstat = en_22003; else sqlstat = en_22005; PUSHSQLERR( pstmt->herr, sqlstat ); return SQL_ERROR; } if ( len && clen == len ) flag = 1; if ( len && pcol->pdatalen ) *(pcol->pdatalen) = clen; /* not 'len' but 'clen' */ } if ( flag ) { PUSHSQLERR( pstmt->herr, en_01004 ); return SQL_SUCCESS_WITH_INFO; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLPrepare.c0000755000175000017500000000163412262474475014260 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLPrepare( HSTMT hstmt, UCHAR* szSqlStr, SDWORD cbSqlStr ) { stmt_t* pstmt = hstmt; UNSET_ERROR( pstmt->herr ); return nnodbc_sqlprepare(hstmt, (char*)szSqlStr, cbSqlStr); } unixODBC-2.3.9/Drivers/nn/SQLDescribeCol.c0000755000175000017500000000430512262474475015036 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLDescribeCol( HSTMT hstmt, UWORD icol, UCHAR* szColName, SWORD cbColNameMax, SWORD* pcbColName, SWORD* pfSqlType, UDWORD* pcbColDef, SWORD* pibScale, SWORD* pfNullable ) { stmt_t* pstmt = hstmt; char* colname; int colnamelen, sqltype, precision, ncol; RETCODE retcode = SQL_SUCCESS; UNSET_ERROR( pstmt->herr ); ncol = nnsql_getcolnum(pstmt->yystmt); if ( icol > (UWORD)(ncol - 1) ) { PUSHSQLERR( pstmt->herr, en_S1002 ); return SQL_ERROR; } colname = nnsql_getcolnamebyidx( nnsql_column_descid(pstmt->yystmt, icol) ); colnamelen = STRLEN(colname); if ( szColName ) { if ( cbColNameMax < colnamelen + 1 ) { colnamelen = cbColNameMax - 1; PUSHSQLERR( pstmt->herr, en_01004 ); retcode = SQL_SUCCESS_WITH_INFO; } STRNCPY( szColName, colname, colnamelen); szColName[colnamelen] = 0; if ( pcbColName ) *pcbColName = colnamelen; } if ( nnsql_isstrcol(pstmt->yystmt, icol) ) { sqltype = SQL_LONGVARCHAR; precision = SQL_NO_TOTAL; } else if ( nnsql_isnumcol(pstmt->yystmt, icol) ) { sqltype = SQL_INTEGER; precision = 10; } else if ( nnsql_isdatecol(pstmt->yystmt, icol) ) { sqltype = SQL_DATE; precision = 10; } else { sqltype= 0; precision = SQL_NO_TOTAL; } if ( pfSqlType ) *pfSqlType = sqltype; if ( pcbColDef ) *pcbColDef = precision; if ( pfNullable ) *pfNullable = nnsql_isnullablecol(pstmt->yystmt, icol); return retcode; } unixODBC-2.3.9/Drivers/nn/Makefile.in0000664000175000017500000006427013725127174014203 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = Drivers/nn ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libnn_la_LIBADD = am_libnn_la_OBJECTS = SQLAllocConnect.lo SQLAllocEnv.lo \ SQLAllocStmt.lo SQLBindCol.lo SQLBindParameter.lo SQLCancel.lo \ SQLConnect.lo SQLDescribeCol.lo SQLDisconnect.lo \ SQLDriverConnect.lo SQLError.lo SQLExecDirect.lo SQLExecute.lo \ SQLFetch.lo SQLFreeConnect.lo SQLFreeEnv.lo SQLFreeStmt.lo \ SQLGetConnectOption.lo SQLGetData.lo SQLNumParams.lo \ SQLNumResultCols.lo SQLParamData.lo SQLPrepare.lo \ SQLPutData.lo SQLRowCount.lo SQLSetConnectOption.lo \ SQLSetParam.lo misc.lo connect.lo convert.lo execute.lo \ herr.lo prepare.lo yyparse.lo yylex.lo yystmt.lo yyerr.lo \ yyevl.lo yytchk.lo nncol.lo nndate.lo nntp.lo libnn_la_OBJECTS = $(am_libnn_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libnn_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libnn_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = YLWRAP = $(top_srcdir)/ylwrap SOURCES = $(libnn_la_SOURCES) DIST_SOURCES = $(libnn_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/ylwrap ChangeLog \ README TODO yyparse.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libnn.la AM_CPPFLAGS = -I@top_srcdir@/include -I. libnn_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module EXTRA_DIST = \ nnconfig.h \ connect.h \ convert.h \ driver.h \ herr.h \ hstmt.h \ isql.h \ isqlext.h \ nncol.h \ nndate.h \ nnsql.h \ nntp.h \ stmt.h \ yyenv.h \ yyerr.h \ yylex.h \ yyparse.tab.h \ yystmt.h \ herr.ci \ nncol.ci \ nntp.ci \ yyerr.ci \ yylex.ci \ README libnn_la_SOURCES = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParameter.c \ SQLCancel.c \ SQLConnect.c \ SQLDescribeCol.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLFetch.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeStmt.c \ SQLGetConnectOption.c \ SQLGetData.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLPrepare.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectOption.c \ SQLSetParam.c \ misc.c \ connect.c \ convert.c \ execute.c \ herr.c \ prepare.c \ yyparse.y \ yylex.c \ yystmt.c \ yyerr.c \ yyevl.c \ yytchk.c \ nncol.c \ nndate.c \ nntp.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Drivers/nn/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Drivers/nn/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libnn.la: $(libnn_la_OBJECTS) $(libnn_la_DEPENDENCIES) $(EXTRA_libnn_la_DEPENDENCIES) $(AM_V_CCLD)$(libnn_la_LINK) -rpath $(libdir) $(libnn_la_OBJECTS) $(libnn_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindParameter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCancel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDisconnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDriverConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecDirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumParams.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumResultCols.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPutData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRowCount.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/herr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nncol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nndate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nntp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yyerr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yyevl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yylex.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yyparse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yystmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yytchk.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f yyparse.c clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/Drivers/nn/connect.c0000755000175000017500000001364512262474475013740 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" void* nnodbc_getenverrstack(void* henv) { return ((env_t*)henv)->herr; } void* nnodbc_getdbcerrstack(void* hdbc) { return ((dbc_t*)hdbc)->herr; } void nnodbc_pushdbcerr( void* hdbc, int code, char* msg ) { PUSHSYSERR( ((dbc_t*)hdbc)->herr, code, msg ); } void* nnodbc_getnntpcndes( void* hdbc ) { return ((dbc_t*)hdbc)->hcndes; } int nnodbc_attach_stmt(void* hdbc, void* hstmt) { dbc_t* pdbc = hdbc; gstmt_t* pstmt; pstmt = (gstmt_t*)MEM_ALLOC(sizeof(gstmt_t)); if( ! pstmt ) { PUSHSQLERR( pdbc->herr, en_S1001 ); return SQL_ERROR; } pstmt->next = pdbc->stmt; pdbc->stmt = pstmt; pstmt->hstmt= hstmt; pstmt->hdbc = pdbc; return SQL_SUCCESS; } int nnodbc_detach_stmt(void* hdbc, void* hstmt) { dbc_t* pdbc = hdbc; gstmt_t* pstmt; gstmt_t* ptr; for(pstmt=pdbc->stmt;pstmt;pstmt = pstmt->next) { if(pstmt->hstmt == hstmt) { pdbc->stmt = pstmt->next; MEM_FREE(pstmt); return 0; } if(pstmt->next->hstmt == hstmt ) { ptr = pstmt->next; pstmt->next = ptr->next; MEM_FREE(ptr); return 0; } } return -1; } char* /* return new position in input str */ readtoken( char* istr, /* old position in input buf */ char* obuf ) /* token string ( if "\0", then finished ) */ { for(; *istr && *istr != '\n' ; istr ++ ) { char c, nx; c = *(istr); if( c == ' ' || c == '\t' ) { continue; } nx = *(istr + 1); *obuf = c; obuf ++; if( c == ';' || c == '=' ) { istr ++; break; } if( nx == ' ' || nx == '\t' || nx == ';' || nx == '=' ) { istr ++; break; } } *obuf = '\0'; return istr; } #if !defined(WINDOWS) && !defined(WIN32) && !defined(OS2) # include # define UNIX_PWD #endif char* getinitfile(char* buf, int size) { int i, j; char* ptr; j = STRLEN("/odbc.ini") + 1; if( size < j ) { return NULL; } #if !defined(UNIX_PWD) i = GetWindowsDirectory((LPSTR)buf, size ); if( i == 0 || i > size - j ) { return NULL; } sprintf( buf + i, "/odbc.ini"); return buf; #else ptr = (char*)getpwuid(getuid()); if( ptr == NULL ) { return NULL; } ptr = ((struct passwd*)ptr)->pw_dir; if( ptr == NULL || *ptr == '\0' ) { ptr = "/home"; } if( size < STRLEN(ptr) + j ) { return NULL; } sprintf( buf, "%s%s", ptr, "/.odbc.ini"); /* i.e. searching ~/.odbc.ini */ #endif return buf; } char* getkeyvalbydsn( char* dsn, int dsnlen, char* keywd, char* value, int size ) /* read odbc init file to resolve the value of specified * key from named or defaulted dsn section */ { char buf[1024]; char dsntk[SQL_MAX_DSN_LENGTH + 3] = { '[', '\0' }; char token[1024]; /* large enough */ FILE* file; char pathbuf[1024]; char* path; #define DSN_NOMATCH 0 #define DSN_NAMED 1 #define DSN_DEFAULT 2 int dsnid = DSN_NOMATCH; int defaultdsn = DSN_NOMATCH; if( dsn == NULL || *dsn == 0 ) { dsn = "default"; dsnlen = STRLEN(dsn); } if( dsnlen == SQL_NTS ) { dsnlen = STRLEN(dsn); } if( dsnlen <= 0 || keywd == NULL || buf == 0 || size <= 0 ) { return NULL; } if( dsnlen > sizeof(dsntk) - 2 ) { return NULL; } STRNCAT( dsntk, dsn, dsnlen ); STRCAT( dsntk, "]" ); value[0] = 0; dsnlen = dsnlen + 2; path = getinitfile(pathbuf, sizeof(pathbuf)); if( path == NULL ) { return NULL; } file = (FILE*)fopen(path, "r"); if( file == NULL ) { return NULL; } for(;;) { char* str; str = fgets(buf, sizeof(buf), file); if( str == NULL ) { break; } if( *str == '[' ) { if( upper_strneq(str, "[default]", STRLEN("[default]")) ) { /* we only read first dsn default dsn * section (as well as named dsn). */ if( defaultdsn == DSN_NOMATCH ) { dsnid = DSN_DEFAULT; defaultdsn = DSN_DEFAULT; } else { dsnid = DSN_NOMATCH; } continue; } else if( upper_strneq( str, dsntk, dsnlen ) ) { dsnid = DSN_NAMED; } else { dsnid = DSN_NOMATCH; } continue; } else if( dsnid == DSN_NOMATCH ) { continue; } str = readtoken(str, token); if( upper_strneq( keywd, token, STRLEN(keywd)) ) { str = readtoken(str, token); if( ! STREQ( token, "=") ) /* something other than = */ { continue; } str = readtoken(str, token); if( STRLEN(token) > size - 1) { break; } STRNCPY(value, token, size); /* copy the value(i.e. next token) to buf */ if( dsnid != DSN_DEFAULT ) { break; } } } fclose(file); return (*value)? value:NULL; } char* getkeyvalinstr( char* cnstr, int cnlen, char* keywd, char* value, int size ) { char token[1024] = { '\0' }; int flag = 0; if( cnstr == NULL || value == NULL || keywd == NULL || size < 1 ) { return NULL; } if( cnlen == SQL_NTS ) { cnlen = STRLEN (cnstr); } if( cnlen <= 0 ) { return NULL; } for(;;) { cnstr = readtoken(cnstr, token); if( *token == '\0' ) { break; } if( STREQ( token, ";" ) ) { flag = 0; continue; } switch(flag) { case 0: if( upper_strneq(token, keywd, strlen(keywd)) ) { flag = 1; } break; case 1: if( STREQ( token, "=" ) ) { flag = 2; } break; case 2: if( size < strlen(token) + 1 ) { return NULL; } STRNCPY( value, token, size ); return value; default: break; } } return NULL; } unixODBC-2.3.9/Drivers/nn/SQLAllocStmt.c0000755000175000017500000000303212262474475014556 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLAllocStmt( HDBC hdbc, HSTMT* phstmt ) { void* hcndes; void* yystmt; stmt_t* pstmt; *phstmt = 0; hcndes = nnodbc_getnntpcndes(hdbc); if ( ! (yystmt = nnsql_allocyystmt(hcndes)) ) { int code = nnsql_errcode(hcndes); if ( code == -1 ) code = errno; nnodbc_pushdbcerr( hdbc, code, nnsql_errmsg(hcndes)); return SQL_ERROR; } pstmt = (stmt_t*)MEM_ALLOC(sizeof(stmt_t)); if ( !pstmt ) { nnsql_dropyystmt(yystmt); nnodbc_pushdbcerr(hdbc, en_S1001, 0); return SQL_ERROR; } if ( nnodbc_attach_stmt( hdbc, pstmt ) ) { nnsql_dropyystmt(yystmt); MEM_FREE( pstmt ); return SQL_ERROR; } pstmt->yystmt = yystmt; pstmt->herr = 0; pstmt->pcol = 0; pstmt->ppar = 0; pstmt->ndelay = 0; pstmt->hdbc = hdbc; pstmt->refetch = 0; pstmt->putipar = 0; *phstmt = pstmt; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLGetConnectOption.c0000755000175000017500000000242712262474475016105 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLGetConnectOption(HDBC hdbc, UWORD fOption, PTR pvParam) { dbc_t* pdbc = hdbc; UDWORD opt; UNSET_ERROR( pdbc->herr ); if ( fOption == SQL_ACCESS_MODE ) { switch (nntp_getaccmode(pdbc->hcndes)) { case ACCESS_MODE_SELECT: opt = SQL_MODE_READ_ONLY; break; case ACCESS_MODE_INSERT: case ACCESS_MODE_DELETE_TEST: case ACCESS_MODE_DELETE_ANY: opt = SQL_MODE_READ_WRITE; break; default: opt = SQL_MODE_DEFAULT; break; } if (pvParam) *((UDWORD*)pvParam) = opt; return SQL_SUCCESS; } PUSHSQLERR( pdbc->herr, en_S1C00 ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/nn/SQLFreeStmt.c0000755000175000017500000000146212262474475014412 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLFreeStmt( HSTMT hstmt, UWORD fOption ) { return nnodbc_sqlfreestmt(hstmt, fOption); } unixODBC-2.3.9/Drivers/nn/SQLDisconnect.c0000755000175000017500000000166412262474475014756 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLDisconnect( HDBC hdbc) { dbc_t* pdbc = hdbc; UNSET_ERROR( pdbc->herr ); for (;pdbc->stmt;) nnodbc_sqlfreestmt(pdbc->stmt->hstmt, SQL_DROP); nntp_close( pdbc->hcndes ); pdbc->hcndes = 0; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/nncol.ci0000755000175000017500000000277012262474475013566 00000000000000typedef struct { int idx; char* name; int datatype; int nullable; int writable; } col_desc_t; static col_desc_t nncol_info_tab[] = { en_article_num, "Article-Num", en_t_num, 0, 0, en_article_num, "Article", en_t_num, 0, 0, /* alias name */ en_newsgroups, "Newsgroups", en_t_str, 1, 0, en_newsgroups, "Groups", en_t_str, 1, 0, /* alias name */ en_subject, "Subject", en_t_str, 0, 1, en_from, "From", en_t_str, 0, 1, en_sender, "Sender", en_t_str, 1, 1, en_organization,"Organization", en_t_str, 1, 1, en_summary, "Summary", en_t_str, 1, 1, en_keywords, "Keywords", en_t_str, 1, 1, en_expires, "Expires", en_t_str, 1, 1, en_msgid, "Message-ID", en_t_str, 1, 1, en_msgid, "Msgid", en_t_str, 1, 1, /* alias name */ en_references, "References", en_t_str, 1, 1, en_followup_to, "Followup-To", en_t_str, 1, 1, en_reply_to, "Reply-To", en_t_str, 1, 1, en_distribution,"Distribution", en_t_str, 1, 1, en_xref, "Xref", en_t_str, 1, 0, en_host, "NNTP-Posting-Host", en_t_str, 1, 0, en_host, "Host", en_t_str, 1, 0, /* alias name */ en_date, "Date", en_t_date,1, 0, en_path, "Path", en_t_str, 1, 0, en_lines, "Lines", en_t_num, 1, 0, en_x_newsreader,"X-Newsreader", en_t_str, 1, 0, en_x_newsreader,"Agent", en_t_str, 1, 0, /* alias name */ en_body, "Body", en_t_text,0, 1, en_body, "Text", en_t_text,0, 1, /* alias name */ en_sql_count, "count()", en_t_num, 1, 0, en_sql_qstr, "qstring", en_t_str, 1, 0, en_sql_num, "number", en_t_num, 1, 0, en_sql_date, "const. date", en_t_date,1, 0 }; unixODBC-2.3.9/Drivers/nn/yyparse.c0000644000175000017500000025037213272645601013771 00000000000000/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 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 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Copy the first part of user declarations. */ #line 1 "yyparse.y" /* yacc.c:339 */ /** source of nntp odbc sql parser -- yyparse.y Copyright (C) 1995, 1996 by Ke Jin 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. **/ static char sccsid[] = "@(#)SQL parser for NNSQL(NetNews SQL), Copyright(c) 1995, 1996 by Ke Jin"; #include #include #include #include #include #include #include #include #include #include # ifdef YYLSP_NEEDED # undef YYLSP_NEEDED # endif #if defined(YYBISON) || defined(__YY_BISON__) # define yylex(pyylval) nnsql_yylex(pyylval, pyyenv) #else # define yylex() nnsql_yylex(&yylval, pyyenv) #endif #define yyparse(x) nnsql_yyparse (yyenv_t* pyyenv) #define yyerror(msg) nnsql_yyerror (pyyenv, msg) #define SETYYERROR(env, code) { env->pstmt->errcode = code; \ env->pstmt->errpos = env->errpos;} typedef struct { char* schema_tab_name; char* column_name; } column_name_t; static void unpack_col_name(char* schema_tab_column_name, column_name_t* ptr); static void* add_node(yystmt_t* pstmt, node_t* node); static void srchtree_reloc(node_t* srchtree, int num); static int add_attr(yystmt_t* pstmt, int idx, int wstat); static void* add_all_attr(yystmt_t* pstmt); static void* add_news_attr(yystmt_t* pstmt); static void* add_xnews_attr(yystmt_t* pstmt); static void* add_column(yystmt_t* pstmt, yycol_t* pcol); static void nnsql_yyerror(yyenv_t* pyyenv, char* msg); static int table_check(yystmt_t* pstmt); static int column_name(yystmt_t* pstmt, char* name); static void* attr_name(yystmt_t* pstmt, char* name); static int add_ins_head(yystmt_t* pstmt, char* head, int idx); static int add_ins_value(yystmt_t* pstmt, node_t node, int idx); static char* get_unpacked_attrname(yystmt_t* pstmt, char* name); #define ERROR_PTR ((void*)(-1L)) #define EMPTY_PTR ERROR_PTR #line 140 "yyparse.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { kwd_select = 258, kwd_all = 259, kwd_news = 260, kwd_xnews = 261, kwd_distinct = 262, kwd_count = 263, kwd_from = 264, kwd_where = 265, kwd_in = 266, kwd_between = 267, kwd_like = 268, kwd_escape = 269, kwd_group = 270, kwd_by = 271, kwd_having = 272, kwd_order = 273, kwd_for = 274, kwd_insert = 275, kwd_into = 276, kwd_values = 277, kwd_delete = 278, kwd_update = 279, kwd_create = 280, kwd_alter = 281, kwd_drop = 282, kwd_table = 283, kwd_column = 284, kwd_view = 285, kwd_index = 286, kwd_of = 287, kwd_current = 288, kwd_grant = 289, kwd_revoke = 290, kwd_is = 291, kwd_null = 292, kwd_call = 293, kwd_uncase = 294, kwd_case = 295, kwd_fn = 296, kwd_d = 297, QSTRING = 298, NUM = 299, NAME = 300, PARAM = 301, kwd_or = 302, kwd_and = 303, kwd_not = 304, CMPOP = 305 }; #endif /* Tokens. */ #define kwd_select 258 #define kwd_all 259 #define kwd_news 260 #define kwd_xnews 261 #define kwd_distinct 262 #define kwd_count 263 #define kwd_from 264 #define kwd_where 265 #define kwd_in 266 #define kwd_between 267 #define kwd_like 268 #define kwd_escape 269 #define kwd_group 270 #define kwd_by 271 #define kwd_having 272 #define kwd_order 273 #define kwd_for 274 #define kwd_insert 275 #define kwd_into 276 #define kwd_values 277 #define kwd_delete 278 #define kwd_update 279 #define kwd_create 280 #define kwd_alter 281 #define kwd_drop 282 #define kwd_table 283 #define kwd_column 284 #define kwd_view 285 #define kwd_index 286 #define kwd_of 287 #define kwd_current 288 #define kwd_grant 289 #define kwd_revoke 290 #define kwd_is 291 #define kwd_null 292 #define kwd_call 293 #define kwd_uncase 294 #define kwd_case 295 #define kwd_fn 296 #define kwd_d 297 #define QSTRING 298 #define NUM 299 #define NAME 300 #define PARAM 301 #define kwd_or 302 #define kwd_and 303 #define kwd_not 304 #define CMPOP 305 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 78 "yyparse.y" /* yacc.c:355 */ char* qstring; char* name; long number; int ipar; /* parameter index */ int cmpop; /* for comparsion operators */ char esc; int flag; /* for not_opt and case_opt */ int idx; void* offset; /* actually, it is used as a 'int' offset */ node_t node; /* a node haven't add to tree */ #line 293 "yyparse.c" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif int yyparse (void); /* Copy the second part of user declarations. */ #line 309 "yyparse.c" /* yacc.c:358 */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif #if !defined _Noreturn \ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) # if defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 24 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 220 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 59 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 34 /* YYNRULES -- Number of rules. */ #define YYNRULES 106 /* YYNSTATES -- Number of states. */ #define YYNSTATES 219 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 305 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53, 54, 52, 2, 57, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 51, 2, 58, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 55, 2, 56, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 166, 166, 169, 171, 181, 185, 189, 190, 198, 201, 203, 210, 212, 213, 221, 222, 223, 224, 225, 229, 230, 231, 235, 236, 237, 241, 242, 246, 257, 259, 261, 263, 274, 285, 298, 302, 304, 305, 306, 307, 308, 312, 313, 326, 328, 330, 332, 341, 344, 358, 359, 371, 384, 396, 421, 451, 480, 505, 521, 522, 524, 526, 531, 533, 535, 540, 545, 559, 569, 582, 593, 604, 620, 621, 622, 626, 640, 655, 656, 659, 661, 668, 670, 677, 679, 687, 737, 742, 750, 752, 754, 759, 764, 772, 776, 781, 789, 801, 809, 810, 811, 812, 813, 814, 816, 817 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "kwd_select", "kwd_all", "kwd_news", "kwd_xnews", "kwd_distinct", "kwd_count", "kwd_from", "kwd_where", "kwd_in", "kwd_between", "kwd_like", "kwd_escape", "kwd_group", "kwd_by", "kwd_having", "kwd_order", "kwd_for", "kwd_insert", "kwd_into", "kwd_values", "kwd_delete", "kwd_update", "kwd_create", "kwd_alter", "kwd_drop", "kwd_table", "kwd_column", "kwd_view", "kwd_index", "kwd_of", "kwd_current", "kwd_grant", "kwd_revoke", "kwd_is", "kwd_null", "kwd_call", "kwd_uncase", "kwd_case", "kwd_fn", "kwd_d", "QSTRING", "NUM", "NAME", "PARAM", "kwd_or", "kwd_and", "kwd_not", "CMPOP", "';'", "'*'", "'('", "')'", "'{'", "'}'", "','", "'='", "$accept", "sql_stmt", "stmt_body", "select_clauses", "for_stmt", "distinct_opt", "select_list", "news_hotlist", "news_xhotlist", "col_name_list", "col_name", "count_sub_opt", "tab_list", "tab_name", "where_clause", "search_condition", "case_opt", "attr_name", "value_list", "value", "escape_desc", "pattern", "not_opt", "group_clause", "having_clause", "order_clause", "insert_stmt", "ins_head_list", "ins_head", "ins_value_list", "ins_value", "srch_delete_stmt", "posi_delete_stmt", "other_stmt", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 59, 42, 40, 41, 123, 125, 44, 61 }; # endif #define YYPACT_NINF -156 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-156))) #define YYTABLE_NINF -1 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { 1, 86, -12, 5, -156, -156, -156, -156, -156, -156, 8, 19, -6, -156, -156, -156, -156, -156, -156, 34, 21, 21, -156, -28, -156, -156, -3, 2, 17, 47, -156, -156, -156, -156, -156, 27, 48, -156, -156, 58, -156, 51, -156, -156, 50, 69, 113, 87, 70, 73, -32, -156, 83, 12, 85, 21, 29, 88, 101, -22, 52, -156, -156, -156, -156, 78, 79, 80, 81, -156, 82, 77, 84, 89, 90, -5, -156, 76, -156, 91, 94, 95, -156, 97, 38, -156, 96, 107, -156, 53, 53, 99, 72, 15, -156, -156, -156, -156, -156, 98, 100, 108, -156, 53, 21, -156, 126, 114, -156, 110, 112, 115, 128, -22, 116, 111, -156, 40, 129, 53, 53, 117, -156, 66, 4, 104, 105, 103, -156, 146, 147, 109, 118, 120, 121, -156, 122, -156, -156, 124, 119, -156, 131, -156, -156, -156, -156, 123, -156, 130, 125, 66, -156, -156, 156, -156, -156, 127, 29, 53, 153, 132, -156, 136, 16, -156, 137, -156, 138, -156, 66, 134, 68, -156, 58, 72, 159, 165, -156, 133, -156, -156, -156, 42, -156, 135, 139, 59, -156, 66, -156, -156, -8, 29, 161, -156, 140, -156, 16, 141, -156, -156, 66, -156, 143, 176, -156, 58, 160, -156, -156, -156, -156, -156, 148, 29, 142, 58, -156 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 3, 12, 0, 0, 102, 99, 100, 101, 105, 106, 0, 0, 0, 5, 6, 7, 8, 13, 14, 15, 0, 0, 103, 0, 1, 2, 20, 23, 36, 0, 32, 33, 29, 35, 16, 0, 0, 17, 18, 19, 26, 0, 44, 47, 0, 0, 48, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 104, 21, 24, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 48, 42, 0, 27, 0, 0, 0, 89, 0, 0, 87, 0, 0, 63, 0, 0, 0, 49, 78, 40, 41, 39, 38, 30, 0, 0, 0, 34, 0, 0, 4, 80, 0, 45, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 78, 79, 0, 59, 0, 0, 0, 43, 0, 82, 0, 0, 0, 0, 88, 0, 98, 50, 0, 52, 53, 0, 68, 70, 71, 69, 0, 58, 0, 0, 0, 61, 60, 0, 22, 25, 0, 0, 0, 84, 0, 90, 0, 0, 64, 0, 57, 0, 62, 0, 0, 0, 31, 81, 83, 0, 10, 46, 0, 94, 95, 96, 0, 92, 0, 0, 0, 66, 0, 77, 76, 73, 0, 0, 9, 0, 86, 0, 0, 72, 54, 0, 55, 0, 0, 56, 85, 0, 91, 93, 65, 67, 74, 0, 0, 0, 11, 75 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -156, -156, -156, -156, -156, -156, -156, -156, -156, -155, 144, -156, -156, -21, 145, -88, -156, -156, -156, -141, -156, -156, 92, -156, -156, -156, -156, -156, 93, -156, -4, -156, -156, -156 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 11, 12, 105, 195, 19, 36, 37, 38, 39, 40, 51, 75, 45, 61, 92, 154, 93, 187, 148, 206, 192, 124, 130, 160, 177, 13, 84, 85, 183, 184, 14, 15, 16 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_uint8 yytable[] = { 46, 116, 117, 174, 1, 103, 204, 81, 149, 20, 171, 65, 66, 67, 21, 150, 151, 71, 72, 24, 68, 2, 69, 82, 3, 4, 5, 6, 7, 188, 47, 140, 141, 83, 76, 8, 9, 28, 207, 26, 27, 73, 28, 152, 153, 25, 22, 205, 203, 41, 48, 121, 104, 180, 23, 49, 10, 55, 29, 181, 217, 212, 182, 29, 122, 123, 42, 43, 53, 54, 50, 175, 30, 31, 32, 33, 44, 30, 31, 32, 33, 86, 86, 128, 77, 87, 34, 119, 120, 35, 17, 58, 112, 18, 138, 113, 197, 88, 88, 198, 52, 89, 89, 143, 57, 90, 90, 91, 91, 144, 145, 190, 146, 201, 191, 56, 202, 107, 54, 119, 120, 147, 59, 60, 63, 62, 70, 64, 74, 80, 99, 79, 94, 95, 96, 97, 98, 100, 111, 115, 118, 129, 101, 73, 133, 108, 102, 109, 110, 114, 134, 127, 125, 131, 126, 132, 137, 157, 139, 136, 155, 156, 158, 161, 159, 168, 122, 120, 167, 172, 169, 176, 162, 163, 164, 193, 165, 166, 170, 179, 185, 186, 189, 173, 194, 208, 213, 196, 178, 199, 214, 216, 215, 0, 210, 200, 209, 211, 218, 0, 78, 0, 0, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0, 106 }; static const yytype_int16 yycheck[] = { 21, 89, 90, 158, 3, 10, 14, 29, 4, 21, 151, 43, 44, 45, 9, 11, 12, 5, 6, 0, 52, 20, 54, 45, 23, 24, 25, 26, 27, 170, 58, 119, 120, 55, 55, 34, 35, 8, 193, 5, 6, 29, 8, 39, 40, 51, 38, 55, 189, 28, 53, 36, 57, 37, 46, 53, 55, 9, 29, 43, 215, 202, 46, 29, 49, 50, 45, 46, 41, 42, 53, 159, 43, 44, 45, 46, 55, 43, 44, 45, 46, 29, 29, 104, 55, 33, 52, 47, 48, 55, 4, 41, 54, 7, 54, 57, 54, 45, 45, 57, 53, 49, 49, 37, 53, 53, 53, 55, 55, 43, 44, 43, 46, 54, 46, 57, 57, 41, 42, 47, 48, 55, 53, 10, 54, 38, 43, 54, 43, 28, 53, 43, 54, 54, 54, 54, 54, 53, 41, 32, 41, 15, 53, 29, 29, 54, 56, 53, 53, 53, 22, 43, 54, 43, 54, 43, 45, 54, 29, 43, 56, 56, 16, 54, 17, 42, 49, 48, 37, 13, 40, 18, 54, 53, 53, 16, 54, 53, 53, 43, 43, 43, 48, 56, 19, 24, 43, 54, 56, 54, 14, 43, 32, -1, 198, 56, 56, 56, 56, -1, 56, -1, -1, -1, -1, -1, 113, -1, -1, -1, -1, -1, -1, 121, -1, -1, -1, -1, -1, -1, 75 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 3, 20, 23, 24, 25, 26, 27, 34, 35, 55, 60, 61, 85, 90, 91, 92, 4, 7, 64, 21, 9, 38, 46, 0, 51, 5, 6, 8, 29, 43, 44, 45, 46, 52, 55, 65, 66, 67, 68, 69, 28, 45, 46, 55, 72, 72, 58, 53, 53, 53, 70, 53, 41, 42, 9, 57, 53, 41, 53, 10, 73, 38, 54, 54, 43, 44, 45, 52, 54, 43, 5, 6, 29, 43, 71, 72, 55, 69, 43, 28, 29, 45, 55, 86, 87, 29, 33, 45, 49, 53, 55, 74, 76, 54, 54, 54, 54, 54, 53, 53, 53, 56, 10, 57, 62, 73, 41, 54, 53, 53, 41, 54, 57, 53, 32, 74, 74, 41, 47, 48, 36, 49, 50, 81, 54, 54, 43, 72, 15, 82, 43, 43, 29, 22, 87, 43, 45, 54, 29, 74, 74, 81, 37, 43, 44, 46, 55, 78, 4, 11, 12, 39, 40, 75, 56, 56, 54, 16, 17, 83, 54, 54, 53, 53, 54, 53, 37, 42, 40, 53, 78, 13, 56, 68, 74, 18, 84, 56, 43, 37, 43, 46, 88, 89, 43, 43, 77, 78, 48, 43, 46, 80, 16, 19, 63, 54, 54, 57, 54, 56, 54, 57, 78, 14, 55, 79, 68, 24, 56, 89, 56, 78, 43, 14, 32, 43, 68, 56 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 59, 60, 61, 61, 61, 61, 61, 61, 62, 63, 63, 64, 64, 64, 65, 65, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 71, 71, 72, 72, 72, 72, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 76, 76, 76, 77, 77, 78, 78, 78, 78, 78, 79, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 89, 90, 91, 92, 92, 92, 92, 92, 92, 92, 92 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 2, 0, 6, 1, 1, 1, 1, 5, 0, 4, 0, 1, 1, 0, 1, 1, 1, 1, 1, 3, 6, 1, 3, 6, 1, 3, 2, 1, 4, 7, 1, 1, 4, 1, 0, 2, 3, 3, 3, 3, 1, 3, 1, 4, 7, 1, 0, 2, 3, 2, 3, 3, 6, 6, 6, 4, 3, 0, 1, 1, 2, 1, 4, 7, 1, 3, 1, 1, 1, 1, 4, 0, 2, 4, 1, 1, 0, 1, 0, 3, 0, 2, 0, 3, 10, 1, 3, 1, 4, 7, 1, 3, 1, 1, 1, 4, 7, 1, 1, 1, 1, 2, 4, 1, 1 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*----------------------------------------. | Print this symbol's value on YYOUTPUT. | `----------------------------------------*/ static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyo = yyoutput; YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*----------. | yyparse. | `----------*/ int yyparse (void) { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ int yynerrs; int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (&yylval); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 166 "yyparse.y" /* yacc.c:1646 */ { YYACCEPT; } #line 1547 "yyparse.c" /* yacc.c:1646 */ break; case 4: #line 172 "yyparse.y" /* yacc.c:1646 */ { if( ! table_check( pyyenv->pstmt ) ) { SETYYERROR(pyyenv, NOT_SUPPORT_MULTITABLE_QUERY); YYABORT; } pyyenv->pstmt->type = en_stmt_select; } #line 1561 "yyparse.c" /* yacc.c:1646 */ break; case 5: #line 182 "yyparse.y" /* yacc.c:1646 */ { pyyenv->pstmt->type = en_stmt_insert; } #line 1569 "yyparse.c" /* yacc.c:1646 */ break; case 6: #line 186 "yyparse.y" /* yacc.c:1646 */ { pyyenv->pstmt->type = en_stmt_srch_delete; } #line 1577 "yyparse.c" /* yacc.c:1646 */ break; case 8: #line 191 "yyparse.y" /* yacc.c:1646 */ { pyyenv->pstmt->type = en_stmt_alloc; YYABORT; } #line 1586 "yyparse.c" /* yacc.c:1646 */ break; case 11: #line 204 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_UPDATEABLE_CURSOR) ; YYABORT; } #line 1595 "yyparse.c" /* yacc.c:1646 */ break; case 14: #line 214 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_DISTINCT_SELECT); YYABORT; } #line 1604 "yyparse.c" /* yacc.c:1646 */ break; case 15: #line 221 "yyparse.y" /* yacc.c:1646 */ { if(add_all_attr(pyyenv->pstmt)) YYABORT; } #line 1610 "yyparse.c" /* yacc.c:1646 */ break; case 16: #line 222 "yyparse.y" /* yacc.c:1646 */ { if(add_all_attr(pyyenv->pstmt)) YYABORT; } #line 1616 "yyparse.c" /* yacc.c:1646 */ break; case 17: #line 223 "yyparse.y" /* yacc.c:1646 */ { if(add_news_attr(pyyenv->pstmt)) YYABORT; } #line 1622 "yyparse.c" /* yacc.c:1646 */ break; case 18: #line 224 "yyparse.y" /* yacc.c:1646 */ { if(add_xnews_attr(pyyenv->pstmt)) YYABORT; } #line 1628 "yyparse.c" /* yacc.c:1646 */ break; case 19: #line 225 "yyparse.y" /* yacc.c:1646 */ { if(add_attr(pyyenv->pstmt, 0, 0)) YYABORT; } #line 1634 "yyparse.c" /* yacc.c:1646 */ break; case 28: #line 247 "yyparse.y" /* yacc.c:1646 */ { yycol_t col; col.iattr = en_sql_count; col.table = 0; if( add_column(pyyenv->pstmt, &col) ) YYABORT; } #line 1649 "yyparse.c" /* yacc.c:1646 */ break; case 29: #line 258 "yyparse.y" /* yacc.c:1646 */ { if( column_name( pyyenv->pstmt, (yyvsp[0].name) ) ) YYABORT; } #line 1655 "yyparse.c" /* yacc.c:1646 */ break; case 30: #line 260 "yyparse.y" /* yacc.c:1646 */ { if( column_name( pyyenv->pstmt, (yyvsp[-1].qstring) ) ) YYABORT; } #line 1661 "yyparse.c" /* yacc.c:1646 */ break; case 31: #line 262 "yyparse.y" /* yacc.c:1646 */ { if( column_name( pyyenv->pstmt, (yyvsp[-2].qstring) ) ) YYABORT; } #line 1667 "yyparse.c" /* yacc.c:1646 */ break; case 32: #line 264 "yyparse.y" /* yacc.c:1646 */ { yycol_t col; col.iattr = en_sql_qstr; col.value.qstr = (yyvsp[0].qstring); col.table = 0; if( add_column(pyyenv->pstmt, &col) ) YYABORT; } #line 1682 "yyparse.c" /* yacc.c:1646 */ break; case 33: #line 275 "yyparse.y" /* yacc.c:1646 */ { yycol_t col; col.iattr = en_sql_num; col.value.num = (yyvsp[0].number); col.table = 0; if( add_column(pyyenv->pstmt, &col) ) YYABORT; } #line 1697 "yyparse.c" /* yacc.c:1646 */ break; case 34: #line 286 "yyparse.y" /* yacc.c:1646 */ { yycol_t col; col.iattr = en_sql_date; if( nnsql_odbcdatestr2date((yyvsp[-1].qstring), &(col.value.date)) ) YYABORT; col.table = 0; if( add_column(pyyenv->pstmt, &col) ) YYABORT; } #line 1714 "yyparse.c" /* yacc.c:1646 */ break; case 35: #line 299 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, VARIABLE_IN_SELECT_LIST); YYABORT; } #line 1720 "yyparse.c" /* yacc.c:1646 */ break; case 42: #line 312 "yyparse.y" /* yacc.c:1646 */ { pyyenv->pstmt->table = (yyvsp[0].name); } #line 1726 "yyparse.c" /* yacc.c:1646 */ break; case 43: #line 314 "yyparse.y" /* yacc.c:1646 */ { if( ! pyyenv->pstmt->table ) pyyenv->pstmt->table = (yyvsp[0].name); else if( !STREQ(pyyenv->pstmt->table, (yyvsp[0].name)) ) { SETYYERROR(pyyenv, NOT_SUPPORT_MULTITABLE_QUERY); YYABORT; } } #line 1740 "yyparse.c" /* yacc.c:1646 */ break; case 44: #line 327 "yyparse.y" /* yacc.c:1646 */ { (yyval.name) = (yyvsp[0].name); } #line 1746 "yyparse.c" /* yacc.c:1646 */ break; case 45: #line 329 "yyparse.y" /* yacc.c:1646 */ { (yyval.name) = (yyvsp[-1].qstring); } #line 1752 "yyparse.c" /* yacc.c:1646 */ break; case 46: #line 331 "yyparse.y" /* yacc.c:1646 */ { (yyval.name) = (yyvsp[-2].qstring); } #line 1758 "yyparse.c" /* yacc.c:1646 */ break; case 47: #line 333 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, VARIABLE_IN_TABLE_LIST); YYABORT; } #line 1767 "yyparse.c" /* yacc.c:1646 */ break; case 48: #line 341 "yyparse.y" /* yacc.c:1646 */ { pyyenv->pstmt->srchtree = 0; } #line 1775 "yyparse.c" /* yacc.c:1646 */ break; case 49: #line 345 "yyparse.y" /* yacc.c:1646 */ { yystmt_t* pstmt; uintptr_t offset; pstmt = pyyenv->pstmt; offset = (uintptr_t)((yyvsp[0].offset)); pstmt->srchtree = pstmt->node_buf + offset; srchtree_reloc ( pstmt->node_buf, pstmt->srchtreenum); } #line 1790 "yyparse.c" /* yacc.c:1646 */ break; case 50: #line 358 "yyparse.y" /* yacc.c:1646 */ { (yyval.offset) = (yyvsp[-1].offset); } #line 1796 "yyparse.c" /* yacc.c:1646 */ break; case 51: #line 360 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right= (yyvsp[0].offset); if(((yyval.offset) = add_node(pyyenv->pstmt, &node)) == ERROR_PTR ) YYABORT; } #line 1812 "yyparse.c" /* yacc.c:1646 */ break; case 52: #line 372 "yyparse.y" /* yacc.c:1646 */ { node_t node; void* p; node.type = en_nt_logop; node.value.logop = en_logop_or; node.left = (yyvsp[-2].offset); node.right= (yyvsp[0].offset); if(((yyval.offset) = add_node(pyyenv->pstmt, &node)) == ERROR_PTR ) YYABORT; } #line 1829 "yyparse.c" /* yacc.c:1646 */ break; case 53: #line 385 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_logop; node.value.logop = en_logop_and; node.left = (yyvsp[-2].offset); node.right= (yyvsp[0].offset); if(((yyval.offset) = add_node(pyyenv->pstmt, &node)) == ERROR_PTR ) YYABORT; } #line 1845 "yyparse.c" /* yacc.c:1646 */ break; case 54: #line 397 "yyparse.y" /* yacc.c:1646 */ { node_t node; void* ptr; node.type = en_nt_in; node.left = (yyvsp[-5].offset); node.right= (yyvsp[-1].offset); if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; if( (yyvsp[-4].flag) ) { node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right = ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } (yyval.offset) = ptr; } #line 1874 "yyparse.c" /* yacc.c:1646 */ break; case 55: #line 422 "yyparse.y" /* yacc.c:1646 */ { node_t node; void* ptr; if( ((node.left = add_node(pyyenv->pstmt, &((yyvsp[-2].node)))) == ERROR_PTR) || ((node.right= add_node(pyyenv->pstmt, &((yyvsp[0].node)))) == ERROR_PTR) || ((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) ) YYABORT; node.type = en_nt_between; node.left = (yyvsp[-5].offset); node.right = ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; if( (yyvsp[-4].flag) ) { node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right= ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } (yyval.offset) = ptr; } #line 1908 "yyparse.c" /* yacc.c:1646 */ break; case 56: #line 452 "yyparse.y" /* yacc.c:1646 */ { node_t node; void* ptr; if( (yyvsp[-3].flag) ) node.type = en_nt_caselike; else node.type = en_nt_like; node.value.esc = (yyvsp[0].esc); node.left = (yyvsp[-5].offset); node.right= (yyvsp[-1].offset); if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; if( (yyvsp[-4].flag) ) { node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right= ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } (yyval.offset) = ptr; } #line 1941 "yyparse.c" /* yacc.c:1646 */ break; case 57: #line 481 "yyparse.y" /* yacc.c:1646 */ { node_t node; void* ptr; node.type = en_nt_isnull; node.left = (yyvsp[-3].offset); node.right= EMPTY_PTR; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; if( (yyvsp[-1].flag) ) { node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right= ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } (yyval.offset) = ptr; } #line 1970 "yyparse.c" /* yacc.c:1646 */ break; case 58: #line 506 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_cmpop; node.value.cmpop = (yyvsp[-1].cmpop); node.left = (yyvsp[-2].offset); if( ((node.right= add_node(pyyenv->pstmt, &((yyvsp[0].node)))) == ERROR_PTR) || (((yyval.offset) = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) ) YYABORT; } #line 1986 "yyparse.c" /* yacc.c:1646 */ break; case 59: #line 521 "yyparse.y" /* yacc.c:1646 */ { (yyval.flag) = 0; } #line 1992 "yyparse.c" /* yacc.c:1646 */ break; case 60: #line 523 "yyparse.y" /* yacc.c:1646 */ { (yyval.flag) = 0; } #line 1998 "yyparse.c" /* yacc.c:1646 */ break; case 61: #line 525 "yyparse.y" /* yacc.c:1646 */ { (yyval.flag) = 1; } #line 2004 "yyparse.c" /* yacc.c:1646 */ break; case 62: #line 527 "yyparse.y" /* yacc.c:1646 */ { (yyval.flag) = 1; } #line 2010 "yyparse.c" /* yacc.c:1646 */ break; case 63: #line 532 "yyparse.y" /* yacc.c:1646 */ { (yyval.offset) = attr_name( pyyenv->pstmt, (yyvsp[0].name) ); if( (yyval.offset) == ERROR_PTR ) YYABORT; } #line 2016 "yyparse.c" /* yacc.c:1646 */ break; case 64: #line 534 "yyparse.y" /* yacc.c:1646 */ { (yyval.offset) = attr_name( pyyenv->pstmt, (yyvsp[-1].qstring) ); if( (yyval.offset) == ERROR_PTR ) YYABORT; } #line 2022 "yyparse.c" /* yacc.c:1646 */ break; case 65: #line 536 "yyparse.y" /* yacc.c:1646 */ { (yyval.offset) = attr_name( pyyenv->pstmt, (yyvsp[-2].qstring) ); if( (yyval.offset) == ERROR_PTR ) YYABORT; } #line 2028 "yyparse.c" /* yacc.c:1646 */ break; case 66: #line 541 "yyparse.y" /* yacc.c:1646 */ { if( ((yyval.offset) = add_node( pyyenv->pstmt, &((yyvsp[0].node)))) == ERROR_PTR ) YYABORT; } #line 2037 "yyparse.c" /* yacc.c:1646 */ break; case 67: #line 546 "yyparse.y" /* yacc.c:1646 */ { node_t node; node = (yyvsp[0].node); node.left = EMPTY_PTR; node.right= (yyvsp[-2].offset); if( ((yyval.offset) = add_node(pyyenv->pstmt, &node)) == ERROR_PTR ) YYABORT; } #line 2052 "yyparse.c" /* yacc.c:1646 */ break; case 68: #line 560 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_null; node.left = EMPTY_PTR; node.right= EMPTY_PTR; (yyval.node) = node; } #line 2066 "yyparse.c" /* yacc.c:1646 */ break; case 69: #line 570 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_param, node.value.ipar = (yyvsp[0].ipar); node.left = EMPTY_PTR; node.right= EMPTY_PTR; pyyenv->pstmt->npar ++; (yyval.node) = node; } #line 2083 "yyparse.c" /* yacc.c:1646 */ break; case 70: #line 583 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_qstr; node.value.qstr = (yyvsp[0].qstring); node.left = EMPTY_PTR; node.right= EMPTY_PTR; (yyval.node) = node; } #line 2098 "yyparse.c" /* yacc.c:1646 */ break; case 71: #line 594 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_num; node.value.num = (yyvsp[0].number); node.left = EMPTY_PTR; node.right= EMPTY_PTR; (yyval.node) = node; } #line 2113 "yyparse.c" /* yacc.c:1646 */ break; case 72: #line 605 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_date; if( nnsql_odbcdatestr2date((yyvsp[-1].qstring), &(node.value.date)) ) YYABORT; node.left = EMPTY_PTR; node.right= EMPTY_PTR; (yyval.node) = node; } #line 2130 "yyparse.c" /* yacc.c:1646 */ break; case 73: #line 620 "yyparse.y" /* yacc.c:1646 */ { (yyval.esc) = 0; } #line 2136 "yyparse.c" /* yacc.c:1646 */ break; case 74: #line 621 "yyparse.y" /* yacc.c:1646 */ { (yyval.esc) = (yyvsp[0].qstring)[0]; } #line 2142 "yyparse.c" /* yacc.c:1646 */ break; case 75: #line 622 "yyparse.y" /* yacc.c:1646 */ { (yyval.esc) = (yyvsp[-1].qstring)[0]; } #line 2148 "yyparse.c" /* yacc.c:1646 */ break; case 76: #line 627 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_param; node.value.ipar = (yyvsp[0].ipar); node.left = EMPTY_PTR; node.right= EMPTY_PTR; pyyenv->pstmt->npar ++; if(((yyval.offset) = add_node(pyyenv->pstmt, &node)) == EMPTY_PTR) YYABORT; } #line 2166 "yyparse.c" /* yacc.c:1646 */ break; case 77: #line 641 "yyparse.y" /* yacc.c:1646 */ { node_t node; node.type = en_nt_qstr; node.value.qstr = (yyvsp[0].qstring); node.left = EMPTY_PTR; node.right= EMPTY_PTR; if(((yyval.offset) = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } #line 2182 "yyparse.c" /* yacc.c:1646 */ break; case 78: #line 655 "yyparse.y" /* yacc.c:1646 */ { (yyval.flag) = 0; } #line 2188 "yyparse.c" /* yacc.c:1646 */ break; case 79: #line 656 "yyparse.y" /* yacc.c:1646 */ { (yyval.flag) = 1; } #line 2194 "yyparse.c" /* yacc.c:1646 */ break; case 81: #line 662 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_GROUP_CLAUSE); YYABORT; } #line 2203 "yyparse.c" /* yacc.c:1646 */ break; case 83: #line 671 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_HAVING_CLAUSE); YYABORT; } #line 2212 "yyparse.c" /* yacc.c:1646 */ break; case 85: #line 680 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_ORDER_CLAUSE); YYABORT; } #line 2221 "yyparse.c" /* yacc.c:1646 */ break; case 86: #line 688 "yyparse.y" /* yacc.c:1646 */ { int i; char* head = 0; if( (yyvsp[-5].idx) > (yyvsp[-1].idx) ) { SETYYERROR(pyyenv, INSERT_VALUE_LESS); YYABORT; } if( (yyvsp[-5].idx) < (yyvsp[-1].idx) ) { SETYYERROR(pyyenv, INSERT_VALUE_MORE); YYABORT; } for(i=0;;i++) { head = (pyyenv->pstmt->ins_heads)[i]; if( ! head ) { SETYYERROR(pyyenv, POST_WITHOUT_BODY); YYABORT; } if( nnsql_getcolidxbyname(head) == en_body ) break; } if( add_ins_head(pyyenv->pstmt, 0, (yyvsp[-5].idx)) == -1 ) YYABORT; pyyenv->pstmt->table = (yyvsp[-7].name); /* we will not check table(i.e. group)name here. * According to RFC1036, it is totally legal to * post an articl to a group which is not access * able locally. * table name here is actually newsgroups name. * it should look like: * ,,... * Be aware, there are must no space between the * ',' and the two s. Also, group * names are case sensitive. */ } #line 2272 "yyparse.c" /* yacc.c:1646 */ break; case 87: #line 738 "yyparse.y" /* yacc.c:1646 */ { if( ((yyval.idx) = add_ins_head(pyyenv->pstmt, (yyvsp[0].qstring), 0)) == -1) YYABORT; } #line 2281 "yyparse.c" /* yacc.c:1646 */ break; case 88: #line 743 "yyparse.y" /* yacc.c:1646 */ { if( ((yyval.idx) = add_ins_head(pyyenv->pstmt, (yyvsp[0].qstring), (yyvsp[-2].idx)))== -1) YYABORT; } #line 2290 "yyparse.c" /* yacc.c:1646 */ break; case 89: #line 751 "yyparse.y" /* yacc.c:1646 */ { (yyval.qstring) = get_unpacked_attrname(pyyenv->pstmt, (yyvsp[0].name)); } #line 2296 "yyparse.c" /* yacc.c:1646 */ break; case 90: #line 753 "yyparse.y" /* yacc.c:1646 */ { (yyval.qstring) = get_unpacked_attrname(pyyenv->pstmt, (yyvsp[-1].qstring)); } #line 2302 "yyparse.c" /* yacc.c:1646 */ break; case 91: #line 755 "yyparse.y" /* yacc.c:1646 */ { (yyval.qstring) = (yyvsp[-2].qstring); } #line 2308 "yyparse.c" /* yacc.c:1646 */ break; case 92: #line 760 "yyparse.y" /* yacc.c:1646 */ { if( ((yyval.idx) = add_ins_value(pyyenv->pstmt, (yyvsp[0].node), 0))== -1) YYABORT; } #line 2317 "yyparse.c" /* yacc.c:1646 */ break; case 93: #line 765 "yyparse.y" /* yacc.c:1646 */ { if( ((yyval.idx) = add_ins_value(pyyenv->pstmt, (yyvsp[0].node), (yyvsp[-2].idx)))==-1) YYABORT; } #line 2326 "yyparse.c" /* yacc.c:1646 */ break; case 94: #line 773 "yyparse.y" /* yacc.c:1646 */ { (yyval.node).type = en_nt_null; } #line 2334 "yyparse.c" /* yacc.c:1646 */ break; case 95: #line 777 "yyparse.y" /* yacc.c:1646 */ { (yyval.node).type = en_nt_qstr; (yyval.node).value.qstr = (yyvsp[0].qstring); } #line 2343 "yyparse.c" /* yacc.c:1646 */ break; case 96: #line 782 "yyparse.y" /* yacc.c:1646 */ { (yyval.node).type = en_nt_param; (yyval.node).value.ipar= (yyvsp[0].ipar); } #line 2352 "yyparse.c" /* yacc.c:1646 */ break; case 97: #line 790 "yyparse.y" /* yacc.c:1646 */ { pyyenv->pstmt->table = (yyvsp[-1].name); if( add_attr( pyyenv->pstmt, en_sender, 1 ) || add_attr( pyyenv->pstmt, en_from, 1 ) || add_attr( pyyenv->pstmt, en_msgid, 1 ) ) YYABORT; } #line 2365 "yyparse.c" /* yacc.c:1646 */ break; case 98: #line 802 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR( pyyenv, NOT_SUPPORT_POSITION_DELETE ); YYABORT; } #line 2374 "yyparse.c" /* yacc.c:1646 */ break; case 99: #line 809 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } #line 2380 "yyparse.c" /* yacc.c:1646 */ break; case 100: #line 810 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } #line 2386 "yyparse.c" /* yacc.c:1646 */ break; case 101: #line 811 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } #line 2392 "yyparse.c" /* yacc.c:1646 */ break; case 102: #line 812 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_UPDATE); } #line 2398 "yyparse.c" /* yacc.c:1646 */ break; case 103: #line 813 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_SPROC); } #line 2404 "yyparse.c" /* yacc.c:1646 */ break; case 104: #line 815 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_SPROC); } #line 2410 "yyparse.c" /* yacc.c:1646 */ break; case 105: #line 816 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } #line 2416 "yyparse.c" /* yacc.c:1646 */ break; case 106: #line 817 "yyparse.y" /* yacc.c:1646 */ { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } #line 2422 "yyparse.c" /* yacc.c:1646 */ break; #line 2426 "yyparse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } #line 819 "yyparse.y" /* yacc.c:1906 */ static void unpack_col_name(char* schema_tab_column_name, column_name_t* ptr) { int len, i; char c; len = STRLEN(schema_tab_column_name); for(i=len; i; i--) { if( schema_tab_column_name[i-1] == '.' ) { schema_tab_column_name[i-1] = 0; break; } } ptr->column_name = ( schema_tab_column_name + i ); if( i ) ptr->schema_tab_name = schema_tab_column_name; else ptr->schema_tab_name = schema_tab_column_name + len; } static char* get_unpacked_attrname(yystmt_t* pstmt, char* name) { column_name_t attrname; unpack_col_name( name, &attrname ); return attrname.column_name; } #define FILTER_CHUNK_SIZE 16 static void* add_node(yystmt_t* pstmt, node_t* node) { int i; node_t* srchtree; if (!pstmt->node_buf) { pstmt->node_buf = (node_t*)MEM_ALLOC( sizeof(node_t)*FILTER_CHUNK_SIZE); if( ! pstmt->node_buf ) { pstmt->errcode = -1; return ERROR_PTR; } pstmt->srchtreesize = FILTER_CHUNK_SIZE; pstmt->srchtreenum = 0; } if( pstmt->srchtreenum == pstmt->srchtreesize ) { pstmt->node_buf = (node_t*)MEM_REALLOC( pstmt->node_buf, sizeof(node_t)*(pstmt->srchtreesize + FILTER_CHUNK_SIZE)); if( ! pstmt->node_buf ) { pstmt->errcode = -1; return ERROR_PTR; } pstmt->srchtreesize += FILTER_CHUNK_SIZE; } srchtree = pstmt->node_buf; srchtree[pstmt->srchtreenum] = *node; pstmt->srchtreenum ++; for(i=pstmt->srchtreenum;isrchtreesize;i++) { srchtree[i].left = EMPTY_PTR; srchtree[i].right= EMPTY_PTR; } return (void*)((uintptr_t)(pstmt->srchtreenum - 1)); } static void srchtree_reloc(node_t* buf, int num) /* The 'where' srchtree is build on a re-allocateable array with addnode(). The purpose * of using an array rather than a link list is to easy the job of freeing it. Thus, * the left and right pointer of a node point is an offset to the array address not * the virtual address of the subtree. However, an evaluate function would be easy to * work by using virtual address of subtree rather than an offset. Because, in the first * case, a recrusive evaluate function only need to pass virtual address of (sub)tree * without worry about the offset of subtree. The purpose of this function, srchtree_reloc(), * is to convert all subnodes' offset into virtual address. It will called only once * after the whole tree has been built. */ { int i; uintptr_t offset; node_t* ptr = buf; for(i=0; ptr && ileft == EMPTY_PTR ) ptr->left = 0; else { offset = (uintptr_t)(ptr->left); ptr->left = buf + offset; } if( ptr->right== EMPTY_PTR ) ptr->right= 0; else { offset = (uintptr_t)(ptr->right); ptr->right= buf+ offset; } } } static int add_attr(yystmt_t* pstmt, int idx, int wstat) { if( ! pstmt->pattr ) { pstmt->pattr = (yyattr_t*)MEM_ALLOC((en_body+1)*sizeof(yyattr_t)); if( ! pstmt->pattr ) { pstmt->errcode = -1; return -1; } MEM_SET(pstmt->pattr, 0, (en_body+1)*sizeof(yyattr_t)); } (pstmt->pattr)[0].stat = 1; (pstmt->pattr)[0].wstat = 1; (pstmt->pattr)[0].article = 0; (pstmt->pattr)[0].nntp_hand = 0; (pstmt->pattr)[idx].stat = 1; (pstmt->pattr)[idx].wstat |= wstat; return 0; } static void* add_all_attr(yystmt_t* pstmt) { int i; yycol_t col; for(i=en_article_num + 1; i < en_body + 1; i++) { col.iattr = i; col.table = 0; if( add_column(pstmt, &col) || add_attr (pstmt, i, 0) ) return ERROR_PTR; } return 0; } static const int news_attr[] = { en_subject, en_date, en_from, en_organization, en_msgid, en_body }; static void* add_news_attr(yystmt_t* pstmt) { int i, n; yycol_t col; n = sizeof(news_attr)/sizeof(news_attr[0]); for(i=0; ipcol ) { pstmt->pcol = (yycol_t*)MEM_ALLOC((MAX_COLUMN_NUMBER + 1)*sizeof(yycol_t)); if( ! pstmt->pcol ) { pstmt->errcode = -1; return ERROR_PTR; } MEM_SET( pstmt->pcol, 0, (MAX_COLUMN_NUMBER + 1)*sizeof(yycol_t)); } if( ! pstmt->ncol ) { pstmt->ncol = 1; pstmt->pcol->iattr = en_article_num; pstmt->pcol->table = 0; } if( pstmt->ncol > MAX_COLUMN_NUMBER + 1) { pstmt->errcode = TOO_MANY_COLUMNS; return ERROR_PTR; } pcol = pstmt->pcol + pstmt->ncol; pstmt->ncol++; *pcol = *column; return 0; } static void nnsql_yyerror(yyenv_t* pyyenv, char* msg) { yystmt_t* pstmt = pyyenv->pstmt; pstmt->errcode = PARSER_ERROR; pstmt->errpos = pyyenv->errpos; sprintf(pstmt->msgbuf, NNSQL_ERRHEAD "%s", msg); } static int table_check(yystmt_t* pstmt) { int i; char *table, *table1; table = pstmt->table; if( ! (table && *table) ) return 0; for(i=1;pstmt->pcol && incol;i++) { table1 = (pstmt->pcol)[i].table; if( table1 && *table1 && !STREQ( table, table1 ) ) return 0; } return 1; } static void* attr_name(yystmt_t* pstmt, char* name) { node_t node; column_name_t attrname; int attridx; void* offset; unpack_col_name( name, &attrname ); attridx = nnsql_getcolidxbyname( attrname.column_name ); if( attridx == -1 ) { pstmt->errcode = INVALID_COLUMN_NAME; return ERROR_PTR; } if( attridx == en_body ) { pstmt->errcode = UNSEARCHABLE_ATTR; return ERROR_PTR; } node.type = en_nt_attr; node.value.iattr = attridx; node.left = EMPTY_PTR; node.right= EMPTY_PTR; if( (offset = add_node(pstmt, &node)) == ERROR_PTR ) return ERROR_PTR; if( add_attr(pstmt, attridx, 1) ) return ERROR_PTR; return offset; } static int column_name(yystmt_t* pstmt, char* name) { column_name_t colname; int colidx; yycol_t col; unpack_col_name( name, &colname ); colidx = nnsql_getcolidxbyname( colname.column_name ); if( colidx == -1 ) { pstmt->errcode = INVALID_COLUMN_NAME; return -1; } col.iattr = colidx; col.table = colname.schema_tab_name; if( add_column(pstmt, &col) || add_attr(pstmt, colidx, 0) ) return -1; return 0; } static int add_ins_head( yystmt_t* pstmt, char* head, int idx) { if( !idx ) { MEM_FREE(pstmt->ins_heads); pstmt->ins_heads = (char**)MEM_ALLOC( FILTER_CHUNK_SIZE * sizeof(char*)); } else if( ! idx%FILTER_CHUNK_SIZE ) { pstmt->ins_heads = (char**)MEM_REALLOC( pstmt->ins_heads, (idx+FILTER_CHUNK_SIZE)*sizeof(char*)); } if( ! pstmt->ins_heads ) return -1; (pstmt->ins_heads)[idx] = head; return idx + 1; } static int add_ins_value( yystmt_t* pstmt, node_t node, int idx) { if( !idx ) { MEM_FREE(pstmt->ins_values); pstmt->ins_values = (node_t*)MEM_ALLOC( FILTER_CHUNK_SIZE * sizeof(node_t)); } else if( ! idx%FILTER_CHUNK_SIZE ) { pstmt->ins_values = (node_t*)MEM_REALLOC( pstmt->ins_values, (idx+FILTER_CHUNK_SIZE)*sizeof(node_t)); } if( ! pstmt->ins_values ) return -1; (pstmt->ins_values)[idx] = node; return idx + 1; } unixODBC-2.3.9/Drivers/nn/yylex.h0000755000175000017500000000157112262474475013461 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _YYLEX_H # define _YYLEX_H typedef struct { int idx; char* name; } keywd_ent_t; enum { en_cmpop_eq, en_cmpop_ne, en_cmpop_gt, en_cmpop_lt, en_cmpop_ge, en_cmpop_le, en_logop_and, en_logop_or, en_logop_not }; #endif unixODBC-2.3.9/Drivers/nn/SQLParamData.c0000755000175000017500000000377012262474475014517 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLParamData( HSTMT hstmt, PTR* prgbValue) { stmt_t* pstmt = hstmt; int ipar; param_t* ppar; fptr_t cvt; char* data; date_t dt; UNSET_ERROR( pstmt->herr ); ipar = pstmt->putipar; ppar = pstmt->ppar + ipar - 1; if ( ipar ) { ppar->need = 0; pstmt->ndelay --; if ( ppar->ctype == SQL_C_CHAR ) { if ( ! ppar->putdtbuf && ! ppar->putdtlen ) data = 0; else { cvt = ppar->cvt; data= cvt(ppar->putdtbuf, ppar->putdtlen, &dt); } MEM_FREE( ppar->putdtbuf ); ppar->putdtbuf = 0; ppar->putdtlen = 0; if ( data == (char*)(-1) ) { PUSHSQLERR( pstmt->herr, en_S1000 ); return SQL_ERROR; } sqlputdata( pstmt, ipar, data ); } } if ( pstmt->ndelay ) { for (ipar++, ppar++;;) { if ( ppar->need ) { *prgbValue = (PTR)(ppar->userbuf); pstmt->putipar = ipar; return SQL_NEED_DATA; } } } if ( nnsql_execute(pstmt->yystmt) ) { int code; code = nnsql_errcode( pstmt->yystmt ); if ( code == -1 ) code = errno; PUSHSYSERR( pstmt->herr, code, nnsql_errmsg(pstmt->yystmt)); return SQL_ERROR; } if ( ! nnsql_getcolnum(pstmt->yystmt) && nnsql_getrowcount(pstmt->yystmt) > 1 ) { PUSHSQLERR( pstmt->herr, en_01S04); return SQL_SUCCESS_WITH_INFO; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLSetConnectOption.c0000755000175000017500000000235212262474475016116 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLSetConnectOption(HDBC hdbc, UWORD fOption, UDWORD vParam) { dbc_t* pdbc = hdbc; UNSET_ERROR( pdbc->herr ); if ( fOption == SQL_ACCESS_MODE ) { switch (vParam) { case SQL_MODE_READ_ONLY: nntp_setaccmode( pdbc->hcndes, ACCESS_MODE_SELECT ); break; case SQL_MODE_READ_WRITE: nntp_setaccmode( pdbc->hcndes, ACCESS_MODE_DELETE_TEST ); break; default: PUSHSQLERR(pdbc->herr, en_S1009 ); return SQL_ERROR; } return SQL_SUCCESS; } PUSHSQLERR(pdbc->herr, en_S1C00 ); return SQL_ERROR; } unixODBC-2.3.9/Drivers/nn/nncol.h0000755000175000017500000000270612262474475013421 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _NNCOL_H # define _NNCOL_H # define PRIV_NONE 0 # define PRIV_REFER 1 # define PRIV_SELECT 2 # define PRIV_INSERT 3 # define PRIV_UPDATE 4 enum { en_article_num = 0, en_newsgroups, en_subject, en_from, en_sender, en_organization, en_summary, en_keywords, en_expires, en_msgid, en_references, en_followup_to, en_reply_to, en_distribution, en_xref, en_host, en_date, en_path, en_x_newsreader, en_lines, en_body, en_sql_count, en_sql_qstr, en_sql_num, en_sql_date }; enum { en_t_null, en_t_num, en_t_str, en_t_date, en_t_text }; char* nnsql_getcolnamebyidx(int idx); int nnsql_getcolidxbyname(char* name); void* nnsql_getcoldescbyidx(int idx); char* nnsql_getcolnamebydesc(void* desc); int nnsql_getcoldatetypebydesc(void* desc); int nnsql_getcolnullablebydesc(void* desc); #endif unixODBC-2.3.9/Drivers/nn/SQLGetData.c0000755000175000017500000000574212262474475014177 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLGetData( HSTMT hstmt, UWORD icol, SWORD fCType, PTR rgbValue, SDWORD cbValueMax, SDWORD* pcbValue ) { stmt_t* pstmt = hstmt; column_t* pcol; int ncol, flag = 0, clen = 0, len = 0; int sqltype, dft_ctype, sqlstat; char* ptr; char* ret; fptr_t cvt; UNSET_ERROR( pstmt->herr ); ncol = nnsql_getcolnum(pstmt->yystmt); if ( icol >= (UWORD)ncol ) { PUSHSQLERR( pstmt->herr, en_S1002 ); return SQL_ERROR; } pcol = pstmt->pcol + icol; if ( pcol->offset == -1 ) return SQL_NO_DATA_FOUND; if ( fCType == SQL_C_BOOKMARK ) fCType = SQL_C_ULONG; switch (fCType) { case SQL_C_DEFAULT: case SQL_C_CHAR: case SQL_C_TINYINT: case SQL_C_STINYINT: case SQL_C_UTINYINT: case SQL_C_SHORT: case SQL_C_SSHORT: case SQL_C_USHORT: case SQL_C_LONG: case SQL_C_SLONG: case SQL_C_ULONG: case SQL_C_DATE: break; default: PUSHSQLERR( pstmt->herr, en_S1C00 ); return SQL_ERROR; } if ( nnsql_isnullcol(pstmt->yystmt, icol) ) { if ( pcbValue ) *pcbValue = SQL_NULL_DATA; return SQL_SUCCESS; } if ( pcbValue ) *pcbValue = 0L; if ( nnsql_isstrcol(pstmt->yystmt, icol) ) { ptr = nnsql_getstr(pstmt->yystmt, icol) + pcol->offset; len = STRLEN(ptr) + 1; sqltype = SQL_CHAR; dft_ctype = SQL_C_CHAR; } else if ( nnsql_isnumcol(pstmt->yystmt, icol) ) { ptr = (char*)nnsql_getnum(pstmt->yystmt, icol); sqltype = SQL_INTEGER; dft_ctype = SQL_C_LONG; } else if ( nnsql_isdatecol(pstmt->yystmt, icol) ) { ptr = (char*)nnsql_getdate(pstmt->yystmt, icol); sqltype = SQL_DATE; dft_ctype = SQL_C_DATE; } else abort(); if ( fCType == SQL_C_DEFAULT ) fCType = dft_ctype; cvt = nnodbc_get_sql2c_cvt(sqltype, fCType); if ( ! cvt ) { PUSHSQLERR(pstmt->herr, en_07006); return SQL_ERROR; } ret = cvt(ptr, rgbValue, cbValueMax, &clen); if ( ret ) { if ( clen ) sqlstat = en_22003; else sqlstat = en_22005; PUSHSQLERR( pstmt->herr, sqlstat ); return SQL_ERROR; } if ( len && clen == cbValueMax ) { flag = 1; pcol->offset += (clen - 1); } else pcol->offset = -1; if ( len && pcbValue ) *pcbValue = len; /* not 'clen' but 'len' */ if ( flag ) { PUSHSQLERR(pstmt->herr, en_01004 ); return SQL_SUCCESS_WITH_INFO; } return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/yyerr.h0000755000175000017500000000315512262474475013461 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _YYERR_H # define _YYERR_H # include # define NNSQL_ERRHEAD "[NetNewSQL][Dynamic SQL parser]" # define INVALID_COLUMN_NAME 200 # define NOT_SUPPORT_UPDATEABLE_CURSOR 201 # define NOT_SUPPORT_DISTINCT_SELECT 202 # define NOT_SUPPORT_MULTITABLE_QUERY 203 # define NOT_SUPPORT_GROUP_CLAUSE 204 # define NOT_SUPPORT_HAVING_CLAUSE 205 # define NOT_SUPPORT_ORDER_CLAUSE 206 # define NOT_SUPPORT_DDL_DCL 207 # define NOT_SUPPORT_UPDATE 208 # define NOT_SUPPORT_POSITION_DELETE 209 # define NOT_SUPPORT_SPROC 210 # define TOO_MANY_COLUMNS 211 # define VARIABLE_IN_SELECT_LIST 212 # define VARIABLE_IN_TABLE_LIST 213 # define UNSEARCHABLE_ATTR 214 # define INSERT_VALUE_LESS 215 # define INSERT_VALUE_MORE 216 # define POST_WITHOUT_BODY 217 # define NO_POST_PRIVILEGE 218 # define NO_INSERT_PRIVILEGE 219 # define NO_DELETE_PRIVILEGE 220 # define NO_DELETE_ANY_PRIVILEGE 221 # define TYPE_VIOLATION 222 # define PARSER_ERROR 256 #endif unixODBC-2.3.9/Drivers/nn/herr.ci0000755000175000017500000001115112262474475013406 00000000000000static struct { int code; char* stat; char* msg; } sqlerrmsg_tab[] = { en_00000, "00000", "", en_01000, "01000", "General warning", en_01002, "01002", "Disconnect error", en_01004, "01004", "Data truncated", en_01006, "01006", "Privilege not revoked", en_01S00, "01S00", "Invalid connection string attribute", en_01S01, "01S01", "Error in row", en_01S02, "01S02", "Optional value changed", en_01S03, "01S03", "No rows updated or deleted", en_01S04, "01S04", "More than one row updated or deleted", en_07001, "07001", "Wrong number of parameters", en_07006, "07006", "Restricted data type attribute violation", en_08001, "08001", "Unable to connect to data source", en_08002, "08002", "Connection in use", en_08003, "08003", "Connect not open", en_08004, "08004", "Data source rejected establishment of connection", en_08007, "08007", "Connection failure during transaction", en_08S01, "08S01", "Communication link failure", en_0A000, "0A000", "Feature not supported", en_21S01, "21S01", "Insert value list does not match", en_21S02, "21S02", "Degree of derived table does not match column list", en_22001, "22001", "String data right truncation", en_22003, "22003", "Numeric value out of range", en_22005, "22005", "Error in assignment", en_22008, "22008", "Datetime field overflow", en_22012, "22012", "Division by zero", en_22026, "22026", "String data, length mismatch", en_23000, "23000", "Integrity constraint violation", en_24000, "24000", "Invalid cursor state", en_25000, "25000", "Invalid transaction state", en_28000, "28000", "Invalid authorization specification", en_34000, "34000", "Invalid cursor name", en_37000, "37000", "Syntex error or access violation", en_3C000, "3C000", "Duplicate cursor name", en_40001, "40001", "Serialization failure", en_42000, "42000", "Syntax error or access violation", en_70100, "70100", "Operation aborted", en_IM001, "IM001", "Driver does not support this function", en_IM002, "IM002", "Data source name not found and no default " "driver specified. Driver could not be loaded", en_IM003, "IM003", "Specified driver could not be loaded", en_IM004, "IM004", "Driver's SQLAllocEnv() failed", en_IM005, "IM005", "Driver's SQLAllocConnect() failed", en_IM006, "IM006", "Driver's SQLSetConnectOption failed", en_IM007, "IM007", "No data source or driver specified, dialog prohibited", en_IM008, "IM008", "Dialog failed", en_IM009, "IM009", "Unable to load translation DLL", en_IM010, "IM010", "Data source name too long", en_IM011, "IM011", "Driver name too long", en_IM012, "IM012", "DRIVER keyword syntax error", en_IM013, "IM013", "Trace file error", en_IM014, "IM014", "Try to change tracing file while tracing is on", en_S0001, "S0001", "Base table or view already exists", en_S0002, "S0002", "Base table not found", en_S0011, "S0011", "Index already exists", en_S0012, "S0012", "Index not found", en_S0021, "S0021", "Column already exists", en_S0022, "S0022", "Column not found", en_S0023, "S0023", "No default for column", en_S1000, "S1000", "General error", en_S1001, "S1001", "Memory allocation failure", en_S1002, "S1002", "Invalid column number", en_S1003, "S1003", "Program type out of range", en_S1004, "S1004", "SQL data type out of range", en_S1008, "S1008", "Operation canceled", en_S1009, "S1009", "Invalid argument value", en_S1010, "S1010", "Function sequence error", en_S1011, "S1011", "Operation invalid at this time", en_S1012, "S1012", "Invalid transaction operation code specified", en_S1015, "S1015", "No cursor name available", en_S1090, "S1090", "Invalid string or buffer length", en_S1091, "S1091", "Descriptor type out of range", en_S1092, "S1092", "Option type out of range", en_S1093, "S1093", "Invalid parameter", en_S1094, "S1094", "Invalid scale value", en_S1095, "S1095", "Function type out of range", en_S1096, "S1096", "Information type out of range", en_S1097, "S1097", "Column type out of range", en_S1098, "S1098", "Scope type out of range", en_S1099, "S1099", "Nullable type out of range", en_S1100, "S1100", "Uniquenss option type out of range", en_S1101, "S1101", "Accuracy option type out of range", en_S1103, "S1103", "Direction option out of range", en_S1104, "S1104", "Invalid precision value", en_S1105, "S1105", "Invalid parameter type", en_S1106, "S1106", "Fetch type out of range", en_S1107, "S1107", "Row value out of range", en_S1108, "S1108", "Concurrency option out of range", en_S1109, "S1109", "Invalid cursor position", en_S1110, "S1110", "Invalid driver completion", en_S1111, "S1111", "Invalid bookmark value", en_S1C00, "S1C00", "Driver not capable", en_S1T00, "S1T00", "Timeout expired", -1, 0, 0 }; unixODBC-2.3.9/Drivers/nn/SQLPutData.c0000755000175000017500000000347212262474475014226 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLPutData( HSTMT hstmt, PTR rgbValue, SDWORD cbValue) { stmt_t* pstmt = hstmt; param_t* ppar; char* ptr; fptr_t cvt; char* data; date_t dt; UNSET_ERROR( pstmt->herr ); ppar = pstmt->ppar + pstmt->putipar - 1; if ( ppar->ctype == SQL_C_CHAR ) { if ( cbValue == SQL_NULL_DATA ) return SQL_SUCCESS; if ( cbValue == SQL_NTS ) cbValue = STRLEN(rgbValue); if ( ! ppar->putdtbuf ) { ppar->putdtbuf = (char*)MEM_ALLOC(cbValue + 1); } else if ( cbValue ) { ppar->putdtbuf = (char*)MEM_REALLOC( ppar->putdtbuf, ppar->putdtlen + cbValue + 1); } if ( ! ppar->putdtbuf ) { PUSHSQLERR(pstmt->herr, en_S1001); return SQL_ERROR; } ptr = ppar->putdtbuf + ppar->putdtlen; STRNCPY(ptr, rgbValue, cbValue); ptr[cbValue] = 0; ppar->putdtlen += cbValue; return SQL_SUCCESS; } cvt = ppar->cvt; data= cvt(ppar->putdtbuf, ppar->putdtlen, &dt); if ( data == (char*)(-1) ) { PUSHSQLERR( pstmt->herr, en_S1000 ); return SQL_ERROR; } sqlputdata( pstmt, pstmt->putipar, data ); return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/convert.h0000755000175000017500000000151712262474475013767 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #ifndef _CONVERT_H # define _CONVERT_H typedef char* (*fptr_t)(); extern fptr_t nnodbc_get_c2sql_cvt(int ctype, int sqltype); extern fptr_t nnodbc_get_sql2c_cvt(int sqltype, int ctype); #endif unixODBC-2.3.9/Drivers/nn/SQLBindParameter.c0000755000175000017500000000466212262474475015403 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLBindParameter( HSTMT hstmt, UWORD ipar, SWORD fParamType, SWORD fCType, SWORD fSqlType, UDWORD cbColDef, SWORD ibScale, PTR rgbValue, SDWORD cbValueMax, SDWORD* pcbValue) { param_t* ppar; int i, max; stmt_t* pstmt = hstmt; fptr_t cvt; UNSET_ERROR( pstmt->herr ); max = nnsql_max_param(); if ( ipar > (UWORD)max ) { PUSHSQLERR( pstmt->herr, en_S1093); return SQL_ERROR; } if ( fCType == SQL_C_DEFAULT ) { switch ( fSqlType ) { case SQL_CHAR: case SQL_VARCHAR: case SQL_LONGVARCHAR: fCType = SQL_C_CHAR; break; case SQL_TINYINT: fCType = SQL_C_STINYINT; break; case SQL_SMALLINT: fCType = SQL_C_SSHORT; break; case SQL_INTEGER: fCType = SQL_C_SLONG; break; case SQL_DATE: fCType = SQL_C_DATE; break; default: PUSHSQLERR( pstmt->herr, en_S1C00 ); return SQL_ERROR; } } cvt = nnodbc_get_c2sql_cvt( fCType, fSqlType); if ( ! cvt ) { PUSHSQLERR( pstmt->herr, en_07006 ); return SQL_ERROR; } if ( ! pstmt->ppar ) { int i; pstmt->ppar = (param_t*)MEM_ALLOC( sizeof(param_t)*max ); if ( ! pstmt->ppar ) { PUSHSQLERR( pstmt->herr, en_S1001 ); return SQL_ERROR; } ppar = pstmt->ppar; MEM_SET( ppar, 0, sizeof(param_t)*max ); for (i=0; i< max; i++ ) { ppar->bind = 0; ppar ++; } } ppar = pstmt->ppar + ipar - 1; ppar->bind = 1; ppar->type = fParamType; ppar->coldef = cbColDef; ppar->scale = ibScale; ppar->userbuf = rgbValue; ppar->userbufsize = cbValueMax; ppar->pdatalen = (long*) pcbValue; ppar->ctype = fCType; ppar->sqltype = fSqlType; ppar->cvt = cvt; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLCancel.c0000755000175000017500000000216712262474475014051 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLCancel( HSTMT hstmt) { stmt_t* pstmt = hstmt; param_t* ppar; int i, npar; UNSET_ERROR( pstmt->herr ); npar = nnsql_getparnum(pstmt->yystmt); for (i=1, ppar = pstmt->ppar; ppar && i < npar + 1; i++, ppar++ ) { nnsql_yyunbindpar( pstmt->yystmt, i); MEM_FREE(ppar->putdtbuf); ppar->putdtbuf = 0; ppar->putdtlen = 0; ppar->need = 0; } pstmt->ndelay = 0; pstmt->putipar= 0; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLBindCol.c0000755000175000017500000000366412262474475014201 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLBindCol( HSTMT hstmt, UWORD icol, SWORD fCType, PTR rgbValue, SDWORD cbValueMax, SDWORD* pcbValue ) { stmt_t* pstmt = hstmt; column_t* pcol; int i, max; UNSET_ERROR( pstmt->herr ); if ( fCType == SQL_C_BOOKMARK ) fCType = SQL_C_ULONG; switch (fCType) { case SQL_C_DEFAULT: case SQL_C_CHAR: case SQL_C_TINYINT: case SQL_C_STINYINT: case SQL_C_UTINYINT: case SQL_C_SHORT: case SQL_C_SSHORT: case SQL_C_USHORT: case SQL_C_LONG: case SQL_C_SLONG: case SQL_C_ULONG: case SQL_C_DATE: break; default: PUSHSQLERR( pstmt->herr, en_S1C00 ); return SQL_ERROR; } max = nnsql_max_column(); if ( icol > (UWORD)max ) { PUSHSQLERR( pstmt->herr, en_S1002 ); return SQL_ERROR; } if ( ! pstmt->pcol ) { if ( ! rgbValue ) return SQL_SUCCESS; pstmt->pcol = (column_t*)MEM_ALLOC( sizeof(column_t)*(max+1) ); if ( ! pstmt->pcol ) { PUSHSQLERR( pstmt->herr, en_S1001 ); return SQL_ERROR; } MEM_SET(pstmt->pcol, 0, sizeof(column_t)*(max+1) ); } pcol = pstmt->pcol + icol; pcol->ctype = fCType; pcol->userbuf = rgbValue; pcol->userbufsize = cbValueMax; pcol->pdatalen = (long*) pcbValue; pcol->offset = 0; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/Makefile.am0000755000175000017500000000213212262756066014163 00000000000000lib_LTLIBRARIES = libnn.la AM_CPPFLAGS = -I@top_srcdir@/include -I. libnn_la_LDFLAGS = -no-undefined -version-info 1:0:0 -module EXTRA_DIST = \ nnconfig.h \ connect.h \ convert.h \ driver.h \ herr.h \ hstmt.h \ isql.h \ isqlext.h \ nncol.h \ nndate.h \ nnsql.h \ nntp.h \ stmt.h \ yyenv.h \ yyerr.h \ yylex.h \ yyparse.tab.h \ yystmt.h \ herr.ci \ nncol.ci \ nntp.ci \ yyerr.ci \ yylex.ci \ README libnn_la_SOURCES = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParameter.c \ SQLCancel.c \ SQLConnect.c \ SQLDescribeCol.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLFetch.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeStmt.c \ SQLGetConnectOption.c \ SQLGetData.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLPrepare.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectOption.c \ SQLSetParam.c \ misc.c \ connect.c \ convert.c \ execute.c \ herr.c \ prepare.c \ yyparse.y \ yylex.c \ yystmt.c \ yyerr.c \ yyevl.c \ yytchk.c \ nncol.c \ nndate.c \ nntp.c unixODBC-2.3.9/Drivers/nn/SQLAllocConnect.c0000755000175000017500000000216012262474475015221 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLAllocConnect( HENV henv, HDBC * phdbc) { env_t* penv = henv; dbc_t* pdbc; int i; UNSET_ERROR( penv->herr ); pdbc = *phdbc = (void*)MEM_ALLOC( sizeof(dbc_t) ); if (! pdbc ) { PUSHSQLERR( penv->herr, en_S1001 ); return SQL_ERROR; } pdbc->next = penv->hdbc; penv->hdbc = pdbc; pdbc->henv = henv; pdbc->stmt= 0; pdbc->herr = 0; pdbc->hcndes = 0; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/SQLAllocEnv.c0000755000175000017500000000161612262474475014365 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include "driver.h" RETCODE SQL_API SQLAllocEnv( HENV* phenv) { env_t* penv; *phenv = penv = (env_t*)MEM_ALLOC(sizeof(env_t)); if ( ! penv ) return SQL_ERROR; penv->herr = 0; penv->hdbc = 0; return SQL_SUCCESS; } unixODBC-2.3.9/Drivers/nn/yytchk.c0000755000175000017500000000717712262474475013625 00000000000000/** Copyright (C) 1995, 1996 by Ke Jin Enhanced for unixODBC (1999) by Peter Harvey 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. **/ #include #include #include #include #include #include #include static int getleaftype(yystmt_t* yystmt, node_t* nd) { yypar_t* par; yyattr_t* attr; switch( nd->type ) { case en_nt_attr: attr = yystmt->pattr + (nd->value).iattr; switch((nd->value).iattr) { case en_lines: case en_article_num: case en_sql_num: case en_sql_count: return en_nt_num; case en_date: case en_sql_date: return en_nt_date; default: break; } return en_nt_qstr; case en_nt_param: par = yystmt->ppar + (nd->value).ipar - 1; switch(par->type) { case en_nt_null: case en_nt_num: case en_nt_qstr: case en_nt_date: break; default: return -1; } return par->type; case en_nt_num: case en_nt_qstr: case en_nt_date: case en_nt_null: return nd->type; default: return -1; } } static int cmp_tchk(yystmt_t* yystmt, node_t* a, node_t* b) { int ta, tb; ta = getleaftype( yystmt, a ); tb = getleaftype( yystmt, b ); if( ta == -1 || tb == -1 ) return -1; if( ta == en_nt_date && tb == en_nt_qstr ) return 0; if( ta != tb && ta != en_nt_null && tb != en_nt_null ) return -1; return 0; } static int evl_like_tchk(yystmt_t* yystmt, node_t* a, node_t* b) { int ta, tb; ta = getleaftype(yystmt, a); tb = getleaftype(yystmt, b); if( tb == en_nt_null || tb == en_nt_null ) return 0; if( ta != en_nt_qstr || tb != en_nt_qstr ) return -1; return 0; } static int srchtree_tchk(yystmt_t* yystmt, node_t* node) /* return -1: err or syserr, 0: ok */ { int r, s, flag = 0; node_t* ptr; if( ! node ) return 0; switch( node->type ) { case en_nt_cmpop: return cmp_tchk(yystmt, node->left, node->right); case en_nt_logop: switch( (node->value).logop ) { case en_logop_not: return srchtree_tchk(yystmt, node->right); case en_logop_and: case en_logop_or: r = srchtree_tchk(yystmt, node->left); s = srchtree_tchk(yystmt, node->right); if( r == -1 || s == -1 ) return -1; return 0; default: abort(); break; /* just for turn off the warning */ } break; /* just for turn off the warning */ case en_nt_isnull: return 0; case en_nt_between: r = cmp_tchk(yystmt, node->left, node->right->left); s = cmp_tchk(yystmt, node->left, node->right->right); if( r == -1 || s == -1 ) return -1; return 0; case en_nt_in: for(ptr=node->right; ptr; ptr=ptr->right) { r = cmp_tchk(yystmt, node->left, ptr); if( r == -1 ) return -1; } return 0; case en_nt_caselike: case en_nt_like: return evl_like_tchk( yystmt, node->left, node->right); default: abort(); break; /* turn off the warning */ } return -1; /* just for turn off the warning */ } int nnsql_srchtree_tchk(void* hstmt) { yystmt_t* yystmt = hstmt; int r; r = srchtree_tchk(yystmt, yystmt->srchtree); if( r ) yystmt->errcode = TYPE_VIOLATION; return r; } unixODBC-2.3.9/Drivers/nn/yyparse.y0000644000175000017500000005476613272645600014027 00000000000000%{ /** source of nntp odbc sql parser -- yyparse.y Copyright (C) 1995, 1996 by Ke Jin 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. **/ static char sccsid[] = "@(#)SQL parser for NNSQL(NetNews SQL), Copyright(c) 1995, 1996 by Ke Jin"; #include #include #include #include #include #include #include #include #include #include # ifdef YYLSP_NEEDED # undef YYLSP_NEEDED # endif #if defined(YYBISON) || defined(__YY_BISON__) # define yylex(pyylval) nnsql_yylex(pyylval, pyyenv) #else # define yylex() nnsql_yylex(&yylval, pyyenv) #endif #define yyparse(x) nnsql_yyparse (yyenv_t* pyyenv) #define yyerror(msg) nnsql_yyerror (pyyenv, msg) #define SETYYERROR(env, code) { env->pstmt->errcode = code; \ env->pstmt->errpos = env->errpos;} typedef struct { char* schema_tab_name; char* column_name; } column_name_t; static void unpack_col_name(char* schema_tab_column_name, column_name_t* ptr); static void* add_node(yystmt_t* pstmt, node_t* node); static void srchtree_reloc(node_t* srchtree, int num); static int add_attr(yystmt_t* pstmt, int idx, int wstat); static void* add_all_attr(yystmt_t* pstmt); static void* add_news_attr(yystmt_t* pstmt); static void* add_xnews_attr(yystmt_t* pstmt); static void* add_column(yystmt_t* pstmt, yycol_t* pcol); static void nnsql_yyerror(yyenv_t* pyyenv, char* msg); static int table_check(yystmt_t* pstmt); static int column_name(yystmt_t* pstmt, char* name); static void* attr_name(yystmt_t* pstmt, char* name); static int add_ins_head(yystmt_t* pstmt, char* head, int idx); static int add_ins_value(yystmt_t* pstmt, node_t node, int idx); static char* get_unpacked_attrname(yystmt_t* pstmt, char* name); #define ERROR_PTR ((void*)(-1L)) #define EMPTY_PTR ERROR_PTR %} %pure_parser /* forcing to generate reentrant parser */ %start sql_stmt %union { char* qstring; char* name; long number; int ipar; /* parameter index */ int cmpop; /* for comparsion operators */ char esc; int flag; /* for not_opt and case_opt */ int idx; void* offset; /* actually, it is used as a 'int' offset */ node_t node; /* a node haven't add to tree */ } %token kwd_select %token kwd_all %token kwd_news %token kwd_xnews %token kwd_distinct %token kwd_count %token kwd_from %token kwd_where %token kwd_in %token kwd_between %token kwd_like %token kwd_escape %token kwd_group %token kwd_by %token kwd_having %token kwd_order %token kwd_for %token kwd_insert %token kwd_into %token kwd_values %token kwd_delete %token kwd_update %token kwd_create %token kwd_alter %token kwd_drop %token kwd_table %token kwd_column %token kwd_view %token kwd_index %token kwd_of %token kwd_current %token kwd_grant %token kwd_revoke %token kwd_is %token kwd_null %token kwd_call %token kwd_uncase %token kwd_case %token kwd_fn %token kwd_d %token QSTRING %token NUM %token NAME %token PARAM %type escape_desc %type not_opt %type case_opt %type tab_name %type search_condition %type pattern %type attr_name %type value_list %type ins_head_list %type ins_value_list %type value %type ins_value %type ins_head %left kwd_or %left kwd_and %nonassoc kwd_not %nonassoc CMPOP %% sql_stmt : stmt_body ';' { YYACCEPT; } ; stmt_body : | kwd_select distinct_opt select_list kwd_from tab_list select_clauses { if( ! table_check( pyyenv->pstmt ) ) { SETYYERROR(pyyenv, NOT_SUPPORT_MULTITABLE_QUERY); YYABORT; } pyyenv->pstmt->type = en_stmt_select; } | insert_stmt { pyyenv->pstmt->type = en_stmt_insert; } | srch_delete_stmt { pyyenv->pstmt->type = en_stmt_srch_delete; } | posi_delete_stmt | other_stmt { pyyenv->pstmt->type = en_stmt_alloc; YYABORT; } ; select_clauses : where_clause group_clause having_clause order_clause for_stmt ; for_stmt : | kwd_for kwd_update kwd_of col_name_list { SETYYERROR(pyyenv, NOT_SUPPORT_UPDATEABLE_CURSOR) ; YYABORT; } ; distinct_opt : | kwd_all | kwd_distinct { SETYYERROR(pyyenv, NOT_SUPPORT_DISTINCT_SELECT); YYABORT; } ; select_list : { if(add_all_attr(pyyenv->pstmt)) YYABORT; } | '*' { if(add_all_attr(pyyenv->pstmt)) YYABORT; } | news_hotlist { if(add_news_attr(pyyenv->pstmt)) YYABORT; } | news_xhotlist { if(add_xnews_attr(pyyenv->pstmt)) YYABORT; } | col_name_list { if(add_attr(pyyenv->pstmt, 0, 0)) YYABORT; } ; news_hotlist : kwd_news | kwd_news '(' ')' | '{' kwd_fn kwd_news '(' ')' '}' ; news_xhotlist : kwd_xnews | kwd_xnews '(' ')' | '{' kwd_fn kwd_xnews '(' ')' '}' ; col_name_list : col_name | col_name_list ',' col_name ; col_name : kwd_count count_sub_opt { yycol_t col; col.iattr = en_sql_count; col.table = 0; if( add_column(pyyenv->pstmt, &col) ) YYABORT; } | NAME { if( column_name( pyyenv->pstmt, $1 ) ) YYABORT; } | kwd_column '(' QSTRING ')' { if( column_name( pyyenv->pstmt, $3 ) ) YYABORT; } | '{' kwd_fn kwd_column '(' QSTRING ')' '}' { if( column_name( pyyenv->pstmt, $5 ) ) YYABORT; } | QSTRING { yycol_t col; col.iattr = en_sql_qstr; col.value.qstr = $1; col.table = 0; if( add_column(pyyenv->pstmt, &col) ) YYABORT; } | NUM { yycol_t col; col.iattr = en_sql_num; col.value.num = $1; col.table = 0; if( add_column(pyyenv->pstmt, &col) ) YYABORT; } | '{' kwd_d QSTRING '}' { yycol_t col; col.iattr = en_sql_date; if( nnsql_odbcdatestr2date($3, &(col.value.date)) ) YYABORT; col.table = 0; if( add_column(pyyenv->pstmt, &col) ) YYABORT; } | PARAM { SETYYERROR(pyyenv, VARIABLE_IN_SELECT_LIST); YYABORT; } ; count_sub_opt : | '(' ')' | '(' '*' ')' | '(' NAME ')' | '(' QSTRING ')' | '(' NUM ')' ; tab_list : tab_name { pyyenv->pstmt->table = $1; } | tab_list ',' tab_name { if( ! pyyenv->pstmt->table ) pyyenv->pstmt->table = $3; else if( !STREQ(pyyenv->pstmt->table, $3) ) { SETYYERROR(pyyenv, NOT_SUPPORT_MULTITABLE_QUERY); YYABORT; } } ; tab_name : NAME { $$ = $1; } | kwd_table '(' QSTRING ')' { $$ = $3; } | '{' kwd_fn kwd_table '(' QSTRING ')' '}' { $$ = $5; } | PARAM { SETYYERROR(pyyenv, VARIABLE_IN_TABLE_LIST); YYABORT; } ; where_clause : { pyyenv->pstmt->srchtree = 0; } | kwd_where search_condition { yystmt_t* pstmt; uintptr_t offset; pstmt = pyyenv->pstmt; offset = (uintptr_t)($2); pstmt->srchtree = pstmt->node_buf + offset; srchtree_reloc ( pstmt->node_buf, pstmt->srchtreenum); } ; search_condition : '(' search_condition ')' { $$ = $2; } | kwd_not search_condition { node_t node; node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right= $2; if(($$ = add_node(pyyenv->pstmt, &node)) == ERROR_PTR ) YYABORT; } | search_condition kwd_or search_condition { node_t node; void* p; node.type = en_nt_logop; node.value.logop = en_logop_or; node.left = $1; node.right= $3; if(($$ = add_node(pyyenv->pstmt, &node)) == ERROR_PTR ) YYABORT; } | search_condition kwd_and search_condition { node_t node; node.type = en_nt_logop; node.value.logop = en_logop_and; node.left = $1; node.right= $3; if(($$ = add_node(pyyenv->pstmt, &node)) == ERROR_PTR ) YYABORT; } | attr_name not_opt kwd_in '(' value_list ')' { node_t node; void* ptr; node.type = en_nt_in; node.left = $1; node.right= $5; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; if( $2 ) { node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right = ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } $$ = ptr; } | attr_name not_opt kwd_between value kwd_and value { node_t node; void* ptr; if( ((node.left = add_node(pyyenv->pstmt, &($4))) == ERROR_PTR) || ((node.right= add_node(pyyenv->pstmt, &($6))) == ERROR_PTR) || ((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) ) YYABORT; node.type = en_nt_between; node.left = $1; node.right = ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; if( $2 ) { node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right= ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } $$ = ptr; } | attr_name not_opt case_opt kwd_like pattern escape_desc { node_t node; void* ptr; if( $3 ) node.type = en_nt_caselike; else node.type = en_nt_like; node.value.esc = $6; node.left = $1; node.right= $5; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; if( $2 ) { node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right= ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } $$ = ptr; } | attr_name kwd_is not_opt kwd_null { node_t node; void* ptr; node.type = en_nt_isnull; node.left = $1; node.right= EMPTY_PTR; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; if( $3 ) { node.type = en_nt_logop; node.value.logop = en_logop_not; node.left = EMPTY_PTR; node.right= ptr; if((ptr = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } $$ = ptr; } | attr_name CMPOP value { node_t node; node.type = en_nt_cmpop; node.value.cmpop = $2; node.left = $1; if( ((node.right= add_node(pyyenv->pstmt, &($3))) == ERROR_PTR) || (($$ = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) ) YYABORT; } ; case_opt : { $$ = 0; } | kwd_case { $$ = 0; } | kwd_uncase { $$ = 1; } | kwd_all kwd_case { $$ = 1; } ; attr_name : NAME { $$ = attr_name( pyyenv->pstmt, $1 ); if( $$ == ERROR_PTR ) YYABORT; } | kwd_column '(' QSTRING ')' { $$ = attr_name( pyyenv->pstmt, $3 ); if( $$ == ERROR_PTR ) YYABORT; } | '{' kwd_fn kwd_column '(' QSTRING ')' '}' { $$ = attr_name( pyyenv->pstmt, $5 ); if( $$ == ERROR_PTR ) YYABORT; } ; value_list : value { if( ($$ = add_node( pyyenv->pstmt, &($1))) == ERROR_PTR ) YYABORT; } | value_list ',' value { node_t node; node = $3; node.left = EMPTY_PTR; node.right= $1; if( ($$ = add_node(pyyenv->pstmt, &node)) == ERROR_PTR ) YYABORT; } ; value : kwd_null { node_t node; node.type = en_nt_null; node.left = EMPTY_PTR; node.right= EMPTY_PTR; $$ = node; } | PARAM { node_t node; node.type = en_nt_param, node.value.ipar = $1; node.left = EMPTY_PTR; node.right= EMPTY_PTR; pyyenv->pstmt->npar ++; $$ = node; } | QSTRING { node_t node; node.type = en_nt_qstr; node.value.qstr = $1; node.left = EMPTY_PTR; node.right= EMPTY_PTR; $$ = node; } | NUM { node_t node; node.type = en_nt_num; node.value.num = $1; node.left = EMPTY_PTR; node.right= EMPTY_PTR; $$ = node; } | '{' kwd_d QSTRING '}' { node_t node; node.type = en_nt_date; if( nnsql_odbcdatestr2date($3, &(node.value.date)) ) YYABORT; node.left = EMPTY_PTR; node.right= EMPTY_PTR; $$ = node; } ; escape_desc : { $$ = 0; } | kwd_escape QSTRING { $$ = $2[0]; } | '{' kwd_escape QSTRING '}' { $$ = $3[0]; } ; pattern : PARAM { node_t node; node.type = en_nt_param; node.value.ipar = $1; node.left = EMPTY_PTR; node.right= EMPTY_PTR; pyyenv->pstmt->npar ++; if(($$ = add_node(pyyenv->pstmt, &node)) == EMPTY_PTR) YYABORT; } | QSTRING { node_t node; node.type = en_nt_qstr; node.value.qstr = $1; node.left = EMPTY_PTR; node.right= EMPTY_PTR; if(($$ = add_node(pyyenv->pstmt, &node)) == ERROR_PTR) YYABORT; } ; not_opt : { $$ = 0; } | kwd_not { $$ = 1; } ; group_clause : | kwd_group kwd_by col_name_list { SETYYERROR(pyyenv, NOT_SUPPORT_GROUP_CLAUSE); YYABORT; } ; having_clause : | kwd_having search_condition { SETYYERROR(pyyenv, NOT_SUPPORT_HAVING_CLAUSE); YYABORT; } ; order_clause : | kwd_order kwd_by col_name_list { SETYYERROR(pyyenv, NOT_SUPPORT_ORDER_CLAUSE); YYABORT; } ; insert_stmt : kwd_insert kwd_into tab_name '(' ins_head_list ')' kwd_values '(' ins_value_list ')' { int i; char* head = 0; if( $5 > $9 ) { SETYYERROR(pyyenv, INSERT_VALUE_LESS); YYABORT; } if( $5 < $9 ) { SETYYERROR(pyyenv, INSERT_VALUE_MORE); YYABORT; } for(i=0;;i++) { head = (pyyenv->pstmt->ins_heads)[i]; if( ! head ) { SETYYERROR(pyyenv, POST_WITHOUT_BODY); YYABORT; } if( nnsql_getcolidxbyname(head) == en_body ) break; } if( add_ins_head(pyyenv->pstmt, 0, $5) == -1 ) YYABORT; pyyenv->pstmt->table = $3; /* we will not check table(i.e. group)name here. * According to RFC1036, it is totally legal to * post an articl to a group which is not access * able locally. * table name here is actually newsgroups name. * it should look like: * ,,... * Be aware, there are must no space between the * ',' and the two s. Also, group * names are case sensitive. */ } ; ins_head_list : ins_head { if( ($$ = add_ins_head(pyyenv->pstmt, $1, 0)) == -1) YYABORT; } | ins_head_list ',' ins_head { if( ($$ = add_ins_head(pyyenv->pstmt, $3, $1))== -1) YYABORT; } ; ins_head : NAME { $$ = get_unpacked_attrname(pyyenv->pstmt, $1); } | kwd_column '(' QSTRING ')' { $$ = get_unpacked_attrname(pyyenv->pstmt, $3); } | '{' kwd_fn kwd_column '(' QSTRING ')' '}' { $$ = $5; } ; ins_value_list : ins_value { if( ($$ = add_ins_value(pyyenv->pstmt, $1, 0))== -1) YYABORT; } | ins_value_list ',' ins_value { if( ($$ = add_ins_value(pyyenv->pstmt, $3, $1))==-1) YYABORT; } ; ins_value : kwd_null { $$.type = en_nt_null; } | QSTRING { $$.type = en_nt_qstr; $$.value.qstr = $1; } | PARAM { $$.type = en_nt_param; $$.value.ipar= $1; } ; srch_delete_stmt : kwd_delete kwd_from tab_name where_clause { pyyenv->pstmt->table = $3; if( add_attr( pyyenv->pstmt, en_sender, 1 ) || add_attr( pyyenv->pstmt, en_from, 1 ) || add_attr( pyyenv->pstmt, en_msgid, 1 ) ) YYABORT; } ; posi_delete_stmt : kwd_delete kwd_from tab_name kwd_where kwd_current kwd_of NAME { SETYYERROR( pyyenv, NOT_SUPPORT_POSITION_DELETE ); YYABORT; } ; other_stmt : kwd_create { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } | kwd_alter { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } | kwd_drop { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } | kwd_update { SETYYERROR(pyyenv, NOT_SUPPORT_UPDATE); } | '{' kwd_call { SETYYERROR(pyyenv, NOT_SUPPORT_SPROC); } | '{' PARAM '=' kwd_call { SETYYERROR(pyyenv, NOT_SUPPORT_SPROC); } | kwd_grant { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } | kwd_revoke { SETYYERROR(pyyenv, NOT_SUPPORT_DDL_DCL); } ; %% static void unpack_col_name(char* schema_tab_column_name, column_name_t* ptr) { int len, i; char c; len = STRLEN(schema_tab_column_name); for(i=len; i; i--) { if( schema_tab_column_name[i-1] == '.' ) { schema_tab_column_name[i-1] = 0; break; } } ptr->column_name = ( schema_tab_column_name + i ); if( i ) ptr->schema_tab_name = schema_tab_column_name; else ptr->schema_tab_name = schema_tab_column_name + len; } static char* get_unpacked_attrname(yystmt_t* pstmt, char* name) { column_name_t attrname; unpack_col_name( name, &attrname ); return attrname.column_name; } #define FILTER_CHUNK_SIZE 16 static void* add_node(yystmt_t* pstmt, node_t* node) { int i; node_t* srchtree; if (!pstmt->node_buf) { pstmt->node_buf = (node_t*)MEM_ALLOC( sizeof(node_t)*FILTER_CHUNK_SIZE); if( ! pstmt->node_buf ) { pstmt->errcode = -1; return ERROR_PTR; } pstmt->srchtreesize = FILTER_CHUNK_SIZE; pstmt->srchtreenum = 0; } if( pstmt->srchtreenum == pstmt->srchtreesize ) { pstmt->node_buf = (node_t*)MEM_REALLOC( pstmt->node_buf, sizeof(node_t)*(pstmt->srchtreesize + FILTER_CHUNK_SIZE)); if( ! pstmt->node_buf ) { pstmt->errcode = -1; return ERROR_PTR; } pstmt->srchtreesize += FILTER_CHUNK_SIZE; } srchtree = pstmt->node_buf; srchtree[pstmt->srchtreenum] = *node; pstmt->srchtreenum ++; for(i=pstmt->srchtreenum;isrchtreesize;i++) { srchtree[i].left = EMPTY_PTR; srchtree[i].right= EMPTY_PTR; } return (void*)((uintptr_t)(pstmt->srchtreenum - 1)); } static void srchtree_reloc(node_t* buf, int num) /* The 'where' srchtree is build on a re-allocateable array with addnode(). The purpose * of using an array rather than a link list is to easy the job of freeing it. Thus, * the left and right pointer of a node point is an offset to the array address not * the virtual address of the subtree. However, an evaluate function would be easy to * work by using virtual address of subtree rather than an offset. Because, in the first * case, a recrusive evaluate function only need to pass virtual address of (sub)tree * without worry about the offset of subtree. The purpose of this function, srchtree_reloc(), * is to convert all subnodes' offset into virtual address. It will called only once * after the whole tree has been built. */ { int i; uintptr_t offset; node_t* ptr = buf; for(i=0; ptr && ileft == EMPTY_PTR ) ptr->left = 0; else { offset = (uintptr_t)(ptr->left); ptr->left = buf + offset; } if( ptr->right== EMPTY_PTR ) ptr->right= 0; else { offset = (uintptr_t)(ptr->right); ptr->right= buf+ offset; } } } static int add_attr(yystmt_t* pstmt, int idx, int wstat) { if( ! pstmt->pattr ) { pstmt->pattr = (yyattr_t*)MEM_ALLOC((en_body+1)*sizeof(yyattr_t)); if( ! pstmt->pattr ) { pstmt->errcode = -1; return -1; } MEM_SET(pstmt->pattr, 0, (en_body+1)*sizeof(yyattr_t)); } (pstmt->pattr)[0].stat = 1; (pstmt->pattr)[0].wstat = 1; (pstmt->pattr)[0].article = 0; (pstmt->pattr)[0].nntp_hand = 0; (pstmt->pattr)[idx].stat = 1; (pstmt->pattr)[idx].wstat |= wstat; return 0; } static void* add_all_attr(yystmt_t* pstmt) { int i; yycol_t col; for(i=en_article_num + 1; i < en_body + 1; i++) { col.iattr = i; col.table = 0; if( add_column(pstmt, &col) || add_attr (pstmt, i, 0) ) return ERROR_PTR; } return 0; } static const int news_attr[] = { en_subject, en_date, en_from, en_organization, en_msgid, en_body }; static void* add_news_attr(yystmt_t* pstmt) { int i, n; yycol_t col; n = sizeof(news_attr)/sizeof(news_attr[0]); for(i=0; ipcol ) { pstmt->pcol = (yycol_t*)MEM_ALLOC((MAX_COLUMN_NUMBER + 1)*sizeof(yycol_t)); if( ! pstmt->pcol ) { pstmt->errcode = -1; return ERROR_PTR; } MEM_SET( pstmt->pcol, 0, (MAX_COLUMN_NUMBER + 1)*sizeof(yycol_t)); } if( ! pstmt->ncol ) { pstmt->ncol = 1; pstmt->pcol->iattr = en_article_num; pstmt->pcol->table = 0; } if( pstmt->ncol > MAX_COLUMN_NUMBER + 1) { pstmt->errcode = TOO_MANY_COLUMNS; return ERROR_PTR; } pcol = pstmt->pcol + pstmt->ncol; pstmt->ncol++; *pcol = *column; return 0; } static void nnsql_yyerror(yyenv_t* pyyenv, char* msg) { yystmt_t* pstmt = pyyenv->pstmt; pstmt->errcode = PARSER_ERROR; pstmt->errpos = pyyenv->errpos; sprintf(pstmt->msgbuf, NNSQL_ERRHEAD "%s", msg); } static int table_check(yystmt_t* pstmt) { int i; char *table, *table1; table = pstmt->table; if( ! (table && *table) ) return 0; for(i=1;pstmt->pcol && incol;i++) { table1 = (pstmt->pcol)[i].table; if( table1 && *table1 && !STREQ( table, table1 ) ) return 0; } return 1; } static void* attr_name(yystmt_t* pstmt, char* name) { node_t node; column_name_t attrname; int attridx; void* offset; unpack_col_name( name, &attrname ); attridx = nnsql_getcolidxbyname( attrname.column_name ); if( attridx == -1 ) { pstmt->errcode = INVALID_COLUMN_NAME; return ERROR_PTR; } if( attridx == en_body ) { pstmt->errcode = UNSEARCHABLE_ATTR; return ERROR_PTR; } node.type = en_nt_attr; node.value.iattr = attridx; node.left = EMPTY_PTR; node.right= EMPTY_PTR; if( (offset = add_node(pstmt, &node)) == ERROR_PTR ) return ERROR_PTR; if( add_attr(pstmt, attridx, 1) ) return ERROR_PTR; return offset; } static int column_name(yystmt_t* pstmt, char* name) { column_name_t colname; int colidx; yycol_t col; unpack_col_name( name, &colname ); colidx = nnsql_getcolidxbyname( colname.column_name ); if( colidx == -1 ) { pstmt->errcode = INVALID_COLUMN_NAME; return -1; } col.iattr = colidx; col.table = colname.schema_tab_name; if( add_column(pstmt, &col) || add_attr(pstmt, colidx, 0) ) return -1; return 0; } static int add_ins_head( yystmt_t* pstmt, char* head, int idx) { if( !idx ) { MEM_FREE(pstmt->ins_heads); pstmt->ins_heads = (char**)MEM_ALLOC( FILTER_CHUNK_SIZE * sizeof(char*)); } else if( ! idx%FILTER_CHUNK_SIZE ) { pstmt->ins_heads = (char**)MEM_REALLOC( pstmt->ins_heads, (idx+FILTER_CHUNK_SIZE)*sizeof(char*)); } if( ! pstmt->ins_heads ) return -1; (pstmt->ins_heads)[idx] = head; return idx + 1; } static int add_ins_value( yystmt_t* pstmt, node_t node, int idx) { if( !idx ) { MEM_FREE(pstmt->ins_values); pstmt->ins_values = (node_t*)MEM_ALLOC( FILTER_CHUNK_SIZE * sizeof(node_t)); } else if( ! idx%FILTER_CHUNK_SIZE ) { pstmt->ins_values = (node_t*)MEM_REALLOC( pstmt->ins_values, (idx+FILTER_CHUNK_SIZE)*sizeof(node_t)); } if( ! pstmt->ins_values ) return -1; (pstmt->ins_values)[idx] = node; return idx + 1; } unixODBC-2.3.9/Drivers/Makefile.am0000755000175000017500000000012512262474476013552 00000000000000if DRIVERS SUBDIRS = \ Postgre7.1 \ template \ MiniSQL \ nn endif unixODBC-2.3.9/Interix/0000775000175000017500000000000013725127520011571 500000000000000unixODBC-2.3.9/Interix/libtool0000755000175000017500000044134112262474476013122 00000000000000#! /bin/sh # libtool - Provide generalized library-building support services. # Generated automatically by (GNU unixODBC 2.2.6) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host PERILINUX: # Shell to use when invoking shell scripts. SHELL="/bin/sh" # Whether or not to build shared libraries. build_libtool_libs=yes # Whether or not to build static libraries. build_old_libs=no # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=no # Whether or not to optimize for fast installation. fast_install=needless # The host system. host_alias= host=i386-pc-interix # An echo program that does not interpret backslashes. echo="print -r" # The archiver. AR="ar" AR_FLAGS="cru" # The default C compiler. CC="gcc" # Is the compiler the GNU C compiler? with_gcc=yes # The linker used to build libraries. LD="/opt/gcc.3.3/i586-pc-interix3/bin/ld" # Whether we need hard or soft links. LN_S="ln -s" # A BSD-compatible nm program. NM="/bin/nm -B" # A symbol stripping program STRIP=strip # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=file # Used on cygwin: DLL creation program. DLLTOOL="dlltool" # Used on cygwin: object dumper. OBJDUMP="objdump" # Used on cygwin: assembler. AS="as" # The name of the directory that contains temporary libtool files. objdir=.libs # How to create reloadable object files. reload_flag=" -r" reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" # How to pass a linker flag through the compiler. wl="-Wl," # Object file suffix (normally "o"). objext="o" # Old archive suffix (normally "a"). libext="a" # Executable file suffix (normally ""). exeext="" # Additional compiler flags for building library objects. pic_flag=" " #pic_flag=" -fPIC" pic_mode=default # Does compiler simultaneously support -c and -o options? compiler_c_o="yes" # Can we write directly to a .lo ? compiler_o_lo="yes" # Must we lock files when doing compilation ? need_locks="no" # Do we need the lib prefix for modules? need_lib_prefix=no # Do we need a version for libraries? need_version=no # Whether dlopen is supported. dlopen_support=unknown # Whether dlopen of programs is supported. dlopen_self=unknown # Whether dlopen of statically linked programs is supported. dlopen_self_static=unknown # Compiler flag to prevent dynamic linking. link_static_flag="-static" # Compiler flag to turn off builtin functions. no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions" # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec="\${wl}--export-dynamic" # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" # Compiler flag to generate thread-safe objects. thread_safe_flag_spec="" # Library versioning type. version_type=linux # Format of library name prefix. libname_spec="lib\$name" # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so" # The coded name of the library, if different from the real name. soname_spec="\${libname}\${release}.so\$major" # Commands used to build and install an old-style archive. RANLIB="ranlib" old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib" old_postuninstall_cmds="" # Create an old-style archive from a shared archive. old_archive_from_new_cmds="" # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds="" # Commands used to build and install a shared archive. archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}--soname \$wl\$soname -o \$lib" archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}--soname \$wl\$soname -o \$lib" postinstall_cmds="chmod +x \$lib" postuninstall_cmds="" # Commands to strip libraries. old_striplib="strip --strip-debug" striplib="strip --strip-unneeded" # Method to check whether dependent libraries are shared objects. deplibs_check_method="pass_all" # Command to use when deplibs_check_method == file_magic. file_magic_cmd="" # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag="" # Flag that forces no undefined symbols. no_undefined_flag="" # Commands used to finish a libtool library installation in a directory. finish_cmds="" # Same as above, but a single script fragment to be evaled but not shown. finish_eval="" # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" # Transform the output of nm in a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'" # Transform the output of nm in a C name address pair global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" # This is the shared library runtime path variable. runpath_var=LD_RUN_PATH # This is the shared library path variable. shlibpath_var=LD_LIBRARY_PATH # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=yes # How to hardcode a shared library path into an executable. hardcode_action=immediate # Whether we should hardcode library paths into libraries. hardcode_into_libs=yes # Flag to hardcode $libdir into a binary during linking. # This must work even if $libdir does not exist. hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator="" # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=no # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=no # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=unsupported # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=unknown # Compile-time system search path for libraries sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" # Run-time system search path for libraries sys_lib_dlsearch_path_spec="/lib /usr/lib" # Fix the shell variable $srcfile for the compiler. fix_srcfile_path="" # Set to yes if exported symbols are required. always_export_symbols=no # The commands to list exported symbols. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols" # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds="" # Symbols that should not be listed in the preloaded symbols. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Symbols that must always be exported. include_expsyms="" # ### END LIBTOOL CONFIG # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. while test $# -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 ;; --config) sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 ;; --debug) echo "$progname: enabling shell trace mode" set -x ;; --dry-run | -n) run=: ;; --features) echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit 0 ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --quiet | --silent) show=: ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit 1 ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then case $nonopt in *cc | *++ | gcc* | *-gcc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit 1 fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= prev= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do case $prev in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac # Accept any command-line options. case $arg in -o) if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi user_target=next ;; -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) prev=xcompiler continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac case $user_target in next) # The next one is the -o target name user_target=yes continue ;; yes) # We got the output file user_target=set libobj="$arg" continue ;; esac # Accept the current argument as the source file. lastarg="$srcfile" srcfile="$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $lastarg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi done case $user_target in set) ;; no) # Get the name of the library object. libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSfmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 ;; esac if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit 1 fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $libobj" else removelist="$libobj" fi $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$0" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi if test "$build_old_libs" = yes; then lo_libobj="$libobj" dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$libobj"; then dir="$objdir" else dir="$dir/$objdir" fi libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` if test -d "$dir"; then $show "$rm $libobj" $run $rm $libobj else $show "$mkdir $dir" $run $mkdir $dir status=$? if test $status -ne 0 && test ! -d $dir; then exit $status fi fi fi if test "$compiler_o_lo" = yes; then output_obj="$libobj" command="$command -o $output_obj" elif test "$compiler_c_o" = yes; then output_obj="$obj" command="$command -o $output_obj" fi $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else test -n "$output_obj" && $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj"; then $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist exit $error fi fi # If we have no pic_flag, then copy the object into place and finish. if (test -z "$pic_flag" || test "$pic_mode" != default) && test "$build_old_libs" = yes; then # Rename the .lo from within objdir to obj if test -f $obj; then $show $rm $obj $run $rm $obj fi $show "$mv $libobj $obj" if $run $mv $libobj $obj; then : else error=$? $run $rm $removelist exit $error fi xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 else error=$? $run $rm $removelist exit $error fi fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" output_obj="$obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else $run $rm $removelist exit 1 fi if test "$need_locks" = warn && test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 fi # Just move the object if needed if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test "$build_libtool_libs" != yes; then $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? else # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj; then : else error=$? $run $rm $removelist exit $error fi fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi exit 0 ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= sys_deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test $# -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit 1 fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n $prev prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" sys_deplibs="$sys_deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" sys_deplibs="$sys_deplibs $arg" continue ;; -module) module=yes continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -o) prev=output ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.lo | *.$objext) # A library or standard object. if test "$prev" = dlfiles; then # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $arg" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= else case $arg in *.lo) libobjs="$libobjs $arg" ;; *) objs="$objs $arg" ;; esac fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac libs="$libs $deplib" done deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test $linkmode = prog; then # Determine which files to process case $pass in dlopen) libs="$dlfiles" save_deplibs="$deplibs" # Collect dlpreopened libraries deplibs= ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi for deplib in $libs; do lib= found=no case $deplib in -l*) if test $linkmode = oldlib && test $linkmode = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi if test $pass = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test $pass = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test $pass = conv; then deplibs="$deplib $deplibs" continue fi if test $pass = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test $pass = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test $pass = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then echo echo "*** Warning: This library needs some functionality provided by $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." else echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test $pass != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test $found = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test $linkmode = oldlib && test $linkmode = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test $pass = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done elif test $linkmode != prog && test $linkmode != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test $pass = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test $pass = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test $linkmode = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" fi continue fi if test $linkmode = prog && test $pass != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # Link against this shared library if test "$linkmode,$pass" = "prog,link" || { test $linkmode = lib && test $hardcode_into_libs = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac if test $linkmode = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi fi fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`echo $soroot | sed -e 's/^.*\///'` newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n $old_archive_from_expsyms_cmds if test $linkmode = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit 1 fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test $linkmode = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test $linkmode = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" add="-l$name" fi if test $linkmode = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test $linkmode = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi # Try to link the static library # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This library needs some functionality provided by $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** Therefore, libtool will create a static module, that should work " echo "*** as long as the dlopening application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test $linkmode = lib; then if test -n "$dependency_libs" && { test $hardcode_into_libs != yes || test $build_old_libs = yes || test $link_static = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done if test $link_all_deplibs != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="-L$absdir" fi ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test $pass = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test $pass != dlopen; then test $pass != scan && dependency_libs="$newdependency_libs" if test $pass != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi if test "$pass" = "conv" && { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then libs="$deplibs" # reset libs deplibs= fi done # for pass if test $linkmode = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit 1 fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit 1 fi current="$2" revision="$3" age="$4" # Check that each of the things are valid numbers. case $current in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $revision in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac case $age in 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 ;; esac if test $age -gt $current; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix) major=`expr $current - $age + 1` verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= verstring="0.0" case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring="" ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd*) # Do not include libc due to us having libc/libc_r. ;; *) # Add libc to deplibs on all other systems if necessary. if test $build_libtool_need_lc = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | sed 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do if eval echo \"$potent_lib\" 2>/dev/null \ | sed 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done if test -n "$a_deplib" ; then droppeddeps=yes echo echo "*** Warning: This library needs some functionality provided by $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null; then echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test $allow_undefined = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test $hardcode_into_libs = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs; do xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` if test ! -f $xdir/$oldobj; then $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? fi done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols eval cmds=\"$export_symbols_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? # # Do this on AIX to avoid the name clashes # Nick Gorham # case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) $show "(cd \$xdir && for loobj in *; do nm=\`basename \$loobj .lo\`; mv \$nm.lo \$nm.o; done )" $run eval "(cd \$xdir && for loobj in *; do nm=\`basename \$loobj .lo\`; mv \$nm.lo \$nm.o; done )" || exit $? esac libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else eval cmds=\"$archive_cmds\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" for xlib in $convenience; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" else # Just create a symlink. $show $rm $libobj $run $rm $libobj xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$libobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit 0 ;; prog) case $host in *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$output.exp" $run $rm $export_symbols $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`echo "$arg" | sed -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="cd `pwd`; $relink_command" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo"; then case $0 in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; *) qecho="$SHELL `pwd`/$0 --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe ;; *) exeext= ;; esac $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output fi exit 0 ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "mkdir $gentop" $run mkdir "$gentop" status=$? if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" # Add in members from convenience archives. for xlib in $addlibs; do # Extract the objects. case $xlib in [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; *) xabs=`pwd`"/$xlib" ;; esac xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` xdir="$gentop/$xlib" $show "${rm}r $xdir" $run ${rm}r "$xdir" $show "mkdir $xdir" $run mkdir "$xdir" status=$? if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs; do if test ! -f $oldobj; then xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$oldobj"; then xdir="." else xdir="$xdir" fi baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done eval cmds=\"$old_archive_cmds\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit 0 ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit 1 fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit 1 fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 continue fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" eval cmds=\"$postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit 0 ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`echo $destfile | sed -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $0 --finish$current_libdirs' else exit 0 fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. eval cmds=\"$finish_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = ":" && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do echo " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit 1 fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit 1 fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit 1 fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved enviroment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd='"$cmd"$args' else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit 0 fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit 1 fi rmdirs= for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$objdir" else objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test $mode = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test $mode = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. if test $mode = clean && (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit 1 fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit 1 ;; esac echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: unixODBC-2.3.9/Interix/config.guess0000755000175000017500000011355012262474476014046 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-04' # This file 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner . # Please send patches to . # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # Netbsd (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; mac68k) machine=m68k-apple ;; macppc) machine=powerpc-apple ;; hp3[0-9][05]) machine=m68k-hp ;; ibmrt|romp-ibm) machine=romp-ibm ;; *) machine=${UNAME_MACHINE}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; arc64:OpenBSD:*:*) echo mips64el-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hkmips:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mips-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; sparc*:NetBSD:*) echo `uname -p`-unknown-netbsd${UNAME_RELEASE} exit 0 ;; atari*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; sun3*:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) case "${HPUX_REV}" in 11.[0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; esac ;; esac fi ;; esac if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; hppa*:OpenBSD:*:*) echo hppa-unknown-openbsd exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x*:Interix*:*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in big) echo mips-unknown-linux-gnu && exit 0 ;; little) echo mipsel-unknown-linux-gnu && exit 0 ;; esac ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. ld_supported_targets=`cd /; ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build cat >$dummy.c < #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-pc-linux-gnu\n", argv[1]); # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-pc-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc fi echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: unixODBC-2.3.9/Interix/configure0000755000175000017500000200055412262474476013436 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="DRVConfig/MiniSQL/odbcminiS.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subdirs_all="$ac_subdirs_all libltdl" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE YACC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE CPP LEX LEXLIB LEX_OUTPUT_ROOT LN_S CXX CXXFLAGS ac_ct_CXX CXXDEPMODE EGREP subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os ECHO RANLIB ac_ct_RANLIB LIBTOOL INCLTDL LIBLTDL SHLIBEXT LIBICONV ICONV_CHAR_ENCODING ICONV_UNICODE_ENCODING LIBADD_CRYPT LIBADD_POW READLINE HAVE_FLEX_TRUE HAVE_FLEX_FALSE LFLAGS LIBADD_DL PTH_CPPFLAGS PTH_CFLAGS PTH_LDFLAGS PTH_LIBS LIBSOCKET LIBNSL USER_INCLUDES USER_LDFLAGS LIBZ LIBPNG qt_libraries qt_includes QT_INCLUDES QT_LDFLAGS MOC LIB_QT X_INCLUDES X_LDFLAGS x_libraries x_includes LIB_X11 msql_libraries msql_headers MSQL_TRUE MSQL_FALSE QT_TRUE QT_FALSE DRIVERS_TRUE DRIVERS_FALSE FDB_TRUE FDB_FALSE QNX_TRUE QNX_FALSE WITHLT_TRUE WITHLT_FALSE ALLOCA LIB_VERSION LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-static=PKGS build static libraries default=no --enable-shared=PKGS build shared libraries default=yes --enable-gui build GUI Parts default=yes --enable-threads build with thread support default=yes --enable-gnuthreads build with gnu threads support default=no --enable-readline build with readline support default=yes --enable-drivers build included drivers default=yes --enable-fdb build file-based data access default=no --enable-fastvalidate use relaxed handle checking in the DM default=no --enable-iconv build with iconv support default=yes --enable-stats build with statistic gathering support default=yes --enable-rtldgroup build with RTLD_GROUP passed to dlopen (when supported) default=yes --enable-ltdllib Use system libltdl.so (if found) default=no --enable-fast-install=PKGS optimize for fast installation default=yes --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-pic try to use only PIC/non-PIC objects default=use both --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib --with-iconv-char-enc=enc Encoding to use as ASCII default=auto-search --with-iconv-ucode-enc=enc Encoding to use as UNICODE default=auto-search --with-pth=ARG Build with GNU Pth Library (default=yes) --with-pth-test Perform GNU Pth Sanity Test (default=yes) --with-qt-dir=DIR where the root of Qt is installed --with-qt-includes=DIR where the Qt includes are. --with-qt-libraries=DIR where the Qt library is installed. --with-qt-bin=DIR where the Qt binaries are installed. --with-extra-includes=DIR adds non standard include paths --with-extra-libs=DIR adds non standard library paths --with-extra-xlibs= adds non standard library for X --with-msql-lib=DIR where the root of MiniSQL libs are installed --with-msql-include=DIR where the MiniSQL headers are installed Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.6" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=unixODBC VERSION=2.2.12 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then echo "$as_me:$LINENO: result: $YACC" >&5 echo "${ECHO_T}$YACC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then echo "$as_me:$LINENO: result: $LEX" >&5 echo "${ECHO_T}$LEX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fl_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fl_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ll $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char yywrap (); int main () { yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_l_yywrap=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_l_yywrap=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi fi fi if test "x$LEX" != "x:"; then echo "$as_me:$LINENO: checking lex output file root" >&5 echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. cat >conftest.l <<_ACEOF %% %% _ACEOF { (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 (eval $LEX conftest.l) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" cat >conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 _ACEOF fi fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$ac_save_ifs" ;; esac else enable_static=no fi; # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$ac_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-gui or --disable-gui was given. if test "${enable_gui+set}" = set; then enableval="$enable_gui" case "${enableval}" in yes) gui=true ;; no) gui=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-gui" >&5 echo "$as_me: error: bad value ${enableval} for --enable-gui" >&2;} { (exit 1); exit 1; }; } ;; esac else gui=true fi; if test "x$gui" = "xtrue"; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CXX_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type else if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi fi # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" case "${enableval}" in yes) thread=true ;; no) thread=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-thread" >&5 echo "$as_me: error: bad value ${enableval} for --enable-thread" >&2;} { (exit 1); exit 1; }; } ;; esac else thread=true fi; # Check whether --enable-gnuthreads or --disable-gnuthreads was given. if test "${enable_gnuthreads+set}" = set; then enableval="$enable_gnuthreads" case "${enableval}" in yes) gnuthread=true ;; no) gnuthread=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-gnuthread" >&5 echo "$as_me: error: bad value ${enableval} for --enable-gnuthread" >&2;} { (exit 1); exit 1; }; } ;; esac else gnuthread=false fi; # Check whether --enable-readline or --disable-readline was given. if test "${enable_readline+set}" = set; then enableval="$enable_readline" case "${enableval}" in yes) readline=true ;; no) readline=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-readline" >&5 echo "$as_me: error: bad value ${enableval} for --enable-readline" >&2;} { (exit 1); exit 1; }; } ;; esac else readline=true fi; # Check whether --enable-drivers or --disable-drivers was given. if test "${enable_drivers+set}" = set; then enableval="$enable_drivers" case "${enableval}" in yes) drivers=true ;; no) drivers=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-drivers" >&5 echo "$as_me: error: bad value ${enableval} for --enable-drivers" >&2;} { (exit 1); exit 1; }; } ;; esac else drivers=true fi; # Check whether --enable-fdb or --disable-fdb was given. if test "${enable_fdb+set}" = set; then enableval="$enable_fdb" case "${enableval}" in yes) fdb=true ;; no) fdb=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-fdb" >&5 echo "$as_me: error: bad value ${enableval} for --enable-fdb" >&2;} { (exit 1); exit 1; }; } ;; esac else fdb=false fi; # Check whether --enable-fastvalidate or --disable-fastvalidate was given. if test "${enable_fastvalidate+set}" = set; then enableval="$enable_fastvalidate" case "${enableval}" in yes) fastvalidate=true ;; no) fastvalidate=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-fastvalidate" >&5 echo "$as_me: error: bad value ${enableval} for --enable-fastvalidate" >&2;} { (exit 1); exit 1; }; } ;; esac else fastvalidate=false fi; # Check whether --enable-iconv or --disable-iconv was given. if test "${enable_iconv+set}" = set; then enableval="$enable_iconv" case "${enableval}" in yes) iconv=true ;; no) iconv=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-iconv" >&5 echo "$as_me: error: bad value ${enableval} for --enable-iconv" >&2;} { (exit 1); exit 1; }; } ;; esac else iconv=true fi; echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/sem.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF semh=true else semh=false fi done # Check whether --enable-stats or --disable-stats was given. if test "${enable_stats+set}" = set; then enableval="$enable_stats" case "${enableval}" in yes) if test "x$semh" = "xfalse"; then { { echo "$as_me:$LINENO: error: stats enabled but required header was not found" >&5 echo "$as_me: error: stats enabled but required header was not found" >&2;} { (exit 1); exit 1; }; } fi stats=true ;; no) stats=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-stats" >&5 echo "$as_me: error: bad value ${enableval} for --enable-stats" >&2;} { (exit 1); exit 1; }; } ;; esac else stats=$semh fi; # Check whether --enable-rtldgroup or --disable-rtldgroup was given. if test "${enable_rtldgroup+set}" = set; then enableval="$enable_rtldgroup" case "${enableval}" in yes) rtldgroup=true ;; no) rtldgroup=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-rltdgroup" >&5 echo "$as_me: error: bad value ${enableval} for --enable-rltdgroup" >&2;} { (exit 1); exit 1; }; } ;; esac else rtldgroup=true fi; # Check whether --enable-ltdllib or --disable-ltdllib was given. if test "${enable_ltdllib+set}" = set; then enableval="$enable_ltdllib" case "${enableval}" in yes) ltdllib=true ;; no) ltdllib=false ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-ltdllib" >&5 echo "$as_me: error: bad value ${enableval} for --enable-ltdllib" >&2;} { (exit 1); exit 1; }; } ;; esac else ltdllib=false fi; INCLTDL="" LIBLTDL="" echo "$as_me:$LINENO: checking Have we enabled using RTLD_GROUP " >&5 echo $ECHO_N "checking Have we enabled using RTLD_GROUP ... $ECHO_C" >&6 if test "x$rtldgroup" = "xtrue"; then echo "$as_me:$LINENO: result: yes " >&5 echo "${ECHO_T}yes " >&6 case $enable_ltdl_convenience in no) { { echo "$as_me:$LINENO: error: this package needs a convenience libltdl" >&5 echo "$as_me: error: this package needs a convenience libltdl" >&2;} { (exit 1); exit 1; }; } ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/''libltdl'/libltdlc.la INCLTDL='-I${top_srcdir}/''libltdl' else echo "$as_me:$LINENO: result: no " >&5 echo "${ECHO_T}no " >&6; case $enable_ltdl_convenience in no) { { echo "$as_me:$LINENO: error: this package needs a convenience libltdl" >&5 echo "$as_me: error: this package needs a convenience libltdl" >&2;} { (exit 1); exit 1; }; } ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience --enable-rtdlgroup=no" ;; esac LIBLTDL='${top_builddir}/''libltdl'/libltdlc.la INCLTDL='-I${top_srcdir}/''libltdl' fi subdirs="$subdirs libltdl" # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," for pkg in $enableval; do if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$ac_save_ifs" ;; esac else enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi fi echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi NM="$lt_cv_path_NM" echo "$as_me:$LINENO: result: $NM" >&5 echo "${ECHO_T}$NM" >&6 echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[012]) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; interix*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv5uw[78]* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output" >&5 echo $ECHO_N "checking command to parse $NM output... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris* | sysv5*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= global_symbol_to_c_name_address= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" fi if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in *-*-irix6*) # Find out which ABI we are using. echo '#line 5861 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case $host_os in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$as_me:$LINENO: result: $objdir" >&5 echo "${ECHO_T}$objdir" >&6 # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "${lt_cv_prog_cc_pic+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) lt_cv_prog_cc_wl='-Wl,' # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi fi if test -z "$lt_cv_prog_cc_pic"; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic" >&5 echo "${ECHO_T}$lt_cv_prog_cc_pic" >&6 # Check to make sure the pic_flag actually works. echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_cv_prog_cc_pic works... $ECHO_C" >&6 if test "${lt_cv_prog_cc_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then case $host_os in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then # they create non-PIC objects. So, if there were any warnings, we # assume that PIC is not supported. if test -s conftest.err; then lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_prog_cc_pic_works=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" fi if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi echo "$as_me:$LINENO: result: $lt_cv_prog_cc_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_cc_pic_works" >&6 fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi echo "$as_me:$LINENO: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_cv_prog_cc_static works... $ECHO_C" >&6 if test "${lt_cv_prog_cc_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_prog_cc_static_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= echo "$as_me:$LINENO: result: $lt_cv_prog_cc_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_cc_static_works" >&6 pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no if { (eval echo configure:6423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null fi compiler_c_o=$lt_cv_compiler_c_o echo "$as_me:$LINENO: result: $compiler_c_o" >&5 echo "${ECHO_T}$compiler_c_o" >&6 if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo "$as_me:$LINENO: checking if $compiler supports -c -o file.lo" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.lo... $ECHO_C" >&6 if test "${lt_cv_compiler_o_lo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" save_objext="$ac_objext" ac_objext=lo cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int some_variable = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_objext="$save_objext" CFLAGS="$save_CFLAGS" fi compiler_o_lo=$lt_cv_compiler_o_lo echo "$as_me:$LINENO: result: $compiler_o_lo" >&5 echo "${ECHO_T}$compiler_o_lo" >&6 else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int some_variable = 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" echo "$as_me:$LINENO: result: $compiler_rtti_exceptions" >&5 echo "${ECHO_T}$compiler_rtti_exceptions" >&6 if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. echo "$as_me:$LINENO: checking whether the linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the linker ($LD) supports shared libraries... $ECHO_C" >&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* interix' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; interix*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}--soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}--soname $wl$soname -o $lib' ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw* | pw32*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. hardcode_direct=yes archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then shared_flag='${wl}-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf '-exported_symbol ' >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes export_dynamic_flag_spec='${wl}-Bexport' ;; solaris*) # gcc --version < 3.0 without binutils cannot create self contained # shared libraries reliably, requiring libgcc.a to resolve some of # the object symbols generated in some cases. Libraries that use # assert need libgcc.a to resolve __eprintf, for example. Linking # a copy of libgcc.a into every shared library to guarantee resolving # such symbols causes other problems: According to Tim Van Holder # , C++ libraries end up with a separate # (to the application) exception stack for one thing. no_undefined_flag=' -z defs' if test "$GCC" = yes; then case `$CC --version 2>/dev/null` in [12].*) cat <&2 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably *** create self contained shared libraries on Solaris systems, without *** introducing a dependency on libgcc.a. Therefore, libtool is disabling *** -no-undefined support, which will at least allow you to build shared *** libraries. However, you may find that when you link such libraries *** into an application without using GCC, you have to manually add *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to *** upgrade to a newer version of GCC. Another option is to rebuild your *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. EOF no_undefined_flag= ;; esac fi # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now # Dont do the -M $lib.exp, it fails on unixware archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4* | aix5*) version_type=linux if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can # not hardcode correct soname into executable. Probably we can # add versioning support to collect2, so additional links can # be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' case $host_os in irix5*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case "$host_os" in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*|interix*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi if test "$enable_shared" = yes && test "$GCC" = yes; then case $host_os in sco3.2v5*) # On SCO 5, an explicit -lc is not wanted when making shared # libraries. It's unnecessary, and giving it makes strange things # happen, like profiler mcount calls segfaulting and ctype.h # macros not working (if used in a library but not the mainline). # FIXME: Maybe the below code could detect -lc is unnecessary, but # SCO $archive_cmds uses $LD, so it's not reached. lt_cv_archive_cmds_need_lc=no ;; esac case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 if test "${lt_cv_archive_cmds_need_lc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi fi echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6 ;; esac else case $host_os in sco3.2v5*) # On SCO 5, an explicit -lc is not wanted when making shared # libraries. It's unnecessary, and giving it makes strange things # happen, like profiler mcount calls segfaulting and ctype.h # macros not working (if used in a library but not the mainline). # FIXME: Maybe the below code could detect -lc is unnecessary, but # SCO $archive_cmds uses $LD, so it's not reached. lt_cv_archive_cmds_need_lc=no ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib file_magic_cmd export_symbols_cmds \ deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ global_symbol_to_c_name_address \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case $var in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996-2000 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$need_lc # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # This is a source program that is used to create dlls on Windows # Don't remove nor modify the starting and closing comments # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ # This is a source program that is used to create import libraries # on Windows for dlls which lack them. Don't remove nor modify the # starting and closing comments # /* impgen.c starts here */ # /* Copyright (C) 1999-2000 Free Software Foundation, Inc. # # This file is part of GNU libtool. # # 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 /* for printf() */ # #include /* for open(), lseek(), read() */ # #include /* for O_RDONLY, O_BINARY */ # #include /* for strdup() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # static unsigned int # pe_get16 (fd, offset) # int fd; # int offset; # { # unsigned char b[2]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 2); # return b[0] + (b[1]<<8); # } # # static unsigned int # pe_get32 (fd, offset) # int fd; # int offset; # { # unsigned char b[4]; # lseek (fd, offset, SEEK_SET); # read (fd, b, 4); # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # static unsigned int # pe_as32 (ptr) # void *ptr; # { # unsigned char *b = ptr; # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); # } # # int # main (argc, argv) # int argc; # char *argv[]; # { # int dll; # unsigned long pe_header_offset, opthdr_ofs, num_entries, i; # unsigned long export_rva, export_size, nsections, secptr, expptr; # unsigned long name_rvas, nexp; # unsigned char *expdata, *erva; # char *filename, *dll_name; # # filename = argv[1]; # # dll = open(filename, O_RDONLY|O_BINARY); # if (dll < 1) # return 1; # # dll_name = filename; # # for (i=0; filename[i]; i++) # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') # dll_name = filename + i +1; # # pe_header_offset = pe_get32 (dll, 0x3c); # opthdr_ofs = pe_header_offset + 4 + 20; # num_entries = pe_get32 (dll, opthdr_ofs + 92); # # if (num_entries < 1) /* no exports */ # return 1; # # export_rva = pe_get32 (dll, opthdr_ofs + 96); # export_size = pe_get32 (dll, opthdr_ofs + 100); # nsections = pe_get16 (dll, pe_header_offset + 4 +2); # secptr = (pe_header_offset + 4 + 20 + # pe_get16 (dll, pe_header_offset + 4 + 16)); # # expptr = 0; # for (i = 0; i < nsections; i++) # { # char sname[8]; # unsigned long secptr1 = secptr + 40 * i; # unsigned long vaddr = pe_get32 (dll, secptr1 + 12); # unsigned long vsize = pe_get32 (dll, secptr1 + 16); # unsigned long fptr = pe_get32 (dll, secptr1 + 20); # lseek(dll, secptr1, SEEK_SET); # read(dll, sname, 8); # if (vaddr <= export_rva && vaddr+vsize > export_rva) # { # expptr = fptr + (export_rva - vaddr); # if (export_rva + export_size > vaddr + vsize) # export_size = vsize - (export_rva - vaddr); # break; # } # } # # expdata = (unsigned char*)malloc(export_size); # lseek (dll, expptr, SEEK_SET); # read (dll, expdata, export_size); # erva = expdata - export_rva; # # nexp = pe_as32 (expdata+24); # name_rvas = pe_as32 (expdata+32); # # printf ("EXPORTS\n"); # for (i = 0; i> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion use_builtin_libtool="no" if test "x$ltdllib" = "xtrue"; then echo "$as_me:$LINENO: checking for lt_dlopen in -lltdl" >&5 echo $ECHO_N "checking for lt_dlopen in -lltdl... $ECHO_C" >&6 if test "${ac_cv_lib_ltdl_lt_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char lt_dlopen (); int main () { lt_dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ltdl_lt_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ltdl_lt_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ltdl_lt_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_ltdl_lt_dlopen" >&6 if test $ac_cv_lib_ltdl_lt_dlopen = yes; then LIBLTDL="-lltdl" else use_builtin_libtool="yes" fi if test "x$use_builtin_libtool" = "xno"; then for ac_header in ltdl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else use_builtin_libtool="yes" fi done fi else use_builtin_libtool="yes" fi echo "$as_me:$LINENO: checking if we are using the included libltdl " >&5 echo $ECHO_N "checking if we are using the included libltdl ... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $use_builtin_libtool " >&5 echo "${ECHO_T}$use_builtin_libtool " >&6 echo "$as_me:$LINENO: checking which extension is used for shared libraries" >&5 echo $ECHO_N "checking which extension is used for shared libraries... $ECHO_C" >&6 if test "${libltdl_cv_shlibext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_last= for ac_spec in $library_names_spec; do ac_last="$ac_spec" done echo "$ac_last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest libltdl_cv_shlibext=`cat conftest` rm -f conftest fi echo "$as_me:$LINENO: result: $libltdl_cv_shlibext" >&5 echo "${ECHO_T}$libltdl_cv_shlibext" >&6 if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LTDL_SHLIB_EXT "$libltdl_cv_shlibext" _ACEOF fi SHLIBEXT="$libltdl_cv_shlibext" if test "x$iconv" = "xtrue"; then # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval="$with_libiconv_prefix" for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done fi; echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6 if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6 if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- }$am_cv_proto_iconv" >&6 cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi LIBICONV= if test "$am_cv_lib_iconv" = yes; then LIBICONV="-liconv" fi iconv_char_enc="auto-search" # Check whether --with-iconv_char_enc or --without-iconv_char_enc was given. if test "${with_iconv_char_enc+set}" = set; then withval="$with_iconv_char_enc" iconv_char_enc="$withval" fi; ICONV_CHAR_ENCODING="$iconv_char_enc" iconv_ucode_enc="auto-search" # Check whether --with-iconv_ucode_enc or --without-iconv_ucode_enc was given. if test "${with_iconv_ucode_enc+set}" = set; then withval="$with_iconv_ucode_enc" iconv_ucode_enc="$withval" fi; ICONV_CHAR_ENCODING="" ICONV_UNICODE_ENCODING="" if test "$am_cv_func_iconv" = yes; then echo "$as_me:$LINENO: checking for encoding to use for CHAR representations " >&5 echo $ECHO_N "checking for encoding to use for CHAR representations ... $ECHO_C" >&6; ICONV_CHAR_ENCODING="$iconv_char_enc" echo "$as_me:$LINENO: result: $iconv_char_enc " >&5 echo "${ECHO_T}$iconv_char_enc " >&6; echo "$as_me:$LINENO: checking for encoding to use for UNICODE representations " >&5 echo $ECHO_N "checking for encoding to use for UNICODE representations ... $ECHO_C" >&6; ICONV_UNICODE_ENCODING="$iconv_ucode_enc" echo "$as_me:$LINENO: result: $iconv_ucode_enc " >&5 echo "${ECHO_T}$iconv_ucode_enc " >&6; fi fi echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6 if test "${ac_cv_lib_crypt_crypt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char crypt (); int main () { crypt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_crypt_crypt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypt_crypt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 if test $ac_cv_lib_crypt_crypt = yes; then LIBADD_CRYPT="-lcrypt"; cat >>confdefs.h <<\_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF fi echo "$as_me:$LINENO: checking for pow in -lm" >&5 echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_pow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pow (); int main () { pow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_pow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_pow=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 echo "${ECHO_T}$ac_cv_lib_m_pow" >&6 if test $ac_cv_lib_m_pow = yes; then LIBADD_POW="-lm" fi have_readline="no" if test "x$readline" = "xtrue"; then echo "$as_me:$LINENO: checking for readline in -lreadline " >&5 echo $ECHO_N "checking for readline in -lreadline ... $ECHO_C" >&6 ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline(); int main () { readline() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_$ac_lib_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 READLINE=-lreadline have_readline="yes" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 echo "$as_me:$LINENO: checking for readline in -lreadline -lcurses " >&5 echo $ECHO_N "checking for readline in -lreadline -lcurses ... $ECHO_C" >&6 ac_save_LIBS="$LIBS" LIBS="-lreadline -lcurses $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline(); int main () { readline() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_$ac_lib_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 READLINE="-lreadline -lcurses" have_readline="yes" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "x$have_readline" = "xyes"; then for ac_header in readline/history.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_READLINE 1 _ACEOF fi done fi fi if test "x$drivers" = "xtrue"; then echo "$as_me:$LINENO: checking Are we using flex " >&5 echo $ECHO_N "checking Are we using flex ... $ECHO_C" >&6 if test "x$LEX" = "xflex"; then LFLAGS="$LFLAGS -i" echo "$as_me:$LINENO: result: yes " >&5 echo "${ECHO_T}yes " >&6; else echo "$as_me:$LINENO: result: no - text driver disabled " >&5 echo "${ECHO_T}no - text driver disabled " >&6; fi if test "x$LEX" = "xflex" ; then HAVE_FLEX_TRUE= HAVE_FLEX_FALSE='#' else HAVE_FLEX_TRUE='#' HAVE_FLEX_FALSE= fi else if test "xabc" = "xdef" ; then HAVE_FLEX_TRUE= HAVE_FLEX_FALSE='#' else HAVE_FLEX_TRUE='#' HAVE_FLEX_FALSE= fi fi case $host_os in *qnx* ) qnx="true" cat >>confdefs.h <<\_ACEOF #define QNX_LIBLTDL 1 _ACEOF ;; esac echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi for ac_header in sys/time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6 if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((long *) 0) return 0; if (sizeof (long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6 echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (long))) < 0) { long i = longval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_long=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF echo "$as_me:$LINENO: checking if platform is 64 bit" >&5 echo $ECHO_N "checking if platform is 64 bit... $ECHO_C" >&6 if test "$ac_cv_sizeof_long" = "8"; then echo "$as_me:$LINENO: result: Yes " >&5 echo "${ECHO_T}Yes " >&6; cat >>confdefs.h <<\_ACEOF #define PLATFORM64 1 _ACEOF else echo "$as_me:$LINENO: result: No " >&5 echo "${ECHO_T}No " >&6; fi echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6 if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { long long x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6 if eval "test \"`echo $ac_cv_type_long_long`\" = yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_LONG 1 _ACEOF fi for ac_func in strcasecmp strncasecmp vsnprintf strtol atoll strtoll endpwent do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBADD_DL= THREADLIB="" if test "x$thread" = "xtrue"; then if test "x$gnuthread" = "xtrue"; then PTH_CPPFLAGS='' PTH_CFLAGS='' PTH_LDFLAGS='' PTH_LIBS='' echo "$as_me:$LINENO: checking for GNU Pth" >&5 echo $ECHO_N "checking for GNU Pth... $ECHO_C" >&6 if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T} " >&6 fi # Check whether --with-pth or --without-pth was given. if test "${with_pth+set}" = set; then withval="$with_pth" else with_pth="yes" fi; # Check whether --with-pth-test or --without-pth-test was given. if test "${with_pth_test+set}" = set; then withval="$with_pth_test" else with_pth_test="yes" fi; if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: + Command Line Options:" >&5 echo "${ECHO_T} + Command Line Options:" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o --with-pth=$with_pth" >&5 echo "${ECHO_T} o --with-pth=$with_pth" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o --with-pth-test=$with_pth_test" >&5 echo "${ECHO_T} o --with-pth-test=$with_pth_test" >&6 fi if test ".$with_pth" != .no; then _pth_subdir=no _pth_subdir_opts='' case "$with_pth" in subdir:* ) _pth_subdir=yes _pth_subdir_opts=`echo $with_pth | sed -e 's/^subdir:[^ ]*[ ]*//'` with_pth=`echo $with_pth | sed -e 's/^subdir:\([^ ]*\).*$/\1/'` ;; esac _pth_version="" _pth_location="" _pth_type="" _pth_cppflags="" _pth_cflags="" _pth_ldflags="" _pth_libs="" if test ".$with_pth" = .yes; then # via config script in $PATH _pth_version=`(pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` if test ".$_pth_version" != .; then _pth_location=`pth-config --prefix` _pth_type='installed' _pth_cppflags=`pth-config --cflags` _pth_cflags=`pth-config --cflags` _pth_ldflags=`pth-config --ldflags` _pth_libs=`pth-config --libs` fi elif test -d "$with_pth"; then with_pth=`echo $with_pth | sed -e 's;/*$;;'` _pth_found=no # via locally included source tree if test ".$_pth_subdir" = .yes; then _pth_location="$with_pth" _pth_type='local' _pth_cppflags="-I$with_pth" _pth_cflags="-I$with_pth" if test -f "$with_pth/ltconfig"; then _pth_ldflags="-L$with_pth/.libs" else _pth_ldflags="-L$with_pth" fi _pth_libs="-lpth" _pth_version=`grep '^const char PTH_Hello' $with_pth/pth_vers.c |\ sed -e 's;^.*Version[ ]*\([0-9]*\.[0-9]*[.ab][0-9]*\)[ ].*$;\1;'` _pth_found=yes ac_configure_args="$ac_configure_args --enable-subdir $_pth_subdir_opts" with_pth_test=no fi # via config script under a specified directory # (a standard installation, but not a source tree) if test ".$_pth_found" = .no; then for _dir in $with_pth/bin $with_pth; do if test -f "$_dir/pth-config"; then test -f "$_dir/pth-config.in" && continue # pth-config in source tree! _pth_version=`($_dir/pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` if test ".$_pth_version" != .; then _pth_location=`$_dir/pth-config --prefix` _pth_type="installed" _pth_cppflags=`$_dir/pth-config --cflags` _pth_cflags=`$_dir/pth-config --cflags` _pth_ldflags=`$_dir/pth-config --ldflags` _pth_libs=`$_dir/pth-config --libs` _pth_found=yes break fi fi done fi # in any subarea under a specified directory # (either a special installation or a Pth source tree) if test ".$_pth_found" = .no; then _pth_found=0 for _file in x `find $with_pth -name "pth.h" -type f -print`; do test .$_file = .x && continue _dir=`echo $_file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` _pth_version=`($_dir/pth-config --version) 2>/dev/null |\ sed -e 's/^.*\([0-9]\.[0-9]*[ab.][0-9]*\).*$/\1/'` if test ".$_pth_version" = .; then _pth_version=`grep '^#define PTH_VERSION_STR' $_file |\ sed -e 's;^#define[ ]*PTH_VERSION_STR[ ]*"\([0-9]*\.[0-9]*[.ab][0-9]*\)[ ].*$;\1;'` fi _pth_cppflags="-I$_dir" _pth_cflags="-I$_dir" _pth_found=`expr $_pth_found + 1` done for _file in x `find $with_pth -name "libpth.[aso]" -type f -print`; do test .$_file = .x && continue _dir=`echo $_file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'` _pth_ldflags="-L$_dir" _pth_libs="-lpth" _pth_found=`expr $_pth_found + 1` done if test ".$_pth_found" = .2; then _pth_location="$with_pth" _pth_type="uninstalled" else _pth_version='' fi fi fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: + Determined Location:" >&5 echo "${ECHO_T} + Determined Location:" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o path: $_pth_location" >&5 echo "${ECHO_T} o path: $_pth_location" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o type: $_pth_type" >&5 echo "${ECHO_T} o type: $_pth_type" >&6 fi if test ".$_pth_version" = .; then if test ".$with_pth" != .yes; then echo "$as_me:$LINENO: result: *FAILED*" >&5 echo "${ECHO_T}*FAILED*" >&6 echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Unable to locate GNU Pth under $with_pth. Please specify the correct path to either a GNU Pth installation tree (use --with-pth=DIR if you used --prefix=DIR for installing GNU Pth in the past) or to a GNU Pth source tree (use --with-pth=DIR if DIR is a path to a pth-X.Y.Z/ directory; but make sure the package is already built, i.e., the "configure; make" step was already performed there). EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 else echo "$as_me:$LINENO: result: *FAILED*" >&5 echo "${ECHO_T}*FAILED*" >&6 echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Unable to locate GNU Pth in any system-wide location (see \$PATH). Please specify the correct path to either a GNU Pth installation tree (use --with-pth=DIR if you used --prefix=DIR for installing GNU Pth in the past) or to a GNU Pth source tree (use --with-pth=DIR if DIR is a path to a pth-X.Y.Z/ directory; but make sure the package is already built, i.e., the "configure; make" step was already performed there). EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi fi _req_version="1.3.0 " for _var in _pth_version _req_version; do eval "_val=\"\$${_var}\"" _major=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\1/'` _minor=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\2/'` _rtype=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\3/'` _micro=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\4/'` case $_rtype in "a" ) _rtype=0 ;; "b" ) _rtype=1 ;; "." ) _rtype=2 ;; esac _hex=`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, rtype, micro); }' \ "major=$_major" "minor=$_minor" "rtype=$_rtype" "micro=$_micro"` eval "${_var}_hex=\"\$_hex\"" done if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: + Determined Versions:" >&5 echo "${ECHO_T} + Determined Versions:" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o existing: $_pth_version -> 0x$_pth_version_hex" >&5 echo "${ECHO_T} o existing: $_pth_version -> 0x$_pth_version_hex" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o required: $_req_version -> 0x$_req_version_hex" >&5 echo "${ECHO_T} o required: $_req_version -> 0x$_req_version_hex" >&6 fi _ok=0 if test ".$_pth_version_hex" != .; then if test ".$_req_version_hex" != .; then if test $_pth_version_hex -ge $_req_version_hex; then _ok=1 fi fi fi if test ".$_ok" = .0; then echo "$as_me:$LINENO: result: *FAILED*" >&5 echo "${ECHO_T}*FAILED*" >&6 echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found Pth version $_pth_version, but required at least version $_req_version. Upgrade Pth under $_pth_location to $_req_version or higher first, please. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi if test ".$with_pth_test" = .yes; then _ac_save_CPPFLAGS="$CPPFLAGS" _ac_save_CFLAGS="$CFLAGS" _ac_save_LDFLAGS="$LDFLAGS" _ac_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $_pth_cppflags" CFLAGS="$CFLAGS $_pth_cflags" LDFLAGS="$LDFLAGS $_pth_ldflags" LIBS="$LIBS $_pth_libs" if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: + Test Build Environment:" >&5 echo "${ECHO_T} + Test Build Environment:" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o CPPFLAGS=\"$CPPFLAGS\"" >&5 echo "${ECHO_T} o CPPFLAGS=\"$CPPFLAGS\"" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o CFLAGS=\"$CFLAGS\"" >&5 echo "${ECHO_T} o CFLAGS=\"$CFLAGS\"" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o LDFLAGS=\"$LDFLAGS\"" >&5 echo "${ECHO_T} o LDFLAGS=\"$LDFLAGS\"" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o LIBS=\"$LIBS\"" >&5 echo "${ECHO_T} o LIBS=\"$LIBS\"" >&6 fi cross_compile=no if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: + Performing Sanity Checks:" >&5 echo "${ECHO_T} + Performing Sanity Checks:" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o pre-processor test" >&5 echo "${ECHO_T} o pre-processor test" >&6 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then _ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 _ok=no fi rm -f conftest.err conftest.$ac_ext if test ".$_ok" != .yes; then echo "$as_me:$LINENO: result: *FAILED*" >&5 echo "${ECHO_T}*FAILED*" >&6 echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity pre-processor check. This means the GNU Pth header pth.h was not found. We used the following build environment: >> CPP="$CPP" >> CPPFLAGS="$CPPFLAGS" See config.log for possibly more details. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o link check" >&5 echo "${ECHO_T} o link check" >&6 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { int main(int argc, char *argv) { FILE *fp; if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "hmm"); fclose(fp); pth_init(); pth_kill(); if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "yes"); fclose(fp); exit(0); } ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then _ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 _ok=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test ".$_ok" != .yes; then echo "$as_me:$LINENO: result: *FAILED*" >&5 echo "${ECHO_T}*FAILED*" >&6 echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity linker check. This means the GNU Pth library libpth.a was not found. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o run-time check" >&5 echo "${ECHO_T} o run-time check" >&6 fi if test "$cross_compiling" = yes; then _ok=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main(int argc, char *argv) { FILE *fp; if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "hmm"); fclose(fp); pth_init(); pth_kill(); if (!(fp = fopen("conftestval", "w"))) exit(1); fprintf(fp, "yes"); fclose(fp); exit(0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then _ok=`cat conftestval` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) _ok=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test ".$_ok" != .yes; then if test ".$_ok" = .no; then echo "$as_me:$LINENO: result: *FAILED*" >&5 echo "${ECHO_T}*FAILED*" >&6 echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity execution check. This usually means that the GNU Pth shared library libpth.so is present but \$LD_LIBRARY_PATH is incomplete to execute a Pth test. In this case either disable this test via --without-pth-test, or extend \$LD_LIBRARY_PATH, or build GNU Pth as a static library only via its --disable-shared Autoconf option. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 else echo "$as_me:$LINENO: result: *FAILED*" >&5 echo "${ECHO_T}*FAILED*" >&6 echo " +------------------------------------------------------------------------+" 1>&2 cat <>/ /' 1>&2 Found GNU Pth $_pth_version under $_pth_location, but was unable to perform a sanity run-time check. This usually means that the GNU Pth library failed to work and possibly caused a core dump in the test program. In this case it is strongly recommended that you re-install GNU Pth and this time make sure that it really passes its "make test" procedure. We used the following build environment: >> CC="$CC" >> CFLAGS="$CFLAGS" >> LDFLAGS="$LDFLAGS" >> LIBS="$LIBS" See config.log for possibly more details. EOT echo " +------------------------------------------------------------------------+" 1>&2 exit 1 fi fi _extendvars="yes" if test ".$_extendvars" != .yes; then CPPFLAGS="$_ac_save_CPPFLAGS" CFLAGS="$_ac_save_CFLAGS" LDFLAGS="$_ac_save_LDFLAGS" LIBS="$_ac_save_LIBS" fi else _extendvars="yes" if test ".$_extendvars" = .yes; then if test ".$_pth_subdir" = .yes; then CPPFLAGS="$CPPFLAGS $_pth_cppflags" CFLAGS="$CFLAGS $_pth_cflags" LDFLAGS="$LDFLAGS $_pth_ldflags" LIBS="$LIBS $_pth_libs" fi fi fi PTH_CPPFLAGS="$_pth_cppflags" PTH_CFLAGS="$_pth_cflags" PTH_LDFLAGS="$_pth_ldflags" PTH_LIBS="$_pth_libs" if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: + Final Results:" >&5 echo "${ECHO_T} + Final Results:" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"" >&5 echo "${ECHO_T} o PTH_CPPFLAGS=\"$PTH_CPPFLAGS\"" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o PTH_CFLAGS=\"$PTH_CFLAGS\"" >&5 echo "${ECHO_T} o PTH_CFLAGS=\"$PTH_CFLAGS\"" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o PTH_LDFLAGS=\"$PTH_LDFLAGS\"" >&5 echo "${ECHO_T} o PTH_LDFLAGS=\"$PTH_LDFLAGS\"" >&6 fi if test ".$verbose" = .yes; then echo "$as_me:$LINENO: result: o PTH_LIBS=\"$PTH_LIBS\"" >&5 echo "${ECHO_T} o PTH_LIBS=\"$PTH_LIBS\"" >&6 fi fi if test ".$with_pth" != .no; then echo "$as_me:$LINENO: result: version $_pth_version, $_pth_type under $_pth_location" >&5 echo "${ECHO_T}version $_pth_version, $_pth_type under $_pth_location" >&6 : else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 : fi CPPFLAGS="$CPPFLAGS $PTH_CPPFLAGS" CFLAGS="$CFLAGS $PTH_CFLAGS" LDFLAGS="$LDFLAGS $PTH_LDFLAGS" THREADLIB="$PTH_LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPTH 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF else gotthread="no"; echo "$as_me:$LINENO: checking for mutex_lock in -lthread " >&5 echo $ECHO_N "checking for mutex_lock in -lthread ... $ECHO_C" >&6 ac_save_LIBS="$LIBS" LIBS="-lthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mutex_lock(); int main () { mutex_lock() ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_$ac_lib_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_LIBTHREAD 1 _ACEOF echo "$as_me:$LINENO: checking if compiler accepts -mt" >&5 echo $ECHO_N "checking if compiler accepts -mt... $ECHO_C" >&6 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -mt -c conftest.c 2>&1`"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 CFLAGS="$CFLAGS -mt" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF gotthread="yes"; THREADLIB="-lthread" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$gotthread" = "xno"; then echo "$as_me:$LINENO: checking for pthread_mutex_lock in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_lock in -lpthread... $ECHO_C" >&6 ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif #include int main () { pthread_mutex_lock(0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_$ac_lib_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF gotthread="yes"; THREADLIB="-lpthread" if test "x$ac_cv_c_compiler_gnu"="xyes"; then echo "$as_me:$LINENO: checking if compiler accepts -pthread" >&5 echo $ECHO_N "checking if compiler accepts -pthread... $ECHO_C" >&6 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 CFLAGS="$CFLAGS -pthread" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* else echo "$as_me:$LINENO: checking if compiler accepts -mt" >&5 echo $ECHO_N "checking if compiler accepts -mt... $ECHO_C" >&6 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -mt -c conftest.c 2>&1`"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 CFLAGS="$CFLAGS -mt" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* fi else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "x$gotthread" = "xno"; then echo "$as_me:$LINENO: checking for pthread_mutex_lock in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_lock in -lc... $ECHO_C" >&6 ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif #include int main () { pthread_mutex_lock(0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_$ac_lib_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF gotthread="yes"; THREADLIB="" if test "x$ac_cv_c_compiler_gnu"="xyes"; then echo "$as_me:$LINENO: checking if compiler accepts -pthread" >&5 echo $ECHO_N "checking if compiler accepts -pthread... $ECHO_C" >&6 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 CFLAGS="$CFLAGS -pthread" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* else echo "$as_me:$LINENO: checking if compiler accepts -mt" >&5 echo $ECHO_N "checking if compiler accepts -mt... $ECHO_C" >&6 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -mt -c conftest.c 2>&1`"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 CFLAGS="$CFLAGS -mt" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* fi else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "x$gotthread" = "xno"; then if test "x$ac_cv_c_compiler_gnu"="xyes"; then echo "$as_me:$LINENO: checking if compiler accepts -pthread" >&5 echo $ECHO_N "checking if compiler accepts -pthread... $ECHO_C" >&6 echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 CFLAGS="$CFLAGS -pthread" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* echo "$as_me:$LINENO: checking for pthread_mutex_lock in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_lock in -lc... $ECHO_C" >&6 ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif #include int main () { pthread_mutex_lock(0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_$ac_lib_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF THREADLIB="-pthread -lc_r" gotthread="yes"; else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi fi if test "x$gotthread" = "xno"; then SAVECFLAGS="$CFLAGS" CFLAGS="$CFLAGS -D_THREAD_SAFE -D_ALL_SOURCE -D_LONG_LONG" echo "$as_me:$LINENO: checking for pthread_mutex_lock in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_lock in -lpthread... $ECHO_C" >&6 ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __cplusplus extern "C" #endif #include int main () { pthread_mutex_lock(0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_$ac_lib_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_save_LIBS" if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF gotthread="yes"; THREADLIB="-lpthread" else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CFLAGS="$SAVECFLAGS" cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _LONG_LONG 1 _ACEOF fi if test "x$gotthread" = "xyes"; then save_LIBS=$LIBS echo "$as_me:$LINENO: checking for localtime_r in -lc" >&5 echo $ECHO_N "checking for localtime_r in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_localtime_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char localtime_r (); int main () { localtime_r (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_localtime_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_localtime_r=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_localtime_r" >&5 echo "${ECHO_T}$ac_cv_lib_c_localtime_r" >&6 if test $ac_cv_lib_c_localtime_r = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LOCALTIME_R 1 _ACEOF fi LIBS=$save_LIBS fi fi fi case $host_os in "darwin"*) stats="false" macosx="yes" cat >>confdefs.h <<\_ACEOF #define OSXHEADER 1 _ACEOF ;; sysv5Open*) if test "x$THREADLIB" = "x"; then LIBS="$LIBS $THREADLIB" else LIBS="$LIBS -Kthread" fi ;; *) LIBS="$LIBS $THREADLIB" ;; esac if test "x$stats" = "xtrue"; then for ac_func in ftok semget shmget semop snprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else stats=false fi done fi if test "x$stats" = "xtrue"; then ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for semundo union" >&5 echo $ECHO_N "checking for semundo union... $ECHO_C" >&6 if test "${ac_cv_semundo_union+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { union semun semctl_arg; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_semundo_union=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_semundo_union=yes fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_semundo_union" >&5 echo "${ECHO_T}$ac_cv_semundo_union" >&6 if eval "test \"`echo $ac_cv_semundo_union`\" = yes"; then cat >>confdefs.h <<\_ACEOF #define NEED_SEMUNDO_UNION 1 _ACEOF fi cat >>confdefs.h <<\_ACEOF #define COLLECT_STATS 1 _ACEOF fi echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket (); int main () { socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 if test $ac_cv_lib_socket_socket = yes; then LIBSOCKET="-lsocket" fi echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then LIBNSL="-lnsl" fi ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO qt_libraries="" qt_includes="" # Check whether --with-qt-dir or --without-qt-dir was given. if test "${with_qt_dir+set}" = set; then withval="$with_qt_dir" ac_qt_includes="$withval"/include ac_qt_libraries="$withval"/lib ac_qt_bindir="$withval"/bin fi; # Check whether --with-qt-includes or --without-qt-includes was given. if test "${with_qt_includes+set}" = set; then withval="$with_qt_includes" ac_qt_includes="$withval" fi; kde_qt_libs_given=no # Check whether --with-qt-libraries or --without-qt-libraries was given. if test "${with_qt_libraries+set}" = set; then withval="$with_qt_libraries" ac_qt_libraries="$withval" kde_qt_libs_given=yes fi; # Check whether --with-qt-bin or --without-qt-bin was given. if test "${with_qt_bin+set}" = set; then withval="$with_qt_bin" ac_qt_bindir="$withval" fi; if test "x$macosx" = "xyes"; then if test "x$gui" = "xtrue"; then echo "$as_me:$LINENO: checking for extra includes" >&5 echo $ECHO_N "checking for extra includes... $ECHO_C" >&6 # Check whether --with-extra-includes or --without-extra-includes was given. if test "${with_extra_includes+set}" = set; then withval="$with_extra_includes" kde_use_extra_includes="$withval" else kde_use_extra_includes=NONE fi; kde_extra_includes= if test -n "$kde_use_extra_includes" && \ test "$kde_use_extra_includes" != "NONE"; then ac_save_ifs=$IFS IFS=':' for dir in $kde_use_extra_includes; do kde_extra_includes="$kde_extra_includes $dir" all_includes="$all_includes -I$dir" USER_INCLUDES="$USER_INCLUDES -I$dir" done IFS=$ac_save_ifs kde_use_extra_includes="added" else kde_use_extra_includes="no" fi echo "$as_me:$LINENO: result: $kde_use_extra_includes" >&5 echo "${ECHO_T}$kde_use_extra_includes" >&6 kde_extra_libs= echo "$as_me:$LINENO: checking for extra libs" >&5 echo $ECHO_N "checking for extra libs... $ECHO_C" >&6 # Check whether --with-extra-libs or --without-extra-libs was given. if test "${with_extra_libs+set}" = set; then withval="$with_extra_libs" kde_use_extra_libs=$withval else kde_use_extra_libs=NONE fi; if test -n "$kde_use_extra_libs" && \ test "$kde_use_extra_libs" != "NONE"; then ac_save_ifs=$IFS IFS=':' for dir in $kde_use_extra_libs; do kde_extra_libs="$kde_extra_libs $dir" all_libraries="$all_libraries -L$dir" KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -rpath $dir" USER_LDFLAGS="$USER_LDFLAGS -L$dir" done IFS=$ac_save_ifs kde_use_extra_libs="added" else kde_use_extra_libs="no" fi echo "$as_me:$LINENO: result: $kde_use_extra_libs" >&5 echo "${ECHO_T}$kde_use_extra_libs" >&6 kde_extra_xlibs= echo "$as_me:$LINENO: checking for extra xlibs" >&5 echo $ECHO_N "checking for extra xlibs... $ECHO_C" >&6 # Check whether --with-extra-xlibs or --without-extra-xlibs was given. if test "${with_extra_xlibs+set}" = set; then withval="$with_extra_xlibs" kde_use_extra_xlibs=$withval else kde_use_extra_xlibs=NONE fi; if test -n "$kde_use_extra_xlibs" && \ test "$kde_use_extra_xlibs" != "NONE"; then EXTRA_XLIBS="$kde_use_extra_xlibs" USER_LDFLAGS="$USER_LDFLAGS $EXTRA_XLIBS" kde_use_extra_xlibs="added" else kde_use_extra_xlibs="no" fi echo "$as_me:$LINENO: result: $kde_use_extra_xlibs" >&5 echo "${ECHO_T}$kde_use_extra_xlibs" >&6 echo "$as_me:$LINENO: checking for libz" >&5 echo $ECHO_N "checking for libz... $ECHO_C" >&6 if test "${ac_cv_lib_z+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu kde_save_LIBS="$LIBS" LIBS="$all_libraries -lz $LIBSOCKET" kde_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $all_includes" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return (zlibVersion() == ZLIB_VERSION); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_z='-lz'" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_z=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$kde_save_LIBS" CFLAGS="$kde_save_CFLAGS" fi if eval "test ! \"`echo $ac_cv_lib_z`\" = no"; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBZ="$ac_cv_lib_z" echo "$as_me:$LINENO: result: $ac_cv_lib_z" >&5 echo "${ECHO_T}$ac_cv_lib_z" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 LIBZ="" fi echo "$as_me:$LINENO: checking for libpng" >&5 echo $ECHO_N "checking for libpng... $ECHO_C" >&6 if test "${ac_cv_lib_png+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else kde_save_LIBS="$LIBS" LIBS="$LIBS $all_libraries -lpng $LIBZ -lm -lX11 $LIBSOCKET" kde_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $all_includes" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { png_structp png_ptr = png_create_read_struct( /* image ptr */ PNG_LIBPNG_VER_STRING, 0, 0, 0 ); return( png_ptr != 0 ); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "ac_cv_lib_png='-lpng $LIBZ -lm'" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "ac_cv_lib_png=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$kde_save_LIBS" CFLAGS="$kde_save_CFLAGS" fi if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPNG 1 _ACEOF LIBPNG="$ac_cv_lib_png" echo "$as_me:$LINENO: result: $ac_cv_lib_png" >&5 echo "${ECHO_T}$ac_cv_lib_png" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 LIBPNG="" fi if test -z ""; then kde_qtver=2 else kde_qtver= fi if test -z ""; then if test $kde_qtver = 2; then kde_qt_minversion=">= 2.2" else kde_qt_minversion=">= 1.42 and < 2.0" fi else kde_qt_minversion= fi if test -z ""; then if test $kde_qtver = 2; then kde_qt_verstring="QT_VERSION >= 220" else kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" fi else kde_qt_verstring= fi LIBQT="-lqt" if test kde_qtver = 2; then LIBQT="$LIBQT $LIBPNG" fi echo "$as_me:$LINENO: checking for Qt" >&5 echo $ECHO_N "checking for Qt... $ECHO_C" >&6 LIBQT="$LIBQT $LIBSOCKET" if test "${ac_cv_have_qt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else #try to guess Qt locations qt_incdirs="$QTINC /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/include/qt3" test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs" qt_incdirs="$ac_qt_includes $qt_incdirs" qt_incdir=NO for i in $qt_incdirs; do for j in qmovie.h; do if test -r "$i/$j"; then qt_incdir=$i break 2 fi done done ac_qt_includes="$qt_incdir" qt_libdirs="$QTLIB /usr/lib/qt/lib /usr/lib /usr/local/qt/lib /usr/lib/qt" test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs" if test ! "$ac_qt_libraries" = "NO"; then qt_libdirs="$ac_qt_libraries $qt_libdirs" fi test=NONE qt_libdir=NONE for dir in $qt_libdirs; do try="ls -1 $dir/libqt*" if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; break; else echo "tried $dir" >&5 ; fi done ac_qt_libraries="$qt_libdir" ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_cxxflags_safe="$CXXFLAGS" ac_ldflags_safe="$LDFLAGS" ac_libs_safe="$LIBS" CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" LDFLAGS="-L$qt_libdir $all_libraries" LIBS="$LIBS $LIBQT" cat > conftest.$ac_ext < #include #include #include EOF if test $kde_qtver = 2; then cat >> conftest.$ac_ext < EOF fi echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest; then rm -f conftest* else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_qt_libraries="NO" fi rm -f conftest* CXXFLAGS="$ac_cxxflags_safe" LDFLAGS="$ac_ldflags_safe" LIBS="$ac_libs_safe" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then ac_cv_have_qt="have_qt=no" ac_qt_notfound="" if test "$ac_qt_includes" = NO; then if test "$ac_qt_libraries" = NO; then ac_qt_notfound="(headers and libraries)"; else ac_qt_notfound="(headers)"; fi else ac_qt_notfound="(libraries)"; fi have_qt="no" else have_qt="yes" fi fi eval "$ac_cv_have_qt" if test "$have_qt" != yes; then echo "$as_me:$LINENO: result: $have_qt" >&5 echo "${ECHO_T}$have_qt" >&6; LIBQT="-lqt-mt" if test kde_qtver = 2; then LIBQT="$LIBQT $LIBPNG" fi echo "$as_me:$LINENO: checking for Qt-Mt" >&5 echo $ECHO_N "checking for Qt-Mt... $ECHO_C" >&6 LIBQT="$LIBQT $LIBSOCKET" if test "${ac_cv_have_qt_mt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else #try to guess Qt locations qt_incdirs="$QTINC /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/include/qt3" test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs" qt_incdirs="$ac_qt_includes $qt_incdirs" qt_incdir=NO for i in $qt_incdirs; do for j in qmovie.h; do if test -r "$i/$j"; then qt_incdir=$i break 2 fi done done ac_qt_includes="$qt_incdir" qt_libdirs="$QTLIB /usr/lib/qt/lib /usr/lib /usr/local/qt/lib /usr/lib/qt" test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs" if test ! "$ac_qt_libraries" = "NO"; then qt_libdirs="$ac_qt_libraries $qt_libdirs" fi test=NONE qt_libdir=NONE for dir in $qt_libdirs; do try="ls -1 $dir/libqt*" if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; break; else echo "tried $dir" >&5 ; fi done ac_qt_libraries="$qt_libdir" ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_cxxflags_safe="$CXXFLAGS" ac_ldflags_safe="$LDFLAGS" ac_libs_safe="$LIBS" CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" LDFLAGS="-L$qt_libdir $all_libraries" LIBS="$LIBS $LIBQT" cat > conftest.$ac_ext < #include #include #include EOF if test $kde_qtver = 2; then cat >> conftest.$ac_ext < EOF fi echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest; then rm -f conftest* else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_qt_libraries="NO" fi rm -f conftest* CXXFLAGS="$ac_cxxflags_safe" LDFLAGS="$ac_ldflags_safe" LIBS="$ac_libs_safe" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then ac_cv_have_qt_mt="have_qt=no" ac_qt_notfound="" if test "$ac_qt_includes" = NO; then if test "$ac_qt_libraries" = NO; then ac_qt_notfound="(headers and libraries)"; else ac_qt_notfound="(headers)"; fi else ac_qt_notfound="(libraries)"; fi have_qt="no" else have_qt="yes" fi fi if test "$have_qt" != yes; then echo "$as_me:$LINENO: result: $have_qt" >&5 echo "${ECHO_T}$have_qt" >&6; fi fi if test "$have_qt" = yes; then ac_cv_have_qt="have_qt=yes \ ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" echo "$as_me:$LINENO: result: libraries $ac_qt_libraries, headers $ac_qt_includes" >&5 echo "${ECHO_T}libraries $ac_qt_libraries, headers $ac_qt_includes" >&6 qt_libraries="$ac_qt_libraries" qt_includes="$ac_qt_includes" fi if test ! "$kde_qt_libs_given" = "yes"; then echo "$as_me:$LINENO: checking if Qt compiles without flags" >&5 echo $ECHO_N "checking if Qt compiles without flags... $ECHO_C" >&6 if test "${kde_cv_qt_direct+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH ac_LIBRARY_PATH="$LIBRARY_PATH" ac_cxxflags_safe="$CXXFLAGS" ac_ldflags_safe="$LDFLAGS" ac_libs_safe="$LIBS" CXXFLAGS="$CXXFLAGS -I$qt_includes" LDFLAGS="$X_LDFLAGS" LIBS="$LIBQTEXACT -lXext -lX11 $LIBSOCKET" LD_LIBRARY_PATH= export LD_LIBRARY_PATH LIBRARY_PATH= export LIBRARY_PATH cat > conftest.$ac_ext < #include #include #include EOF if test $kde_qtver = 2; then cat >> conftest.$ac_ext < EOF fi echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest; then kde_cv_qt_direct="yes" else kde_cv_qt_direct="no" echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* CXXFLAGS="$ac_cxxflags_safe" LDFLAGS="$ac_ldflags_safe" LIBS="$ac_libs_safe" LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" export LD_LIBRARY_PATH LIBRARY_PATH="$ac_LIBRARY_PATH" export LIBRARY_PATH ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi if test "$kde_cv_qt_direct" = "yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 qt_libraries= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then QT_INCLUDES=""; else QT_INCLUDES="-I$qt_includes" all_includes="$QT_INCLUDES $all_includes" fi if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then QT_LDFLAGS="" else QT_LDFLAGS="-L$qt_libraries" all_libraries="$QT_LDFLAGS $all_libraries" fi echo "$as_me:$LINENO: checking for moc" >&5 echo $ECHO_N "checking for moc... $ECHO_C" >&6 if test "${kde_cv_path_moc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else kde_cv_path_moc="NONE" if test -n "$MOC"; then kde_cv_path_moc="$MOC"; else dirs="$ac_qt_bindir $QTDIR/bin $QTDIR/src/moc \ /usr/bin /usr/X11R6/bin /usr/lib/qt/bin \ /usr/local/qt/bin" kde_save_IFS=$IFS IFS=':' for dir in $PATH; do dirs="$dirs $dir" done IFS=$kde_save_IFS for dir in $dirs; do if test -x "$dir/moc"; then if test -n "" then evalstr="$dir/moc 2>&1 " if eval $evalstr; then kde_cv_path_moc="$dir/moc" break fi else kde_cv_path_moc="$dir/moc" break fi fi done fi fi if test -z "$kde_cv_path_moc" || test "$kde_cv_path_moc" = "NONE"; then echo "$as_me:$LINENO: result: not found" >&5 echo "${ECHO_T}not found" >&6 else echo "$as_me:$LINENO: result: $kde_cv_path_moc" >&5 echo "${ECHO_T}$kde_cv_path_moc" >&6 MOC=$kde_cv_path_moc fi if test -z "$MOC"; then if test -n "$ac_cv_path_moc"; then output=`eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt"` fi echo "configure:13399: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&5 echo "configure:13400: moc output: $output" >&5 # if test -z "$output"; then # KDE_MOC_ERROR_MESSAGE # fi if test -z "$output"; then have_qt="no"; fi fi LIB_QT="$LIBQT" else have_qt="no"; fi else if test "x$gui" = "xtrue"; then echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then kde_x_includes=NO else kde_x_includes=$x_includes fi if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then kde_x_libraries=NO else kde_x_libraries=$x_libraries fi # below we use the standard autoconf calls ac_x_libraries=$kde_x_libraries ac_x_includes=$kde_x_includes rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' _ACEOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XtMalloc (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no if test -z "$ac_x_includes"; then ac_x_includes="." fi if test -z "$ac_x_libraries"; then ac_x_libraries="/usr/lib" fi #from now on we use our own again # when the user already gave --x-includes, we ignore # what the standard autoconf macros told us. if test "$kde_x_includes" = NO; then kde_x_includes=$ac_x_includes fi if test "$kde_x_includes" = NO; then { { echo "$as_me:$LINENO: error: Can't find X includes. Please check your installation and add the correct paths or run configure with --enable-gui=no!" >&5 echo "$as_me: error: Can't find X includes. Please check your installation and add the correct paths or run configure with --enable-gui=no!" >&2;} { (exit 1); exit 1; }; } fi if test "$ac_x_libraries" = NO; then { { echo "$as_me:$LINENO: error: Can't find X libraries. Please check your installation and add the correct paths or run configure with --enable-gui=no!" >&5 echo "$as_me: error: Can't find X libraries. Please check your installation and add the correct paths or run configure with --enable-gui=no!" >&2;} { (exit 1); exit 1; }; } fi # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ kde_x_includes=$kde_x_includes ac_x_libraries=$ac_x_libraries" fi eval "$ac_cv_have_x" if test "$have_x" != yes; then echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else echo "$as_me:$LINENO: result: libraries $ac_x_libraries, headers $kde_x_includes" >&5 echo "${ECHO_T}libraries $ac_x_libraries, headers $kde_x_includes" >&6 fi if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then X_INCLUDES="" x_includes="."; else x_includes=$kde_x_includes X_INCLUDES="-I$x_includes" fi if test -z "$ac_x_libraries" || test "x$ac_x_libraries" = xNONE; then X_LDFLAGS="" x_libraries="/usr/lib"; else x_libraries=$ac_x_libraries X_LDFLAGS="-L$x_libraries" fi all_includes="$all_includes $X_INCLUDES" all_libraries="$all_libraries $X_LDFLAGS" LIB_X11='-lX11 $(LIBSOCKET)' echo "$as_me:$LINENO: checking for libXext" >&5 echo $ECHO_N "checking for libXext... $ECHO_C" >&6 if test "${kde_cv_have_libXext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else kde_ldflags_safe="$LDFLAGS" kde_libs_safe="$LIBS" LDFLAGS="$X_LDFLAGS $USER_LDFLAGS" LIBS="-lXext -lX11 $LIBSOCKET" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { printf("hello Xext\n"); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then kde_cv_have_libXext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 kde_cv_have_libXext=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$kde_ldflags_safe LIBS=$kde_libs_safe fi echo "$as_me:$LINENO: result: $kde_cv_have_libXext" >&5 echo "${ECHO_T}$kde_cv_have_libXext" >&6 if test "kde_cv_have_libXext" = "no"; then { { echo "$as_me:$LINENO: error: We need a working libXext to proceed. Since configure can't find it itself, we stop here assuming that make wouldn't find them either." >&5 echo "$as_me: error: We need a working libXext to proceed. Since configure can't find it itself, we stop here assuming that make wouldn't find them either." >&2;} { (exit 1); exit 1; }; } fi if test -z ""; then kde_qtver=2 else kde_qtver= fi if test -z ""; then if test $kde_qtver = 2; then kde_qt_minversion=">= 2.2" else kde_qt_minversion=">= 1.42 and < 2.0" fi else kde_qt_minversion= fi if test -z ""; then if test $kde_qtver = 2; then kde_qt_verstring="QT_VERSION >= 220" else kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" fi else kde_qt_verstring= fi LIBQT="" LIBQTEXACT="-lqt" if test $kde_qtver = 2; then LIBQT="$LIBQT $LIBPNG" fi echo "$as_me:$LINENO: checking for Qt" >&5 echo $ECHO_N "checking for Qt... $ECHO_C" >&6 LIBQT="$LIBQT $EXTRA_XLIBS -lXext -lX11 $LIBSOCKET" if test "${ac_cv_have_qt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else #try to guess Qt locations qt_incdirs="$QTINC /usr/lib/qt/include /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt $x_includes /usr/include/qt3" test -n "$QTDIR" && qt_incdirs="$QTDIR/include $QTDIR $qt_incdirs" qt_incdirs="$ac_qt_includes $qt_incdirs" qt_incdir=NO for i in $qt_incdirs; do for j in qmovie.h; do if test -r "$i/$j"; then qt_incdir=$i break 2 fi done done ac_qt_includes="$qt_incdir" qt_libdirs="$QTLIB /usr/lib/qt/lib /usr/X11R6/lib /usr/lib /usr/local/qt/lib /usr/lib/qt $x_libraries" test -n "$QTDIR" && qt_libdirs="$QTDIR/lib $QTDIR $qt_libdirs" if test ! "$ac_qt_libraries" = "NO"; then qt_libdirs="$ac_qt_libraries $qt_libdirs" fi test=NONE qt_libdir=NONE for dir in $qt_libdirs; do try="ls -1 $dir/libqt-mt*" if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; LIBQTEXACT="-lqt-mt" break; else try="ls -1 $dir/libqt*" if test=`eval $try 2> /dev/null`; then qt_libdir=$dir; break; else echo "tried $dir" >&5 ; fi echo "tried $dir" >&5 ; fi done LIBQT="$LIBQTEXACT $EXTRA_XLIBS -lXext -lX11 $LIBSOCKET" ac_qt_libraries="$qt_libdir" ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_cxxflags_safe="$CXXFLAGS" ac_ldflags_safe="$LDFLAGS" ac_libs_safe="$LIBS" CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" LDFLAGS="-L$qt_libdir $all_libraries" LIBS="$LIBS $LIBQT" cat > conftest.$ac_ext < #include #include #include EOF if test $kde_qtver = 2; then cat >> conftest.$ac_ext < EOF fi echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest; then rm -f conftest* else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_qt_libraries="NO" fi rm -f conftest* CXXFLAGS="$ac_cxxflags_safe" LDFLAGS="$ac_ldflags_safe" LIBS="$ac_libs_safe" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then ac_cv_have_qt="have_qt=no" ac_qt_notfound="" if test "$ac_qt_includes" = NO; then if test "$ac_qt_libraries" = NO; then ac_qt_notfound="(headers and libraries)"; else ac_qt_notfound="(headers)"; fi else ac_qt_notfound="(libraries)"; fi have_qt="no" else have_qt="yes" fi fi eval "$ac_cv_have_qt" if test "$have_qt" != yes; then echo "$as_me:$LINENO: result: $have_qt" >&5 echo "${ECHO_T}$have_qt" >&6; else ac_cv_have_qt="have_qt=yes \ ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries" echo "$as_me:$LINENO: result: libraries $ac_qt_libraries, headers $ac_qt_includes" >&5 echo "${ECHO_T}libraries $ac_qt_libraries, headers $ac_qt_includes" >&6 qt_libraries="$ac_qt_libraries" qt_includes="$ac_qt_includes" fi if test ! "$kde_qt_libs_given" = "yes"; then echo "$as_me:$LINENO: checking if Qt compiles without flags" >&5 echo $ECHO_N "checking if Qt compiles without flags... $ECHO_C" >&6 if test "${kde_cv_qt_direct+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH ac_LIBRARY_PATH="$LIBRARY_PATH" ac_cxxflags_safe="$CXXFLAGS" ac_ldflags_safe="$LDFLAGS" ac_libs_safe="$LIBS" CXXFLAGS="$CXXFLAGS -I$qt_includes" LDFLAGS="$X_LDFLAGS" LIBS="$LIBQTEXACT -lXext -lX11 $LIBSOCKET" LD_LIBRARY_PATH= export LD_LIBRARY_PATH LIBRARY_PATH= export LIBRARY_PATH cat > conftest.$ac_ext < #include #include #include EOF if test $kde_qtver = 2; then cat >> conftest.$ac_ext < EOF fi echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext cat >> conftest.$ac_ext <> conftest.$ac_ext <> conftest.$ac_ext <&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest; then kde_cv_qt_direct="yes" else kde_cv_qt_direct="no" echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* CXXFLAGS="$ac_cxxflags_safe" LDFLAGS="$ac_ldflags_safe" LIBS="$ac_libs_safe" LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe" export LD_LIBRARY_PATH LIBRARY_PATH="$ac_LIBRARY_PATH" export LIBRARY_PATH ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi if test "$kde_cv_qt_direct" = "yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 qt_libraries= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then QT_INCLUDES=""; else QT_INCLUDES="-I$qt_includes" all_includes="$QT_INCLUDES $all_includes" fi if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then QT_LDFLAGS="" else QT_LDFLAGS="-L$qt_libraries" all_libraries="$QT_LDFLAGS $all_libraries" fi echo "$as_me:$LINENO: checking for moc" >&5 echo $ECHO_N "checking for moc... $ECHO_C" >&6 if test "${kde_cv_path_moc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else kde_cv_path_moc="NONE" if test -n "$MOC"; then kde_cv_path_moc="$MOC"; else dirs="$ac_qt_bindir $QTDIR/bin $QTDIR/src/moc \ /usr/bin /usr/X11R6/bin /usr/lib/qt/bin \ /usr/local/qt/bin" kde_save_IFS=$IFS IFS=':' for dir in $PATH; do dirs="$dirs $dir" done IFS=$kde_save_IFS for dir in $dirs; do if test -x "$dir/moc"; then if test -n "" then evalstr="$dir/moc 2>&1 " if eval $evalstr; then kde_cv_path_moc="$dir/moc" break fi else kde_cv_path_moc="$dir/moc" break fi fi done fi fi if test -z "$kde_cv_path_moc" || test "$kde_cv_path_moc" = "NONE"; then echo "$as_me:$LINENO: result: not found" >&5 echo "${ECHO_T}not found" >&6 else echo "$as_me:$LINENO: result: $kde_cv_path_moc" >&5 echo "${ECHO_T}$kde_cv_path_moc" >&6 MOC=$kde_cv_path_moc fi if test -z "$MOC"; then if test -n "$ac_cv_path_moc"; then output=`eval "$ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt"` fi echo "configure:14173: tried to call $ac_cv_path_moc --help 2>&1 | sed -e '1q' | grep Qt" >&5 echo "configure:14174: moc output: $output" >&5 # if test -z "$output"; then # KDE_MOC_ERROR_MESSAGE # fi if test -z "$output"; then have_qt="no"; fi fi LIB_QT='$(LIBPNG) -lXext $(LIB_X11)' LIB_QT="$LIBQTEXACT $LIB_QT" else have_qt="no"; fi fi # Check whether --with-msql-lib or --without-msql-lib was given. if test "${with_msql_lib+set}" = set; then withval="$with_msql_lib" msql_libraries="$withval" fi; # Check whether --with-msql-include or --without-msql-include was given. if test "${with_msql_include+set}" = set; then withval="$with_msql_include" msql_headers="$withval" fi; echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in malloc.h unistd.h pwd.h crypt.h limits.h synch.h strings.h string.h locale.h sys/malloc.h sys/types.h sys/sem.h stdarg.h varargs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done INCLUDES="$INCLUDES $USER_INCLUDES"; for ac_header in msql.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF msql=true else msql=false; for ac_dir in $kde_extra_includes $msql_headers; do for ac_header in $ac_dir/msql.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF msql=true; INCLUDES="$INCLUDES $USER_INCLUDES -I$ac_dir"; fi done done fi done if test "x$msql" = "xtrue" ; then MSQL_TRUE= MSQL_FALSE='#' else MSQL_TRUE='#' MSQL_FALSE= fi if test "x$have_qt" = "xyes" ; then QT_TRUE= QT_FALSE='#' else QT_TRUE='#' QT_FALSE= fi if test "x$drivers" = "xtrue" ; then DRIVERS_TRUE= DRIVERS_FALSE='#' else DRIVERS_TRUE='#' DRIVERS_FALSE= fi if test "x$fdb" = "xtrue" ; then FDB_TRUE= FDB_FALSE='#' else FDB_TRUE='#' FDB_FALSE= fi if test "x$qnx" = "xtrue" ; then QNX_TRUE= QNX_FALSE='#' else QNX_TRUE='#' QNX_FALSE= fi if test "x$use_builtin_libtool" = "xyes" ; then WITHLT_TRUE= WITHLT_FALSE='#' else WITHLT_TRUE='#' WITHLT_FALSE= fi if test "x$fastvalidate" = "xtrue"; then cat >>confdefs.h <<\_ACEOF #define FAST_HANDLE_VALIDATE 1 _ACEOF fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct tm *tp; tp->tm_sec; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _doprnt to an innocuous variant, in case declares _doprnt. For example, HP-UX 11i declares gettimeofday. */ #define _doprnt innocuous__doprnt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _doprnt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else char (*f) () = _doprnt; #endif #ifdef __cplusplus } #endif int main () { return f != _doprnt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in putenv socket strdup strstr setenv setlocale strchr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done cat >>confdefs.h <<\_ACEOF #define UNIXODBC_SOURCE 1 _ACEOF LIB_VERSION="1:0:0" ac_config_files="$ac_config_files Makefile extras/Makefile log/Makefile lst/Makefile sqp/Makefile ini/Makefile odbcinst/Makefile cur/Makefile DriverManager/Makefile odbcinstQ/Makefile exe/Makefile DRVConfig/Makefile DRVConfig/drvcfg1/Makefile DRVConfig/drvcfg2/Makefile DRVConfig/PostgreSQL/Makefile DRVConfig/MiniSQL/Makefile DRVConfig/MySQL/Makefile DRVConfig/nn/Makefile DRVConfig/esoob/Makefile DRVConfig/oplodbc/Makefile DRVConfig/template/Makefile DRVConfig/tds/Makefile DRVConfig/txt/Makefile DRVConfig/Oracle/Makefile DRVConfig/sapdb/Makefile DRVConfig/Mimer/Makefile Drivers/Makefile Drivers/PostgreSQL/Makefile Drivers/Postgre7.1/Makefile Drivers/nn/Makefile Drivers/txt/Makefile Drivers/txt/doc/Makefile Drivers/odbc/Makefile Drivers/template/Makefile Drivers/MiniSQL/Makefile include/Makefile doc/Makefile doc/AdministratorManual/Makefile doc/ProgrammerManual/Makefile doc/ProgrammerManual/Tutorial/Makefile doc/UserManual/Makefile doc/lst/Makefile DataManager/Makefile DataManagerII/Makefile ODBCConfig/Makefile odbctest/Makefile autotest/Makefile samples/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_FLEX_TRUE}" && test -z "${HAVE_FLEX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_FLEX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_FLEX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_FLEX_TRUE}" && test -z "${HAVE_FLEX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_FLEX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_FLEX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${MSQL_TRUE}" && test -z "${MSQL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MSQL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MSQL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${QT_TRUE}" && test -z "${QT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"QT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"QT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${DRIVERS_TRUE}" && test -z "${DRIVERS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"DRIVERS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"DRIVERS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FDB_TRUE}" && test -z "${FDB_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FDB\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FDB\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${QNX_TRUE}" && test -z "${QNX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"QNX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"QNX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITHLT_TRUE}" && test -z "${WITHLT_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITHLT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITHLT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "extras/Makefile" ) CONFIG_FILES="$CONFIG_FILES extras/Makefile" ;; "log/Makefile" ) CONFIG_FILES="$CONFIG_FILES log/Makefile" ;; "lst/Makefile" ) CONFIG_FILES="$CONFIG_FILES lst/Makefile" ;; "sqp/Makefile" ) CONFIG_FILES="$CONFIG_FILES sqp/Makefile" ;; "ini/Makefile" ) CONFIG_FILES="$CONFIG_FILES ini/Makefile" ;; "odbcinst/Makefile" ) CONFIG_FILES="$CONFIG_FILES odbcinst/Makefile" ;; "cur/Makefile" ) CONFIG_FILES="$CONFIG_FILES cur/Makefile" ;; "DriverManager/Makefile" ) CONFIG_FILES="$CONFIG_FILES DriverManager/Makefile" ;; "odbcinstQ/Makefile" ) CONFIG_FILES="$CONFIG_FILES odbcinstQ/Makefile" ;; "exe/Makefile" ) CONFIG_FILES="$CONFIG_FILES exe/Makefile" ;; "DRVConfig/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/Makefile" ;; "DRVConfig/drvcfg1/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/drvcfg1/Makefile" ;; "DRVConfig/drvcfg2/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/drvcfg2/Makefile" ;; "DRVConfig/PostgreSQL/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/PostgreSQL/Makefile" ;; "DRVConfig/MiniSQL/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/MiniSQL/Makefile" ;; "DRVConfig/MySQL/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/MySQL/Makefile" ;; "DRVConfig/nn/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/nn/Makefile" ;; "DRVConfig/esoob/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/esoob/Makefile" ;; "DRVConfig/oplodbc/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/oplodbc/Makefile" ;; "DRVConfig/template/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/template/Makefile" ;; "DRVConfig/tds/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/tds/Makefile" ;; "DRVConfig/txt/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/txt/Makefile" ;; "DRVConfig/Oracle/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/Oracle/Makefile" ;; "DRVConfig/sapdb/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/sapdb/Makefile" ;; "DRVConfig/Mimer/Makefile" ) CONFIG_FILES="$CONFIG_FILES DRVConfig/Mimer/Makefile" ;; "Drivers/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/Makefile" ;; "Drivers/PostgreSQL/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/PostgreSQL/Makefile" ;; "Drivers/Postgre7.1/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/Postgre7.1/Makefile" ;; "Drivers/nn/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/nn/Makefile" ;; "Drivers/txt/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/txt/Makefile" ;; "Drivers/txt/doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/txt/doc/Makefile" ;; "Drivers/odbc/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/odbc/Makefile" ;; "Drivers/template/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/template/Makefile" ;; "Drivers/MiniSQL/Makefile" ) CONFIG_FILES="$CONFIG_FILES Drivers/MiniSQL/Makefile" ;; "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/AdministratorManual/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/AdministratorManual/Makefile" ;; "doc/ProgrammerManual/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/ProgrammerManual/Makefile" ;; "doc/ProgrammerManual/Tutorial/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/ProgrammerManual/Tutorial/Makefile" ;; "doc/UserManual/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/UserManual/Makefile" ;; "doc/lst/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/lst/Makefile" ;; "DataManager/Makefile" ) CONFIG_FILES="$CONFIG_FILES DataManager/Makefile" ;; "DataManagerII/Makefile" ) CONFIG_FILES="$CONFIG_FILES DataManagerII/Makefile" ;; "ODBCConfig/Makefile" ) CONFIG_FILES="$CONFIG_FILES ODBCConfig/Makefile" ;; "odbctest/Makefile" ) CONFIG_FILES="$CONFIG_FILES odbctest/Makefile" ;; "autotest/Makefile" ) CONFIG_FILES="$CONFIG_FILES autotest/Makefile" ;; "samples/Makefile" ) CONFIG_FILES="$CONFIG_FILES samples/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@YACC@,$YACC,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@CPP@,$CPP,;t t s,@LEX@,$LEX,;t t s,@LEXLIB@,$LEXLIB,;t t s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t s,@LN_S@,$LN_S,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@EGREP@,$EGREP,;t t s,@subdirs@,$subdirs,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@ECHO@,$ECHO,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@INCLTDL@,$INCLTDL,;t t s,@LIBLTDL@,$LIBLTDL,;t t s,@SHLIBEXT@,$SHLIBEXT,;t t s,@LIBICONV@,$LIBICONV,;t t s,@ICONV_CHAR_ENCODING@,$ICONV_CHAR_ENCODING,;t t s,@ICONV_UNICODE_ENCODING@,$ICONV_UNICODE_ENCODING,;t t s,@LIBADD_CRYPT@,$LIBADD_CRYPT,;t t s,@LIBADD_POW@,$LIBADD_POW,;t t s,@READLINE@,$READLINE,;t t s,@HAVE_FLEX_TRUE@,$HAVE_FLEX_TRUE,;t t s,@HAVE_FLEX_FALSE@,$HAVE_FLEX_FALSE,;t t s,@LFLAGS@,$LFLAGS,;t t s,@LIBADD_DL@,$LIBADD_DL,;t t s,@PTH_CPPFLAGS@,$PTH_CPPFLAGS,;t t s,@PTH_CFLAGS@,$PTH_CFLAGS,;t t s,@PTH_LDFLAGS@,$PTH_LDFLAGS,;t t s,@PTH_LIBS@,$PTH_LIBS,;t t s,@LIBSOCKET@,$LIBSOCKET,;t t s,@LIBNSL@,$LIBNSL,;t t s,@USER_INCLUDES@,$USER_INCLUDES,;t t s,@USER_LDFLAGS@,$USER_LDFLAGS,;t t s,@LIBZ@,$LIBZ,;t t s,@LIBPNG@,$LIBPNG,;t t s,@qt_libraries@,$qt_libraries,;t t s,@qt_includes@,$qt_includes,;t t s,@QT_INCLUDES@,$QT_INCLUDES,;t t s,@QT_LDFLAGS@,$QT_LDFLAGS,;t t s,@MOC@,$MOC,;t t s,@LIB_QT@,$LIB_QT,;t t s,@X_INCLUDES@,$X_INCLUDES,;t t s,@X_LDFLAGS@,$X_LDFLAGS,;t t s,@x_libraries@,$x_libraries,;t t s,@x_includes@,$x_includes,;t t s,@LIB_X11@,$LIB_X11,;t t s,@msql_libraries@,$msql_libraries,;t t s,@msql_headers@,$msql_headers,;t t s,@MSQL_TRUE@,$MSQL_TRUE,;t t s,@MSQL_FALSE@,$MSQL_FALSE,;t t s,@QT_TRUE@,$QT_TRUE,;t t s,@QT_FALSE@,$QT_FALSE,;t t s,@DRIVERS_TRUE@,$DRIVERS_TRUE,;t t s,@DRIVERS_FALSE@,$DRIVERS_FALSE,;t t s,@FDB_TRUE@,$FDB_TRUE,;t t s,@FDB_FALSE@,$FDB_FALSE,;t t s,@QNX_TRUE@,$QNX_TRUE,;t t s,@QNX_FALSE@,$QNX_FALSE,;t t s,@WITHLT_TRUE@,$WITHLT_TRUE,;t t s,@WITHLT_FALSE@,$WITHLT_FALSE,;t t s,@ALLOCA@,$ALLOCA,;t t s,@LIB_VERSION@,$LIB_VERSION,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file and --srcdir arguments so they do not pile up. ac_sub_configure_args= ac_prev= for ac_arg in $ac_configure_args; do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | --c=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d $srcdir/$ac_dir || continue { echo "$as_me:$LINENO: configuring in $ac_dir" >&5 echo "$as_me: configuring in $ac_dir" >&6;} { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'" elif test -f $ac_srcdir/configure; then ac_sub_configure="$SHELL '$ac_srcdir/configure'" elif test -f $ac_srcdir/configure.in; then ac_sub_configure=$ac_configure else { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative path. ac_sub_cache_file=$ac_top_builddir$cache_file ;; esac { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval $ac_sub_configure $ac_sub_configure_args \ --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir || { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} { (exit 1); exit 1; }; } fi cd $ac_popdir done fi unixODBC-2.3.9/ChangeLog0000644000175000017500000022347513725127141011653 0000000000000006-Sep-2020 2.3.9 # Remove "#define UNIXODBC_SOURCE" from unixodbc_conf.h 30-Aug-2020 2.3.8 * Add configure support for editline * SQLDriversW was ignoring user config * SQLDataSources Fix termination character * Fix for pooling seg fault * Make calling SQLSetStmtAttrW call the W function in the driver if its there * Try and fix race condition clearing system odbc.ini file * Remove trailing space from isql/iusql SQL * When setting connection attributes set before connect also check if the W entry points can be used * Try calling the W error functions first if available in the driver * Add iconvperdriver configure option to allow calling unicode_setup in SQLAllocHandle * iconv handles was being lost when reusing pooled connection * Catch null copy in iniPropertyInsert * Fix a few leaks 10-Aug-2018 2.3.7 * Fix for pkg-config file update on no linux platforms * Add W entry for GUI work * Various fixes for SQLBrowseConnect/W, SQLGetConnectAttr/W,and SQLSetConnectAttr/W * Fix buffer overflows in SQLConnect/W and refine behaviour of SQLGet/WritePrivateProfileString * SQLBrowseConnect/W allow disconnecting a started browse session after error * Add --with-stats-ftok-name configure option to allow the selection of a file name used to generate the IPC id when collecting stats. Default is the system odbc.ini file * Improve diag record handling with the behavior of Windows DM and export SQLCancelHandle * bug fix when SQLGetPrivateProfileString() is called to get a list of sections or a list of keys * Connection pooling: Fix liveness check for Unicode drivers 19-March-2018 2.3.6 * Fix order of arguments in SQLWriteFileDSN.c, fix unwanted free() in iusql.c (CVE-2018-7485) * Add pkg-config files 2-Jan-2018 2.3.5 * Add configure option --enable-setlibversion set mark the libs with VERS_3.52 Linux only, so any driver built with the libs will work with closed source DM's * Add persistent storage of isql command line history if readline() is used (thanks Axel) * Rename some local mutex functions to avoid name clashes * Assorted fixes (Thanks Markus * 2) * Fix regression in ini caching * Make SQLDrivers look in user as well as system odbcinst.ini for driver attributes * If in use, clear the ini cache when a write is done via SQLWritePrivateProfileString() so the new value is read * Fix problem with pooling if the environment was released by the application * Add check for SQL_COLUMN_COUNT in SQLColAttribute * isql would not display long error messages. Fixed now. * Fix problem calling the driver to report errors if the error is from the DM and the driver has not been called * SQLSetConnectAttrW crashes when attempting to set SQL_ATTR_LOGIN_TIMEOUT * Buffer overflow in unicode_to_ansi_copy() (CVE-2018-7409) * SQLDriverConnect with not-found FILEDSN causes crash * SQLGetDescRec with null name pointer causes crash * Connection string escaping does not work * SQLDriverConnect/W with very long driver name causes crash * Connection string with trailing empty value causes crash * Freeing explicitly allocated descriptor results in writing to freed memory * Buffer overflows and missing null checks in SQLConfigDataSource, SQLInstallDriverEx, and SQLWriteFileDSN * Statement enters incorrect state upon SQLExecDirectW returning SQL_NO_DATA * SQLBulkOperations fails to exit async state after success * SQLFreeStmt causes prepared statements in S1 or S2 to erroneously transition to S3 * Buffer length fixes for SQLGetDiagField * SQLSetConnectAttrW and Unicode string pre-connect attributes do not work * SQLGetData and SQLSetPos async states are incorrect * Various string conversion and length issues in SQLColAttribute(s) * Missing buffer length check in SQLColAttribute(s)W * SQLGetStmtAttr state handling incorrect in S5, S6, and S7 (via SQLExtendedFetch) * SQLSetPos and SQLExtendedFetch state management fixes * SQLExecDirect/W erroneous transition to S1 upon error in S5 * Async SQLGetData and SQLExecDirect/W fails to restore state upon cancellation * SQLFetchScroll cannot move cursor back into the rowset * SQLSetDescField doesn't adjust the length of the buffer when converting to unicode * SQLGetDescField/W and SQLSetDescField/W do not check for negative buffer lengths * SQLSetStmtAttrW SQL_ATTR_APP_PARAM_DESC and SQL_ATTR_APP_ROW_DESC does not accept null * SQLGetData async state reentrancy issues * SQLDriversW off-by-one in enumerating driver list * SQLPrimaryKeys does not pass length in characters to driver * SQLGetConnectAttr with string attributes truncates to half buffer length * SQLTransact with autocommit enabled erroneously changes statement state * SQLDataSources/W fails to reset list position upon end * SQLGetEnvAttr successfully returns unset SQL_ATTR_ODBC_VERSION * Lack of SQL_HANDLE_SENV support * SQLAllocEnv fails to set environment version correctly * SQLMoreResults with streamed output parameters returns unexpected HY010 * Custom pre-connect pointer attributes are truncated to 32 bits * 08003 message should be "Connection not open" * SQL_ATTR_ACCESS_MODE set using SQLSetConnectOption/W before connecting does not persist after disconnecting * SQL_ATTR_AUTOCOMMIT incorrect default value before connecting * SQL_AUTOCOMMIT set using SQLSetConnectOption/W before connecting does not persist after disconnecting * SQLAllocHandle/SQLFreeHandle with invalid handle type should return SQL_INVALID_HANDLE * SQLAllocHandleStd not setting ODBC version correctly * SQLBindParameter does not ignore BufferLength for DAE parameters * SQLBindParameter does not ignore BufferLength for fixed-length parameters * SQLBindParameter returns "Invalid application buffer type" instead of " Program type out of range" * SQLCancel with 01S05 returned from driver should result in SQL_SUCCESS, not SQL_SUCCESS_WITH_INFO (see https://msdn.microsoft.com/en-us/library/aa392708(v=vs.85).aspx ) * SQLColAttribute/SQLColAttributes should return number of bytes needed for Unicode string when truncating * SQLColumnPrivileges/W differing error message precedence from Windows DM and order in ODBC spec * SQLColumns/W extraneous checks on null string's length * SQLCopyDesc does not copy descriptors across connections correctly * SQLDescribeParam extraneous checks for state * SQLDriverConnect/W adds extraneous DM prefix to diagnostic messages * SQLDriversW before ODBC version set returns incorrect SQLSTATE * SQLFetch in state S7 does not return error from DM * SQLFetchScroll missing check for SQL_FETCH_BOOKMARK * SQLForeignKeys/W missing check for null table names * SQLGetConnectAttr/W erroneously retrieves attributes with no default (SQL_ATTR_PACKET_SIZE, SQL_ATTR_QUIET_MODE) * SQLGetConnectAttr/W fails to get some set attributes before connecting * SQLGetConnectAttr/W fails to retrieve set attributes with no connection * SQLGetConnectAttrW returns incorrect value for SQL_ATTR_TRACE * SQLGetConnectOption/W cannot retrieve SQL_ODBC_CURSORS before connection * SQLGetConnectOption/W fails to retrieve SQL_LOGIN_TIMEOUT before connecting * SQLGetConnectOption/W fails to retrieve SQL_ATTR_ACCESS_MODE set with SQLSetConnectOption/W * SQLGetData and SQLSetPos async states are incorrect * SQLGetData missing check for cursor end indication; SQLSetCursorName/W fails to clear previous diagnostic records * SQLGetDiagField/W does not check record number for SQL_DIAG_ROW_COUNT and SQL_DIAG_DYNAMIC_FUNCTION_CODE * SQLGetDiagField/W missing check for negative buffer length for string fields * SQLGetDiagField/W inconsistent handling of statement-only diagnostic fields * SQLGetInstalledDrivers off-by-one length * SQLGetStmtOption various state handling issues * SQLSetConnectAttr/W SQL_ATTR_CURRENT_CATALOG extraneous check with error 24000 * SQLSetConnectAttr/W does not prevent attempts to set ODBC 3.x statement attributes * SQLSetConnectAttr/W with null string attributes causes crash * SQLSetConnectOption passes SQL_ATTR_TRACEFILE to the driver * SQLSetConnectOption/W or SQLSetConnectAttr/W missing validity checks for SQL_ATTR_TXN_ISOLATION * SQLSetConnectOption/W setting SQL_ATTR_TRACEFILE to null results in different error * SQLSetCursorName/W missing checks for negative name length * SQLSetDescField/W missing check for negative SQL_DESC_COUNT * SQLSetParam missing various error checks for invalid data types and buffer * SQLSetPos does not check for state S5 * SQLSetPos missing checks in state S7 * SQLSetScrollOptions various state handling issues * SQLSetStmtOption/W missing check for positive rowset sizes * SQLSpecialColumns/W error precedence differs from Windows DM * SQLSpecialColumns/W incorrect check for SQL_NTS string lengths * SQLStatisticsW uniqueness parameter missing validation * SQLTablePrivileges/W extraneous checks on null string's length * Various issues with SQLGetFunctions * Various string conversion and length issues in SQLColAttribute; missing buffer length check in SQLColAttributeW * As above, but for SQLColAttributes and SQLColAttributesW; incorrect check for SQL_COLUMN_COUNT * Setting SQL_ATTR_TRACEFILE to null value results in different error * check_target_type allows driver-specific C data types for ODBC < 3.8 * fix empty SQL_DIAG_SERVER_NAME field in DM-supplied diag recs * fix differing behaviour for an empty string DSN in SQLConnect/W * Alter isql to return errors from SQLMoreResults * Handle case of building on mingw-w64 3rd-Aug-2015 2.3.4 * Fix typo in the loading of the cursor lib, reports internal error, unexpected SHLIBEXT 2nd-Aug-2015 2.3.3 * Reporting of logging state was broken in SQLGetConnectAttr * Fix incorrect text against HY007 * Add -L option to isql to increase max column data display * Update automake toolset in svn * Add SQLFreeStmt( SQL_CLOSE ) function to SQLCancel * Allow SQL_NTS as a buffer length to SQLBindParameter * More manual pages for the tools * Fix buffer overrun returning long diagnostic from driver * Cross call between wide and ascii error reporting in the driver when needed * Fix some possible unchecked memory references after malloc * Prevent free( NULL ) in SQLGetDiagRecW * Add missing A->W conversion in SQLGetStmtOption * Allow iconv to convert strings into the driver with differing A and W lengthts (UTF) * SQLDataSourcesW takes buffer_lenghts as characters not bytes * Fix memory leak in SQLGetDiagRec * Allow setting custom non standard attributes via DMStmtAttr, format is: DMStmtAttr=[xxxx]=\yyy DMStmtAttr=[xxxx]={ssss} where xxxx = integer attribute to set, yyy is decimal numeric value and ssss is a string value * Add check in SQLGetData for null target value or negative buffer length * Fix memory leak when using the cursor lib * Catch incorrectly expanded SHLIBEXT * There was a bug in the ini caching, now fixed * More ODBC 3.80 additions (streaming parameters) * Check for NULL handle in __validate_xxx() * Avoid potential memory leak in SQLAllocStatement * Avoid buffer overflow via environment variamles * Fix some typos 8th-October-2013 2.3.2 * The logging of WStrings was using the incorrect length in some cases * Pass SQLDescribeCol call to driver when in state 2 (not a cursor spec). * Pass SQLMoreResults call to driver when in state 2 (not a cursor spec). Both the last two changes are not as per the original book state table but allign with the current MS driver manager * The -e option to isql got lost somewhere. Back in now * Update install-sh * SQLCancel assumed that the DM was being built with thread support * Try and speed up SQLTransact and SQLEndTran operation * Add missing \ in Postgres7.1 Makefile * Correct some potential buffer overflows * Handle SQL_NEED_DATA from a SQLMoreResults * Get the local charset via nl_langinfo(CODESET) when asking the DM to do ASCII-UNICODE conversions * Handle (and remove) leading spaces from ini entries * Fixed unicode conversion problems in SQLGetDiagField(W) * missing terminating null in iusql * add to the list of errno states that does not cause a create of the ini file * SQLSetConnactAttr() -> SQLSetConnectAttrW() was passing incorrect string length * Fix double free in SQLGetDiagFieldW * Fix Unicode/Ansi conversion problem in SQLGetDiagFieldW.c * Add support for Driver64 in SQLDriverConnectW * Add missing unicode setting when returning a connection to the pool * Tidy up leaking iconv handles if connect_part_one fails * Fix (and avoid) some out of memory problems * Wrap lt_dlinit and dlerror in the lib mutex * Add slencheck executable to try and find the sizeof(SQLLEN) from a installed driver * SQL_NO_DATA after SQL_STILL_EXECUTING in SQLExtendedFetch was not setting the state correctly * A little more 3.80 stuff being added * Added fixes found by coverity * Added man pages * Patches to update VMS build * Change mutex protection around release_env * Altered strlen to be count of bytes in SQLGetDiagFieldW * Add check for W function support in do_attr * Allow SQLDrivers to return attribute length with no supplied buffer 26th-November-2011 2.3.1 * Change type definition of a integer in SQLConnect.c, just to avoid confusion * Allow setting the DM overrive values in the connection string to SQLDriverConnect for example "DRIVER={Easysoft ODBC-SQL Server};Server=myserver;UID=user;PWD=pass;DMStmtAttr=SQL_QUERY_TIMEOUT=10;" * Error and info message order was being inverted by the driver manager * Fix memory leak in SQLDriverConnect.c (Thanks JM) * The keyword matching for DRIVER=, DSN= etc was case sensitive. Make it insensitive now * Avoid sprintf NULL pointer problem in SQLGetDiagRec * Fix typo affecting the pooling of connections, (thanks Chris) * Fix SunCC _mcount problem * Attempt to stamp version info on the libs generated. There are aps in use linked against other driver managers that expect VERS_3.52 * Fix potential buffer overrun when using SAFEFILE * Fix mutex problem in the exit from __SQLGetInfo (thanks Richard) * Allow getting SQL_DM_VER via SQLGetInfo before connecting to a driver * Generate unixodbc_conf.h using macros to allow cross compiling * Fix some libltdl problems * Fix some naming problems with the cursor lib * Fix odbcinst problems on systems without pwd.h * Change lib version to 2 to reflect SQLLEN changes in v2.3 * Fix threading problem (thanks Petr Vandrovec) * Allow use of lib name in a DRIVER= connection string * Change default threading protection to 0, most drivers should be thread safe by now. If the driver is at all thread safe, allow SQLCancel to bipass the interlock. * Performance change to handle large numbers of connection and statement handles better. Thanks for the change from the folks at Acision. * Add -k option to isql to treat the DSN as a connection string and use SQLDriverConnect isql -k "DSN=server;UID=test;PWD=test" * Couple of the SQLSetConnactAttr values are now SQLULEN instead of SQLUINTEGER * SQLSetConnectAttr was passing a char length instead of a byte length into the Driver SQLSetConnectAttr when converting from Ansi->Unicode * Driver version was not being held when a second connection was made to the driver 20th-April-2010 2.3.0 * Try and rationalise the way the connection process find the driver version and supported functions * Sort out problem in isql with blank lines * Stop libthread from being used under AIX * Move the GUI parts off into a new project http://sourceforge.net/projects/unixodbc-gui-qt/ * Strip out the GUI parts. I have also removed the spec files as they will need redoing, * Move the Test parts off into a new project http://sourceforge.net/projects/unixodbc-test/ * Add interface into odbcinstQ to allow for a dialog if SQLDriverConnect is called without a DSN= (as the MS spec) * Allow the setting of a default Threading level in the ODBC section of odbcinst.ini * Change double format string in Postgre7.1 driver * Add missing CR to output of odbcinst * add fixes to MiniSQL driver * Add missing .y in nn driver, now I need to get it to work * Assoured bux fixes and format problems, thanks Tom * SQLBindCol on metadata calls was incorrectly going via the cursor lib if it was enabled * fix isql problem with nested definitions. * Add configure option to enable building of driver config libs * Shift build to using config.h, the compile lines were so big it was hard to see warnings * Fix bug in isql when using -b option. * Check attribute values when setting connection and statement attrs * Check for valid pointers in SQLGetInfo(W) and SQLGetFunctions * Add extra checks for states in SQLCopyDesc * Add --enable-stricterror option to allow compliance with the error reporting definition, driver errors don't have the unixODBC prefix * Check for statements in the NEED_DATA state when calling SQLEndTran * Extra error check for SQLPutData * Check handle type in SQLEndTran * Prevent seg fault if there are no driver error functions * the -n option to isql was not working correctly * Stripped out all the bespoke LDTL configure stull, not just what libtoolize provides * Fix problem where ansi_to_unicode_alloc didn't leave space for the NULL and could cause memory corruption * Add the ODBC 3.80 additions that MS have produced. I am sure I remember the standard being given to XOpen, what do I know :-) * Change the file open mode for the ini file from w to w+ just in case the original open failed but the file did exist * Fix configure problem preventing the CHAR encoding from being passed * Remove white spave from ini write, not all drivers use unixODBC ini functions and can handle the spaces * Update config.guess to current GNU version including support for AIX6 * Create SVN repository at sourceforge * Add cast to fix problem in SQLSetConnectOption * Fix SQLINTEGER<->SQLLEN conversion broblem in SQLNativeSQL * Fix bug that stopped setting SQL_ATTR_CONCURRENCY to SQL_CONCUR_VALUES * Change minor version number because of the SQLLEN change * Remove unintended trailing white space from log generation 19th-Nov-2008 2.2.14 * missing protype in 2.2.13 made the build fail on some platforms 18th-Nov-2008 2.2.13 * There was a mutex around iconv that needed adding. Without this, there was a potential thread problem * Fix problem with SQLGetDiagRec/Field returning double driver errors * odbctest was using the wrong handle for SQLGetConnectOption * remove startup thread race condition * fix descriptor memory leak with UNICODE only drivers (thanks Ian) * Alter the default 64bit build mode, and change the flag to BUILD_LEGACY_64_BIT_MODE * Fix a couple of 64bit problems * create unixodbc_conf.h on install to contain compile settings * Allow the GUI parts to build with qt4 * try and deal with drivers that call internal W functions and end up in the driver manager (informix for example). Enabled by --enable-handlemap=yes when configuring * Fix leak of iconv handles * Allow the setup API to call through to the wide driver functions * Fix potential seg fault in SQLGetPrivateProfileString * Fix a couple of broken casts, and some MS 64bit changes * Add check for postgres driver getting into a spin wait * Fix logging that reported the setting of env attrs failing * Add isql option to wrap strings with quotes * Add isql option -3 to make isql use ODBC 3 calls instead of 2 * Add timestamp to logging output * Pull any errors from driver whern SQLBrowseConnect returns SQL_NEED_DATA * isql now displays any warnings from SQLMoreResults * Add include path to odbc_config --cflags output * Fix some SQLLEN/SQLINTEGER conflicts in the cursor lib * isql now checks if the driver has SQLMoreResults before calling it * A couple of tweeks in the txt driver * Fix More than 1 log msg relevant in odbcinst now * Changed UI plugin technique for odbcinst see... ODBCConfig > main.cpp, and odbcinst > SQLManageDataSources.c and odbcinstQ4 > SQLManageDataSources.cpp * Add more 64 bit changes, remove SQLROWCOUNT and its frends from 64 bit land * Couple of descriptor typo's fixed (Thanks Jess) * Add odbcinstQ4 to support pure Qt4 SQLCreateDataSource and SQLManageDataSources * Add ODBCCreateDataSourceQ4 as Qt4 based exec to SQLCreateDataSource * Add ODBCManageDataSourcesQ4 as Qt4 based exec to SQLManageDataSources * Add "-c" option to odbcinst to call SQLCreateDataSource * Add "-m" option to odbcinst to call SQLManageDataSources * Add ODBCDataManagerQ4 * Add Wrappers (C++, QtCore 4, QtGui 4 - thin wrappers to ODBC) * Add more complete set of driver config options to GUI config * Fix incorrect export file in odbcinstQ * Added some extra features to isql (thanks to Ron Norman for the ideas) * Add diag support lib for driver development and possibly DM This is very 'black-boxed' on purpose. * Fix Replaced diag code in txt driver to use new diag lib. * Add New odbctrac library. * Add Threading can not be config via Qt(4) based GUI * Add New ODBCString library. * Add odbcinst.ini -> ODBC -> TraceLibrary and corresponding GUI Qt(4) config. * prevent the cursor lib from seg faulting if the query isn't a select * Add SQLULEN size display to the output of odbcinst -j * Add mutexes in odbcinst/_logging.c * Remove the MySQL Driver, its woefully out of date now * Remove incorrect path in vms_odbc.opt * rename trace.h to odbctrace.h to avoid potential name conflicts and move to include dir * update unixODBC.spec file * Add README.CYGWIN * Fix build problem with QT4 without QWizard support * Alter how the Ansi-Unicode mapping is done, so a unicode function can be passed to the driver (if it supports it) even if a non unicode connect was done * Fix buffer overrun in SQLDriverConnectW and SQLColAttributesW * I have cut back on a lot of the GUI parts that are being added. The goal is to create a distinct set of files that contains these and other parts that are not part of the core goal of providing ODBC. Likewise the drivers will go on the next release, as most DB's now have their own folk working on their drivers and they all interoperate with unixODBC so its just adding confusion including them here (IMHO that is) * Prevent a potential buffer overrun in the DM * The processing of --enable-rtldgroup had been dropped, back now * Allow the cursor lib to handle multiple result sets 13th-Oct-2006 Release 2.2.12 * Add missing SQLSetStmtOptionA and SQLSetStmtOptionW * The config string being passed into ConfigDsn was wrong, removed semicolon, and added terminating double null * Add help help to isql * Couple of changes to make the build on OSX work better * Alter odbctest FullConnect to use SQLDriverConnect * Replace a missed flag for true 64 bit operation * Add ODBC3<->ODBC2 type mapping in SQLSetParam * Add missing SQLSetStmtOptionW.c * Tidy up the search for GUI lib code in SQLManageDatasource * Backport a couple of changes from the Debian build into the cursor lib * Add extra config settings to the MaxDB/SapDB setup lib * Fix possible exit from SQLConnect without having closed in the driver * Fix configure problem on Tru64 * Fix a build issue on Sinix * Allow calling metadata functions via the cursor lib * Alter args to SQLParamOptions * Fix bug preventing attribute length from being returned from SQLDrivers * Fix broken iusql * SQLTransact via the cursor lib has the args swapped * Remove leak in the postgres driver (error messages were not being released), and yet a different leak in convert.c * Add code to allow the Cursor lib to call SQLGetDiagRec * Updated libtool, automake and autoconf, so expect problems for the next few months... * Add new QT detection macros (Thanks Peter) * Removed some unneeded strlen's from the postgres drivers * Small change to the logging in SQLBrowseConnect * Add additional SQLGetInfo value SQL_ATTR_DRIVER_THREADING (1028) that returns a SQL_USMALLINT containing the level of thread protection afforded the driver by the driver manager * Fix small bug that prevents SQLDrivers from returning the first entry if SQL_FETCH_FIRST is not used * Make DataManagerII check the DB's quote char when creating SQL * The cursor lib wasn't correctly returning the last rowset * Fix problem with the cursor lib, rowsets and SQLExtendedFetch * Fix couple of spelling mistakes in isql * Allow decoupling of SQLHANDLES between application and driver, there is a 64bit DB2 where the driver handles are int's but unixODBC uses void *. There is a define for DRV_SQLHANDLE in DriverManager/drivermanager.h that allows this choice at build time * Add a few extra checks for only unicode API's from the driver * Check for existance of qt-mt lib before adding to link line * added missing cleanup in Postgres driver * Added a contrib directory with (so far) a new ODBCConfig and ODBCStats apps, (Thanks Fizz for those). * Ask the driver when there are no errors left in the DM's store * Add a couple of unicode fixes suppled by Oracle * Small fix for call to SQLGetDiagField * Fix silly typo that was using sizeof( SQL_WCHAR ) instead of SQLWCHAR * Add check for C_TYPE in SQLBindCol, SQLBindParameter, SQLBindParam, and SQLGetData * Fix overflow if the LOG_MESSAGE_LENGTH is increased * Save the last arg for SQLSetConnectAttr if called before connection for later passing to driver * Fix missing mutex release in SQLFreeHandle (thanks Mark) * Add missing maps from unicode in SQLSetDescFieldW and SQLSetStmtAttrW * Handle resetting statement descriptors to implicit values, by passing in NULL or the implicit descrptor to SQLSetStmtAttr with the attribute SQL_ATTR_APP_PARAM_DESC or SQL_ATTR_APP_ROW_DESC * Avoid calling SQLGetInfo for every SQLEndTran/SQLTransact * Remove inconsistency in the return value from SQLGetPrivateProfileString * Fix broken QT_VERSION detection * Add UNICODE wrapper functions in libodbcinst. The ini file is still ascii, so its not got full support at the moment, but any apps that need the W functions should build now * Add GUI support for SQLCreateDataSource * More informative error message if a invalid handle is passed to SQLAllocHandle * Add TIMESTAMP_NO_TMZONE to Postgres drivers types * The ANSI to UNICODE mapping in SQLTablePrivilges was broken * Fix incorrect buffer length in SQLGetInfo when calling unicode drivers 4-March-2005 Release 2.2.11 * Fix a couple of typo errors in postgres driver and odbctest * Fix problem where ini files could be truncated under heavy load * Fix potential hang with FILEDSN's if the connect string included a DSN= entry as well * Don't save the SAVEFILE attribute in the filedsn. * Fixed bug that prevented the setting of some attributes via the DMConnAttr method * Removed the -module entry from the cursor lib, it prevents it building on HPUX. * Add a couple of extra info types to the pull down in odbctest * SQLGetInfoW was returning the wrong length when converting from the ANSI call. The same was also going on the other way. Also fixed same thing for other calls. * Fix incorrect value in SQLFetchScroll in odbctest * Fix memory leak in odbcinstQ * Check for MOC being found, before building GUI parts * Add list of export symbols to libodbcinst * Fix a problem in the cursor lib returning blobs * SQL_DIAG_NUMBER was being stored and returned as a SQLINTEGER instead of a SQLRETURN * Check if we can include sys/stats.h in iniOpen.c * Fix potential buffer overun in SQLConfigDataSource() * Fix problem in odbctest that prevented intervals from being displayed. * Cope with SHLIBEXT not being set when finding the cursor lib * Add a couple of missing Setup64 checks * Small change in __info to conserve memory * Add odbcinst.exp to distrib * Add missing ODBC2 installer stubs * Fix typo in SQLStatistics * Not passing user names and password into isql passes NULLS not empty strings into SQLConnect * Add missing SQLPrepareA from the driver manager export file * Make the default for DontDLClose 1, it doesn't do any harm, and fixes some segfaults * Fix printf format in the postgres driver on 64 platforms 29-Sep-2004 Release 2.2.10 * Add additional check in sqltypes.h to detect AIX 64 bit * Fixed minor copypaste error in configure.in * Fixed problem in configure script that prevented it using the qt-header and qt-lib config args. And allow the QT bin dir to be set. * Add new spec file (Thanks Stefan) * Alter string initialisation in isql to reduce memory use on some platforms * Remove the parts of odbcinstext.h that only are needed in unixODBC builds from outside app builds. (Cheers Stefan) * Small fix to DataManagerII * Protect iconv handle in threaded environments * Extend cursor lib to cope with where clauses * Remove incorrect duplicate function in iniOpen.c * Strip FILEDSN from connection string before passing to driver * If using a cursor lib use "IS NULL" instead of binding nulls * Allow 32 and 64 installations to coexist using a Driver64 entry in odbcinst.ini * Fix uninitialsed value that was causing "Driver does not support the requested version" warning * Fix typo in sqltypes.h that failed when building Perl DBD::ODBC * INI cacheing is not on by default, it can lead to a memory leak * Alter the Makefile.am's so builds outside the config dir can be done * Fix possible buffer overrun in SQLConnect * Replaced crypt auth in postgres with md5 for 7.1 Postgres driver * Fix memory leak in descriptor thread support 24-Jun-2004 Release 2.2.9 * Fix problem so that if SQLGetPrivateProfileString fails because odbcinst.ini doesn't exist, it copys the default value into the output. * Avoid caling SQLFreeEnv the driver more than once. * Rename lo_xxx func in Postgres driver(s) to avoid clash with postgres lib. * Add odbc-config to find compile time options for use with other build tools * Fix call to SQLParamData in cursor lib * Add SQL_NULL_DESC to include files * Remove -M for unixware builds from libtool * Fix descriptor bug in SQLCopyDesc (Thanks Erik) * Add extra iconv targets * Fix bug that stopped RTLD_GROUP from being added to dlopen * Remove mem leak if libodbc.so is loaded using dlopen instead of linked as is normally done. * Add check for LP64 in sqltypes.h * Remove dlclose from ODBCConfig * Fix typo in the readline detection in configure * Fix potential hang with semaphore allocation in driver manager * Alter how the state is set after a SQLParamData to S5 insted of S4 * Stop the driver manager from calling SQLFreeEnv twice in the driver * Add new MySQL source from MyODBC 3.51.07 * Update the uo_fopen functions * Add some extra mutex locks around end_tran code. * Alter the flag to build real 64 bit mode to BUILD_REAL_64_BIT_MODE * Update a couple of prototypes for 64 bit builds * Fix assorted 64 bit warnings and cast issues 17-Feb-2004 Release 2.2.8 * Fix bug in SQLMoreResults that moves to incorrect state * Fix problem where metadata calls fail if in STATE_S5 * Fix bug inserting ini entry with more than one '=' * Fix some stupid leaks in the connection pooling code * Allow the driver manager to probe a pooled connection, to see if its valid. Set the query to use in the odbcinst.ini entry by setting CPProbe = SQL, for example this works well for postgres [PostgreSQL] Description = Postgres SQL Driver Driver = /usr/local/lib/libodbcpsql.so.2.0.0 Setup = /usr/local/lib/libodbcpsqlS.so CPTimeout = 1000 CPTimeToLive = 100 CPProbe = select user FileUsage = 1 DisableGetFunctions = 0 DontDLCLose = 1 * Fix the SQLGetPrivateProfile code when passing NULL sections or names. * Fix SQLGetData to avoid a problem returning unicode from ODBC2 drivers. * Make the header sqlext.h include the unicode header sqlucode.h. This matches the MS header files. * Added DriverConfig lib for Mimer. (From Mimer) * Make connection pooling check using SQLGetConnectOption as well as Attr * Fix leak if iconv is used and a connection fails * Add configure option to disable the use of readline in isql 02-Dec-2003 Release 2.2.7 * Add missing comma in Oracle setup lib * Add -l option to isql to allow setting locale * Fix problem in SQLDriverConnectW that prevented connecting to UNICODE driver. * Remove a couple of the attribute mappings from SQLColAttribute when going from V2 app to V3 driver. * Clear SQLError errors in the same was as SQLGetDiagRec (this will help PHP out somewhat). * Add a check to handle driver that don't support SQLGetEnvAttr * Allow ATTR; in set attr lists from ini file * Small change to warning dialogs in odbctest (Thanks Mark). * Fix the cursor lib to work via SQLFetch as well as the other fetches. * Update the README.OSX file to cover building the cursor lib. * Remove the SQLNumResults() call after a execute. This means the DM doesn't know if there is a result set, but it seems to match what the MS one is doing. * Fix a major mistake in the thread protection, it worked fine until the driver returned a error. * Fix write beyond string bound in SQLDriverConnect.c (Thanks Ocke) * Add call to setlocale( LC_ALL, "" ) in isql.c, can also be set using -l option * Add initial support for Microsoft Interix, details in README.INTERIX * small change to ODBCConfig to have the password field in the driver properties hide the password * Make both # and ; comments in ini files * Update README.OSX to cover changing driver libs into bundles * Fix a couple of small display problems in odbctest * minor updates to odbctest: Have the gui list match the input order and the ini file Restore the selection after Add/Remove * Expand a text buffer to avoid overflow * Add RTLD_MEMBER to dlopen args if available (AIX) * Fix bug in SQLWritePrivateProfileString 21-July-2003 Release 2.2.6 * Add SQL...A() functions as well as W * Add some 64 Bit changes * Add support for SQL_BIGINT in Postgre7.1 driver * Fix bug in libtool that fixes a call to access * Allow setting of odbcinstQ lib load with either environment variable ODBCINSTQ or in the [ODBC] section of odbcinst.ini with a odbcinstq = /path/to/libodbcinstQ.so * Alter the way SQLDataSources works (again :-) * Add configure option to force the way dlopen works * Fix bug in stats collection * Add call to endpwent() to avoid a small leak * Allow isql to handle SQLMoreResults * Add option TracePid in [ODBC] section of odbcinst.ini, setting this makes the DM treat the TracePath as a path to a directory, and creates seperate log file for eack PID in use, mainly of use when used under something like apache. * Add extra unicode string for Solaris, see README.SOLARIS * Sort error messages according to state (as per the spec) * Remove trailing \ from doc/Makefile.am * Fix memory corruption in postgres driver that caused table creation under OpenOffice to fail * Tidy up gODBCconfig so it builds with current tools (or so I hope). 26-Feb-2003 Release 2.2.5 * On error from SQLMoreResult don't change to S1 * Fix build problem with QT 3.1.1 * Fix spelling of error message * Fix bug where multiple connections give ODBC version error (thanks Jay Cai) * Increase the TEXT_FIELD_SIZE in the PG drivers * Set output handle to NULL if SQLAllocHandle call fails * Return any errors from the drivers SQLAllocConnect * Update version of automake and autoconf used to produce distributions * rebuild libtools configure to work with new autoconf 24-January-2003 Release 2.2.4 * Make the DM look in libdir for the cursor lib * Additions to DataManagerII * More thread safe issues and fixes * Fix uninitialised pointer in SQLDriverConnect.c * Fix memory leak in SQLGetDiagRec * Add missing SAG conformance SQLGetfo call in odbctest * Fix bug in SQLDriverConnect where warnings were not getting into the error stack * Add quotes to table names in DataManager * update the file "missing" * Add missing SQL_DECIMAL in logging conversions * VMS build changes... (Thanks Craig) * get caught up with changes since the original VMS port * follow the compiler warnings to fix myriad small nits throughout the sources * change the handling of shareable images so they no longer need to be placed in SYS$SHARE * improve the installation and set-up process * Make the cursor lib build without needing libodbc, it breaks on HPUX * Fix allocation problem in cursor lib * Fix potential seg fault in cursor lib, when bind is done with null indicator * Update README.QNX to cope with QNX 6.2 * Fix problem with flags to dlopen * Make the exit logging in the driver manager display unknown return codes * Fix bug in driver manager where a SQLAllocHandle in the driver can cause a seg fault * Add -s option to isql to allow the input buffer size to be set i.e. isql -s32000 dsn * Update some of the autoconf scripts to handle RH 8 * Add extra attrs to oracle setup lib * Allow DMEnvAttrs to be set in odbcinst.ini as well * Alter the way the config mode is stored, don't use putenv now, as it causes trouble if the DM is unloaded. Also malloc the strings if the environment is set via the DM, to avoid the same problem with putenv. This caused a crash of OpenOffice on Solaris 23-August-2002 Release 2.2.3 * fix bug in unicode_to_ansi_copy * DataManagerII was missed from the last release, sorry, I thought that it had been moved to DataManager. * DatamanagerII: Remove duplicate rows with drivers such as Postgres which doesn't work as expected when getting lists of Schemas * Attempt to set permissions for the file dsn directory. * Fix bug with conversion of ODBC 2 values to SQL_C_WCHAR * Make the postgres drivers return a SQL State of 01000 for a warning, not 00000 * Add option to isql (-x) to specify a separator in hex (0x09 is V tab) or octal (012) * Fix typo in pre 7.1 Postgres driver that broke bound timestamps * Fix what looks like a bug in the libtool dlopen wrapper, its fails to fail, when failing to load a lib. * Only call the ODBC 3 version of SQLGetFuctions if we have requested ODBC3 some drivers (SAPDB) that return ODBC 3 API's only return this call if the connect specified ODBC 3. * Check the attributes being passed into SQLSetConnectAttr, only pas into SQLSetConnectOption if they are ODBC 2 values. The same for SQLSetStmtAttr * Allow double clicks on dsn's to bring up the configure in ODBCConfig * Add extra thread checks for FreeBSD * Add check for SQL_NO_DATA in isql * Add code to make DM cope with SQL_NO_DATA from SQLExec(Direct) * Change UNICODE conversions, remove all inplace converts. * Add support for iconv for the UNICODE to ANSI conversions * Add code to make DM code with SQL_NO_DATA from SQLExec(Direct) * DBFIO: completed basic functionality (DBF file access library) * dbfio: completed basic functionality (test program for DBFIO) * Add checks for usage counts for loaded libs * Replicate the way the MS DM only calls SQLAllocEnv on a driver once * Add fix from John L Miller for SQLEndTran and SQLTransact * Make it try and find a working iconv set of encodings * Small fix to SQLMoreResults from John L Miller * Alter error state return in SQLCloseCursor * Allow state 07009 to be mapped to S1002 or S1093 depending on the calling function * Fix major ineffiency with text fields and the Postgres drivers * Fix incorrect return state from SQLEndTran/SQLTransact * Make rowcount return a count of -1 if its returns a error * Further AIX linking tweeks 08-July-2002 Release 2.2.2 * added -m option to isql * improved row count at end-of-result in isql * allow SQLColAttribute(s)(W) to be called with a column number of 0 to get the descriptor count * Remove -export-symbols from sample, it was causing some problems on Solaris * Add DataManagerII, this is a updated version from Mark Vanderwiel * Update libtool to escape from AIX build problem * Add fix to avoid file handle limitations * Add more UNICODE changes, it looks like it is native 16 representation after all. The old way (Fixed at BE) can be reproduced by defining UCS16BE * Add iusql, its just the same as isql but uses the wide functions * Couple of cast warnings cleaned up * Add change to libtool to clean up AIX build * Create README.AIX * Fix small bug in SQLDriverConnectW, I was allocating 1 byte two little * Fix typo in SQLConnect that wasn't allowing the driver manager to supply SQLFreeConnect for drivers that didn't support this. * Fix build on Caldera OpenUnix8 (not sure why anywone would want to go anywhere near this OS IMHO...) * Move DataManagerII to DataManager * Alter what comes back in the second field from SQLDataSources to be the description from the ODBCINST.INI entry, this matches what happens in with the windows DM. 23-Mar-2002 Release 2.2.1 * odbcinst: now tries to auto create system odbc.ini * odbcinst: implemented -n, -l, -h for -q -s * Add option to disable definition of windows types in sqltype.h * Fix small bug in ini uper case routines. * Added STMT and OPTION to MySQL driver setup * Added -j arg for odbcinst (shows INI file names) * Fixed seg fault bug in Text File driver * Fix small bug in SQLBrowseConnect * Fix check for Darwin (OSX) * Fix bug in sqltypes that stopped 64 bit builds * Fix build problem on 32 bit platforms without long long * Add option to set environment (unix) values via SQLSetEnv, this can also be done in the odbc.ini, for example [sample] Description = Test to DB2 Driver = DB2 DMEnvAttr = SQL_ATTR_UNIXODBC_ENVATTR={DB2INSTANCE=db2inst1} * Fix some cases where the trace file env value was "Trace File" * Make the readline check make sure there are headers as well as libs * Add check to use RTLD_GROUP in libltdl if present * change DWORD definition to unsigned long where applicable * Fix bug in error reporting that cound crash with multiple errors and ODBC3 * Remove C++ comment from exe/odbcinst.c * If we are not building the drivers, dont build sqp * Alter default size of odbctest window * Improve check for stats headers * Add install-data-am section back to Makefile.am to create the empty ini files * Extend naming of cursor lib to work on non linux platforms (it expected a .so) * Make Postgres driver(s) handle {oj ... } syntax * Fix some endian issues with 4 byte unicode support * Update the MySQL driver code 30-Jan-2002 Release 2.2.0 * Allow SQL_ATTR_LOGIN_TIMEOUT to be set on a connected connection doesn't make that much sense, but it mirrors what the Windows DM does. * Change DWORD in sqltypes to be a unsigned int to work on 64 bit platforms * Fix incorrect diag message in SQLSetStmtOption.c * Hack to the 7.1 postgres driver to enable SQLPrepare to be called BEFORE SQLBindParameter * Reset the stmt->prepared flag when going into a SQLParamData state after SQLExecDirect * Fix silly bug that stops odbctest adding the fidt entry on the list * Add missing tracing to SQLBrowseConnect * Fix some potential corruption in SQLGetDiagField * Add some simple cacheing to SQLGetPrivateProfileString * check for redefinition of SQL_OL_CAP to stop AIX build breaking * Add missing getGlobalDefaults in PG 7.1 driver (Thanks Rick) * Fix bug in SQLConnectW (Thanks Artiom) * More mods to SQLConnectW and SQLDriverConnectW * More MS generated 64bit changes * Add MyODBC 3.5 driver. Its a separate configure in Drivers/MySQL Release 2.1.1 2001-12-21 * started to add mac package/install dirs for PackageMaker * added qmake project files as an optional build process * ODBCConfig can build with a static odbcinstQ * Remove auto text driver setup, this breaks new installs as it can't find odbcinst * Fix mixup in SQLSetScrollOptions * Small portability fix for BSDI * Make UNIX Domain socket settable in postgres driver vua UDP= in odbc.ini dsn entry * Fix bug where some SQLGetConnectAttr values were not coming from the driver, but the driver manager * Alter odbctest to make directory select in Manage Auto Test work better * Fix browser in DataManager so that it works with drivers that don't return values from SQLRowCount * Fix some error retrieval problems * Alter the include files to match MS ODBC 3.52 with 64bit support, fix assorted warnings when building on 64bit platforms * Add option to force tracing on, this is for use with apps like StarOffice that disable tracing * Add support for MAX_ROWS in postgres drivers * Add fix to cover Darwin 1.5 (OSX) * Add DisableGetFunctions option to driver section of odbcinst.ini to cope with drivers that can't handle the call (Solid 2.2 AFAIK) * Fix 64 bit bug in Postgres driver * Add some ODBC 3 bits to the Postgres driver to make it run with Star Office 6.0 (beta) Release 2.1.0 2001-11-27 * cvs moved to Source Forge * attempts have been made to cleanup GNU auto-stuff to make the cvs code more accessable - added README.cvs - hopefully "make -f Makefile.cvs" works on more platforms * implemented more in SQLManageDataSources() - created odbcinstQ (plugin for Qt GUI support in odbcinst) - moved most code from ODBCConfig to odbcinstQ * stupid mistake on my part(Nick), left a #ifdef in isql.c that prevented displaying a list of tables * Make calls to localtime in Postgres Driver only when required * Made some changes to Postgres prototypes * Add option to get odbcinst info from stdin * Make SQLError errors clean down after each API call for ODBC 3 apps * Add mapping from SQLColAttribute attributes to ODBC2 attributes * Fix reported leak in ltdl.c * Make the path for file DSN's come from the odbcinst.ini file * If using a ODBC 3 driver call the one off version of SQLGetFunctions * Now builds better on Darwin * Reinstate conversion from wide to ansi types in SQLGetData if the driver is ODBC2, also adjust the buffer length to prevent buffer overrun. * Stop ODBCConfig setting Trace File in odbcinst.ini it should be TraceFile Release 2.0.10 2001-10-14 * odbctxt : escape special chars when read/write lines into a table * Fix bug where a Execute that errors should return to state S2 * Update README.OSX to cover a txt driver problem * Add Drivers/txt/doc to distribution * Add missing text driver setup from spec file * add missing VMS opt files * Add missing include from DataManager (Samuel Cote) * Remove LT_GLOBAL from the libtool code. This breaks perl amongst others. * Allow the display of unicode data in logs * Fix stupid WCHAR bug in SQLGetData * Move ifdef in __stats.c to allow the building of ODBCConfig under Mac OSX * Add missing args to prototype in sqlext.h (Thanks Christian) * Pass on unknown connection attributes to driver after connect * Make SQLGetPrivateProfileString return the actual len read, not + 2 * Make the OSX build cleaner, it just needs the dlcompat lib now * Allow ODBCConfig to handle attributes not described in setup libs * Stop the ODBC Version being set when there are open connections * Alter odbcinst error messages to match windows * Fix incorrect installer errors (they were offset by one...) * Create ./odbc.ini if it doesn't exist * Fix typo that stoped odbctest from building on Suns latest compiler * Slightly alter the unicode definitions in sqltypes.h * Add support for FILEDSN in driver manager, odbcinst, and ODBCConfig * Fix buffer overrun in Postgres drivers Release 2.0.9 2001-08-14 * odbctxt: tweeked - now works on PowerPC * Add auto register for text driver to Makefile.am * Add check for flex, sqp won't build with lex now * odbctxtS: now supports CaseSensitive property * Add build time option to select wchar_t UNICODE (4 bytes) as opposed to signed short UNICODE (2 byte) * Add build time option to select the length of logged strings (LOG_MESSAGE_LEN in drivermanager.h) * Fix libtool bug that caused the AIX build to not produce shared libs * Fix couple of typos that caused the build to fail on Solaris * Add conditional for 64 bit application compilation when the sizeof(long) will not have been done by configure * Fix small bug in postgres driver on debian * Add build instruction for QNX * add Slovak translation of gODBCConfig * Fixes to SQLBrowseConnect in driver manager * Get the DM to check with the driver for the CLI Year * Fix small bug in strncasecmp in extras * Add extra support for SQLSetConnectAttr before connection * rename global structure in Postgres drivers to avoid a colision * Add support for presetting Env,Conn and Stmt attributes via the ini file using the following syntax in the dsn section of odbc.ini DMConnAttr = SQL_ATTR_CONNECTION_TIMEOUT=30 DMStmtAttr = SQL_ATTR_NOSCAN=SQL_NOSCAN_OFF;*SQL_ROWSET_SIZE=20 the * indicates thats its a override attribute, so any attempt to call SQLSetStmtAttr to set the rowsize, will always set it to 20 in this example. NOTE: That at the moment, this information will be lost if ODBCConfig is used Release 2.0.8 2001-06-25 * Add definition of alphasort and checks for location of dir.h in the txt driver. * Add some missing functions from cur lib * Fix a problem in configure.in that was loosing LIB settings * Remove C++ comment from sqlext.h * sqp: now makes use of check for NOT NULL in CREATE TABLE * sqp: fixed missing pointer assignment (affected CREATE TABLE) * sqp: added more debugging messages (but turned off by default) * odbctxt: removed long log message (would cause seg fault) * odbctxt: now appends a space to each SQL statement; this is to work around a problem in the sqp lexer when last char is close quote * Fixed a bug in the driver manager that would fail if the driver returned a max size error message * sqp: now makes use of IS NULL and IS NOT NULL * sqp: now makes use of INSERT INTO table(col1,...) * sqp: now makes use of LIKE and NOT LIKE (with optional ESCAPE) * sqp: now makes use of any mix of AND, OR, () in WHERE clause * sqp: now makes use of ? for column value (used in SQLBindParameter) * sqp: now makes use of integers for column values (just mapped to string) * odbctxt: basic implementation of SQLBindParameter (only SQL_C_CHAR input allowed) * odbctxt: new syntaxes of sqp parser taken into account * odbctxt: new option CaseSensitive (Yes or No) allowed in .odbc.ini file * odbctxt: fix message length returned in SQLGetDiagRec function * odbctxt: drop statement when freeing it via SQLFreeHandle * sqp: default string length changed to 255 * Fix threading problem when multiple ENV's are in use Release 2.0.7 Peter Harvey And Nick Gorham 2001-06-06 * ODBCConfig/DataManager: Updates for Qt 3.0 * Add extra decoding of types in the log output * Fix some type problems for 64 bit platforms * Fix rogue logging in SQLGetInfo * Add correlation and alias to sqp * Add some fixes to the txt driver to enable it to work with StarOffice * Stop Ctrl-D from Segfaulting isql * Add a example autotest to the build * Make isql detect the EOF when not using readline * Tidy up the libs from autoconf * DataManager: refinements such as; logout a DSN, isql history * sqp: CREATE TABLE now supports most data types and some column options * sqp: added DROP TABLE * sqp: added ORDER BY * sqp: enhanced api with sqpOpen, sqpClose... * odbctxt: checked in rewrite (much less code now) * odbctxtS: added setup lib for odbctxt * ODBCConfig: Stats now shows PIDs * Add missing -lpthread in configure (thanks Jon Kåre Hellan) * Remove C++ comments from autotest.h * Fix big in Postgres7.1 with binding a column to a double (thanks Jürgen) * Update libtool to 1.4 * Fix problem that looked like a restriction on the size of ini files, but was actually a problem when the same section appeared twice in a file * Add VMS port (Thanks Jason) * Add extra PG7.1 numeric fix (Thanks Zoltan) * Add fix to PG7.1 to allow the retrieval of more than 8K blobs, adjust the define TEXT_FIELD_SIZE in psqlodbc.h (Thanks Bojnourdi) * Fix small typo in SQLConnect (Thanks Martin) * The postgres drivers didn't recognise "Yes" in the ini files, only 1 or 0, fixed now * Avoid "broken pipe" message with postgres (Thanks Gary) * Alter check if cursor lib needed with ODBC 3 apps * Fix couple of bugs with cursor lib * Get to build on Mac OS X (without GUI bits ATM) look at README.OSX for help and hints * Fix for use with QT 3 * Remove default trace option from ODBCINSTConstructProperties * Stop ODBCConfig from accepting null DSN names Release 2.0.6 Nick Gorham 2001-04-18 * Add define for _THREAD_SAFE to help AIX builds * Fix bug in cursor lib introduced by UNICODE addon's * Make the header definitions work on 64 bit platforms * Fix a incorrect return from SQLConnect with pooling * Add support for unicode drivers that have ANSI functions renamed to the unicode versions (duh!). * If pooling, then set the flag to not close the driver handle (DontDLClose) * Add CPTimeToLive option to restrict the number of times a driver will be reused (useful with leaky drivers) * Alter logging, and support setting logging via SQLSetConnectAttr call * Add a AutoTest facility to odbctest * Fix incorrect error test in SQLBrowseConnect * Check descriptor is for a open connection * More unicode fixes Release 2.0.5 2001-03-21 Nick Gorham * Add extra autoconf checks for -pthread and -mt compiler options * Add Postgres7.1 tree for code from new postgres development * Fix retrieval of errors for SQLTables and SQLColumns call in isql * Fix mem leak in DM if SQLDisconnect was called with open statements or descriptors * Fix broken check if readline needs -lcurses * Add setup lib for SAPDB (thanks Holger Schurig) * Added locale fixes to PG7.1 driver (thanks Zoltan) * Fix configure problem on Solaris Release 2.0.4 2001-02-02 Nick Gorham * Changes to Postgres driver for operation with PG 7 and locale changes (Zoltan Boszormenyi) * Fix problem with SQLSetConnectAttr and unicode operation * Apply patch to DataManager from Christian.Werner which fixes truncated query result rows, formatting errors in HTML output, and adds a leading blank to each where expression in order to prevent SQL syntax errors in e.g. LIKE '..' or MATCHES '..'cases. * Add support for SQLDriverLoad and SQLDriverUnload functions Release 2.0.3 2001-01-13 Peter Harvey and Nick Gorham * sqp: added a yywrap() to eliminate link dependency * sqi: home dir default if no path with database file name * sqi: creates database file if not exists * ini: open fails if existing file appears not be an ini * Fixed problem where null row status array could be passed into SQLExtendedFetch * Fixed further bug in unicode_to_ansi (thanks Martin Edlman) * Fixed bug in UNICODE converison in SQLGetInfo * Added sqi/test to build tree, its moved to exe * Add extra checks for readline to see if -lcurses is needed * Add check for -lpthreads that should be ok on Tru64 * Replace printf with puts in isql to cope with columns containing '%' Release 2.0.2 2001-01-08 Peter Harvey * ODBCConfig: Repurposed 'Tracing' tab. Now is 'Advanced' and contains both Tracing and Pooling options. * Fixed bug in __info that caused SQLGetDiagRec to fail Release 2.0.1 2001-01-06 Nick Gorham * Fix bug introduced with UNICODE that corrupted the SQLSTATE from SQLError Release 2.0.0 2001-01-04 Nick Gorham * Added table browse for DataManager * Fix problem in template driver with Solaris compiler * Add msql-include option to specify search path * Fix compile problem in MiniSQL code with Solaris compiler * Fix conditional include of strings.h in ODBCConfig build * Fix tracing in SQLConnect * Alter check for DSN length in SQLConnect * Validate input handle before setting output handle * Fix error code from SQLSpecialColumns and null table names * Fix potential deadlock in SQLFreeHandle * Add change to make the Postgres driver look for the local socket in two places to cope with debian distrib * Fiddle with the MiniSQL searching again * Add sqlucode.h to headers * Fix threaded race condition in __handles.c * Revamped Credits page in ODBCConfig. * Show more useful info in DataManager tree-view * Fixed problem with DataManager 'hanging' upon exit * Added -pthread option to gcc calls when needed * Now needs QT 2.2.x, changed configure to check * Add missing identifier_type in SQLSpecialColumns log * Add some checks for long columns in isql and DataManager * Add connection pooling support to driver manager * ODBCConfig; Code cleanup. Removed extra class layer created by QtArch * ODBCConfig.Drivers.Config; driver specific options now accepted, if already exist in odbcinst.ini, as simple text fields in GUI * ODBCConfig and DataManager now attempt to save and restore state... such as window geometry. * ODBCConfig now supports connection pooling options. * ODBCConfig now has a Stats tab which is similar to CPU or mem monitor. This will be improved upon and the code will likley make its way into a dock widget * Add UNICODE support * Disable the default building of static libs * Add support for GNU portable threads Release 1.8.13 2000-11-14 Nick Gorham * Add missing line continuation char in SQLGetDiagField.c * Add fix to SQLGetDiagField to return the server name on statements and descriptors * Remove -lcrypt from all but the Postgres driver build * Remove CR/LF expansion in Postgres driver * odbctest was calling SQLPrimaryKeys when it should have been calling SQLTablePrivileges * Add SQL_DRIVER_HDESC support to SQLGetInfo * Add display of returned error text in log file * Take notice of DontDLClose when calling ConfigDataSource. * Fix duplicated log messages on failed connect * Fix incorrect arg to SQLError, change from SQLINTEGER to SQLSMALLINT (Thanks Ralf) * Updated libtool to 1.3.5 * Fixed crash in SQLConnect when NULL server and SQL_NTS passed in (Thanks Venu for the next four changes) * The error code mapping was wrong, it should only map ODBC 3 errors to ODBC 2, not the other way around * Fixed a incorrect error return in SQLPrepare when a NULL string was passed * Zero the handles when released, just to avoid reuse of values * Added readline support to isql, (thanks Tomas Zellerin) * Support the setting of SQL_AUTOCOMMIT before connecting * Fixed bug in odbctest's SQLColAttributes call * Add test in configure for localtime_r and use if present 2000-08-18 Nick Gorham Release 1.8.12 * Fix typo in Postgres driver. * Add i18n support to the Postgres driver (thanks Zoltan) * Remove fix for Postgres driver and large objects, it breaks the SQLColumns call :-( Release 1.8.11 2000-08-16 Nick Gorham * Add --enable-fastvalidate option. This reduces the safety of the handle checking but improves performance when using many handles * If SQLDriverConnect is called with a NULL con_str_in look for the DEFAULT DSN entry * Remove a underscore from odbcinst_system_file_path, it seem's to cause the linker on AIX to have problems * Remove some additional C++ comments from the postgres driver * Call SQLSetConfigMode before calling SQLConfigDataSource * Fix error handling in case of referential integrity violations in Postgres driver * Fix problem with SQLColAttributes swapping its args, and don't check the driver version before mapping to ODBC 3 values. (thanks Tomas) * Make SQLDescribeParam work in state S4 and above, when in ODBC 2 mode * Avoid potential buffer overrun in __info.c when reporting errors from SQLConnect/SQLDriverConnect * Fix potential mem corruption in SQLGetDiagField (thanks Jay) * Add fix to allow the Postgres driver to receive large objects (thanks Bill) * Fix buffer overrun in SQLGetDiagField (thanks again Jay) * Fix for SQLGetDiagField(SQL_DIAG_SUBCLASS_ORIGIN) returning a null string, it now returns something meaningful * The Postgres driver didn't shupdown the connection to the database before dropping the socket * Fix incorrect return from SQLDataSources * Make SQLDriverConnect return all errors from the driver not just the first one * Add Oracle setup lib for http://www.easysoft.org/projects/oracle * Stop isql calling SQLFetch if the query doesn't generate a result set. This stops the function sequence error * Add missing break in postgres password authentication * Add fix in SQLTables for broken version of EXCEL * Fix a bug that caused SQLTransact to fail if called with a connection handle in state C4. This caused Corel Paradox to fall over Release 1.8.10 2000-06-15 Nick Gorham * Add some fixes to make it work and compile on IRIX (Murad) * Add a couple of missing casts in odbctest (Michael) * Fix BOOL bug in postgres driver (Dmitriy) * use setenv rather that putenv if available * Fix a couple of bugs in odbctest/attr.cpp * Fix problem where info warnings could be lost * Fix a couple of problems in the Postgres driver * Fix bug that caused a success with info message from SQLExecute or SQLExecDirect to be lost if used with a ODBC 3 driver and the application called SQLGetDiagRec * Fix problem where bookmarks were failing for StarOffice 5.2 * Stop SQLDriverConnect dumping core when passed a null dsn string * Map ODBC 2 SQLSTATE values to ODBC 3 * Add missing odbcconfig.h to the install include in gODBCConfig * Fix incorrect state from Postgres Driver * Fix integer length problem with SQLExtendedFetch that manifested on big endian platforms (Sparc,Aix,HPUX etc) (Alex) * Avoid clash with definition of CHAR in GNOME XML layer * odbctest SQLExtendedFetch was using the wrong orentation value * Add define for SQLTCHAR * Fix problem in setting tracing on, and a core dump when loading the cursor lib failed (Steve) Release 1.8.9 2000-06-13 Nick Gorham * Fix a State problem when coming out of a SQLParamData cycle * Fix bug where SQLBrowseConnect may leave a connection in C1 not C2 * Pass LOGIN_TIMEOUT onto driver if it is set before the connect * Reverse the test to set DIAG_CLASS_ORIGIN * Return SQL_DIAG_SERVER_NAME and SQL_DIAG_RETURNCODE * Allow explicit allocation of Descriptors * Fix a problem with the SQLFetchScroll -> SQLExtendedFetch mapping * Fix a problem in the MiniSQL Makefile.am * Call SQLSetConfigMode before calling ConfigDSN * Fix problem in SQLCopyDesc and complete case when DM does the work * Return SQL_SUCCESS_WITH_INFO messages from SQLConnect * Added MetaDataBlockFetch connection attribute to esoob driver * Fix bug in __info.c that caused a small memory corruption when logging was on * Enable the reporting of errors on descriptors * Fix extra ] in the msql part of configure.in * Add error reporting to DataManager (Tim) * Assorted fixes to text driver (Peter) * odbctest now ready to use (hopefully) 2000-05-03 Nick Gorham * Fix bug in configure.in where disabling build of drivers also disabled build of GUI bits. * SQLDataSources should return the Driver Description, not the data source description * Add partly written odbctest GUI to project * Remove conditional around VOID typedef in sqltypes.h by default Release 1.8.8 2000-04-27 Nick Gorham * Add extra include for unixware * Added some fixes to the template driver found by Nikolai Afanasiev, and also fix the logging code to recongnise 'On' * Alter distrib to not include moc generated files * Using the env var ODBCHOME was a "real bad idea" for perl I have changed it to ODBCSYSINI * Alter logging so that if the log file fails to open stderr is not used. This caused problems in server processes. * Fix a problem with SQLDrivers * Fix a potential leak, that stopped SQLDisconnect being called * Fix problems with text driver * Improve isql (thanks Ralf) * Make gODBCConfig a proper gtk widget * Remove stray printf in the DM code * Fix a couple of daft bugs, thanks to Tim Roepken * Fix a problem where handles were not being free'd * Fix a problem that stopped StarOffice 5.2 working with a ODBC 2 driver, it failed to set SQLGetDiagRec in the output of SQLGetFunctions 2000-03-11 Nick Gorham * Adjust configure to check for limits, and use this to find max file path. It was only 14 char before under HP-UX * Make ODBCCOnfig try calling SQLConfigureDSN, for setup libs that can do it themself * Make the mutex functions static * Remove some unwanted X functions from the lib line * Remove dlfcn.h in ODBCConfig * Rationalise environment vars, ODBCHOME points to where odbc.ini and odbcinst.ini are. ODBCINI points to the user ini file (normally ~/.odbc.ini) * Fix bug causing all connection errors to be lost after connecting * Add GTK+ Based gODBCConfig 2000-03-01 Nick Gorham * Add extra defines to sqltypes.h * Fix bug in the Postgres driver with the use if the SQL_DATA_AT_EXEC value * Replace the ODBCINI with ODBCHOME environment var 2000-02-23 Nick Gorham * Remove the GLOBAL flag from the dlopen in the libtool lib. This caused problems with perl DBD::ODBC * Fix the support for threads and Solaris * Add odbcinst.ini flag to disable unloading the driver, this enables the IBM DB2 lib to be used Release 1.8.6 2000-02-21 Nick Gorham * Fix memory leak in the Postgres driver * Fix a bug in the DM when using threads and ODBC 3 drivers, SQLGetDiagField fails * Fix a situation where PHP can crash the DM by calling SQLFreeStmt after SQLDisconnect * Add support for Solaris Threada * Make building with thread support the default 2000-02-12 Nick Gorham * Add option to use ODBCINI to move the odbcinst and odbc ini file. This was asked for by applix * Add setup lib for Easysoft ODBC-ODBC bridge 2000-02-02 Nick Gorham * Add flag in odbcinst.ini to disable the SQLFetch -> SQLExtendedFetch mapping for broken drivers * Alter the ini file parsing so the right hand side can contain extra ='s * Fix a bug in SQLGetStmtAttr with a missing '&' * Added a couple of patches from Manush to improve working with the solid driver Release 1.8.4 2000-01-18 Nick Gorham * Fix bug in SQLAllocHandle where a failed stmt alloc would report a error on the statement not the connection and dump core * Make the default path when adding a driver in ODBCConfig $prefix\lib * Add the missing [unixODBC] prefix to error messages * Fix a problem in template/SQLDriverConnect found by Charles Overbeck * Update to libtool 1.3.4 * Fix problem in ODBCConfig where a cast to const char * was needed Release 1.8.3 1999-12-28 Nick Gorham * Fix a bug where a SQLDisconnect was not releasing the lib handle 1999-12-11 Nick Gorham * Merge in changes from the Postgres ODBC people to fix a problem with LONGBIN's * Mask out the password fields in log for SQLConnect and SQLDriverConnect * Change a incorrent HY004 error return to IM004 in SQLConnect Release 1.8.2 For AlphaLinux Distribution 1999-12-02 Nick Gorham * Fix some daft mistakes in odbcinst.c, and the template driver * Remove the C++ comments from the Postgres driver so it can be compiled with a C compiler * Add LIBSOCKET to the Postgres driver link line * Add strncasecmp to extras * Make the Postgres driver use the socket lib if needed 1999-11-23 Nick Gorham * Add support for encrypted passwords in the Postgre driber * Remove some remaining non-libtool dlopen code * Fix some threading problems 1999-11-19 Nick Gorham Release 1.8.1 ********** * Make the code more portable * Remove CR from Postgres source 1999-11-17 Nick Gorham * Fix a bug with the ODBC 3 error functions. * Fix a missing function_entry from SQLExecDirect(). Release 1.8 ************* 1999-11-13 Nick Gorham * Fix bug with logging that killed StarOffice * Upgrade the Postgres driver to 6.4.6, this fixes a problem with fields containing cr/lf combinations. * Change the logging so that the logging info comes from a special [ODBC] section in odbcinst.ini. This means that what goes on before the connect can be logged 1999-11-10 Nick Gorham * Make SQLError,SQLGetDiagField and SQLGetDiagRec usable with all versions of application and driver. * Add configure flag to specify where to look for the MiniSQL lib. * Add configure flag to disable the building of the drivers. 1999-11-02 Nick Gorham * Fix bug in the cursor lib introduced by the fix for the glibc bugs. * Fix bug where SQLSetConnectAttr/Option can return without clearing a connection thread lock. 1999-10-29 Nick Gorham * Make the postgres driver able to connect via UNIX domain sockets 1999-10-29 Holger Bischoff * Assorted stupid bugs fixed in the DM 1999-10-26 Nick Gorham * Started rewrite of the SQLError/SQLGetDiagSupport in the driver manager * Fix isql so that SQL_SUCCESS_WITH_INFO is a success for SQLConnect 1999-10-20 Greg Bentz * Added fix for SQLTransact, it was checking for a non null henv first, it now checks the hdbc first (Thanks Greg) * The connection_count in the environment handle was only incremented on the first connection, but decremented on all free dbc's, this caused the count to go negative at time. 1999-10-09 Nick Gorham * Added Manush's patch to map ODBC 3-2 datetime values 1999-10-05 Nick Gorham * working on getting the build to be more portable * added --enable-gui configure option to turn off all c++ and GUI bits * improved performance by removing logging core when logging is off * added extras dir to contain code for missing functions on certain platforms * first day out for the cursor lib, read only at the moment, a sample program is included in samples/cursor.c * fixed problem that if the user .odbc.ini was not found the code failed to go on to the system odbc.ini * fixed problem caused by some versions of dlsym reporting function that should be in the driver and returning the entry from the DM Release 1.7 ************* 1999-07-26 Nick Gorham * New config added, now using autoconf. * Thread safe support added. * Assorted Driver Manager bug fixes added. * default location for odbcinst.ini and odbc.ini is now /usr/local/etc to conform to GNU standards. 1999-05-15 Peter Harvey * Drivers: nn driver added 1999-05-10 Nick * DM: New Dm added. 1999-04-04 Martin Evans * Makefiles: Some changes to; a) use gcc, and b) build into other than /usr 1999-03-30 Peter Harvey * ChangeLog: Started ChangeLog unixODBC-2.3.9/m4/0000755000175000017500000000000013725127167010474 500000000000000unixODBC-2.3.9/m4/ltversion.m40000644000175000017500000000127313725127167012706 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) unixODBC-2.3.9/m4/ltdl.m40000644000175000017500000007251613725127167011630 00000000000000# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- # # Copyright (C) 1999-2008, 2011-2015 Free Software Foundation, Inc. # Written by Thomas Tanner, 1999 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 20 LTDL_INIT # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) # ------------------------------------------ # DIRECTORY contains the libltdl sources. It is okay to call this # function multiple times, as long as the same DIRECTORY is always given. AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ])# LT_CONFIG_LTDL_DIR # We break this out into a separate macro, so that we can call it safely # internally without being caught accidentally by the sed scan in libtoolize. m4_defun([_LT_CONFIG_LTDL_DIR], [dnl remove trailing slashes m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) m4_case(_LTDL_DIR, [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply '.' m4_if(_ARG_DIR, [.], [], [m4_define([_LTDL_DIR], _ARG_DIR) _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], [m4_if(_ARG_DIR, _LTDL_DIR, [], [m4_fatal([multiple libltdl directories: ']_LTDL_DIR[', ']_ARG_DIR['])])]) m4_popdef([_ARG_DIR]) ])# _LT_CONFIG_LTDL_DIR # Initialise: m4_define([_LTDL_DIR], []) # _LT_BUILD_PREFIX # ---------------- # If Autoconf is new enough, expand to '$(top_build_prefix)', otherwise # to '$(top_builddir)/'. m4_define([_LT_BUILD_PREFIX], [m4_ifdef([AC_AUTOCONF_VERSION], [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], [$(top_build_prefix)], [$(top_builddir)/])], [$(top_build_prefix)])], [$(top_builddir)/])[]dnl ]) # LTDL_CONVENIENCE # ---------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with # '$(top_build_prefix)' if available, otherwise with '$(top_builddir)/', # and LTDLINCL will be prefixed with '$(top_srcdir)/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_build_prefix, top_builddir, and top_srcdir appropriately # in your Makefiles. AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_CONVENIENCE # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) # _LTDL_CONVENIENCE # ----------------- # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). m4_defun([_LTDL_CONVENIENCE], [case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL=$LTDLINCL AC_SUBST([INCLTDL]) ])# _LTDL_CONVENIENCE # LTDL_INSTALLABLE # ---------------- # sets LIBLTDL to the link flags for the libltdl installable library # and LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl # is not found, LIBLTDL will be prefixed with '$(top_build_prefix)' if # available, otherwise with '$(top_builddir)/', and LTDLINCL will be # prefixed with '$(top_srcdir)/' (note the single quotes!). If your # package is not flat and you're not using automake, define top_build_prefix, # top_builddir, and top_srcdir appropriately in your Makefiles. # In the future, this macro may have to be called after LT_INIT. AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_INSTALLABLE # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) # _LTDL_INSTALLABLE # ----------------- # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). m4_defun([_LTDL_INSTALLABLE], [if test -f "$prefix/lib/libltdl.la"; then lt_save_LDFLAGS=$LDFLAGS LDFLAGS="-L$prefix/lib $LDFLAGS" AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) LDFLAGS=$lt_save_LDFLAGS if test yes = "${lt_lib_ltdl-no}"; then if test yes != "$enable_ltdl_install"; then # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install AC_MSG_WARN([not overwriting libltdl at $prefix, force with '--enable-ltdl-install']) enable_ltdl_install=no fi elif test no = "$enable_ltdl_install"; then AC_MSG_WARN([libltdl not installed, but installation disabled]) fi fi # If configure.ac declared an installable ltdl, and the user didn't override # with --disable-ltdl-install, we will install the shipped libltdl. case $enable_ltdl_install in no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; *) enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" ;; esac AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL=$LTDLINCL AC_SUBST([INCLTDL]) ])# LTDL_INSTALLABLE # _LTDL_MODE_DISPATCH # ------------------- m4_define([_LTDL_MODE_DISPATCH], [dnl If _LTDL_DIR is '.', then we are configuring libltdl itself: m4_if(_LTDL_DIR, [], [], dnl if _LTDL_MODE was not set already, the default value is 'subproject': [m4_case(m4_default(_LTDL_MODE, [subproject]), [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) _LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir])], [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir; lt_libobj_prefix=$lt_ltdl_dir/])], [recursive], [], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl dnl Be careful not to expand twice: m4_define([$0], []) ])# _LTDL_MODE_DISPATCH # _LT_LIBOBJ(MODULE_NAME) # ----------------------- # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead # of into LIBOBJS. AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ])# _LT_LIBOBJS # LTDL_INIT([OPTIONS]) # -------------------- # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. If the shipped ltdl sources are not in a # subdirectory named libltdl, the directory name must be given by # LT_CONFIG_LTDL_DIR. AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test yes != "$with_included_ltdl"; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: '$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: '$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR(['--with-ltdl-include' and '--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL=-I$with_ltdl_include ;; esac INCLTDL=$LTDLINCL # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ])# LTDL_INIT # Old names: AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIB_LTDL], []) dnl AC_DEFUN([AC_WITH_LTDL], []) dnl AC_DEFUN([LT_WITH_LTDL], []) # _LTDL_SETUP # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. This is a public # interface mainly for the benefit of libltdl's own configure.ac, most # other users should call LTDL_INIT instead. AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([LT_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's|^[[ ]]*||;s|[[ :]].*$||'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ])# _LTDL_SETUP # _LT_ENABLE_INSTALL # ------------------ m4_define([_LT_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) case ,$enable_ltdl_install,$enable_ltdl_convenience in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac m4_ifdef([AM_CONDITIONAL], [AM_CONDITIONAL(INSTALL_LTDL, test no != "${enable_ltdl_install-no}") AM_CONDITIONAL(CONVENIENCE_LTDL, test no != "${enable_ltdl_convenience-no}")]) ])# _LT_ENABLE_INSTALL # LT_SYS_DLOPEN_DEPLIBS # --------------------- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this 'case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; bitrig*) lt_cv_sys_dlopen_deplibs=yes ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say 'no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to 'yes'. Without it, it would be 'no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say 'yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test yes != "$lt_cv_sys_dlopen_deplibs"; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# LT_SYS_DLOPEN_DEPLIBS # Old name: AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) # LT_SYS_MODULE_EXT # ----------------- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi if test -n "$shared_archive_member_spec"; then m4_pattern_allow([LT_SHARED_LIB_MEMBER])dnl AC_DEFINE_UNQUOTED([LT_SHARED_LIB_MEMBER], ["($shared_archive_member_spec.o)"], [Define to the shared archive member specification, say "(shr.o)".]) fi ])# LT_SYS_MODULE_EXT # Old name: AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) # LT_SYS_MODULE_PATH # ------------------ AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var=$shlibpath_var]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ])# LT_SYS_MODULE_PATH # Old name: AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) # LT_SYS_DLSEARCH_PATH # -------------------- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path=$dir else sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ])# LT_SYS_DLSEARCH_PATH # Old name: AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) # _LT_CHECK_DLPREOPEN # ------------------- m4_defun([_LT_CHECK_DLPREOPEN], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test yes = "$libltdl_cv_preloaded_symbols"; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# _LT_CHECK_DLPREOPEN # LT_LIB_DLLOAD # ------------- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required"; then LIBADD_DLOPEN=-ldl fi libltdl_cv_lib_dl_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" then lt_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS=$lt_save_LIBS fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD=-ldld])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) LIBS=$lt_dlload_save_LIBS AC_LANG_POP ])# LT_LIB_DLLOAD # Old name: AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLLIB], []) # LT_SYS_SYMBOL_USCORE # -------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ])# LT_SYS_SYMBOL_USCORE # Old name: AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) # LT_FUNC_DLSYM_USCORE # -------------------- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([_LT_COMPILER_PIC])dnl for lt_prog_compiler_wl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl for lt_cv_sys_symbol_underscore AC_REQUIRE([LT_SYS_MODULE_EXT])dnl for libltdl_cv_shlibext if test yes = "$lt_cv_sys_symbol_underscore"; then if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown dlsym_uscore_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" libname=conftmod # stay within 8.3 filename limits! cat >$libname.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; }] _LT_EOF # ltfn_module_cmds module_cmds # Execute tilde-delimited MODULE_CMDS with environment primed for # $module_cmds or $archive_cmds type content. ltfn_module_cmds () {( # subshell avoids polluting parent global environment module_cmds_save_ifs=$IFS; IFS='~' for cmd in @S|@1; do IFS=$module_cmds_save_ifs libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. major=; versuffix=; verstring=; deplibs= ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= eval $cmd done IFS=$module_cmds_save_ifs )} # Compile a loadable module using libtool macro expansion results. $CC $pic_flag -c $libname.$ac_ext ltfn_module_cmds "${module_cmds:-$archive_cmds}" # Try to fetch fnord with dlsym(). libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 cat >conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifndef RTLD_GLOBAL # ifdef DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # else # define RTLD_GLOBAL 0 # endif #endif #ifndef RTLD_NOW # ifdef DL_NOW # define RTLD_NOW DL_NOW # else # define RTLD_NOW 0 # endif #endif int main () { void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); int status = $libltdl_dlunknown; if (handle) { if (dlsym (handle, "fnord")) status = $libltdl_dlnouscore; else { if (dlsym (handle, "_fnord")) status = $libltdl_dluscore; else puts (dlerror ()); } dlclose (handle); } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null libltdl_status=$? case x$libltdl_status in x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; x*) libltdl_cv_need_uscore=unknown ;; esac fi rm -rf conftest* $libname* LIBS=$dlsym_uscore_save_LIBS ]) fi fi if test yes = "$libltdl_cv_need_uscore"; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# LT_FUNC_DLSYM_USCORE # Old name: AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) unixODBC-2.3.9/m4/lt~obsolete.m40000644000175000017500000001377413725127167013244 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) unixODBC-2.3.9/m4/ltargz.m40000644000175000017500000000501113725127167012156 00000000000000# Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004-2007, 2011-2015 Free Software Foundation, Inc. # Written by Gary V. Vaughan # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 1 ltargz.m4 AC_DEFUN([LT_FUNC_ARGZ], [ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for 'error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) LT_ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [LT_ARGZ_H=lt__argz.h; AC_LIBOBJ([lt__argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$LT_ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test yes = "$lt_cv_sys_argz_works"], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [LT_ARGZ_H=lt__argz.h AC_LIBOBJ([lt__argz])])]) AC_SUBST([LT_ARGZ_H]) ]) unixODBC-2.3.9/m4/libtool.m40000644000175000017500000112507313725127167012333 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS unixODBC-2.3.9/m4/argz.m40000755000175000017500000000506713230101055011607 00000000000000# Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004-2007, 2011-2013 Free Software Foundation, Inc. # Written by Gary V. Vaughan # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 argz.m4 AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for 'error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test yes = "$lt_cv_sys_argz_works"], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [ARGZ_H=argz.h AC_LIBOBJ([argz])])]) AC_SUBST([ARGZ_H]) ]) # Prerequisites of lib/argz.c. AC_DEFUN([gl_PREREQ_ARGZ], [:]) unixODBC-2.3.9/m4/ltoptions.m40000644000175000017500000003426213725127167012720 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) unixODBC-2.3.9/m4/ltsugar.m40000644000175000017500000001044013725127167012336 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) unixODBC-2.3.9/README.SOLARIS0000755000175000017500000000266512262474476012106 00000000000000Building unixODBC on Solaris ---------------------------- This should just work, however I have had the following helpfull hints sent to me by David Brown of Starquest. The suggested change has been made to the code in __info.c "Last fall, I had problems running on Solaris 7, because my system did have an iconv conversion between ISO8859-1 and UCS-2. I discovered two things: * the missing iconv tables are available by a patch for Solaris 7 (there is also a corresponding patch for Solaris 8, that fixes a lot in this area - seems recommended to use that as well) * Solaris uses the name 8859-1 in its tables rather than ISO8859-1 or ISO-8859-1. So what I've done is: 1) make the following change to DriverManager/__info.c: diff __info.c __info.c.orig 385c385 < char *asc[] = { "char", "ISO8859-1", "ISO-8859-1", "8859-1", "ASCII", NULL }; --- >> char *asc[] = { "char", "ISO8859-1", "ISO-8859-1", "ASCII", NULL }; 2) tell customers to apply the following Solaris patches: Solaris 7: Patch-ID# 112689-02 Keywords: UTF-8 ICONV Synopsis: SunOS 5.7: UTF-8 locale ICONV patch Date: Aug/28/2002 Solaris 8: Patch-ID# 113261-01 Keywords: UTF-8 ICONV Synopsis: SunOS 5.8: UTF-8 locale ICONV patch Date: Oct/11/2002 this has since been superceded by 11326-02, but I think unixODBC should function fine with 113261-01 Patch-ID# 113261-02 Keywords: UTF-8 ICONV Synopsis: SunOS 5.8: UTF-8 locale ICONV patch Date: Feb/21/2003" unixODBC-2.3.9/vms/0000775000175000017500000000000013725127520010754 500000000000000unixODBC-2.3.9/vms/odbc_setup.com0000755000175000017500000000077312262474476013545 00000000000000$ whoami = f$parse(f$environment("PROCEDURE"),,,,"NO_CONCEAL") $ whereami = f$parse(whoami,,,"DEVICE") + f$parse(whoami,,,"DIRECTORY") - ".][000000]" - "][" - ".]" - "]" + "]" $ define ODBC_LIBDIR 'whereami' $! $ file_loop: $ file = f$search("ODBC_LIBDIR:*ODBC*.EXE") $ if file .eqs. "" then goto file_loop_end $ image_name = f$parse(file,,,"NAME") $ define 'f$edit(image_name,"UPCASE")' "ODBC_LIBDIR:''image_name'.EXE" $ goto file_loop $ file_loop_end: $! $ isql :== $ODBC_LIBDIR:ISQL.EXE $ exit unixODBC-2.3.9/vms/odbc2_axp.opt0000755000175000017500000000303212262474476013272 00000000000000LIBODBCINST.EXE/SHARE CASE_SENSITIVE=YES SYMBOL_VECTOR = (SQLAllocConnect=PROCEDURE,- SQLAllocEnv=PROCEDURE,- SQLAllocStmt=PROCEDURE,- SQLBindCol=PROCEDURE,- SQLBindParameter=PROCEDURE,- SQLBrowseConnect=PROCEDURE,- SQLCancel=PROCEDURE,- SQLColAttributes=PROCEDURE,- SQLColumnPrivileges=PROCEDURE,- SQLColumns=PROCEDURE,- SQLConnect=PROCEDURE,- SQLDescribeCol=PROCEDURE,- SQLDescribeParam=PROCEDURE,- SQLDisconnect=PROCEDURE,- SQLDriverConnect=PROCEDURE,- SQLError=PROCEDURE,- SQLExecDirect=PROCEDURE,- SQLExecute=PROCEDURE,- SQLExtendedFetch=PROCEDURE,- SQLFetch=PROCEDURE,- SQLForeignKeys=PROCEDURE,- SQLFreeConnect=PROCEDURE,- SQLFreeEnv=PROCEDURE,- SQLFreeStmt=PROCEDURE,- SQLGetConnectOption=PROCEDURE,- SQLGetCursorName=PROCEDURE,- SQLGetData=PROCEDURE,- SQLGetFunctions=PROCEDURE,- SQLGetInfo=PROCEDURE,- SQLGetStmtOption=PROCEDURE,- SQLGetTypeInfo=PROCEDURE,- SQLMoreResults=PROCEDURE,- SQLNativeSql=PROCEDURE,- SQLNumParams=PROCEDURE,- SQLNumResultCols=PROCEDURE,- SQLParamData=PROCEDURE,- SQLParamOptions=PROCEDURE,- SQLPrepare=PROCEDURE,- SQLPrimaryKeys=PROCEDURE,- SQLProcedureColumns=PROCEDURE,- SQLProcedures=PROCEDURE,- SQLPutData=PROCEDURE,- SQLRowCount=PROCEDURE,- SQLSetConnectOption=PROCEDURE,- SQLSetCursorName=PROCEDURE,- SQLSetPos=PROCEDURE,- SQLSetScrollOptions=PROCEDURE,- SQLSetStmtOption=PROCEDURE,- SQLSpecialColumns=PROCEDURE,- SQLStatistics=PROCEDURE,- SQLTablePrivileges=PROCEDURE,- SQLTables=PROCEDURE,- SQLTransact=PROCEDURE) unixODBC-2.3.9/vms/odbcinst_axp.opt0000755000175000017500000000162012262474476014107 00000000000000CASE_SENSITIVE=YES SYMBOL_VECTOR = (- _SQLDriverConnectPrompt=PROCEDURE,- SQLManageDataSources=PROCEDURE,- SQLCreateDataSource=PROCEDURE,- SQLGetTranslator=PROCEDURE,- SQLInstallDriverManager=PROCEDURE,- SQLGetInstalledDrivers=PROCEDURE,- SQLGetAvailableDrivers=PROCEDURE,- SQLConfigDataSource=PROCEDURE,- SQLWriteDSNToIni=PROCEDURE,- SQLRemoveDSNFromIni=PROCEDURE,- SQLValidDSN=PROCEDURE,- SQLWritePrivateProfileString=PROCEDURE,- SQLGetPrivateProfileString=PROCEDURE,- SQLRemoveDriverManager=PROCEDURE,- SQLRemoveTranslator=PROCEDURE,- SQLRemoveDriver=PROCEDURE,- SQLConfigDriver=PROCEDURE,- SQLInstallerError=PROCEDURE,- SQLPostInstallerError=PROCEDURE,- SQLWriteFileDSN=PROCEDURE,- SQLReadFileDSN=PROCEDURE,- SQLInstallDriverEx=PROCEDURE,- SQLInstallTranslatorEx=PROCEDURE,- SQLGetConfigMode=PROCEDURE,- SQLSetConfigMode=PROCEDURE,- odbcinst_system_file_name=PROCEDURE,- odbcinst_system_file_path=PROCEDURE) unixODBC-2.3.9/vms/odbc_axp.opt0000755000175000017500000000452012262474476013213 00000000000000LIBODBCINST.EXE/SHARE CASE_SENSITIVE=YES SYMBOL_VECTOR = (SQLAllocConnect=PROCEDURE,- SQLAllocEnv=PROCEDURE,- SQLAllocHandle=PROCEDURE,- SQLAllocHandleStd=PROCEDURE,- SQLAllocStmt=PROCEDURE,- SQLBindCol=PROCEDURE,- SQLBindParam=PROCEDURE,- SQLBindParameter=PROCEDURE,- SQLBrowseConnect=PROCEDURE,- SQLBulkOperations=PROCEDURE,- SQLCancel=PROCEDURE,- SQLCloseCursor=PROCEDURE,- SQLColAttribute=PROCEDURE,- SQLColAttributes=PROCEDURE,- SQLColumnPrivileges=PROCEDURE,- SQLColumns=PROCEDURE,- SQLConnect=PROCEDURE,- SQLCopyDesc=PROCEDURE,- SQLDataSources=PROCEDURE,- SQLDescribeCol=PROCEDURE,- SQLDescribeParam=PROCEDURE,- SQLDisconnect=PROCEDURE,- SQLDriverConnect=PROCEDURE,- SQLDrivers=PROCEDURE,- SQLEndTran=PROCEDURE,- SQLError=PROCEDURE,- SQLExecDirect=PROCEDURE,- SQLExecute=PROCEDURE,- SQLExtendedFetch=PROCEDURE,- SQLFetch=PROCEDURE,- SQLFetchScroll=PROCEDURE,- SQLForeignKeys=PROCEDURE,- SQLFreeConnect=PROCEDURE,- SQLFreeEnv=PROCEDURE,- SQLFreeHandle=PROCEDURE,- SQLFreeStmt=PROCEDURE,- SQLGetConnectAttr=PROCEDURE,- SQLGetConnectOption=PROCEDURE,- SQLGetCursorName=PROCEDURE,- SQLGetData=PROCEDURE,- SQLGetDescField=PROCEDURE,- SQLGetDescRec=PROCEDURE,- SQLGetDiagField=PROCEDURE,- SQLGetDiagRec=PROCEDURE,- SQLGetEnvAttr=PROCEDURE,- SQLGetFunctions=PROCEDURE,- SQLGetInfo=PROCEDURE,- SQLGetStmtAttr=PROCEDURE,- SQLGetStmtOption=PROCEDURE,- SQLGetTypeInfo=PROCEDURE,- SQLMoreResults=PROCEDURE,- SQLNativeSql=PROCEDURE,- SQLNumParams=PROCEDURE,- SQLNumResultCols=PROCEDURE,- SQLParamData=PROCEDURE,- SQLParamOptions=PROCEDURE,- SQLPrepare=PROCEDURE,- SQLPrimaryKeys=PROCEDURE,- SQLProcedureColumns=PROCEDURE,- SQLProcedures=PROCEDURE,- SQLPutData=PROCEDURE,- SQLRowCount=PROCEDURE,- SQLSetConnectAttr=PROCEDURE,- SQLSetConnectOption=PROCEDURE,- SQLSetCursorName=PROCEDURE,- SQLSetDescField=PROCEDURE,- SQLSetDescRec=PROCEDURE,- SQLSetEnvAttr=PROCEDURE,- SQLSetParam=PROCEDURE,- SQLSetPos=PROCEDURE,- SQLSetScrollOptions=PROCEDURE,- SQLSetStmtAttr=PROCEDURE,- SQLSetStmtOption=PROCEDURE,- SQLSpecialColumns=PROCEDURE,- SQLStatistics=PROCEDURE,- SQLTablePrivileges=PROCEDURE,- SQLTables=PROCEDURE,- SQLTransact=PROCEDURE,- iniElement=PROCEDURE) unixODBC-2.3.9/vms/install_image.com0000755000175000017500000000104312262474476014215 00000000000000$ $ if p1 .eqs. "" then $goto ERR_NOPARAMS $ $ install :== $install/command $ $ if (f$file ("''p1'", "KNOWN")) $ then install replace/open/header/shared 'p1' $ else install create/open/header/shared 'p1' $ endif $done: $ exit $ $ERR_NOPARAMS: $ write sys$output " " $ write sys$output "The correct calling sequence is: " $ write sys$output " " $ write sys$output "$ @install_server p1 $ write sys$output " " $ write sys$output "Where: " $ write sys$output " " $ write sys$output " p1 = Image to be installed" $ write sys$output " " $ exit 44 $ unixODBC-2.3.9/vms/drivermanager_axp.opt0000755000175000017500000000444012262474476015133 00000000000000CASE_SENSITIVE=YES SYMBOL_VECTOR = (SQLAllocConnect=PROCEDURE,- SQLAllocEnv=PROCEDURE,- SQLAllocHandle=PROCEDURE,- SQLAllocHandleStd=PROCEDURE,- SQLAllocStmt=PROCEDURE,- SQLBindCol=PROCEDURE,- SQLBindParam=PROCEDURE,- SQLBindParameter=PROCEDURE,- SQLBrowseConnect=PROCEDURE,- SQLBulkOperations=PROCEDURE,- SQLCancel=PROCEDURE,- SQLCloseCursor=PROCEDURE,- SQLColAttribute=PROCEDURE,- SQLColAttributes=PROCEDURE,- SQLColumnPrivileges=PROCEDURE,- SQLColumns=PROCEDURE,- SQLConnect=PROCEDURE,- SQLCopyDesc=PROCEDURE,- SQLDataSources=PROCEDURE,- SQLDescribeCol=PROCEDURE,- SQLDescribeParam=PROCEDURE,- SQLDisconnect=PROCEDURE,- SQLDriverConnect=PROCEDURE,- SQLDrivers=PROCEDURE,- SQLEndTran=PROCEDURE,- SQLError=PROCEDURE,- SQLExecDirect=PROCEDURE,- SQLExecute=PROCEDURE,- SQLExtendedFetch=PROCEDURE,- SQLFetch=PROCEDURE,- SQLFetchScroll=PROCEDURE,- SQLForeignKeys=PROCEDURE,- SQLFreeConnect=PROCEDURE,- SQLFreeEnv=PROCEDURE,- SQLFreeHandle=PROCEDURE,- SQLFreeStmt=PROCEDURE,- SQLGetConnectAttr=PROCEDURE,- SQLGetConnectOption=PROCEDURE,- SQLGetCursorName=PROCEDURE,- SQLGetData=PROCEDURE,- SQLGetDescField=PROCEDURE,- SQLGetDescRec=PROCEDURE,- SQLGetDiagField=PROCEDURE,- SQLGetDiagRec=PROCEDURE,- SQLGetEnvAttr=PROCEDURE,- SQLGetFunctions=PROCEDURE,- SQLGetInfo=PROCEDURE,- SQLGetStmtAttr=PROCEDURE,- SQLGetStmtOption=PROCEDURE,- SQLGetTypeInfo=PROCEDURE,- SQLMoreResults=PROCEDURE,- SQLNativeSql=PROCEDURE,- SQLNumParams=PROCEDURE,- SQLNumResultCols=PROCEDURE,- SQLParamData=PROCEDURE,- SQLParamOptions=PROCEDURE,- SQLPrepare=PROCEDURE,- SQLPrimaryKeys=PROCEDURE,- SQLProcedureColumns=PROCEDURE,- SQLProcedures=PROCEDURE,- SQLPutData=PROCEDURE,- SQLRowCount=PROCEDURE,- SQLSetConnectAttr=PROCEDURE,- SQLSetConnectOption=PROCEDURE,- SQLSetCursorName=PROCEDURE,- SQLSetDescField=PROCEDURE,- SQLSetDescRec=PROCEDURE,- SQLSetEnvAttr=PROCEDURE,- SQLSetParam=PROCEDURE,- SQLSetPos=PROCEDURE,- SQLSetScrollOptions=PROCEDURE,- SQLSetStmtAttr=PROCEDURE,- SQLSetStmtOption=PROCEDURE,- SQLSpecialColumns=PROCEDURE,- SQLStatistics=PROCEDURE,- SQLTablePrivileges=PROCEDURE,- SQLTables=PROCEDURE,- SQLTransact=PROCEDURE) unixODBC-2.3.9/AUTHORS0000644000175000017500000000411013441433115011124 00000000000000Authors of unixODBC... Peter Harvey Nick Gorham The PostgreSQL Driver was modified from the standard PostgreSQL ODBC driver (http://www.postgresql.org) The NNTP Driver as written by Ke Jin The MySQL driver is a mirror from the MySQL folks. Other contributors include Alex Hornby Axel Reinhold Alexander Mitin Artiom Morozov Arun K Desai Bard Hustveit Bill Bouma Bill Medland Bojnourdi Kaikavous Brian Harris Bruce A Mallett Charles Morrison Charles Overbeck Chris Friesen Christian Jullien Christian Werner Constantine Filin Craig A Berry Dave Berry David Brown Dmitriy Yusupov Donnie Pinkston Emile Heitor Erik Lundqvist Frediano Ziglio Gary Bunting Geoffrey Gowan Greg Bentz Heikki Linnakangas Holger Bischoff Holger Schurig Honza Horak Hristo Hristov Hugh McMaster Ian Ashley James Dugal Jan Cihlar Jan Stanek Jason Crummack Jay Cai Jay Q. Cai Jay Van Vark Jeff Garzik Jean Louis Charton Jens Schlegel Jess Balint Jim Ziegler Joel W. Reed John C. Rood John L Miller John Moreshead Jon KÃ¥re Hellan Jon Pounder Jon Willeke Jürgen Pfeifer Keith Woodard Lars Doelle Manush Dodunekov Marcogiusti Markus Beth Mark Chopping Mark Hessling Mark Vanderwiel Martin Edlman Martin Evans Martin Hobbs Martin Kittel Martin Lacko Max Khon Michael Koch Michael Vetter Miloslav Marik Mike Schultz Mikko Vierula Murad Nayal Murray Todd Williams Nehal J Wani Nikolai Afanasiev Ocke Janssen Oded Comay Ola Sundell Oren Nechushtan Patrice Favre Paul Richardson Per Bengtsson Per I. Mathisen Petr Vandrovec Pierangelo Masarati Rafi Einstein Ralf Fassel Rick Flower Richard Kettlewell Ron Norman Samuel Cote Scot Loach Scott Courtney Shandy J. Brown Simon Pepping Stefan Radman Steffen Dettmer Steve Gilbert Steve Langasek Steven M. Schultz Steven Reynolds Stuart Coupe Thomas Langen Tim Roepken Tomas Zellerin Trond Eivind Glomsrød Venu Anuganti Zoltan Boszormenyi If I have omitted anyone from this let me know and I will amend it ASAP. I have removed the email address of the people on this list. If someone wants to get in touch, mail me and I will pass it on. Nick Gorham unixODBC-2.3.9/compile0000755000175000017500000001624513725127167011462 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2015 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixODBC-2.3.9/README.QNX0000755000175000017500000000223512262474476011431 00000000000000Building unixODBC on QNX ======================== This has been tested on the QNX 6.1 x86 release. 1. unpack the distribution, and cd into the distribution dir 2. Add any missing files automake --add-missing 3. Configure unixODBC ./configure --sysconfdir=/etc --enable-gui=no --prefix=/opt 4. run libtooloze using the QNX version of libtool, then update aclocal.m4 libtoolize --force aclocal 5. We now need to alter the flags dlopen uses cd libltdl sed "s/RTLD_GLOBAL/RTLD_GROUP/" ltdl.c > ltdl.c.new sed "s/RTLD_LAZY/RTLD_NOW/" ltdl.c.new > ltdl.c cd .. 6. Force a reconfigure rm config.cache 7. Make, then install make make install And with luck and a trailing wind, that should be that. EXTRA STUFF for QNX 6.2, if the wind is head on... If you find that it segfaults, its worth going into the libltdl directory, editing the Makefile, and changing the line CFLAGS = -g -O2 to CFLAGS = -g -O2 -DPIC -fPIC then touch ltdl.c to force a rebuild You may also get a error when building in the exe directory, to fix this, go to the exe directory, edit Makefile, and change OBJEXT = @OBJEXT@ to OBJEXT = o And EXEEXT = @EXEEXT@ to EXEEXT = unixODBC-2.3.9/Makefile.in0000664000175000017500000007306313725127175012153 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in unixodbc_conf.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/unixodbc_conf.h.in AUTHORS COPYING ChangeLog INSTALL \ NEWS README compile config.guess config.sub depcomp install-sh \ ltmain.sh missing mkinstalldirs ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = \ cur/odbccr.pc \ DriverManager/odbc.pc \ odbcinst/odbcinst.pc SUBDIRS = \ extras \ log \ lst \ ini \ libltdl \ odbcinst \ DriverManager \ exe \ cur \ DRVConfig \ Drivers \ include \ doc \ man \ samples EXTRA_DIST = \ README.OSX \ README.VMS \ README.QNX \ README.CYGWIN \ README.AIX \ README.SOLARIS \ README.INTERIX \ vms/install_image.com \ vms/odbc2_axp.opt \ vms/odbc_axp.opt \ vms/odbcinst_axp.opt \ vms/odbc_setup.com \ vms/drivermanager_axp.opt \ vmsbuild.com \ Interix/configure \ Interix/config.guess \ Interix/libtool \ m4 \ configure.ac \ Makefile.svn all: config.h unixodbc_conf.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ unixodbc_conf.h: stamp-h2 @test -f $@ || rm -f stamp-h2 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2 stamp-h2: $(srcdir)/unixodbc_conf.h.in $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status unixodbc_conf.h distclean-hdr: -rm -f config.h stamp-h1 unixodbc_conf.h stamp-h2 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h unixodbc_conf.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile install-data-am: install-pkgconfigDATA -mkdir -p $(DESTDIR)${sysconfdir}/ODBCDataSources -touch $(DESTDIR)${sysconfdir}/odbcinst.ini -touch $(DESTDIR)${sysconfdir}/odbc.ini cp unixodbc_conf.h $(DESTDIR)${includedir}/unixodbc_conf.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/INSTALL0000755000175000017500000001752412522170630011124 00000000000000Prerequisites ============= Before trying to compile unixODBC make sure you have installed the following software packages: o gnu make version 3.7 or newer or a native C compiler The code will build with native unix compilers on platforms such as HPUX AIX and Solaris. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Type `make install' to install the programs and any data files and documentation. 4. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. unixODBC-2.3.9/samples/0000775000175000017500000000000013725127522011615 500000000000000unixODBC-2.3.9/samples/cursor.c0000755000175000017500000001711512262474476013234 00000000000000#include #include #include #define ROWS 20 #define STATUS_LEN 6 #define OPENDATE_LEN 11 #define DONE -1 int res[][ 3 ] = { { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_PRIOR, 0, 0 }, { SQL_FETCH_FIRST, 0, 0 }, { SQL_FETCH_ABSOLUTE, -100, 0 }, { SQL_FETCH_ABSOLUTE, -400, 0 }, { SQL_FETCH_ABSOLUTE, 200, 0 }, { SQL_FETCH_ABSOLUTE, 350, 0 }, { SQL_FETCH_LAST, 0, 0 }, { SQL_FETCH_NEXT, 0, 0 }, { SQL_FETCH_LAST, 0, 0 }, { SQL_FETCH_FIRST, 0, 0 }, { SQL_FETCH_RELATIVE, 20, 0 }, { SQL_FETCH_RELATIVE, 50, 0 }, { SQL_FETCH_RELATIVE, 101, 0 }, { SQL_FETCH_RELATIVE, -5, 0 }, { SQL_FETCH_RELATIVE, 60, 0 }, { SQL_FETCH_RELATIVE, -60, 0 }, { SQL_FETCH_RELATIVE, 0, 0 }, { SQL_FETCH_RELATIVE, 0, 0 }, { SQL_FETCH_NEXT, 0, -1 }, }; int PromptScroll( SQLUINTEGER *ort, SQLUINTEGER *offset ) { static int count = 0; int ret; *ort = res[ count ][ 0 ]; *offset = res[ count ][ 1 ]; ret = res[ count ][ 2 ]; count ++; return ret; } int DumpODBCLog( SQLHENV hEnv, SQLHDBC hDbc, SQLHSTMT hStmt ) { SQLCHAR szError[501]; SQLCHAR szSqlState[10]; SQLINTEGER nNativeError; SQLSMALLINT nErrorMsg; if ( hStmt ) { while ( SQLError( hEnv, hDbc, hStmt, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "%s\n", szError ); } } if ( hDbc ) { while ( SQLError( hEnv, hDbc, 0, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "%s\n", szError ); } } if ( hEnv ) { while ( SQLError( hEnv, 0, 0, szSqlState, &nNativeError, szError, 500, &nErrorMsg ) == SQL_SUCCESS ) { printf( "%s\n", szError ); } } return 1; } static int Display( SQLUSMALLINT *rsa, SQLUINTEGER crow, SQLSMALLINT *sOrderID, SQLINTEGER *cbOrderID, SQLCHAR szOrderDate[][OPENDATE_LEN], SQLINTEGER *cbOrderDate, SQLCHAR szStatus[][STATUS_LEN], SQLINTEGER *cbStatus ) { int i; printf( "crow = %d\n", crow ); for ( i = 0; i < crow; i ++ ) { printf( "%d %d |%d:%d|%s:%d|%s:%d\n", i, rsa[ i ], sOrderID[ i ], cbOrderID[ i ], szOrderDate[ i ], cbOrderDate[ i ], szStatus[ i ], cbStatus[ i ] ); } } void create_file( SQLHANDLE hstmt ) { SQLRETURN ret; int i; ret = SQLExecDirect( hstmt, "drop table ctest", SQL_NTS ); ret = SQLExecDirect( hstmt, "create table ctest ( id integer, dt character( 10 ), status character( 5 ), other character varying( 40 ))", SQL_NTS ); for ( i = 1; i < 1000; i ++ ) { char sql[ 256 ]; sprintf( sql, "insert into ctest values( %d, '%10d', '%05d', 'other line %d' )", i, i, i, i ); ret = SQLExecDirect( hstmt, sql, SQL_NTS ); printf( "%s - %d\n", sql, ret ); } } void cursor_test() { SQLHENV henv; SQLHDBC hdbc; SQLHSTMT hstmt1, hstmt2; SQLRETURN retcode; SQLCHAR szStatus[ROWS][STATUS_LEN], szOpenDate[ROWS][OPENDATE_LEN]; SQLCHAR szNewStatus[STATUS_LEN], szNewOpenDate[OPENDATE_LEN]; SQLSMALLINT sOrderID[ROWS], sNewOrderID[ROWS]; SQLINTEGER cbStatus[ROWS], cbOrderID[ROWS], cbOpenDate[ROWS]; SQLUINTEGER FetchOrientation, crow, FetchOffset, irowUpdt; SQLUSMALLINT RowStatusArray[ROWS]; SQLAllocHandle( SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv ); SQLSetEnvAttr( henv, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3, 0 ); SQLAllocHandle( SQL_HANDLE_DBC, henv, &hdbc ); /* Specify the ODBC Cursor Library is always used then connect. */ SQLSetConnectAttr( hdbc, SQL_ATTR_ODBC_CURSORS, SQL_CUR_USE_ODBC, 0 ); retcode = SQLConnect( hdbc, "postgres", SQL_NTS, "", SQL_NTS, "", SQL_NTS ); DumpODBCLog( NULL, hdbc, NULL ); if ( retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO ) { /* Allocate a statement handle for the result set and a statement */ /* handle for a positioned update statement */ SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt1 ); SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt2 ); /* * create the data */ create_file( hstmt1 ); /* Specify an updateable statis cursor with 20 rows of data. Set */ /* the cursor name, execute the SELECT statement, and bind the */ /* rowset buffer to result set columns in column-wise fashion */ SQLSetStmtAttr( hstmt1, SQL_ATTR_CONCURRENCY, SQL_CONCUR_VALUES, 0 ); SQLSetStmtAttr( hstmt1, SQL_ATTR_CURSOR_TYPE, SQL_CURSOR_STATIC, 0 ); SQLSetStmtAttr( hstmt1, SQL_ATTR_ROW_ARRAY_SIZE, ROWS, 20 ); SQLSetStmtAttr( hstmt1, SQL_ATTR_ROW_STATUS_PTR, RowStatusArray, 0 ); SQLSetStmtAttr( hstmt1, SQL_ATTR_ROWS_FETCHED_PTR, &crow, 0 ); SQLSetCursorName( hstmt1, "ORDERCURSOR", SQL_NTS ); SQLPrepare( hstmt1, "select id, dt, status from ctest", SQL_NTS ); { char cname[ 30 ]; retcode = SQLDescribeCol( hstmt1, 1, cname, sizeof( cname ), NULL, NULL, NULL, NULL, NULL ); printf( "ret = %d %s\n", retcode, cname ); DumpODBCLog( NULL, NULL, hstmt1 ); } SQLExecute( hstmt1 ); SQLBindCol( hstmt1, 1, SQL_C_SSHORT, sOrderID, 0, cbOrderID ); SQLBindCol( hstmt1, 2, SQL_C_CHAR, szOpenDate, OPENDATE_LEN, cbOpenDate ); SQLBindCol( hstmt1, 3, SQL_C_CHAR, szStatus, STATUS_LEN, cbStatus ); FetchOrientation = SQL_FETCH_FIRST; FetchOffset = 0; do { int ret; int count; printf( "fetch %d %d\n", FetchOrientation, FetchOffset ); ret = SQLFetchScroll( hstmt1, FetchOrientation, FetchOffset ); SQLRowCount( hstmt1, &count ); printf( "ret = %d count = %d\n", ret, count ); Display( RowStatusArray, crow, sOrderID, cbOrderID, szOpenDate, cbOpenDate, szStatus, cbStatus ); if ( SQL_SUCCEEDED( ret )) { char txt[ 50 ]; SQLINTEGER len; ret = SQLSetPos( hstmt1, 5, SQL_POSITION, SQL_LOCK_NO_CHANGE ); ret = SQLGetData( hstmt1, 2, SQL_C_CHAR, txt, sizeof( txt ), &len ); printf( "ret = %d %s:%d\n", ret, txt, len ); } } while( PromptScroll( &FetchOrientation, &FetchOffset ) != DONE ); SQLCloseCursor( hstmt1 ); SQLFreeStmt( hstmt1, SQL_DROP ); SQLFreeStmt( hstmt2, SQL_DROP ); SQLDisconnect( hdbc ); SQLFreeHandle( SQL_HANDLE_DBC, hdbc ); } SQLFreeHandle( SQL_HANDLE_ENV, henv ); } int main() { cursor_test(); } unixODBC-2.3.9/samples/Makefile.in0000664000175000017500000003215113725127175013610 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = samples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ cursor.c all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu samples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu samples/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/samples/Makefile.am0000755000175000017500000000003512262474476013600 00000000000000EXTRA_DIST = \ cursor.c unixODBC-2.3.9/config.h.in0000664000175000017500000003077313725127327012131 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Encoding to use for CHAR */ #undef ASCII_ENCODING /* Install bindir */ #undef BIN_PREFIX /* Use a semaphore to allow ODBCConfig to display running counts */ #undef COLLECT_STATS /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Lib directory */ #undef DEFLIB_PATH /* Using perdriver iconv */ #undef ENABLE_DRIVER_ICONV /* Using ini cacheing */ #undef ENABLE_INI_CACHING /* Install exec_prefix */ #undef EXEC_PREFIX /* Disable the precise but slow checking of the validity of handles */ #undef FAST_HANDLE_VALIDATE /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the `atoll' function. */ #undef HAVE_ATOLL /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Add editline support */ #undef HAVE_EDITLINE /* Define to 1 if you have the header file. */ #undef HAVE_EDITLINE_READLINE_H /* Define to 1 if you have the `endpwent' function. */ #undef HAVE_ENDPWENT /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the `ftime' function. */ #undef HAVE_FTIME /* Define to 1 if you have the `ftok' function. */ #undef HAVE_FTOK /* Define to 1 if you have the `getpwuid' function. */ #undef HAVE_GETPWUID /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Add -lcrypt to lib list */ #undef HAVE_LIBCRYPT /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Use the -lpth thread library */ #undef HAVE_LIBPTH /* Use -lpthread threading lib */ #undef HAVE_LIBPTHREAD /* Use the -lthread threading lib */ #undef HAVE_LIBTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Use rentrant version of localtime */ #undef HAVE_LOCALTIME_R /* Define if you have long long */ #undef HAVE_LONG_LONG /* Define this if a modern libltdl is already installed */ #undef HAVE_LTDL /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_MSQL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the `nl_langinfo' function. */ #undef HAVE_NL_LANGINFO /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if the system has the type `ptrdiff_t'. */ #undef HAVE_PTRDIFF_T /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Add readline support */ #undef HAVE_READLINE /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Use the scandir lib */ #undef HAVE_SCANDIR /* Define to 1 if you have the `semget' function. */ #undef HAVE_SEMGET /* Define to 1 if you have the `semop' function. */ #undef HAVE_SEMOP /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the `shmget' function. */ #undef HAVE_SHMGET /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `stricmp' function. */ #undef HAVE_STRICMP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strnicmp' function. */ #undef HAVE_STRNICMP /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the header file. */ #undef HAVE_SYNCH_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MALLOC_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SEM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMEB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `time' function. */ #undef HAVE_TIME /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Install includedir */ #undef INCLUDE_PREFIX /* Lib directory */ #undef LIB_PREFIX /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Define to the shared archive member specification, say "(shr.o)". */ #undef LT_SHARED_LIB_MEMBER /* Define if you need semundo union */ #undef NEED_SEMUNDO_UNION /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Using OSX */ #undef OSXHEADER /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Platform is 64 bit */ #undef PLATFORM64 /* Install prefix */ #undef PREFIX /* Using QNX */ #undef QNX_LIBLTDL /* Shared lib extension */ #undef SHLIBEXT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long int', as computed by sizeof. */ #undef SIZEOF_LONG_INT /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Filename to use for ftok */ #undef STATS_FTOK_NAME /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* don't include unixODBC prefix in driver error messages */ #undef STRICT_ODBC_ERROR /* System file path */ #undef SYSTEM_FILE_PATH /* Lib path */ #undef SYSTEM_LIB_PATH /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Encoding to use for UNICODE */ #undef UNICODE_ENCODING /* Flag that we are not using another DM */ #undef UNIXODBC /* We are building inside the unixODBC source tree */ #undef UNIXODBC_SOURCE /* Version number of package */ #undef VERSION /* Work with IBM drivers that use 32 bit handles on 64 bit platforms */ #undef WITH_HANDLE_REDIRECT /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Build flag for AIX */ #undef _ALL_SOURCE /* Build flag for AIX */ #undef _LONG_LONG /* Build flag for AIX */ #undef _THREAD_SAFE /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to a type to use for 'error_t' if it is not otherwise available. */ #undef error_t /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t unixODBC-2.3.9/lst/0000775000175000017500000000000013725127520010751 500000000000000unixODBC-2.3.9/lst/lstSeek.c0000755000175000017500000000040712262474476012463 00000000000000#include #include "lst.h" int lstSeek( HLST hLst, void *pData ) { if ( !hLst ) return false; lstFirst( hLst ); while ( !lstEOL( hLst ) ) { if ( lstGet( hLst ) == pData ) return true; lstNext( hLst ); } return false; } unixODBC-2.3.9/lst/lstSet.c0000755000175000017500000000101212262474476012320 00000000000000#include #include "lst.h" void *lstSet( HLST hLst, void *pData ) { HLSTITEM hItem; HLST hLstRoot; if ( !hLst ) return NULL; if ( !hLst->hCurrent ) return NULL; if ( hLst->hLstBase ) hItem = (HLSTITEM)hLst->hCurrent->pData; else hItem = hLst->hCurrent; hLstRoot = (HLST)hItem->hLst; /************************** * SET VALUE **************************/ if ( hItem->pData && hLstRoot->pFree ) hLstRoot->pFree( hItem->pData ); hItem->pData = pData; return pData; } unixODBC-2.3.9/lst/lstGetBookMark.c0000755000175000017500000000045212262474476013741 00000000000000#include #include "lst.h" int lstGetBookMark( HLST hLst, HLSTBOOKMARK hLstBookMark ) { if ( !hLst ) return LST_ERROR; if ( !hLstBookMark ) return LST_ERROR; hLstBookMark->hCurrent = hLst->hCurrent; hLstBookMark->hLst = hLst; return LST_SUCCESS; } unixODBC-2.3.9/lst/lstSetFreeFunc.c0000755000175000017500000000025612262474476013747 00000000000000#include #include "lst.h" int lstSetFreeFunc( HLST hLst, void (*pFree)( void *pData ) ) { if ( !hLst ) return false; hLst->pFree = pFree; return true; } unixODBC-2.3.9/lst/lstLast.c0000755000175000017500000000046712262474476012505 00000000000000#include #include "lst.h" void *lstLast( HLST hLst ) { if ( !hLst ) return NULL; if ( !hLst->hLast ) return NULL; if ( !_lstVisible( hLst->hLast ) ) hLst->hCurrent = _lstPrevValidItem( hLst, hLst->hLast ); else hLst->hCurrent = hLst->hLast; return hLst->hCurrent; } unixODBC-2.3.9/lst/lstFirst.c0000755000175000017500000000047412262474476012667 00000000000000#include #include "lst.h" void *lstFirst( HLST hLst ) { if ( !hLst ) return NULL; if ( !hLst->hFirst ) return NULL; if ( !_lstVisible( hLst->hFirst ) ) hLst->hCurrent = _lstNextValidItem( hLst, hLst->hFirst ); else hLst->hCurrent = hLst->hFirst; return hLst->hCurrent; } unixODBC-2.3.9/lst/lstClose.c0000755000175000017500000000225012262474476012637 00000000000000#include #include "lst.h" /********************* * lstClose * * Call for Cursor or root list. *********************/ int lstClose( HLST hLst ) { HLSTITEM hItem; if ( !hLst ) return LST_ERROR; hLst->nRefs--; /********************* * We will not really remove the list if we have * refs to it... we will just decrement ref. * We will be deleted when the last ref is being removed. *********************/ if ( hLst->nRefs > 0 ) return LST_SUCCESS; /************************ * DELETE ITEMS (and their refs) * - do not use standard nav funcs because they will skip items where bDelete ************************/ hItem = hLst->hFirst; while ( hItem ) { _lstFreeItem( hItem ); hItem = hLst->hFirst; } /************************ * RECURSE AS REQUIRED. RECURSION WILL STOP AS SOON AS WE GET TO A LIST WHICH * DOES NOT NEED TO BE DELETED YET (refs >= 0). ************************/ if ( hLst->hLstBase ) /* we are a cursor */ lstClose( hLst->hLstBase ); /* dec ref count and close if < 0 */ /************************ * FREE LIST HANDLE ************************/ free( hLst ); return LST_SUCCESS; } unixODBC-2.3.9/lst/lstSeekItem.c0000755000175000017500000000041612262474476013302 00000000000000#include #include "lst.h" int lstSeekItem( HLST hLst, HLSTITEM hItem ) { if ( !hLst ) return false; lstFirst( hLst ); while ( !lstEOL( hLst ) ) { if ( hLst->hCurrent == hItem ) return true; lstNext( hLst ); } return false; } unixODBC-2.3.9/lst/lstGoto.c0000755000175000017500000000177412262474476012514 00000000000000#include #include "lst.h" /*! * \brief Returns the data stored at nIndex. * * This does a scan from first-to-last until nIndex or until EOL. This * can be slow if there are many items in the list. * * This does not return the item handle - it returns the user data stored * in the item. * * When done; the current item is either the item at nIndex or EOL. * * \param hLst Input. Viable list handle. * \param nIndex Input. 0-based index of the desired item. * * \return void* * \retval NULL Item at index could not be found - effectively data is NULL. * \retval !NULL Reference to the data stored at nIndex */ void *lstGoto( HLST hLst, long nIndex ) { long n = 0; if ( !hLst ) return NULL; lstFirst( hLst ); while ( n <= nIndex ) { if ( lstEOL( hLst ) ) break; if ( n == nIndex ) return hLst->hCurrent->pData; n++; lstNext( hLst ); } return NULL; } unixODBC-2.3.9/lst/README0000755000175000017500000000257412262474476011574 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * * * * Peter Harvey 04.APR.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | LST lib (liblst.so) | +-------------------------------------------------------------+ README Description: A linked list lib. Provides user with a set of very easy to use and proven functions for a doubly-linked list. Supports the creation of cursor sets which may, optionally, be based upon a user supplied filter function. Concurrency is handled to a certian extent but this lib is no substitute for the fine concurrency handling of a full DBMS. +-------------------------------------------------------------+ | Peter Harvey | | pharvey@codebydesign.com | | www.unixodbc.org | | 16.APR.99 | +-------------------------------------------------------------+ unixODBC-2.3.9/lst/TODO0000755000175000017500000000244712262474476011403 00000000000000*************************************************************** * This code is LGPL. You CAN make commercial solutions using * * LGPL software. * * * * Peter Harvey 04.APR.99 pharvey@codebydesign.com * *************************************************************** +-------------------------------------------------------------+ | unixODBC | | LST lib (liblst.so) | +-------------------------------------------------------------+ TODO 1. Improve the handling of concurrency issues. 2. Add support for user defined sort function. 3. Enhance lstSeek() so as to use sort order to improve search efficiency. 4. Improve handling of serious errors where memory is likely to be lost... for example printf a message. +-------------------------------------------------------------+ | Peter Harvey | | pharvey@codebydesign.com | | www.genix.net/unixODBC | | 16.APR.99 | +-------------------------------------------------------------+ unixODBC-2.3.9/lst/lstOpenCursor.c0000755000175000017500000000207712262474476013700 00000000000000#include #include "lst.h" HLST lstOpenCursor( HLST hBase, int (*pFilterFunc)( HLST, void * ), void *pExtras ) { HLST hLst = NULL; if ( !hBase ) return NULL; /************************* * CREATE A NEW LIST *************************/ hLst = lstOpen(); if ( !hLst ) return NULL; hBase->nRefs++; hLst->pFilter = pFilterFunc; hLst->pFree = NULL; /* never free pData in a cursor */ hLst->pExtras = pExtras; /************************* * ADD ITEMS FROM hBase (skipping any bDelete items) *************************/ lstFirst( hBase ); if ( pFilterFunc ) { while ( !lstEOL( hBase ) ) { if ( pFilterFunc( hLst, lstGet( hBase ) ) ) lstAppend( hLst, hBase->hCurrent ); lstNext( hBase ); } } else { while ( !lstEOL( hBase ) ) { lstAppend( hLst, hBase->hCurrent ); lstNext( hBase ); } } /************************* * THIS *MUST* BE DONE AFTER THE LIST IS LOADED * OTHERWISE lstAppend() WILL APPEND INTO ROOT LIST AND MAKE A REF IN THIS LIST *************************/ hLst->hLstBase = hBase; return hLst; } unixODBC-2.3.9/lst/_lstNextValidItem.c0000755000175000017500000000047512262474476014455 00000000000000#include #include "lst.h" HLSTITEM _lstNextValidItem( HLST hLst, HLSTITEM hItem ) { if ( !hLst ) return NULL; if ( !hItem ) return NULL; hItem = hItem->pNext; while ( hItem ) { if ( _lstVisible( hItem ) ) return hItem; hItem = hItem->pNext; } return NULL; } unixODBC-2.3.9/lst/_lstPrevValidItem.c0000755000175000017500000000047612262474476014454 00000000000000#include #include "lst.h" HLSTITEM _lstPrevValidItem( HLST hLst, HLSTITEM hItem ) { if ( !hLst ) return NULL; if ( !hItem ) return NULL; hItem = hItem->pPrev; while ( hItem ) { if ( _lstVisible( hItem ) ) return hItem; hItem = hItem->pPrev; } return NULL; } unixODBC-2.3.9/lst/_lstVisible.c0000755000175000017500000000046612262474476013335 00000000000000#include #include "lst.h" int _lstVisible( HLSTITEM hItem ) { HLST hLst; if ( !hItem ) return false; hLst = (HLST)hItem->hLst; if ( hItem->bDelete && hLst->bShowDeleted == false ) return false; if ( hItem->bHide && hLst->bShowHidden == false ) return false; return true; } unixODBC-2.3.9/lst/lstInsert.c0000755000175000017500000000337212262474476013044 00000000000000#include #include "lst.h" int lstInsert( HLST hLst, void *pData ) { HLSTITEM hItem; if ( !hLst ) return LST_ERROR; if ( !hLst->hCurrent ) return lstAppend( hLst, pData ); /********************** * CREATE AN ITEM **********************/ hItem = malloc( sizeof(LSTITEM) ); if ( !hItem ) return LST_ERROR; hItem->bDelete = false; hItem->bHide = false; hItem->hLst = hLst; hItem->nRefs = 0; hItem->pData = NULL; hItem->pNext = NULL; hItem->pPrev = NULL; if ( hLst->hLstBase ) { /********************** * WE ARE A CURSOR LIST SO... * 1. ADD TO BASE LIST * 2. inc BASE LIST ITEM REF COUNT * 3. ADD TO THIS LIST (ref to base list) **********************/ lstInsert( hLst->hLstBase, pData ); /* !!! INSERT POS IN BASE LIST IS UNPREDICTABLE !!! */ /* BECAUSE hCurrent MAY HAVE CHANGED AND WE */ /* ARE NOT TRYING TO PUT IT BACK */ hItem->pData = hLst->hLstBase->hCurrent; hLst->hLstBase->hCurrent->nRefs++; _lstInsert( hLst, hItem ); } else { /********************** * WE ARE THE ROOT SO... * 1. ADD TO THIS LIST **********************/ hItem->pData = pData; _lstInsert( hLst, hItem ); } return LST_SUCCESS; } /************************* * SIMPLY CONNECTS THE LINKS/POINTERS AND SETS CURRENT *************************/ int _lstInsert( HLST hLst, HLSTITEM hItem ) { if ( !hLst->hCurrent ) return _lstAppend( hLst, hItem ); hItem->pPrev = hLst->hCurrent->pPrev; hItem->pNext = hLst->hCurrent; if ( hLst->hCurrent->pPrev ) hLst->hCurrent->pPrev->pNext = hItem; hLst->hCurrent->pPrev = hItem; if ( hLst->hCurrent == hLst->hFirst ) hLst->hFirst = hItem; hLst->hCurrent = hItem; hLst->nItems++; return LST_SUCCESS; } unixODBC-2.3.9/lst/_lstAdjustCurrent.c0000755000175000017500000000151312262474476014527 00000000000000#include #include "lst.h" /*************************** * ENSURE CURRENT IS NOT ON A bDelete ITEM * * 1. Should only be required for root list. ***************************/ void *_lstAdjustCurrent( HLST hLst ) { HLSTITEM h; if ( !hLst ) return NULL; if ( !hLst->hCurrent ) return NULL; if ( _lstVisible( hLst->hCurrent ) ) return hLst->hCurrent; h = hLst->hCurrent; while ( !_lstVisible( hLst->hCurrent ) && hLst->hCurrent->pPrev ) { hLst->hCurrent = hLst->hCurrent->pPrev; } if ( _lstVisible( hLst->hCurrent ) ) return hLst->hCurrent; hLst->hCurrent = h; while ( !_lstVisible( hLst->hCurrent ) && hLst->hCurrent->pNext ) { hLst->hCurrent = hLst->hCurrent->pNext; } if ( _lstVisible( hLst->hCurrent ) ) return hLst->hCurrent; hLst->hCurrent = NULL; return NULL; } unixODBC-2.3.9/lst/lstGet.c0000755000175000017500000000073512262474476012317 00000000000000#include #include "lst.h" /* * */ void *lstGet( HLST hLst ) { HLSTITEM hItem; if ( !hLst ) return NULL; if ( !hLst->hCurrent ) return NULL; if ( hLst->hLstBase ) hItem = (HLSTITEM)hLst->hCurrent->pData; /* cursor pData points directly to the root Item (not the roots pData) */ else /* a cursor may be based upon another cursor but pData is always ptr to root item */ hItem = hLst->hCurrent; return hItem->pData; } unixODBC-2.3.9/lst/lstPrev.c0000755000175000017500000000053712262474476012514 00000000000000#include #include "lst.h" void *lstPrev( HLST hLst ) { if ( !hLst ) return NULL; if ( !hLst->hCurrent ) return NULL; hLst->hCurrent = hLst->hCurrent->pPrev; if ( hLst->hCurrent ) { if ( !_lstVisible( hLst->hCurrent ) ) hLst->hCurrent = _lstPrevValidItem( hLst, hLst->hCurrent ); } return hLst->hCurrent; } unixODBC-2.3.9/lst/ChangeLog0000755000175000017500000000111312262474476012452 000000000000001999-04-30 Peter Harvey * bVisible: Added bVisible to HLSTITEM and it is used by nav funcs. 1999-04-28 Peter Harvey * lstOpen: Now inits nItem to 0 (got removed somehow) 1999-04-21 Peter Harvey * _lstDump: Added 1999-04-15 Peter Harvey * All: Added lstOpenCursor and cursor support (still needs locking) 1999-04-07 Peter Harvey * BookMarks: Added 1999-04-04 Peter Harvey * ChangeLog: Started ChangeLog unixODBC-2.3.9/lst/_lstFreeItem.c0000755000175000017500000000323212262474476013432 00000000000000#include #include "lst.h" /*************************** * _lstFreeItem * * 1. FREES MEMORY USED BY THE LIST ITEM AND REMOVES IT FROM ITS LIST * 2. WILL CLEAN UP root ITEM IF REQUIRED.. NEVER SETS bDelete... lstDelete DOES SET bDelete * 3. CALLS _lstAdjustCurrent TO ENSURE THAT CURRENT DOES NOT END UP ON bDelete ITEM ***************************/ int _lstFreeItem( HLSTITEM hItem ) { HLST hLst; HLSTITEM hItemRoot; HLSTITEM hNewCurrent = NULL; if ( !hItem ) return LST_ERROR; hLst = (HLST)hItem->hLst; /************* * FREE root ITEM AS REQUIRED *************/ if ( hLst->hLstBase ) { hItemRoot = (HLSTITEM)hItem->pData; /************* * dec ref count in root item *************/ hItemRoot->nRefs--; /************* * DELETE root ITEM IF REF = 0 AND SOMEONE SAID DELETE IT *************/ if ( hItemRoot->nRefs < 1 && hItemRoot->bDelete ) { _lstFreeItem( hItemRoot ); } } /************* * WE ALWAYS FREE hItem *************/ if ( hItem->pData && hLst->pFree ) hLst->pFree( hItem->pData ); if ( !hItem->bDelete ) /* THIS IS REALLY ONLY A FACTOR FOR ROOT ITEMS */ hLst->nItems--; if ( hItem == hLst->hFirst ) hLst->hFirst = hItem->pNext; if ( hItem == hLst->hLast ) hLst->hLast = hItem->pPrev; if ( hItem->pPrev ) { hItem->pPrev->pNext = hItem->pNext; if ( hItem == hLst->hCurrent ) hNewCurrent = hItem->pPrev; } if ( hItem->pNext ) { hItem->pNext->pPrev = hItem->pPrev; if ( !hNewCurrent && hItem == hLst->hCurrent ) hNewCurrent = hItem->pNext; } free( hItem ); hLst->hCurrent = hNewCurrent; _lstAdjustCurrent( hLst ); return LST_SUCCESS; } unixODBC-2.3.9/lst/lstAppend.c0000755000175000017500000000302612262474476013003 00000000000000#include #include "lst.h" /************************* * lstAppend * * 1. APPEND TO BASE LIST IF hLst IS A CURSOR * 2. APPEND REF TO THIS LIST *************************/ int lstAppend( HLST hLst, void *pData ) { HLSTITEM hItem; if ( !hLst ) return LST_ERROR; /********************** * CREATE AN ITEM **********************/ hItem = (HLSTITEM) malloc( sizeof(LSTITEM) ); if ( !hItem ) return LST_ERROR; hItem->bDelete = false; hItem->bHide = false; hItem->hLst = hLst; hItem->nRefs = 0; hItem->pData = NULL; hItem->pNext = NULL; hItem->pPrev = NULL; if ( hLst->hLstBase ) { /********************** * WE ARE A CURSOR LIST SO... * 1. ADD TO BASE LIST * 2. ADD TO THIS LIST (ref to base list) **********************/ lstAppend( hLst->hLstBase, pData ); hItem->pData = hLst->hLstBase->hCurrent; hLst->hLstBase->hCurrent->nRefs++; _lstAppend( hLst, hItem ); } else { /********************** * WE ARE THE ROOT SO... * 1. ADD TO THIS LIST **********************/ hItem->pData = pData; _lstAppend( hLst, hItem ); } return LST_SUCCESS; } /************************* * SIMPLY CONNECTS THE LINKS/POINTERS AND SETS CURRENT *************************/ int _lstAppend( HLST hLst, HLSTITEM hItem ) { if ( hLst->hFirst ) { hItem->pPrev = hLst->hLast; hLst->hLast->pNext = hItem; hLst->hLast = hItem; } else { hItem->pPrev = NULL; hLst->hFirst = hItem; hLst->hLast = hItem; } hLst->hCurrent = hItem; hLst->nItems++; return LST_SUCCESS; } unixODBC-2.3.9/lst/lstNext.c0000755000175000017500000000053512262474476012514 00000000000000#include #include "lst.h" void *lstNext( HLST hLst ) { if ( !hLst ) return NULL; if ( !hLst->hCurrent ) return NULL; hLst->hCurrent = hLst->hCurrent->pNext; if ( hLst->hCurrent ) { if ( !_lstVisible( hLst->hCurrent ) ) hLst->hCurrent = _lstNextValidItem( hLst, hLst->hCurrent ); } return hLst->hCurrent; } unixODBC-2.3.9/lst/lstEOL.c0000755000175000017500000000024212262474476012210 00000000000000#include #include "lst.h" int lstEOL( HLST hLst ) { if ( !hLst ) return true; if ( !hLst->hCurrent ) return true; return false; } unixODBC-2.3.9/lst/Makefile.in0000664000175000017500000005230513725127175012751 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lst ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) liblstlc_la_LIBADD = am_liblstlc_la_OBJECTS = _lstAdjustCurrent.lo _lstDump.lo \ _lstFreeItem.lo _lstNextValidItem.lo _lstPrevValidItem.lo \ _lstVisible.lo lstAppend.lo lstClose.lo lstDelete.lo lstEOL.lo \ lstFirst.lo lstGet.lo lstGetBookMark.lo lstGoto.lo \ lstGotoBookMark.lo lstInsert.lo lstLast.lo lstNext.lo \ lstOpen.lo lstOpenCursor.lo lstPrev.lo lstSeek.lo \ lstSeekItem.lo lstSet.lo lstSetFreeFunc.lo liblstlc_la_OBJECTS = $(am_liblstlc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = liblstlc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(liblstlc_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(liblstlc_la_SOURCES) DIST_SOURCES = $(liblstlc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/mkinstalldirs ChangeLog README TODO DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = liblstlc.la AM_CPPFLAGS = -I@top_srcdir@/include liblstlc_la_LDFLAGS = -no-undefined liblstlc_la_SOURCES = \ _lstAdjustCurrent.c \ _lstDump.c \ _lstFreeItem.c \ _lstNextValidItem.c \ _lstPrevValidItem.c \ _lstVisible.c \ lstAppend.c \ lstClose.c \ lstDelete.c \ lstEOL.c \ lstFirst.c \ lstGet.c \ lstGetBookMark.c \ lstGoto.c \ lstGotoBookMark.c \ lstInsert.c \ lstLast.c \ lstNext.c \ lstOpen.c \ lstOpenCursor.c \ lstPrev.c \ lstSeek.c \ lstSeekItem.c \ lstSet.c \ lstSetFreeFunc.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lst/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu lst/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } liblstlc.la: $(liblstlc_la_OBJECTS) $(liblstlc_la_DEPENDENCIES) $(EXTRA_liblstlc_la_DEPENDENCIES) $(AM_V_CCLD)$(liblstlc_la_LINK) $(liblstlc_la_OBJECTS) $(liblstlc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_lstAdjustCurrent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_lstDump.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_lstFreeItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_lstNextValidItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_lstPrevValidItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_lstVisible.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstAppend.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstClose.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstDelete.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstEOL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstFirst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstGet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstGetBookMark.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstGoto.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstGotoBookMark.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstInsert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstLast.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstNext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstOpen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstOpenCursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstPrev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstSeek.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstSeekItem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstSetFreeFunc.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/lst/_lstDump.c0000755000175000017500000000124312262474476012637 00000000000000#include #include "lst.h" void _lstDump( HLST hLst ) { HLSTITEM hItem; int nItem = 0; printf( "LST - BEGIN DUMP\n" ); if ( hLst ) { printf( "\thLst = %p\n", hLst ); printf( "\t\thLst->hLstBase = %p\n", hLst->hLstBase ); hItem = hLst->hFirst; while ( hItem ) { printf( "\t%d\n", nItem ); printf( "\t\thItem = %p\n", hItem ); printf( "\t\thItem->bDelete = %d\n", hItem->bDelete ); printf( "\t\thItem->bHide = %d\n", hItem->bHide ); printf( "\t\thItem->pData = %p\n", hItem->pData ); printf( "\t\thItem->hLst = %p\n", hItem->hLst ); nItem++; hItem = hItem->pNext; } } printf( "LST - END DUMP\n" ); } unixODBC-2.3.9/lst/lstGotoBookMark.c0000755000175000017500000000034412262474476014132 00000000000000#include #include "lst.h" int lstGotoBookMark( HLSTBOOKMARK hLstBookMark ) { if ( !hLstBookMark ) return LST_ERROR; hLstBookMark->hLst->hCurrent = hLstBookMark->hCurrent; return LST_SUCCESS; } unixODBC-2.3.9/lst/lstDelete.c0000755000175000017500000000300212262474476012770 00000000000000#include #include "lst.h" int _lstDeleteFlag( HLSTITEM hItem ); /*********************** * lstDelete * * Do not call unless you want to delete the item * from the cursor (if the list is one) **AND** the * root list. In other words; this should not be * called from functions such as lstClose() which * desire to simply free memory used by a specific * the list. * * This is the only function to set bDelete in the root * item (as required). * * lstFreeItem will decrement ref counters and do a real * delete when refs are 0. ************************/ int lstDelete( HLST hLst ) { HLSTITEM hItem = NULL; HLSTITEM hItemRoot = NULL; if ( !hLst ) return LST_ERROR; hItem = hLst->hCurrent; if ( !hItem ) return LST_ERROR; /********************* * ARE WE A CURSOR LIST *********************/ if ( hLst->hLstBase ) { hItemRoot = (HLSTITEM)hItem->pData; _lstDeleteFlag( hItemRoot ); return _lstFreeItem( hItem ); } /********************* * WE ARE root LIST. CHECK FOR REFS BEFORE CALLING FREE *********************/ _lstDeleteFlag( hItem ); if ( hItem->nRefs < 1 ) return _lstFreeItem( hItem ); return LST_SUCCESS; } /*************************** * FLAG FOR DELETE (should only be called if root list) ***************************/ int _lstDeleteFlag( HLSTITEM hItem ) { HLST hLst; hLst = (HLST)hItem->hLst; if ( !hItem->bDelete ) hLst->nItems--; hItem->bDelete = true; if ( hLst->hCurrent == hItem ) _lstAdjustCurrent( hLst ); return true; } unixODBC-2.3.9/lst/Makefile.am0000755000175000017500000000102612262756076012736 00000000000000noinst_LTLIBRARIES = liblstlc.la AM_CPPFLAGS = -I@top_srcdir@/include liblstlc_la_LDFLAGS = -no-undefined liblstlc_la_SOURCES = \ _lstAdjustCurrent.c \ _lstDump.c \ _lstFreeItem.c \ _lstNextValidItem.c \ _lstPrevValidItem.c \ _lstVisible.c \ lstAppend.c \ lstClose.c \ lstDelete.c \ lstEOL.c \ lstFirst.c \ lstGet.c \ lstGetBookMark.c \ lstGoto.c \ lstGotoBookMark.c \ lstInsert.c \ lstLast.c \ lstNext.c \ lstOpen.c \ lstOpenCursor.c \ lstPrev.c \ lstSeek.c \ lstSeekItem.c \ lstSet.c \ lstSetFreeFunc.c unixODBC-2.3.9/lst/lstOpen.c0000755000175000017500000000075212262474476012500 00000000000000#include #include "lst.h" HLST lstOpen() { HLST hLst = NULL; hLst = malloc( sizeof(LST) ); if ( hLst ) { hLst->bExclusive = false; hLst->hCurrent = NULL; hLst->hFirst = NULL; hLst->hLast = NULL; hLst->hLstBase = NULL; hLst->nRefs = 1; /* someone created us so lets assume that it counts as one ref */ hLst->pFilter = NULL; hLst->pFree = free; hLst->nItems = 0; hLst->bShowDeleted = false; hLst->bShowHidden = false; } return hLst; } unixODBC-2.3.9/config.sub0000755000175000017500000010623213725127167012063 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # This file 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: unixODBC-2.3.9/missing0000755000175000017500000001533013725127167011475 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: unixODBC-2.3.9/README.CYGWIN0000755000175000017500000000104112262474476011755 00000000000000To build unixODBC on cygwin, all you need to do is to rerun the autoconf tools to create versions that seem to play on windows, then build as normal. Of course to do this you need to have installed the Cygwin development packages. So: aclocal automake --add-missing automake autoconf libtoolize --copy --ltdl --force Then you can run configure as normal ./configure --enable-gui=no make make install At least that seems to work when I tried it... If you find problems just let me know. -- Nick Gorham (nick.gorham@easysoft.com) unixODBC-2.3.9/Makefile.am0000644000175000017500000000162613263126070012122 00000000000000ACLOCAL_AMFLAGS=-I m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = \ cur/odbccr.pc \ DriverManager/odbc.pc \ odbcinst/odbcinst.pc SUBDIRS = \ extras \ log \ lst \ ini \ libltdl \ odbcinst \ DriverManager \ exe \ cur \ DRVConfig \ Drivers \ include \ doc \ man \ samples EXTRA_DIST = \ README.OSX \ README.VMS \ README.QNX \ README.CYGWIN \ README.AIX \ README.SOLARIS \ README.INTERIX \ vms/install_image.com \ vms/odbc2_axp.opt \ vms/odbc_axp.opt \ vms/odbcinst_axp.opt \ vms/odbc_setup.com \ vms/drivermanager_axp.opt \ vmsbuild.com \ Interix/configure \ Interix/config.guess \ Interix/libtool \ m4 \ configure.ac \ Makefile.svn install-data-am: install-pkgconfigDATA -mkdir -p $(DESTDIR)${sysconfdir}/ODBCDataSources -touch $(DESTDIR)${sysconfdir}/odbcinst.ini -touch $(DESTDIR)${sysconfdir}/odbc.ini cp unixodbc_conf.h $(DESTDIR)${includedir}/unixodbc_conf.h unixODBC-2.3.9/DriverManager/0000775000175000017500000000000013725127520012675 500000000000000unixODBC-2.3.9/DriverManager/SQLColumns.c0000644000175000017500000003126613303466667015001 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColumns.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLColumns.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 2000/06/20 12:43:58 ngorham * * Fix bug that caused a success with info message from SQLExecute or * SQLExecDirect to be lost if used with a ODBC 3 driver and the application * called SQLGetDiagRec * * Revision 1.8 2000/06/16 16:52:16 ngorham * * Stop info messages being lost when calling SQLExecute etc on ODBC 3 * drivers, the SQLNumResultCols were clearing the error before * function return had a chance to get to them * * Revision 1.7 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.2 1999/06/07 01:29:30 pharvey * *** empty log message *** * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLColumns.c,v $ $Revision: 1.8 $"; SQLRETURN SQLColumnsA( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *column_name, SQLSMALLINT name_length4 ) { return SQLColumns( statement_handle, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); } SQLRETURN SQLColumns( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *column_name, SQLSMALLINT name_length4 ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tColumn Name = %s", statement, __string_with_length( s1, catalog_name, name_length1 ), __string_with_length( s2, schema_name, name_length2 ), __string_with_length( s3, table_name, name_length3 ), __string_with_length( s4, column_name, name_length4 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( catalog_name && name_length1 < 0 && name_length1 != SQL_NTS ) || ( schema_name && name_length2 < 0 && name_length2 != SQL_NTS ) || ( table_name && name_length3 < 0 && name_length3 != SQL_NTS ) || ( column_name && name_length4 < 0 && name_length4 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLCOLUMNS ) { __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3, *s4; int wlen; if ( !CHECK_SQLCOLUMNSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( catalog_name, name_length1, statement -> connection, &wlen ); name_length1 = wlen; s2 = ansi_to_unicode_alloc( schema_name, name_length2, statement -> connection, &wlen ); name_length2 = wlen; s3 = ansi_to_unicode_alloc( table_name, name_length3, statement -> connection, &wlen ); name_length3 = wlen; s4 = ansi_to_unicode_alloc( column_name, name_length4, statement -> connection, &wlen ); name_length4 = wlen; ret = SQLCOLUMNSW( statement -> connection , statement -> driver_stmt, s1, name_length1, s2, name_length2, s3, name_length3, s4, name_length4 ); if( s1 ) free( s1 ); if( s2 ) free( s2 ); if( s3 ) free( s3 ); if( s4 ) free( s4 ); } else { if ( !CHECK_SQLCOLUMNS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLCOLUMNS( statement -> connection , statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); /******/ #endif statement -> state = STATE_S5; statement -> hascols = 1; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLCOLUMNS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLNumResultCols.c0000644000175000017500000001645213303466667016140 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLNumResultCols.c,v 1.5 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLNumResultCols.c,v $ * Revision 1.5 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2007/01/02 10:27:50 lurcher * Fix descriptor leak with unicode only driver * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/10/14 06:49:24 ngorham * * Remove @all_includes@ from Drivers/MiniSQL/Makefile.am * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLNumResultCols.c,v $ $Revision: 1.5 $"; SQLRETURN SQLNumResultCols( SQLHSTMT statement_handle, SQLSMALLINT *column_count ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Count = %p", statement, column_count ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLNUMRESULTCOLS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( !CHECK_SQLNUMRESULTCOLS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, column_count ); if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLNUMRESULTCOLS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } if ( log_info.log_flag ) { if ( SQL_SUCCEEDED( ret )) { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tCount = %s", __get_return_status( ret, s2 ), __sptr_as_string( s1, column_count )); } else { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s2 )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/__connection.c0000755000175000017500000001647113303466667015442 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: __connection.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: __connection.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.4 2004/09/08 16:38:54 lurcher * * Get ready for a 2.2.10 release * * Revision 1.3 2003/04/10 13:45:52 lurcher * * Alter the way that SQLDataSources returns the description field (again) * * Revision 1.2 2003/04/09 08:42:18 lurcher * * Allow setting of odbcinstQ lib from odbcinst.ini and Environment * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.2 2001/05/15 10:57:44 nick * * Add initial support for VMS * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/28 18:35:50 ngorham * * Add extra ODBC3/2 Date/Time mapping * * Revision 1.6 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.5 1999/10/09 00:56:16 ngorham * * Added Manush's patch to map ODBC 3-2 datetime values * * Revision 1.4 1999/08/03 21:47:39 shandyb * Moving to automake: changed files in DriverManager * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/19 17:51:41 ngorham * * Applied assorted minor bug fixes * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" /* * list of places to look, a $ at the start indicates * then it following text should be looked in as a env * variable */ static char const rcsid[]= "$RCSfile: __connection.c,v $ $Revision: 1.6 $"; /* * search for the library (.so) that the DSN points to */ char *__find_lib_name( char *dsn, char *lib_name, char *driver_name ) { char driver[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver_lib[ INI_MAX_PROPERTY_VALUE + 1 ]; SQLSetConfigMode( ODBC_USER_DSN ); /* * GET DRIVER FROM ODBC.INI */ SQLGetPrivateProfileString( dsn, "Driver", "", driver_lib, sizeof( driver_lib ), "ODBC.INI" ); if ( driver_lib[ 0 ] == 0 ) { /* * if not found look in system DSN */ SQLSetConfigMode( ODBC_SYSTEM_DSN ); SQLGetPrivateProfileString( dsn, "Driver", "", driver_lib, sizeof( driver_lib ), "ODBC.INI" ); SQLSetConfigMode( ODBC_BOTH_DSN ); if ( driver_lib[ 0 ] == 0 ) return NULL; } /* * GET DRIVER FROM ODBCINST.INI IF ODBC.INI HAD USER FRIENDLY NAME */ strcpy( driver_name, "" ); if ( driver_lib[ 0 ] != '/' ) { strcpy( driver, driver_lib ); /* * allow the use of "User odbcinst files */ #ifdef PLATFORM64 SQLGetPrivateProfileString( driver, "Driver64", "", driver_lib, sizeof( driver_lib ), "ODBCINST.INI" ); if ( driver_lib[ 0 ] == '\0' ) { SQLGetPrivateProfileString( driver, "Driver", "", driver_lib, sizeof( driver_lib ), "ODBCINST.INI" ); } #else SQLGetPrivateProfileString( driver, "Driver", "", driver_lib, sizeof( driver_lib ), "ODBCINST.INI" ); #endif strcpy( driver_name, driver ); if ( driver_lib[ 0 ] == 0 ) { return NULL; } } strcpy( lib_name, driver_lib ); return lib_name; } static SQLSMALLINT sql_old_to_new(SQLSMALLINT type) { switch(type) { case SQL_TIME: type=SQL_TYPE_TIME; break; case SQL_DATE: type=SQL_TYPE_DATE; break; case SQL_TIMESTAMP: type=SQL_TYPE_TIMESTAMP; break; } return type; } static SQLSMALLINT sql_new_to_old(SQLSMALLINT type) { switch(type) { case SQL_TYPE_TIME: type=SQL_TIME; break; case SQL_TYPE_DATE: type=SQL_DATE; break; case SQL_TYPE_TIMESTAMP: type=SQL_TIMESTAMP; break; } return type; } static SQLSMALLINT c_old_to_new(SQLSMALLINT type) { switch(type) { case SQL_C_TIME: type=SQL_C_TYPE_TIME; break; case SQL_C_DATE: type=SQL_C_TYPE_DATE; break; case SQL_C_TIMESTAMP: type=SQL_C_TYPE_TIMESTAMP; break; } return type; } static SQLSMALLINT c_new_to_old(SQLSMALLINT type) { switch(type) { case SQL_C_TYPE_TIME: type=SQL_C_TIME; break; case SQL_C_TYPE_DATE: type=SQL_C_DATE; break; case SQL_C_TYPE_TIMESTAMP: type=SQL_C_TIMESTAMP; break; } return type; } SQLSMALLINT __map_type(int map, DMHDBC connection, SQLSMALLINT type) { int driver_ver=connection->driver_act_ver; int wanted_ver=connection->environment->requested_version; if(driver_ver==SQL_OV_ODBC2 && wanted_ver>=SQL_OV_ODBC3) { switch(map) { case MAP_SQL_DM2D: type=sql_new_to_old(type); break; case MAP_SQL_D2DM: type=sql_old_to_new(type); break; case MAP_C_DM2D: type=c_new_to_old(type); break; case MAP_C_D2DM: type=c_old_to_new(type); break; } } else if(driver_ver>=SQL_OV_ODBC3 && wanted_ver==SQL_OV_ODBC2) { switch(map) { case MAP_SQL_DM2D: type=sql_old_to_new(type); break; case MAP_SQL_D2DM: type=sql_new_to_old(type); break; case MAP_C_DM2D: type=c_old_to_new(type); break; case MAP_C_D2DM: type=c_new_to_old(type); break; } } else if(driver_ver>=SQL_OV_ODBC3 && wanted_ver>=SQL_OV_ODBC3) { switch(map) { case MAP_SQL_DM2D: case MAP_SQL_D2DM: type=sql_old_to_new(type); break; case MAP_C_DM2D: case MAP_C_D2DM: type=c_old_to_new(type); break; } } else if(driver_ver==SQL_OV_ODBC2 && wanted_ver==SQL_OV_ODBC2) { switch(map) { case MAP_SQL_DM2D: case MAP_SQL_D2DM: type=sql_new_to_old(type); break; case MAP_C_DM2D: case MAP_C_D2DM: type=c_new_to_old(type); break; } } return type; } unixODBC-2.3.9/DriverManager/SQLSetStmtAttr.c0000644000175000017500000006654513470564344015623 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetStmtAttr.c,v 1.16 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetStmtAttr.c,v $ * Revision 1.16 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.15 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.14 2007/12/17 13:13:03 lurcher * Fix a couple of descriptor typo's * * Revision 1.13 2007/02/12 11:49:34 lurcher * Add QT4 support to existing GUI parts * * Revision 1.12 2006/04/27 16:39:50 lurcher * fix missing return from SQLSetStmtAttr changes * * Revision 1.11 2006/04/24 08:42:10 lurcher * Handle resetting statement descriptors to implicit values, by passing in NULL or the implicit descrptor to SQLSetStmtAttr with the attribute SQL_ATTR_APP_PARAM_DESC or SQL_ATTR_APP_ROW_DESC. Also catch trying to call SQLGetDescField on a closed connection * * Revision 1.10 2005/11/23 08:29:16 lurcher * Add cleanup in postgres driver * * Revision 1.9 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.8 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.7 2003/02/27 12:19:40 lurcher * * Add the A functions as well as the W * * Revision 1.6 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.5 2002/09/18 14:49:32 lurcher * * DataManagerII additions and some more threading fixes * * Revision 1.3 2002/07/16 13:08:18 lurcher * * Filter attribute values from SQLSetStmtAttr to SQLSetStmtOption to fit * within ODBC 2 * Make DSN's double clickable in ODBCConfig * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.8 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.7 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.6 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.5 2001/03/28 14:57:22 nick * * Fix bugs in corsor lib introduced bu UNCODE and other changes * * Revision 1.4 2001/01/09 22:33:13 nick * * Stop passing NULL into SQLExtendedFetch * Further fixes to unicode to ansi conversions * * Revision 1.3 2000/12/18 12:53:29 nick * * More pooling tweeks * * Revision 1.2 2000/11/22 19:03:40 nick * * Fix problem with error status in SQLSpecialColumns * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.11 2000/06/24 18:45:09 ngorham * * Fix for SQLExtendedFetch on big endian platforms. the row count pointer * was declared as a small not a int. * * Revision 1.10 2000/06/20 13:30:10 ngorham * * Fix problems when using bookmarks * * Revision 1.9 2000/02/11 00:41:46 ngorham * * Added a couple of fixes for drivers without SQLExtendedFetch * * Revision 1.8 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/09/19 22:24:34 ngorham * * Added support for the cursor library * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.6 1999/06/04 16:29:00 ngorham * * Added chack that SQLSetStmtAttr exists in the driver before calling it * * Revision 1.5 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.4 1999/06/02 23:48:45 ngorham * * Added more 3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:21 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetStmtAttr.c,v $ $Revision: 1.16 $"; SQLRETURN SQLSetStmtAttrA( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { return SQLSetStmtAttr( statement_handle, attribute, value, string_length ); } SQLRETURN SQLSetStmtAttr( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tStrLen = %d", statement, __stmt_attr_as_string( s1, attribute ), value, (int)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( attribute == SQL_ATTR_CONCURRENCY || attribute == SQL_ATTR_CURSOR_TYPE || attribute == SQL_ATTR_SIMULATE_CURSOR || attribute == SQL_ATTR_USE_BOOKMARKS || attribute == SQL_ATTR_CURSOR_SCROLLABLE || attribute == SQL_ATTR_CURSOR_SENSITIVITY ) { if ( statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &statement -> error, ERROR_HY011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { if ( statement -> prepared ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &statement -> error, ERROR_HY011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } } else { if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( (!CHECK_SQLSETSTMTATTR( statement -> connection ) && !CHECK_SQLSETSTMTATTRW( statement -> connection )) && !CHECK_SQLSETSTMTOPTION( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * map descriptors to our copies */ if ( attribute == SQL_ATTR_APP_ROW_DESC ) { DMHDESC desc = ( DMHDESC ) value; /* * needs to reset to implicit descriptor, this is safe * without a validate, as the value is either null, or the * same as a descriptor we know is valid */ if ( desc == NULL || desc == statement -> implicit_ard ) { DRV_SQLHDESC drv_desc = NULL; ret = SQL_SUCCESS; if ( desc == statement -> implicit_ard ) { drv_desc = statement -> implicit_ard -> driver_desc; } if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, drv_desc, 0 ); } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, statement -> implicit_ard -> driver_desc, 0 ); } else { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, statement -> implicit_ard -> driver_desc ); } if ( ret != SQL_SUCCESS ) { if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } /* * copy DM descriptor */ statement -> apd = statement -> implicit_apd; if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } if ( !__validate_desc( desc )) { thread_release( SQL_HANDLE_STMT, statement ); sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_INVALID_HANDLE, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); return SQL_INVALID_HANDLE; } if ( desc -> implicit && desc != statement -> implicit_ard ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &statement -> error, ERROR_HY017, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( desc -> connection != statement -> connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &statement -> error, ERROR_HY024, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * set the value to the driver descriptor handle */ value = ( SQLPOINTER ) desc -> driver_desc; statement -> ard = desc; desc -> associated_with = statement; } if ( attribute == SQL_ATTR_APP_PARAM_DESC ) { DMHDESC desc = ( DMHDESC ) value; /* * needs to reset to implicit descriptor, this is safe * without a validate, as the value is either null, or the * same as a descriptor we know is valid */ if ( desc == NULL || desc == statement -> implicit_apd ) { DRV_SQLHDESC drv_desc = NULL; ret = SQL_SUCCESS; if ( desc == statement -> implicit_apd ) { drv_desc = statement -> implicit_apd -> driver_desc; } if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, statement -> implicit_apd -> driver_desc, 0 ); } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, statement -> implicit_apd -> driver_desc, 0 ); } else { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, drv_desc ); } if ( ret != SQL_SUCCESS ) { if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } /* * copy DM descriptor */ statement -> apd = statement -> implicit_apd; if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } if ( !__validate_desc( desc )) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_INVALID_HANDLE, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); thread_release( SQL_HANDLE_STMT, statement ); return SQL_INVALID_HANDLE; } if ( desc -> implicit && desc != statement -> implicit_apd ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &statement -> error, ERROR_HY017, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( desc -> connection != statement -> connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &statement -> error, ERROR_HY024, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * set the value to the driver descriptor handle */ value = ( SQLPOINTER ) desc -> driver_desc; statement -> apd = desc; desc -> associated_with = statement; } /* * save for internal use */ if ( attribute == SQL_ATTR_METADATA_ID ) { statement -> metadata_id = (SQLLEN) value; } if ( attribute == SQL_ATTR_IMP_ROW_DESC || attribute == SQL_ATTR_IMP_PARAM_DESC ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &statement -> error, ERROR_HY017, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * is it a legitimate value */ ret = dm_check_statement_attrs( statement, attribute, value ); if ( ret != SQL_SUCCESS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &statement -> error, ERROR_HY024, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * is it something overridden */ value = __attr_override( statement, SQL_HANDLE_STMT, attribute, value, &string_length ); /* * does the call need mapping from 3 to 2 */ if ( attribute == SQL_ATTR_FETCH_BOOKMARK_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection ) && !CHECK_SQLFETCHSCROLL( statement -> connection )) { statement -> fetch_bm_ptr = (SQLULEN*) value; /* * pass on if required */ if ( statement -> connection -> cl_handle ) { if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } else { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, value ); } } ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROW_STATUS_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 ) { statement -> row_st_arr = (SQLUSMALLINT*) value; /* * pass on if required */ if ( statement -> connection -> cl_handle ) { if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } else { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, value ); } } ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROWS_FETCHED_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 ) { statement -> row_ct_ptr = (SQLULEN*) value; /* * pass on if required */ if ( statement -> connection -> cl_handle ) { if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } else { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, value ); } } ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROW_ARRAY_SIZE && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 ) { /* * save this in case we need it in SQLExtendedFetch */ statement -> row_array_size = (SQLULEN) value; if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value, string_length ); } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value, string_length ); } else { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value ); } } else if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } else { /* * Is it in the legal range of values */ if ( attribute < SQL_STMT_DRIVER_MIN && ( attribute > SQL_ROW_NUMBER || attribute < SQL_QUERY_TIMEOUT )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &statement -> error, ERROR_HY092, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, value ); } /* * take notice of this */ if ( attribute == SQL_ATTR_USE_BOOKMARKS && SQL_SUCCEEDED( ret )) { statement -> bookmarks_on = (SQLULEN) value; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/__stats.h0000755000175000017500000000564213303466675014443 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: __stats.h,v 1.2 2005/02/01 10:24:24 lurcher Exp $ * * $Log: __stats.h,v $ * Revision 1.2 2005/02/01 10:24:24 lurcher * Cope if SHLIBEXT is not set * * Revision 1.1.1.1 2001/10/17 16:40:09 lurcher * * First upload to SourceForge * * Revision 1.1 2000/12/18 11:53:51 martin * * handle statistic API. * * **********************************************************************/ #ifndef UNIXODBC__STATS_H #define UNIXODBC__STATS_H 1 #include #include #ifdef HAVE_SYS_STAT_H #include #endif typedef struct uodbc_stats_proc { pid_t pid; /* process ID */ long n_env; /* # of henvs */ long n_dbc; /* # of hdbcs */ long n_stmt; /* # of hstmts */ long n_desc; /* # of hdescs */ } uodbc_stats_proc_t; typedef struct uodbc_stats { int n_pid; /* # of PIDs attached */ uodbc_stats_proc_t perpid[20]; } uodbc_stats_t; typedef struct uodbc_stats_handle { char id[5]; /* identifier */ # define UODBC_STATS_ID "UODBC" int sem_id; /* sempahore ID */ int shm_id; /* shared memory ID */ uodbc_stats_t *stats; /* ptr to stats in shared mem */ pid_t pid; } uodbc_stats_handle_t; int uodbc_update_stats(void *rh, unsigned int type, void *value); #define UODBC_STATS_TYPE_TYPE_MASK 0xffff #define UODBC_STATS_TYPE_HENV 1 #define UODBC_STATS_TYPE_HDBC 2 #define UODBC_STATS_TYPE_HSTMT 3 #define UODBC_STATS_TYPE_HDESC 4 #endif /* UNIXODBC__STATS_H */ unixODBC-2.3.9/DriverManager/SQLGetConnectAttr.c0000644000175000017500000006116113364066353016235 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetConnectAttr.c,v 1.15 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetConnectAttr.c,v $ * Revision 1.15 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.14 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.13 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.12 2006/03/08 09:18:41 lurcher * fix silly typo that was using sizeof( SQL_WCHAR ) instead of SQLWCHAR * * Revision 1.11 2004/11/22 17:02:48 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.10 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.9 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.8 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.7 2002/11/11 17:10:09 lurcher * * VMS changes * * Revision 1.6 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.5 2002/07/16 13:08:18 lurcher * * Filter attribute values from SQLSetStmtAttr to SQLSetStmtOption to fit * within ODBC 2 * Make DSN's double clickable in ODBCConfig * * Revision 1.4 2002/01/30 12:20:02 lurcher * * Add MyODBC 3 driver source * * Revision 1.3 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.2 2001/12/04 16:46:19 lurcher * * Allow the Unix Domain Socket to be set from the ini file (DSN) * Make the DataManager browser work with drivers that don't support * SQLRowCount * Make the directory selection from odbctest work simplier * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/08/03 15:19:00 nick * * Add changes to set values before connect * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/09/19 22:24:33 ngorham * * Added support for the cursor library * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetConnectAttr.c,v $ $Revision: 1.15 $"; SQLRETURN SQLGetConnectAttrA( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { return SQLGetConnectAttr( connection_handle, attribute, value, buffer_length, string_length ); } SQLRETURN SQLGetConnectAttr( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { DMHDBC connection = (DMHDBC)connection_handle; int type = 0; char *ptr; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * doesn't require a handle */ if ( attribute == SQL_ATTR_TRACE ) { if ( value ) { if ( log_info.log_flag ) { *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON; } else { *((SQLINTEGER*)value) = SQL_OPT_TRACE_OFF; } } return SQL_SUCCESS; } else if ( attribute == SQL_ATTR_TRACEFILE ) { SQLRETURN ret = SQL_SUCCESS; ptr = log_info.log_file_name; if ( log_info.log_file_name ) { if ( string_length ) { *string_length = strlen( ptr ); } if ( value ) { if ( buffer_length > strlen( log_info.log_file_name ) + 1 ) { strcpy( value, ptr ); } else { memcpy( value, log_info.log_file_name, buffer_length - 1 ); ((char*)value)[ buffer_length - 1 ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } } } else { if ( string_length ) { *string_length = 0; } if ( value ) { if ( buffer_length >= 1 ) { strcpy( value, "" ); } else { ret = SQL_SUCCESS_WITH_INFO; } } } return ret; } /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen = %p", connection, __con_attr_as_string( s1, attribute ), value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( connection -> state == STATE_C2 ) { switch ( attribute ) { case SQL_ATTR_ACCESS_MODE: case SQL_ATTR_AUTOCOMMIT: case SQL_ATTR_LOGIN_TIMEOUT: case SQL_ATTR_ODBC_CURSORS: case SQL_ATTR_TRACE: case SQL_ATTR_TRACEFILE: case SQL_ATTR_ASYNC_ENABLE: break; case SQL_ATTR_PACKET_SIZE: if ( connection -> packet_size_set ) break; case SQL_ATTR_QUIET_MODE: if ( connection -> quite_mode_set ) break; default: { struct save_attr *sa = connection -> save_attr; while (sa) { if (sa -> attr_type == attribute) { SQLRETURN rc = SQL_SUCCESS; if (sa -> str_len == SQL_NTS || sa -> str_len > 0) { SQLLEN realLen = sa->str_attr ? strlen(sa->str_attr) : 0; if(value && sa->str_attr) { strncpy(value, sa->str_attr, buffer_length - 1); ((SQLCHAR*)value)[buffer_length - 1] = 0; } if(string_length) { *string_length = realLen; } if(realLen > buffer_length - 1) { __post_internal_error( &connection -> error, ERROR_01004, NULL, connection -> environment -> requested_version ); rc = SQL_SUCCESS_WITH_INFO; } } else if(buffer_length >= sizeof(intptr_t)) { *(intptr_t*)value = sa -> intptr_attr; if(string_length) { *string_length = sizeof(intptr_t); } } else if(sa -> str_len >= SQL_IS_SMALLINT && sa -> str_len <= SQL_IS_POINTER) { SQLLEN length = 0; switch (sa -> str_len) { case SQL_IS_SMALLINT: *(SQLSMALLINT*)value = sa->intptr_attr; length = sizeof(SQLSMALLINT); break; case SQL_IS_USMALLINT: *(SQLUSMALLINT*)value = sa->intptr_attr; length = sizeof(SQLUSMALLINT); break; case SQL_IS_INTEGER: *(SQLINTEGER*)value = sa->intptr_attr; length = sizeof(SQLINTEGER); break; case SQL_IS_UINTEGER: *(SQLUINTEGER*)value = sa->intptr_attr; length = sizeof(SQLUINTEGER); break; case SQL_IS_POINTER: *(SQLPOINTER**)value = (SQLPOINTER*) sa->intptr_attr; length = sizeof(SQLPOINTER); break; } if(string_length) { *string_length = length; } } else { memcpy(value, &sa->intptr_attr, buffer_length); } return function_return_nodrv( SQL_HANDLE_DBC, connection, rc ); } sa = sa -> next; } } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } switch ( attribute ) { case SQL_ATTR_ACCESS_MODE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> access_mode; type = 1; } break; case SQL_ATTR_AUTOCOMMIT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> auto_commit; type = 1; } break; case SQL_ATTR_LOGIN_TIMEOUT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> login_timeout; type = 1; } break; case SQL_ATTR_ODBC_CURSORS: *((SQLULEN*)value) = connection -> cursors; type = 1; break; case SQL_ATTR_TRACE: *((SQLINTEGER*)value) = connection -> trace; type = 1; break; case SQL_ATTR_TRACEFILE: ptr = connection -> tracefile; type = 2; break; case SQL_ATTR_ASYNC_ENABLE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLULEN*)value) = connection -> async_enable; type = 1; } break; case SQL_ATTR_AUTO_IPD: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> auto_ipd; type = 1; } break; case SQL_ATTR_CONNECTION_TIMEOUT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> connection_timeout; type = 1; } break; case SQL_ATTR_METADATA_ID: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> metadata_id; type = 1; } break; case SQL_ATTR_PACKET_SIZE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> packet_size; type = 1; } break; case SQL_ATTR_QUIET_MODE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLLEN*)value) = connection -> quite_mode; type = 1; } break; case SQL_ATTR_TXN_ISOLATION: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> txn_isolation; type = 1; } break; default: break; } /* * if type has been set we have already set the value, * so just return */ if ( type ) { SQLRETURN ret = SQL_SUCCESS; if ( type == 1 ) { if ( string_length ) { *string_length = sizeof( SQLUINTEGER ); } } else { if ( string_length ) { *string_length = strlen( ptr ); } if ( value ) { if ( buffer_length > strlen( ptr ) + 1 ) { strcpy( value, ptr ); } else { memcpy( value, ptr, buffer_length - 1 ); ((char*)value)[ buffer_length - 1 ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } } } sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return_nodrv( SQL_HANDLE_DBC, connection, ret ); } else { SQLRETURN ret = 0; /* * call the driver */ if ( connection -> unicode_driver ) { if ( !CHECK_SQLGETCONNECTATTRW( connection )) { if (( ret = CHECK_SQLGETCONNECTOPTIONW( connection ))) { SQLWCHAR *s1 = NULL; /* * Is it in the legal range of values */ if ( attribute < SQL_CONN_DRIVER_MIN && ( attribute > SQL_PACKET_SIZE || attribute < SQL_ACCESS_MODE )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value ) { s1 = malloc( sizeof( SQLWCHAR ) * ( 1024 )); } break; } ret = SQLGETCONNECTOPTIONW( connection, connection -> driver_dbc, attribute, s1 ? s1 : value ); switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value && s1 ) { unicode_to_ansi_copy( value, buffer_length, s1, SQL_NTS, connection, NULL ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length /= sizeof( SQLWCHAR ); } break; } if ( s1 ) { free( s1 ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { SQLWCHAR *s1 = NULL; switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value && buffer_length > 0 ) { s1 = malloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 )); } break; } ret = SQLGETCONNECTATTRW( connection, connection -> driver_dbc, attribute, s1 ? s1 : value, s1 ? sizeof( SQLWCHAR ) * buffer_length : buffer_length, string_length ); switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value && s1 ) { unicode_to_ansi_copy( value, buffer_length, s1, SQL_NTS, connection, NULL ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length /= sizeof( SQLWCHAR ); } break; } if ( s1 ) { free( s1 ); } } } else { if ( !CHECK_SQLGETCONNECTATTR( connection )) { if ( CHECK_SQLGETCONNECTOPTION( connection )) { /* * Is it in the legal range of values */ if ( attribute < SQL_CONN_DRIVER_MIN && ( attribute > SQL_PACKET_SIZE || attribute < SQL_ACCESS_MODE )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } ret = SQLGETCONNECTOPTION( connection, connection -> driver_dbc, attribute, value ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { ret = SQLGETCONNECTATTR( connection, connection -> driver_dbc, attribute, value, buffer_length, string_length ); } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } } unixODBC-2.3.9/DriverManager/SQLGetConnectOptionW.c0000644000175000017500000003320713676601247016725 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetConnectOptionW.c,v 1.10 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetConnectOptionW.c,v $ * Revision 1.10 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.9 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.8 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/11/11 17:10:12 lurcher * * VMS changes * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/08/03 15:19:00 nick * * Add changes to set values before connect * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetConnectOptionW.c,v $"; SQLRETURN SQLGetConnectOptionW( SQLHDBC connection_handle, SQLUSMALLINT option, SQLPOINTER value ) { DMHDBC connection = (DMHDBC)connection_handle; int type = 0; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * doesn't require a handle */ if ( option == SQL_ATTR_TRACE ) { if ( value ) { *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON; } return SQL_SUCCESS; } else if ( option == SQL_ATTR_TRACEFILE ) { SQLRETURN ret = SQL_SUCCESS; if ( log_info.log_file_name ) { ansi_to_unicode_copy( value, log_info.log_file_name, SQL_NTS, connection, NULL ); } else { ansi_to_unicode_copy( value, "", SQL_NTS, connection, NULL ); } return ret; } /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDBC parent_connection; parent_connection = find_parent_handle( connection, SQL_HANDLE_DBC ); if ( parent_connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETCONNECTOPTIONW( parent_connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETCONNECTOPTIONW( parent_connection, connection, option, value ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tOption = %s\ \n\t\t\tValue = %p", connection, __con_attr_as_string( s1, option ), value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( connection -> state == STATE_C2 ) { switch ( option ) { case SQL_ACCESS_MODE: case SQL_AUTOCOMMIT: case SQL_LOGIN_TIMEOUT: case SQL_ODBC_CURSORS: break; default: dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } switch ( option ) { case SQL_ACCESS_MODE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> access_mode; type = 1; } break; case SQL_AUTOCOMMIT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> auto_commit; type = 1; } break; case SQL_ODBC_CURSORS: *((SQLINTEGER*)value) = connection -> cursors; type = 1; break; case SQL_ATTR_LOGIN_TIMEOUT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> login_timeout; type = 1; } break; default: break; } /* * if type has been set we have already set the value, * so just return */ if ( type ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } else { SQLRETURN ret = 0; /* * call the driver */ if ( connection -> unicode_driver || CHECK_SQLGETCONNECTOPTIONW( connection ) || CHECK_SQLGETCONNECTATTRW( connection )) { if ( CHECK_SQLGETCONNECTOPTIONW( connection )) { ret = SQLGETCONNECTOPTIONW( connection, connection -> driver_dbc, option, value ); } else if ( CHECK_SQLGETCONNECTATTRW( connection )) { SQLINTEGER length, len; void * ptr; SQLWCHAR txt[ 1024 ]; switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: length = sizeof( txt ); ptr = txt; break; default: length = sizeof( SQLINTEGER ); ptr = value; break; } ret = SQLGETCONNECTATTRW( connection, connection -> driver_dbc, option, ptr, length, &len ); /* * not much else we can do here, lets assume that * there is enough space */ if ( ptr != value ) { wide_strcpy( value, ptr ); /* * are we still here ? good */ } } else { __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { if (( ret = CHECK_SQLGETCONNECTOPTION( connection ))) { SQLCHAR *as1 = NULL; switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value ) { /* * we need to chance out arm here, as we dont know */ as1 = malloc( 1024 ); } break; } ret = SQLGETCONNECTOPTION( connection, connection -> driver_dbc, option, as1 ? as1 : value ); switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value && as1 ) { ansi_to_unicode_copy( value, (char*) as1, SQL_NTS, connection, NULL ); } if ( as1 ) { free( as1 ); } break; } } else if ( CHECK_SQLGETCONNECTATTR( connection )) { SQLINTEGER length, len; void * ptr; char txt[ 1024 ]; switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: length = sizeof( txt ); ptr = txt; break; default: length = sizeof( SQLINTEGER ); ptr = value; break; } ret = SQLGETCONNECTATTR( connection, connection -> driver_dbc, option, ptr, length, &len ); /* * not much else we can do here, lets assume that * there is enough space */ if ( ptr != value ) { SQLWCHAR *s1; s1 = ansi_to_unicode_alloc( value, SQL_NTS, connection, NULL ); if ( s1 ) { wide_strcpy( value, s1 ); free( s1 ); } /* * are we still here ? good */ } } else { __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } } unixODBC-2.3.9/DriverManager/SQLSetPos.c0000644000175000017500000002446313303466667014577 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetPos.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetPos.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.4 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/29 21:07:40 ngorham * * Fix some stupid bugs in the DM * Make the postgres driver work via unix sockets * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetPos.c,v $ $Revision: 1.6 $"; SQLRETURN SQLSetPos( SQLHSTMT statement_handle, SQLSETPOSIROW irow, SQLUSMALLINT foption, SQLUSMALLINT flock ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tIrow = %ld\ \n\t\t\tFoption = %d\ \n\t\t\tFlock = %d", statement, (long int)irow, foption, flock ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( foption != SQL_POSITION && foption != SQL_REFRESH && foption != SQL_UPDATE && foption != SQL_DELETE && foption != SQL_ADD ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &statement -> error, ERROR_HY092, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( flock != SQL_LOCK_NO_CHANGE && flock != SQL_LOCK_EXCLUSIVE && flock != SQL_LOCK_UNLOCK ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &statement -> error, ERROR_HY092, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || (foption != SQL_ADD && statement -> state == STATE_S7 && statement -> eod )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func == SQL_API_SQLEXTENDEDFETCH ) { __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> interupted_func != SQL_API_SQLSETPOS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( !CHECK_SQLSETPOS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLSETPOS( statement -> connection, statement -> driver_stmt, irow, foption, flock ); if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLSETPOS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) { statement -> interupted_state = statement -> state; statement -> state = STATE_S11; } } else if ( SQL_SUCCEEDED( ret ) && (statement -> state == STATE_S11 || statement -> state == STATE_S12)) { statement -> state = statement -> interupted_state; } else if ( ret == SQL_NEED_DATA ) { statement -> interupted_func = SQL_API_SQLSETPOS; statement -> interupted_state = statement -> state; statement -> state = STATE_S8; } else if (statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { statement -> state = statement -> interupted_state; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetTypeInfo.c0000644000175000017500000002232213303466667015547 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetTypeInfo.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetTypeInfo.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.4 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.5 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.4 2001/04/18 15:03:37 nick * * Fix problem when going to DB2 unicode driver * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetTypeInfo.c,v $ $Revision: 1.6 $"; SQLRETURN SQLGetTypeInfoA( SQLHSTMT statement_handle, SQLSMALLINT data_type ) { return SQLGetTypeInfo( statement_handle, data_type ); } SQLRETURN SQLGetTypeInfo( SQLHSTMT statement_handle, SQLSMALLINT data_type ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tData Type = %s", statement, __type_as_string( s1, data_type )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLGETTYPEINFO ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { if ( !CHECK_SQLGETTYPEINFOW( statement -> connection ) && !CHECK_SQLGETTYPEINFO( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( CHECK_SQLGETTYPEINFOW( statement -> connection ) ) { ret = SQLGETTYPEINFOW( statement -> connection , statement -> driver_stmt, data_type ); } else { ret = SQLGETTYPEINFO( statement -> connection , statement -> driver_stmt, data_type ); } } else { if ( !CHECK_SQLGETTYPEINFO( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLGETTYPEINFO( statement -> connection , statement -> driver_stmt, data_type ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLGETTYPEINFO; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLPrepareW.c0000664000175000017500000002430513542704724015076 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLPrepareW.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLPrepareW.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.6 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLPrepareW.c,v $"; SQLRETURN SQLPrepareW( SQLHSTMT statement_handle, SQLWCHAR *statement_text, SQLINTEGER text_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR *s1; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLPREPAREW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLPREPAREW( parent_statement -> connection, statement_handle, statement_text, text_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { /* * allocate some space for the buffer */ if ( statement_text && text_length == SQL_NTS ) { s1 = malloc( wide_strlen( statement_text ) + 100 ); } else if ( statement_text ) { s1 = malloc( text_length + 100 ); } else { s1 = malloc( 101 ); } sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tSQL = %s", statement, __wstring_with_length( s1, statement_text, text_length )); free( s1 ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( !statement_text ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( text_length <= 0 && text_length != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPREPARE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver || CHECK_SQLPREPAREW( statement -> connection )) { if ( !CHECK_SQLPREPAREW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPREPAREW( statement -> connection , statement -> driver_stmt, statement_text, text_length ); } else { SQLCHAR *as1; int clen; if ( !CHECK_SQLPREPARE( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( statement_text, text_length, statement -> connection, &clen ); text_length = clen; ret = SQLPREPARE( statement -> connection , statement -> driver_stmt, as1, text_length ); if ( as1 ) free( as1 ); } if ( SQL_SUCCEEDED( ret )) { statement -> hascols = 0; statement -> state = STATE_S3; statement -> prepared = 1; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPREPARE; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s2 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLAllocHandle.c0000664000175000017500000012636413616250072015521 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLAllocHandle.c,v 1.13 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLAllocHandle.c,v $ * Revision 1.13 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.12 2007/12/17 13:13:03 lurcher * Fix a couple of descriptor typo's * * Revision 1.11 2007/02/12 11:49:34 lurcher * Add QT4 support to existing GUI parts * * Revision 1.10 2006/06/28 08:08:41 lurcher * Add timestamp with timezone to Postgres7.1 driver * * Revision 1.9 2005/11/21 17:25:43 lurcher * A few DM fixes for Oracle's ODBC driver * * Revision 1.8 2005/11/08 09:37:10 lurcher * Allow the driver and application to have different length handles * * Revision 1.7 2005/10/06 08:50:58 lurcher * Fix problem with SQLDrivers not returning first entry * * Revision 1.6 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2003/02/25 13:28:21 lurcher * * Allow errors on the drivers AllocHandle to be reported * Fix a problem that caused errors to not be reported in the log * Remove a redundant line from the spec file * * Revision 1.4 2002/12/12 18:21:21 lurcher * * Fix bug where if a SQLAllocHandle in the driver failed, the driver manager * seg faulted * * Revision 1.3 2002/08/12 13:17:52 lurcher * * Replicate the way the MS DM handles loading of driver libs, and allocating * handles in the driver. usage counting in the driver means that dlopen is * only called for the first use, and dlclose for the last. AllocHandle for * the driver environment is only called for the first time per driver * per application environment. * * Revision 1.2 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.1.1.1 2001/10/17 16:40:03 lurcher * * First upload to SourceForge * * Revision 1.13 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.12 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.11 2001/08/03 15:19:00 nick * * Add changes to set values before connect * * Revision 1.10 2001/07/31 12:03:46 nick * * Fix how the DM gets the CLI year for SQLGetInfo * Fix small bug in strncasecmp * * Revision 1.9 2001/06/04 15:24:49 nick * * Add port to MAC OSX and QT3 changes * * Revision 1.8 2001/05/15 13:33:44 jason * * Wrapped calls to stats with COLLECT_STATS * * Revision 1.7 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.6 2000/12/18 11:03:58 martin * * Add support for the collection and retrieval of handle statistics. * * Revision 1.5 2000/12/14 18:10:18 nick * * Add connection pooling * * Revision 1.4 2000/11/22 19:03:40 nick * * Fix problem with error status in SQLSpecialColumns * * Revision 1.3 2000/11/22 18:35:43 nick * * Check input handle before touching output handle * * Revision 1.2 2000/11/14 10:15:27 nick * * Add test for localtime_r * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.19 2000/06/21 11:07:35 ngorham * * Stop Errors from SQLAllocHandle being lost * * Revision 1.18 2000/05/22 17:10:34 ngorham * * Fix problems with the FetchScroll -> ExtendedFetch Mapping * * Revision 1.17 2000/05/21 21:49:18 ngorham * * Assorted fixes * * Revision 1.16 2001/04/27 01:29:35 ngorham * * Added a couple of fixes from Tim Roepken * * Revision 1.15 2000/01/03 14:24:01 ngorham * * Fix bug where a failed alloc of a statement would dump core * * Revision 1.14 2000/01/01 18:21:16 ngorham * * Fix small bug where a invalid input handle to SQLAllocHandle can cause * a seg fault. * * Revision 1.13 1999/12/01 09:20:07 ngorham * * Fix some threading problems * * Revision 1.12 1999/11/15 21:42:52 ngorham * * Remove some debug info * * Revision 1.11 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.10 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.9 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.8 1999/10/20 23:01:41 ngorham * * Fixed problem with the connection counting * * Revision 1.7 1999/09/26 18:55:03 ngorham * * Fixed a problem where the cursor lib was being used by default * * Revision 1.6 1999/09/21 22:34:23 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/09/19 22:24:33 ngorham * * Added support for the cursor library * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.4 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) #include "__stats.h" #include #endif static char const rcsid[]= "$RCSfile: SQLAllocHandle.c,v $ $Revision: 1.13 $"; /* * connection pooling stuff */ extern int pooling_enabled; /* * this is used so that it can be called without falling * fowl of any other instances in any other modules. */ SQLRETURN __SQLAllocHandle( SQLSMALLINT handle_type, SQLHANDLE input_handle, SQLHANDLE *output_handle, SQLINTEGER requested_version ) { switch( handle_type ) { case SQL_HANDLE_ENV: case SQL_HANDLE_SENV: { DMHENV environment; char pooling_string[ 128 ]; if ( !output_handle ) { return SQL_ERROR; } if ( input_handle ) { return SQL_INVALID_HANDLE; } /* * check connection pooling attributes */ SQLGetPrivateProfileString( "ODBC", "Pooling", "0", pooling_string, sizeof( pooling_string ), "ODBCINST.INI" ); if ( pooling_string[ 0 ] == '1' || toupper( pooling_string[ 0 ] ) == 'Y' || ( toupper( pooling_string[ 0 ] ) == 'O' && toupper( pooling_string[ 1 ] ) == 'N' )) { pooling_enabled = 1; } else { pooling_enabled = 0; } if ( !( environment = __alloc_env())) { *output_handle = SQL_NULL_HENV; return SQL_ERROR; } *output_handle = (SQLHANDLE) environment; /* * setup environment state */ environment -> state = STATE_E1; environment -> requested_version = requested_version; environment -> version_set = !!requested_version; environment -> sql_driver_count = -1; /* * if SQLAllocEnv is called then it's probable that * the application wants ODBC2.X type behaviour * * In this case we don't need to set the version via * SQLSetEnvAttr() * */ environment -> connection_count = 0; return SQL_SUCCESS; } break; case SQL_HANDLE_DBC: { DMHENV environment = (DMHENV) input_handle; DMHDBC connection; if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } if ( output_handle ) *output_handle = SQL_NULL_HDBC; thread_protect( SQL_HANDLE_ENV, environment ); function_entry(( void * ) input_handle ); if ( log_info.log_flag ) { /* * log that we are here */ sprintf( environment -> msg, "\n\t\tEntry:\n\t\t\tHandle Type = %d\n\t\t\tInput Handle = %p", handle_type, (void*)input_handle ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } if ( !output_handle ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &environment -> error, ERROR_HY009, NULL, SQL_OV_ODBC3 ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } /* * check that a version has been requested */ if ( environment -> requested_version == 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &environment -> error, ERROR_HY010, NULL, SQL_OV_ODBC3 ); *output_handle = SQL_NULL_HDBC; return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } connection = __alloc_dbc(); if ( !connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &environment -> error, ERROR_HY013, NULL, environment -> requested_version ); *output_handle = SQL_NULL_HDBC; return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } /* * sort out the states */ connection -> state = STATE_C2; if ( environment -> state == STATE_E1 ) { environment -> state = STATE_E2; } environment -> connection_count ++; connection -> environment = environment; connection -> cursors = SQL_CUR_DEFAULT; connection -> login_timeout = SQL_LOGIN_TIMEOUT_DEFAULT; connection -> login_timeout_set = 0; connection -> auto_commit = SQL_AUTOCOMMIT_ON; connection -> auto_commit_set = 0; connection -> async_enable = 0; connection -> async_enable_set = 0; connection -> auto_ipd = 0; connection -> auto_ipd_set = 0; connection -> connection_timeout = 0; connection -> connection_timeout_set = 0; connection -> metadata_id = 0; connection -> metadata_id_set = 0; connection -> packet_size = 0; connection -> packet_size_set = 0; connection -> quite_mode = 0; connection -> quite_mode_set = 0; connection -> txn_isolation = 0; connection -> txn_isolation_set = 0; strcpy( connection -> cli_year, "1995" ); connection -> env_attribute.count = 0; connection -> env_attribute.list = NULL; connection -> dbc_attribute.count = 0; connection -> dbc_attribute.list = NULL; connection -> stmt_attribute.count = 0; connection -> stmt_attribute.list = NULL; connection -> save_attr = NULL; #ifdef HAVE_ICONV connection -> iconv_cd_uc_to_ascii = (iconv_t)-1; connection -> iconv_cd_ascii_to_uc = (iconv_t)-1; strcpy( connection -> unicode_string, DEFAULT_ICONV_ENCODING ); #endif *output_handle = (SQLHANDLE) connection; #ifndef ENABLE_DRIVER_ICONV /* * initialize unicode */ if ( !unicode_setup( connection )) { char txt[ 256 ]; sprintf( txt, "Can't initiate unicode conversion" ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, txt ); } #endif if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[SQL_SUCCESS]\n\t\t\tOutput Handle = %p", connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) uodbc_update_stats(environment->sh, UODBC_STATS_TYPE_HDBC, (void *)1); #endif thread_release( SQL_HANDLE_ENV, environment ); return SQL_SUCCESS; } break; case SQL_HANDLE_STMT: { SQLRETURN ret, ret1; DMHDBC connection = (DMHDBC) input_handle; DMHSTMT statement; if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } if ( output_handle ) *output_handle = SQL_NULL_HSTMT; thread_protect( SQL_HANDLE_DBC, connection ); function_entry(( void * ) input_handle ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\n\t\t\tHandle Type = %d\n\t\t\tInput Handle = %p", handle_type, (void*)input_handle ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } if ( !output_handle ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &connection -> error, ERROR_HY009, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection , SQL_ERROR ); } if ( connection -> state == STATE_C1 || connection -> state == STATE_C2 || connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); *output_handle = SQL_NULL_HSTMT; return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } statement = __alloc_stmt(); if ( !statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); *output_handle = SQL_NULL_HSTMT; return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * pass the call on */ if ( requested_version >= SQL_OV_ODBC3 ) { if ( CHECK_SQLALLOCHANDLE( connection )) { ret = SQLALLOCHANDLE( connection, SQL_HANDLE_STMT, connection -> driver_dbc, &statement -> driver_stmt, statement ); if ( !SQL_SUCCEEDED( ret )) __release_stmt( statement ); } else if ( CHECK_SQLALLOCSTMT( connection )) { ret = SQLALLOCSTMT( connection, connection -> driver_dbc, &statement -> driver_stmt, statement ); if ( !SQL_SUCCEEDED( ret )) __release_stmt( statement ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM003" ); __post_internal_error( &connection -> error, ERROR_IM003, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); *output_handle = SQL_NULL_HSTMT; return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { if ( CHECK_SQLALLOCSTMT( connection )) { ret = SQLALLOCSTMT( connection, connection -> driver_dbc, &statement -> driver_stmt, statement ); if ( !SQL_SUCCEEDED( ret )) __release_stmt( statement ); } else if ( CHECK_SQLALLOCHANDLE( connection )) { ret = SQLALLOCHANDLE( connection, SQL_HANDLE_STMT, connection -> driver_dbc, &statement -> driver_stmt, statement ); if ( !SQL_SUCCEEDED( ret )) __release_stmt( statement ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM003" ); __post_internal_error( &connection -> error, ERROR_IM003, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); *output_handle = SQL_NULL_HSTMT; return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } if ( SQL_SUCCEEDED( ret )) { /* * sort out the states */ statement -> state = STATE_S1; if ( connection -> state == STATE_C4 ) connection -> state = STATE_C5; __register_stmt ( connection, statement ); *output_handle = (SQLHANDLE) statement; statement -> metadata_id = SQL_FALSE; /* * if we are connected to a 3 driver then * we need to get the 4 implicit descriptors * so we know that they are valid */ if ( connection -> driver_act_ver == 3 && CHECK_SQLGETSTMTATTR( connection )) { DRV_SQLHDESC desc; /* * ARD */ ret1 = SQLGETSTMTATTR( connection, statement -> driver_stmt, SQL_ATTR_APP_ROW_DESC, &desc, sizeof( desc ), NULL ); if ( SQL_SUCCEEDED( ret1 )) { /* * allocate one of our descriptors * to wrap around this */ statement -> ard = __alloc_desc(); if ( !statement -> ard ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R1 ); } statement -> implicit_ard = statement -> ard; statement -> ard -> implicit = 1; statement -> ard -> associated_with = statement; statement -> ard -> state = STATE_D1i; statement -> ard -> driver_desc = desc; statement -> ard -> connection = connection; } /* * APD */ ret1 = SQLGETSTMTATTR( connection, statement -> driver_stmt, SQL_ATTR_APP_PARAM_DESC, &desc, sizeof( desc ), NULL ); if ( SQL_SUCCEEDED( ret1 )) { /* * allocate one of our descriptors * to wrap around this */ statement -> apd = __alloc_desc(); if ( !statement -> apd ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); *output_handle = SQL_NULL_HSTMT; return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R1 ); } statement -> implicit_apd = statement -> apd; statement -> apd -> implicit = 1; statement -> apd -> associated_with = statement; statement -> apd -> state = STATE_D1i; statement -> apd -> driver_desc = desc; statement -> apd -> connection = connection; } /* * IRD */ ret1 = SQLGETSTMTATTR( connection, statement -> driver_stmt, SQL_ATTR_IMP_ROW_DESC, &desc, sizeof( desc ), NULL ); if ( SQL_SUCCEEDED( ret1 )) { /* * allocate one of our descriptors * to wrap around this */ statement -> ird = __alloc_desc(); if ( !statement -> ird ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); *output_handle = SQL_NULL_HSTMT; return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R1 ); } statement -> implicit_ird = statement -> ird; statement -> ird -> implicit = 1; statement -> ird -> associated_with = statement; statement -> ird -> state = STATE_D1i; statement -> ird -> driver_desc = desc; statement -> ird -> connection = connection; } /* * IPD */ ret1 = SQLGETSTMTATTR( connection, statement -> driver_stmt, SQL_ATTR_IMP_PARAM_DESC, &desc, sizeof( desc ), NULL ); if ( SQL_SUCCEEDED( ret1 )) { /* * allocate one of our descriptors * to wrap around this */ statement -> ipd = __alloc_desc(); if ( !statement -> ipd ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); *output_handle = SQL_NULL_HSTMT; return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R1 ); } statement -> implicit_ipd = statement -> ipd; statement -> ipd -> implicit = 1; statement -> ipd -> associated_with = statement; statement -> ipd -> state = STATE_D1i; statement -> ipd -> driver_desc = desc; statement -> ipd -> connection = connection; } } /* Driver may only have unicode API's */ else if ( CHECK_SQLGETSTMTATTRW( connection )) { DRV_SQLHDESC desc; /* * ARD */ ret1 = SQLGETSTMTATTRW( connection, statement -> driver_stmt, SQL_ATTR_APP_ROW_DESC, &desc, sizeof( desc ), NULL ); if ( SQL_SUCCEEDED( ret1 )) { /* * allocate one of our descriptors * to wrap around this */ statement -> ard = __alloc_desc(); if ( !statement -> ard ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R1 ); } statement -> implicit_ard = statement -> ard; statement -> ard -> implicit = 1; statement -> ard -> associated_with = statement; statement -> ard -> state = STATE_D1i; statement -> ard -> driver_desc = desc; statement -> ard -> connection = connection; } /* * APD */ ret1 = SQLGETSTMTATTRW( connection, statement -> driver_stmt, SQL_ATTR_APP_PARAM_DESC, &desc, sizeof( desc ), NULL ); if ( SQL_SUCCEEDED( ret1 )) { /* * allocate one of our descriptors * to wrap around this */ statement -> apd = __alloc_desc(); if ( !statement -> apd ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); *output_handle = SQL_NULL_HSTMT; return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R1 ); } statement -> implicit_apd = statement -> apd; statement -> apd -> implicit = 1; statement -> apd -> associated_with = statement; statement -> apd -> state = STATE_D1i; statement -> apd -> driver_desc = desc; statement -> apd -> connection = connection; } /* * IRD */ ret1 = SQLGETSTMTATTRW( connection, statement -> driver_stmt, SQL_ATTR_IMP_ROW_DESC, &desc, sizeof( desc ), NULL ); if ( SQL_SUCCEEDED( ret1 )) { /* * allocate one of our descriptors * to wrap around this */ statement -> ird = __alloc_desc(); if ( !statement -> ird ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); *output_handle = SQL_NULL_HSTMT; return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R1 ); } statement -> implicit_ird = statement -> ird; statement -> ird -> implicit = 1; statement -> ird -> associated_with = statement; statement -> ird -> state = STATE_D1i; statement -> ird -> driver_desc = desc; statement -> ird -> connection = connection; } /* * IPD */ ret1 = SQLGETSTMTATTRW( connection, statement -> driver_stmt, SQL_ATTR_IMP_PARAM_DESC, &desc, sizeof( desc ), NULL ); if ( SQL_SUCCEEDED( ret1 )) { /* * allocate one of our descriptors * to wrap around this */ statement -> ipd = __alloc_desc(); if ( !statement -> ipd ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); __release_stmt( statement ); *output_handle = SQL_NULL_HSTMT; return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R1 ); } statement -> implicit_ipd = statement -> ipd; statement -> ipd -> implicit = 1; statement -> ipd -> associated_with = statement; statement -> ipd -> state = STATE_D1i; statement -> ipd -> driver_desc = desc; statement -> ipd -> connection = connection; } } } /* * set any preset statement attributes */ if ( SQL_SUCCEEDED( ret )) { __set_attributes( statement, SQL_HANDLE_STMT ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[SQL_SUCCESS]\n\t\t\tOutput Handle = %p", statement ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) uodbc_update_stats(connection->environment->sh, UODBC_STATS_TYPE_HSTMT, (void *)1); #endif return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R1 ); } break; case SQL_HANDLE_DESC: { SQLRETURN ret; DMHDBC connection = (DMHDBC) input_handle; DMHDESC descriptor; if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } if ( output_handle ) *output_handle = SQL_NULL_HDESC; thread_protect( SQL_HANDLE_DBC, connection ); function_entry(( void * ) input_handle ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\n\t\t\tHandle Type = %d\n\t\t\tInput Handle = %p", handle_type, (void*)input_handle ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } if ( !output_handle ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &connection -> error, ERROR_HY009, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection , SQL_ERROR ); } if ( connection -> state == STATE_C1 || connection -> state == STATE_C2 || connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); *output_handle = SQL_NULL_HDESC; return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } descriptor = __alloc_desc(); if ( !descriptor ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY013" ); __post_internal_error( &connection -> error, ERROR_HY013, NULL, connection -> environment -> requested_version ); *output_handle = SQL_NULL_HDESC; return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * pass the call on */ if ( CHECK_SQLALLOCHANDLE( connection )) { ret = SQLALLOCHANDLE( connection, SQL_HANDLE_DESC, connection -> driver_dbc, &descriptor -> driver_desc, NULL ); if ( !SQL_SUCCEEDED( ret )) __release_desc( descriptor ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM003" ); __post_internal_error( &connection -> error, ERROR_IM003, NULL, connection -> environment -> requested_version ); __release_desc( descriptor ); *output_handle = SQL_NULL_HDESC; return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( SQL_SUCCEEDED( ret )) { /* * sort out the states */ descriptor -> state = STATE_D1e; descriptor -> implicit = 0; descriptor -> associated_with = NULL; connection -> statement_count ++; descriptor -> connection = connection; *output_handle = (SQLHANDLE) descriptor; } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[SQL_SUCCESS]\n\t\t\tOutput Handle = %p", descriptor ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) uodbc_update_stats(connection->environment->sh, UODBC_STATS_TYPE_HDESC, (void *)1); #endif return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R1 ); } break; default: if ( __validate_env( (DMHENV) input_handle )) { DMHENV environment = (DMHENV) input_handle; thread_protect( SQL_HANDLE_ENV, environment ); __post_internal_error( &environment -> error, ERROR_HY092, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } else if ( __validate_dbc( (DMHDBC) input_handle )) { DMHDBC connection = (DMHDBC) input_handle; thread_protect( SQL_HANDLE_DBC, connection ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } break; } } SQLRETURN SQLAllocHandle( SQLSMALLINT handle_type, SQLHANDLE input_handle, SQLHANDLE *output_handle ) { /* * setting a requested version to 0 * indicates that we are ODBC3 and the application must * select ODBC2 or 3 explicitly */ return __SQLAllocHandle( handle_type, input_handle, output_handle, 0 ); } unixODBC-2.3.9/DriverManager/SQLGetDiagRecW.c0000644000175000017500000004174513303466667015451 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDiagRecW.c,v 1.11 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetDiagRecW.c,v $ * Revision 1.11 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.10 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.9 2007/11/26 11:37:23 lurcher * Sync up before tag * * Revision 1.8 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.7 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/11/11 17:10:17 lurcher * * VMS changes * * Revision 1.5 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.4 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/05/21 14:19:44 lurcher * * * Update libtool to escape from AIX build problem * * Add fix to avoid file handle limitations * * Add more UNICODE changes, it looks like it is native 16 representation * the old way can be reproduced by defining UCS16BE * * Add iusql, its just the same as isql but uses the wide functions * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetDiagRecW.c,v $"; extern int __is_env( EHEAD * head ); /* in SQLGetDiagRec.c */ SQLRETURN extract_parent_handle_rec( DRV_SQLHANDLE handle, int handle_type, SQLSMALLINT rec_number, SQLWCHAR *sqlstate, SQLINTEGER *native, SQLWCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length_ptr ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); if ( handle_type != SQL_HANDLE_ENV ) { #ifdef WITH_HANDLE_REDIRECT { DMHDBC *parent_handle_dbc; DMHSTMT *parent_handle_stmt; DMHDESC *parent_handle_desc; switch ( handle_type ) { case SQL_HANDLE_DBC: { parent_handle_dbc = find_parent_handle( handle, handle_type ); } break; case SQL_HANDLE_STMT: { parent_handle_stmt = find_parent_handle( handle, handle_type ); parent_handle_dbc = parent_handle_stmt->connection; } break; case SQL_HANDLE_DESC: { parent_handle_desc = find_parent_handle( handle, handle_type ); parent_handle_dbc = parent_handle_desc->connection; } break; default: { return SQL_INVALID_HANDLE; } } if ( parent_handle_dbc ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETDIAGRECW( parent_handle_dbc )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETDIAGRECW( parent_handle_dbc, handle_type, handle, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr ); } } } #endif } return SQL_INVALID_HANDLE; } static SQLRETURN extract_sql_error_rec_w( EHEAD *head, SQLWCHAR *sqlstate, SQLINTEGER rec_number, SQLINTEGER *native_error, SQLWCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ) { SQLRETURN ret; if ( sqlstate ) { SQLWCHAR *tmp; tmp = ansi_to_unicode_alloc((SQLCHAR*) "00000", SQL_NTS, __get_connection( head ), NULL ); wide_strcpy( sqlstate, tmp ); free( tmp ); } if ( rec_number <= head -> sql_diag_head.internal_count ) { ERROR *ptr; ptr = head -> sql_diag_head.internal_list_head; while( rec_number > 1 ) { ptr = ptr -> next; rec_number --; } if ( !ptr ) { return SQL_NO_DATA; } if ( sqlstate ) { wide_strcpy( sqlstate, ptr -> sqlstate ); } if ( buffer_length < wide_strlen( ptr -> msg ) + 1 ) { ret = SQL_SUCCESS_WITH_INFO; } else { ret = SQL_SUCCESS; } if ( message_text ) { if ( ret == SQL_SUCCESS ) { wide_strcpy( message_text, ptr -> msg ); } else { memcpy( message_text, ptr -> msg, buffer_length * 2 ); message_text[ buffer_length - 1 ] = '\0'; } } if ( text_length ) { *text_length = wide_strlen( ptr -> msg ); } if ( native_error ) { *native_error = ptr -> native_error; } /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) __map_error_state_w(sqlstate, __get_version( head )); return ret; } else if ( !__is_env( head ) && __get_connection( head ) -> state != STATE_C2 && head->sql_diag_head.error_count ) { ERROR *ptr; rec_number -= head -> sql_diag_head.internal_count; if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGRECW( __get_connection( head ))) { ret = SQLGETDIAGRECW( __get_connection( head ), head -> handle_type, __get_driver_handle( head ), rec_number, sqlstate, native_error, message_text, buffer_length, text_length ); /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) { __map_error_state_w( sqlstate, __get_version( head )); } return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGREC( __get_connection( head ))) { SQLCHAR *as1 = NULL, *as2 = NULL; if ( sqlstate ) { as1 = malloc( 7 ); } if ( message_text && buffer_length > 0 ) { as2 = malloc( buffer_length + 1 ); } ret = SQLGETDIAGREC( __get_connection( head ), head -> handle_type, __get_driver_handle( head ), rec_number, as1 ? as1 : (SQLCHAR *)sqlstate, native_error, as2 ? as2 : (SQLCHAR *)message_text, buffer_length, text_length ); /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) { if ( sqlstate ) { if ( as1 ) { ansi_to_unicode_copy( sqlstate,(char*) as1, SQL_NTS, __get_connection( head ), NULL ); __map_error_state_w( sqlstate, __get_version( head )); } } if ( message_text ) { if ( as2 ) { ansi_to_unicode_copy( message_text,(char*) as2, SQL_NTS, __get_connection( head ), NULL ); } } } if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); return ret; } else { ptr = head -> sql_diag_head.error_list_head; while( rec_number > 1 ) { ptr = ptr -> next; rec_number --; } if ( !ptr ) { return SQL_NO_DATA; } if ( sqlstate ) { wide_strcpy( sqlstate, ptr -> sqlstate ); } if ( buffer_length < wide_strlen( ptr -> msg ) + 1 ) { ret = SQL_SUCCESS_WITH_INFO; } else { ret = SQL_SUCCESS; } if ( message_text ) { if ( ret == SQL_SUCCESS ) { wide_strcpy( message_text, ptr -> msg ); } else { memcpy( message_text, ptr -> msg, buffer_length * 2 ); message_text[ buffer_length - 1 ] = '\0'; } } if ( text_length ) { *text_length = wide_strlen( ptr -> msg ); } if ( native_error ) { *native_error = ptr -> native_error; } /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) __map_error_state_w( sqlstate, __get_version( head )); return ret; } } else { return SQL_NO_DATA; } } SQLRETURN SQLGetDiagRecW( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLWCHAR *sqlstate, SQLINTEGER *native, SQLWCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length_ptr ) { SQLRETURN ret; SQLCHAR s0[ 32 ], s1[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s3[ 100 + LOG_MESSAGE_LEN ]; DMHENV environment = ( DMHENV ) handle; DMHDBC connection = NULL; DMHSTMT statement = NULL; DMHDESC descriptor = NULL; EHEAD *herror; char *handle_msg; const char *handle_type_ptr; if ( rec_number < 1 ) { return SQL_ERROR; } switch ( handle_type ) { case SQL_HANDLE_ENV: { if ( !__validate_env( environment )) { return extract_parent_handle_rec( environment, handle_type, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr ); } herror = &environment->error; handle_msg = environment->msg; handle_type_ptr = "Environment"; } break; case SQL_HANDLE_DBC: { connection = ( DMHDBC ) handle; if ( !__validate_dbc( connection )) { return extract_parent_handle_rec( connection, handle_type, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr); } herror = &connection->error; handle_msg = connection->msg; handle_type_ptr = "Connection"; } break; case SQL_HANDLE_STMT: { statement = ( DMHSTMT ) handle; if ( !__validate_stmt( statement )) { return extract_parent_handle_rec( statement, handle_type, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr ); } connection = statement->connection; herror = &statement->error; handle_msg = statement->msg; handle_type_ptr = "Statement"; } break; case SQL_HANDLE_DESC: { descriptor = ( DMHDESC ) handle; if ( !__validate_desc( descriptor )) { return extract_parent_handle_rec( descriptor, handle_type, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr ); } connection = descriptor->connection; herror = &descriptor->error; handle_msg = descriptor->msg; handle_type_ptr = "Descriptor"; } break; default: { return SQL_NO_DATA; } } thread_protect( handle_type, handle ); if ( log_info.log_flag ) { sprintf( handle_msg, "\n\t\tEntry:\ \n\t\t\t%s = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tSQLState = %p\ \n\t\t\tNative = %p\ \n\t\t\tMessage Text = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tText Len Ptr = %p", handle_type_ptr, handle, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } /* * Do diag extraction here if defer flag is set. * Clean the flag after extraction. */ if ( connection && herror->defer_extract ) { extract_error_from_driver( herror, connection, herror->ret_code_deferred, 0 ); herror->defer_extract = 0; herror->ret_code_deferred = 0; } ret = extract_sql_error_rec_w( herror, sqlstate, rec_number, native, message_text, buffer_length, text_length_ptr ); if ( log_info.log_flag ) { if ( SQL_SUCCEEDED( ret )) { char *ts1, *ts2; sprintf( handle_msg, "\n\t\tExit:[%s]\ \n\t\t\tSQLState = %s\ \n\t\t\tNative = %s\ \n\t\t\tMessage Text = %s", __get_return_status( ret, s2 ), __sdata_as_string( s3, SQL_CHAR, NULL, ts1 = unicode_to_ansi_alloc(sqlstate, SQL_NTS, connection, NULL )), __iptr_as_string( s0, native ), __sdata_as_string( s1, SQL_CHAR, text_length_ptr, ts2 = unicode_to_ansi_alloc(message_text, SQL_NTS, connection, NULL ))); if ( ts1 ) { free( ts1 ); } if ( ts2 ) { free( ts2 ); } } else { sprintf( handle_msg, "\n\t\tExit:[%s]", __get_return_status( ret, s2 )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } thread_release( handle_type, handle ); return ret; } unixODBC-2.3.9/DriverManager/SQLSetScrollOptions.c0000644000175000017500000004322113364070655016634 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetScrollOptions.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetScrollOptions.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2007/01/02 10:27:50 lurcher * Fix descriptor leak with unicode only driver * * Revision 1.7 2005/11/23 08:29:16 lurcher * Add cleanup in postgres driver * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/01/15 10:31:34 lurcher * * Fix invalid diag message * * Revision 1.3 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.2 2001/12/04 10:16:59 lurcher * * Fix SQLSetScrollOption problem * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.5 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.4 1999/06/02 23:48:45 ngorham * * Added more 3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:21 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetScrollOptions.c,v $ $Revision: 1.9 $"; SQLRETURN SQLSetScrollOptions( SQLHSTMT statement_handle, SQLUSMALLINT f_concurrency, SQLLEN crow_keyset, SQLUSMALLINT crow_rowset ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tConcurrency = %d\ \n\t\t\tKeyset = %d\ \n\t\t\tRowset = %d", statement, f_concurrency, (int)crow_keyset, crow_rowset ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state != STATE_S1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1010" ); __post_internal_error( &statement -> error, ERROR_S1010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (( crow_keyset != SQL_SCROLL_FORWARD_ONLY && crow_keyset != SQL_SCROLL_STATIC && crow_keyset != SQL_SCROLL_KEYSET_DRIVEN && crow_keyset != SQL_SCROLL_DYNAMIC ) || !crow_rowset) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1107" ); __post_internal_error( &statement -> error, ERROR_S1107, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( f_concurrency != SQL_CONCUR_READ_ONLY && f_concurrency != SQL_CONCUR_LOCK && f_concurrency != SQL_CONCUR_ROWVER && f_concurrency != SQL_CONCUR_VALUES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1108" ); __post_internal_error( &statement -> error, ERROR_S1108, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( CHECK_SQLSETSCROLLOPTIONS( statement -> connection )) { ret = SQLSETSCROLLOPTIONS( statement -> connection, statement -> driver_stmt, f_concurrency, crow_keyset, crow_rowset ); } else if ( statement -> connection -> driver_act_ver >= SQL_OV_ODBC3 && (CHECK_SQLGETINFO( statement -> connection ) || CHECK_SQLGETINFOW( statement -> connection )) && (CHECK_SQLSETSTMTATTR( statement -> connection ) || CHECK_SQLSETSTMTATTRW( statement -> connection ))) { SQLINTEGER info_type, ivp; switch( crow_keyset ) { case SQL_SCROLL_FORWARD_ONLY: info_type = SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2; break; case SQL_SCROLL_STATIC: info_type = SQL_STATIC_CURSOR_ATTRIBUTES2; break; case SQL_SCROLL_KEYSET_DRIVEN: info_type = SQL_KEYSET_CURSOR_ATTRIBUTES2; break; case SQL_SCROLL_DYNAMIC: info_type = SQL_DYNAMIC_CURSOR_ATTRIBUTES2; break; default: if ( crow_keyset > crow_rowset ) { info_type = SQL_KEYSET_CURSOR_ATTRIBUTES2; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1107" ); __post_internal_error( &statement -> error, ERROR_S1107, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } break; } ret = __SQLGetInfo( statement -> connection, info_type, &ivp, sizeof( ivp ), 0 ); if( !SQL_SUCCEEDED( ret )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQLGetInfo fails" ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } if ( f_concurrency == SQL_CONCUR_READ_ONLY && !( ivp & SQL_CA2_READ_ONLY_CONCURRENCY )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1C00" ); __post_internal_error( &statement -> error, ERROR_S1C00, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } else if ( f_concurrency == SQL_CONCUR_LOCK && !( ivp & SQL_CA2_LOCK_CONCURRENCY )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1C00" ); __post_internal_error( &statement -> error, ERROR_S1C00, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } else if ( f_concurrency == SQL_CONCUR_ROWVER && !( ivp & SQL_CA2_OPT_ROWVER_CONCURRENCY )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1C00" ); __post_internal_error( &statement -> error, ERROR_S1C00, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } if ( f_concurrency == SQL_CONCUR_VALUES && !( ivp & SQL_CA2_OPT_VALUES_CONCURRENCY )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1C00" ); __post_internal_error( &statement -> error, ERROR_S1C00, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } if ( f_concurrency != SQL_CONCUR_READ_ONLY && f_concurrency != SQL_CONCUR_LOCK && f_concurrency != SQL_CONCUR_ROWVER && f_concurrency != SQL_CONCUR_VALUES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1108" ); __post_internal_error( &statement -> error, ERROR_S1108, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } if(CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ATTR_CONCURRENCY, f_concurrency, 0 ); } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ATTR_CONCURRENCY, f_concurrency, 0 ); } if ( !SQL_SUCCEEDED( ret )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQLSetStmtAttr fails" ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } switch( crow_keyset ) { case SQL_SCROLL_FORWARD_ONLY: info_type = SQL_CURSOR_FORWARD_ONLY; break; case SQL_SCROLL_STATIC: info_type = SQL_CURSOR_STATIC; break; case SQL_SCROLL_KEYSET_DRIVEN: info_type = SQL_CURSOR_KEYSET_DRIVEN; break; case SQL_SCROLL_DYNAMIC: info_type = SQL_CURSOR_DYNAMIC; break; default: if ( crow_keyset > crow_rowset ) { info_type = SQL_CURSOR_KEYSET_DRIVEN; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1107" ); __post_internal_error( &statement -> error, ERROR_S1107, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } break; } if(CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ATTR_CURSOR_TYPE, info_type, 0 ); } else if(CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ATTR_CURSOR_TYPE, info_type, 0 ); } if ( !SQL_SUCCEEDED( ret )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQLSetStmtAttr fails" ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } if ( crow_keyset > 0 ) { if(CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ATTR_KEYSET_SIZE, crow_keyset, 0 ); } else if(CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ATTR_KEYSET_SIZE, crow_keyset, 0 ); } if ( !SQL_SUCCEEDED( ret )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQLSetStmtAttr fails" ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R3 ); } } if(CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, crow_rowset, 0 ); } else if(CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, crow_rowset, 0 ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLColAttributesW.c0000644000175000017500000004650513303466667016276 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColAttributesW.c,v 1.14 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLColAttributesW.c,v $ * Revision 1.14 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.13 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.12 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.11 2007/02/28 15:37:47 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.10 2004/11/22 17:02:48 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.9 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.8 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.7 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.6 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.5 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.4 2002/04/25 15:16:46 lurcher * * Fix bug with SQLCOlAttribute(s)(W) where a column of zero could not be * used to get the count value * * Revision 1.3 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.2 2001/11/16 11:39:17 lurcher * * Add mapping between ODBC 2 and ODBC 3 types for SQLColAttribute(s)(W) * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLColAttributesW.c,v $"; SQLRETURN SQLColAttributesW( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLCOLATTRIBUTEW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLCOLATTRIBUTEW( parent_statement -> connection, statement_handle, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Number = %d\ \n\t\t\tField Identifier = %s\ \n\t\t\tCharacter Attr = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tString Length = %p\ \n\t\t\tNumeric Attribute = %p", statement, column_number, __col_attr_as_string( s1, field_identifier ), character_attribute, buffer_length, string_length, numeric_attribute ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( column_number == 0 && statement -> bookmarks_on == SQL_UB_OFF && statement -> connection -> bookmarks_on == SQL_UB_OFF && field_identifier != SQL_COLUMN_COUNT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLCOLATTRIBUTES ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * Commented out for now because most drivers can not calc num cols * before Execute (they have no parse). - PAH * if ( field_identifier != SQL_DESC_COUNT && statement -> numcols < column_number ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ /* * check states */ if ( statement -> state == STATE_S1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S2 && field_identifier != SQL_DESC_COUNT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07005" ); __post_internal_error( &statement -> error, ERROR_07005, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLCOLATTRIBUTES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } switch ( field_identifier ) { case SQL_COLUMN_LABEL: case SQL_COLUMN_NAME: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: if ( buffer_length < 0 && buffer_length != SQL_NTS ) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver || CHECK_SQLCOLATTRIBUTESW( statement -> connection ) || CHECK_SQLCOLATTRIBUTEW( statement -> connection )) { if ( !CHECK_SQLCOLATTRIBUTESW( statement -> connection )) { if ( CHECK_SQLCOLATTRIBUTEW( statement -> connection )) { /* * map to the ODBC3 function */ field_identifier = map_ca_odbc2_to_3( field_identifier ); ret = SQLCOLATTRIBUTEW( statement -> connection, statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { ret = SQLCOLATTRIBUTESW( statement -> connection, statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } } else { if ( !CHECK_SQLCOLATTRIBUTES( statement -> connection )) { if ( CHECK_SQLCOLATTRIBUTE( statement -> connection )) { SQLCHAR *as1 = NULL; /* * map to the ODBC3 function */ field_identifier = map_ca_odbc2_to_3( field_identifier ); switch( field_identifier ) { case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: case SQL_COLUMN_NAME: buffer_length = buffer_length / 2; if ( buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } break; default: break; } ret = SQLCOLATTRIBUTE( statement -> connection, statement -> driver_stmt, column_number, field_identifier, as1 ? as1 : character_attribute, buffer_length, string_length, numeric_attribute ); switch( field_identifier ) { case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: case SQL_COLUMN_NAME: if ( SQL_SUCCEEDED( ret ) && character_attribute && as1 ) { ansi_to_unicode_copy( character_attribute, (char*) as1, SQL_NTS, statement -> connection, NULL ); } if ( as1 ) { free( as1 ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length *= sizeof( SQLWCHAR ); } break; default: break; } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { SQLCHAR *as1 = NULL; switch( field_identifier ) { case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: case SQL_COLUMN_NAME: buffer_length = buffer_length / 2; if ( buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } break; default: break; } ret = SQLCOLATTRIBUTES( statement -> connection, statement -> driver_stmt, column_number, field_identifier, as1 ? as1 : character_attribute, buffer_length, string_length, numeric_attribute ); switch( field_identifier ) { case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: case SQL_COLUMN_NAME: if ( SQL_SUCCEEDED( ret ) && character_attribute && as1 ) { ansi_to_unicode_copy( character_attribute, (char*) as1, SQL_NTS, statement -> connection, NULL ); } if ( as1 ) { free( as1 ); } if ( SQL_SUCCEEDED( ret ) && string_length && character_attribute ) { *string_length *= sizeof( SQLWCHAR ); } break; default: break; } } } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLCOLATTRIBUTES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( SQL_SUCCEEDED( ret )) { /* * map ODBC 3 datetime fields to ODBC2 */ if ( field_identifier == SQL_COLUMN_TYPE && numeric_attribute && statement -> connection -> driver_version == SQL_OV_ODBC2 ) { SQLINTEGER na; memcpy( &na, numeric_attribute, sizeof( na )); switch( na ) { case SQL_TYPE_TIME: na = SQL_TIME; memcpy( numeric_attribute, &na, sizeof( na )); break; case SQL_TYPE_DATE: na = SQL_DATE; memcpy( numeric_attribute, &na, sizeof( na )); break; case SQL_TYPE_TIMESTAMP: na = SQL_TIMESTAMP; memcpy( numeric_attribute, &na, sizeof( na )); break; } } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLSetParam.c0000644000175000017500000003045313303466667015072 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetParam.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetParam.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2005/04/26 08:40:35 lurcher * * Add data type mapping for SQLSetPos. * Remove out of date macro in sqlext.h * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/29 21:07:40 ngorham * * Fix some stupid bugs in the DM * Make the postgres driver work via unix sockets * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.4 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:21 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetParam.c,v $ $Revision: 1.7 $"; int check_value_type( int c_type, int connection_mode) { /* * * driver defined types * */ if ( connection_mode >= SQL_OV_ODBC3_80 && c_type >= 0x4000 && c_type <= 0x7FFF ) { return 1; } switch( c_type ) { case SQL_C_CHAR: case SQL_C_LONG: case SQL_C_SHORT: case SQL_C_FLOAT: case SQL_C_NUMERIC: case SQL_C_DEFAULT: case SQL_C_DATE: case SQL_C_TIME: case SQL_C_TIMESTAMP: case SQL_C_TYPE_DATE: case SQL_C_TYPE_TIME: case SQL_C_TYPE_TIMESTAMP: case SQL_C_INTERVAL_YEAR: case SQL_C_INTERVAL_MONTH: case SQL_C_INTERVAL_DAY: case SQL_C_INTERVAL_HOUR: case SQL_C_INTERVAL_MINUTE: case SQL_C_INTERVAL_SECOND: case SQL_C_INTERVAL_YEAR_TO_MONTH: case SQL_C_INTERVAL_DAY_TO_HOUR: case SQL_C_INTERVAL_DAY_TO_MINUTE: case SQL_C_INTERVAL_DAY_TO_SECOND: case SQL_C_INTERVAL_HOUR_TO_MINUTE: case SQL_C_INTERVAL_HOUR_TO_SECOND: case SQL_C_INTERVAL_MINUTE_TO_SECOND: case SQL_C_BINARY: case SQL_C_BIT: case SQL_C_SBIGINT: case SQL_C_UBIGINT: case SQL_C_TINYINT: case SQL_C_SLONG: case SQL_C_SSHORT: case SQL_C_STINYINT: case SQL_C_ULONG: case SQL_C_USHORT: case SQL_C_UTINYINT: case SQL_C_GUID: case SQL_C_WCHAR: case SQL_ARD_TYPE: case SQL_C_DOUBLE: /* case SQL_C_XML: still trying to find what value this is */ return 1; default: return 0; } } SQLRETURN SQLSetParam( SQLHSTMT statement_handle, SQLUSMALLINT parameter_number, SQLSMALLINT value_type, SQLSMALLINT parameter_type, SQLULEN length_precision, SQLSMALLINT parameter_scale, SQLPOINTER parameter_value, SQLLEN *strlen_or_ind ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tParam Number = %d\ \n\t\t\tValue Type = %d %s\ \n\t\t\tParameter Type = %d %s\ \n\t\t\tLength Precision = %d\ \n\t\t\tParameter Scale = %d\ \n\t\t\tParameter Value = %p\ \n\t\t\tStrLen Or Ind = %p", statement, parameter_number, value_type, __c_as_text( value_type ), parameter_type, __sql_as_text( parameter_type ), (int)length_precision, (int)parameter_scale, (void*)parameter_value, (void*)strlen_or_ind ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( parameter_number < 1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLSETPARAM ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (!check_value_type( value_type, statement -> connection -> environment -> requested_version )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY003" ); __post_internal_error_api( &statement -> error, ERROR_HY003, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLSETPARAM ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( parameter_value == NULL && strlen_or_ind == NULL && value_type != SQL_PARAM_OUTPUT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error_api( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLSETPARAM ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( CHECK_SQLSETPARAM( statement -> connection )) { ret = SQLSETPARAM( statement -> connection, statement -> driver_stmt, parameter_number, __map_type(MAP_C_DM2D,statement->connection,value_type), __map_type(MAP_SQL_DM2D,statement->connection,parameter_type), length_precision, parameter_scale, parameter_value, strlen_or_ind ); } else if ( CHECK_SQLBINDPARAMETER( statement -> connection )) { ret = SQLBINDPARAMETER( statement -> connection, statement -> driver_stmt, parameter_number, SQL_PARAM_INPUT_OUTPUT, __map_type(MAP_C_DM2D,statement->connection,value_type), __map_type(MAP_SQL_DM2D,statement->connection,parameter_type), length_precision, parameter_scale, parameter_value, SQL_SETPARAM_VALUE_MAX, strlen_or_ind ); } else if ( CHECK_SQLBINDPARAM( statement -> connection )) { ret = SQLBINDPARAM( statement -> connection, statement -> driver_stmt, parameter_number, __map_type(MAP_C_DM2D,statement->connection,value_type), __map_type(MAP_SQL_DM2D,statement->connection,parameter_type), length_precision, parameter_scale, parameter_value, strlen_or_ind ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLForeignKeysW.c0000644000175000017500000003307413303466667015734 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLForeignKeysW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLForeignKeysW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLForeignKeysW.c,v $"; SQLRETURN SQLForeignKeysW( SQLHSTMT statement_handle, SQLWCHAR *szpk_catalog_name, SQLSMALLINT cbpk_catalog_name, SQLWCHAR *szpk_schema_name, SQLSMALLINT cbpk_schema_name, SQLWCHAR *szpk_table_name, SQLSMALLINT cbpk_table_name, SQLWCHAR *szfk_catalog_name, SQLSMALLINT cbfk_catalog_name, SQLWCHAR *szfk_schema_name, SQLSMALLINT cbfk_schema_name, SQLWCHAR *szfk_table_name, SQLSMALLINT cbfk_table_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s5[ 100 + LOG_MESSAGE_LEN ], s6[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLFOREIGNKEYSW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLFOREIGNKEYSW( parent_statement -> connection, statement, szpk_catalog_name, cbpk_catalog_name, szpk_schema_name, cbpk_schema_name, szpk_table_name, cbpk_table_name, szfk_catalog_name, cbfk_catalog_name, szfk_schema_name, cbfk_schema_name, szfk_table_name, cbfk_table_name ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tPK Catalog Name = %s\ \n\t\t\tPK Schema Name = %s\ \n\t\t\tPK Table Name = %s\ \n\t\t\tFK Catalog Name = %s\ \n\t\t\tFK Schema Name = %s\ \n\t\t\tFK Table Name = %s", statement, __wstring_with_length( s1, szpk_catalog_name, cbpk_catalog_name ), __wstring_with_length( s2, szpk_schema_name, cbpk_schema_name ), __wstring_with_length( s3, szpk_table_name, cbpk_table_name ), __wstring_with_length( s4, szfk_catalog_name, cbfk_catalog_name ), __wstring_with_length( s5, szfk_schema_name, cbfk_schema_name ), __wstring_with_length( s6, szfk_table_name, cbfk_table_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( !szpk_table_name && !szfk_table_name ) { __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (( cbpk_catalog_name < 0 && cbpk_catalog_name != SQL_NTS ) || ( cbpk_schema_name < 0 && cbpk_schema_name != SQL_NTS ) || ( cbpk_table_name < 0 && cbpk_table_name != SQL_NTS ) || ( cbfk_catalog_name < 0 && cbfk_catalog_name != SQL_NTS ) || ( cbfk_schema_name < 0 && cbfk_schema_name != SQL_NTS ) || ( cbfk_table_name < 0 && cbfk_table_name != SQL_NTS )) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if ( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLFOREIGNKEYS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLFOREIGNKEYSW( statement -> connection )) { if ( !CHECK_SQLFOREIGNKEYSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLFOREIGNKEYSW( statement -> connection , statement -> driver_stmt, szpk_catalog_name, cbpk_catalog_name, szpk_schema_name, cbpk_schema_name, szpk_table_name, cbpk_table_name, szfk_catalog_name, cbfk_catalog_name, szfk_schema_name, cbfk_schema_name, szfk_table_name, cbfk_table_name ); } else { SQLCHAR *as1, *as2, *as3, *as4, *as5, *as6; int clen; if ( !CHECK_SQLFOREIGNKEYS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( szpk_catalog_name, cbpk_catalog_name, statement -> connection, &clen ); cbpk_catalog_name = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( szpk_schema_name, cbpk_schema_name, statement -> connection, &clen ); cbpk_schema_name = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( szpk_table_name, cbpk_table_name, statement -> connection, &clen ); cbpk_table_name = clen; as4 = (SQLCHAR*) unicode_to_ansi_alloc( szfk_catalog_name, cbfk_catalog_name, statement -> connection, &clen ); cbfk_catalog_name = clen; as5 = (SQLCHAR*) unicode_to_ansi_alloc( szfk_schema_name, cbfk_schema_name, statement -> connection, &clen ); cbfk_schema_name = clen; as6 = (SQLCHAR*) unicode_to_ansi_alloc( szfk_table_name, cbfk_table_name, statement -> connection, &clen ); cbfk_table_name = clen; ret = SQLFOREIGNKEYS( statement -> connection , statement -> driver_stmt, as1, cbpk_catalog_name, as2, cbpk_schema_name, as3, cbpk_table_name, as4, cbfk_catalog_name, as5, cbfk_schema_name, as6, cbfk_table_name ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); if ( as4 ) free( as4 ); if ( as5 ) free( as5 ); if ( as6 ) free( as6 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLFOREIGNKEYS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLSpecialColumns.c0000644000175000017500000003457213364070773016301 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSpecialColumns.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSpecialColumns.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:40 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.6 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.5 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.4 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.3 2000/12/05 16:49:21 nick * * Add missing identifier_type in SQLSpecialColumns log * * Revision 1.2 2000/11/22 19:03:40 nick * * Fix problem with error status in SQLSpecialColumns * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:56 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSpecialColumns.c,v $ $Revision: 1.7 $"; SQLRETURN SQLSpecialColumnsA( SQLHSTMT statement_handle, SQLUSMALLINT identifier_type, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT scope, SQLUSMALLINT nullable ) { return SQLSpecialColumns( statement_handle, identifier_type, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, scope, nullable ); } SQLRETURN SQLSpecialColumns( SQLHSTMT statement_handle, SQLUSMALLINT identifier_type, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT scope, SQLUSMALLINT nullable ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tIdentifier Type = %d\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tScope = %d\ \n\t\t\tNullable = %d", statement, identifier_type, __string_with_length( s1, catalog_name, name_length1 ), __string_with_length( s2, schema_name, name_length2 ), __string_with_length( s3, table_name, name_length3 ), scope, nullable ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( identifier_type != SQL_BEST_ROWID && identifier_type != SQL_ROWVER ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY097" ); __post_internal_error( &statement -> error, ERROR_HY097, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS )) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( table_name == NULL ) { __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( name_length3 < 0 && name_length3 != SQL_NTS ) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> metadata_id == SQL_TRUE && schema_name == NULL ) { __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( scope != SQL_SCOPE_CURROW && scope != SQL_SCOPE_TRANSACTION && scope != SQL_SCOPE_SESSION ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY098" ); __post_internal_error( &statement -> error, ERROR_HY098, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( nullable != SQL_NO_NULLS && nullable != SQL_NULLABLE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY099" ); __post_internal_error( &statement -> error, ERROR_HY099, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if ( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 2400" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLSPECIALCOLUMNS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3; int wlen; if ( !CHECK_SQLSPECIALCOLUMNSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( catalog_name, name_length1, statement -> connection, &wlen ); name_length1 = wlen; s2 = ansi_to_unicode_alloc( schema_name, name_length2, statement -> connection, &wlen ); name_length2 = wlen; s3 = ansi_to_unicode_alloc( table_name, name_length3, statement -> connection, &wlen ); name_length3 = wlen; ret = SQLSPECIALCOLUMNSW( statement -> connection , statement -> driver_stmt, identifier_type, s1, name_length1, s2, name_length2, s3, name_length3, scope, nullable ); if( s1 ) free( s1 ); if( s2 ) free( s2 ); if( s3 ) free( s3 ); } else { if ( !CHECK_SQLSPECIALCOLUMNS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLSPECIALCOLUMNS( statement -> connection , statement -> driver_stmt, identifier_type, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, scope, nullable ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); */ statement -> numcols = 1; /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLSPECIALCOLUMNS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLDriverConnectW.c0000644000175000017500000006503613520310135016232 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDriverConnectW.c,v 1.18 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDriverConnectW.c,v $ * Revision 1.18 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.17 2009/01/16 11:02:38 lurcher * Interface to GUI for DSN selection * * Revision 1.16 2009/01/12 15:18:15 lurcher * Add interface into odbcinstQ to allow for a dialog if SQLDriverConnect is called without a DSN= * * Revision 1.15 2008/09/29 14:02:44 lurcher * Fix missing dlfcn group option * * Revision 1.14 2007/02/28 15:37:47 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.13 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.12 2003/08/08 11:14:21 lurcher * * Fix UNICODE problem in SQLDriverConnectW * * Revision 1.11 2002/12/20 11:36:46 lurcher * * Update DMEnvAttr code to allow setting in the odbcinst.ini entry * * Revision 1.10 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.9 2002/10/14 09:46:10 lurcher * * Remove extra return * * Revision 1.8 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.7 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.6 2002/07/04 17:27:56 lurcher * * Small bug fixes * * Revision 1.4 2002/05/24 12:42:50 lurcher * * Alter NEWS and ChangeLog to match their correct usage * Additional UNICODE tweeks * * Revision 1.3 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/05/15 10:57:44 nick * * Add initial support for VMS * * Revision 1.4 2001/04/16 15:41:24 nick * * Fix some problems calling non existing error funcs * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/03 11:57:27 nick * * Fix some name collisions * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDriverConnectW.c,v $"; int __parse_connection_string_w( struct con_struct *con_str, SQLWCHAR *str, int str_len ) { struct con_pair *cp; char *local_str, *ptr; int len; int got_dsn = 0; /* if we have a DSN then ignore any DRIVER or FILEDSN */ int got_driver = 0; /* if we have a DRIVER or FILEDSN then ignore any DSN */ con_str -> count = 0; con_str -> list = NULL; if ( str_len == SQL_NTS ) { len = wide_strlen( str ); local_str = malloc( len + 1 ); } else { len = str_len; local_str = malloc( len + 1 ); } unicode_to_ansi_copy( local_str, len+1, str, len, NULL, NULL ); if ( !local_str || strlen( local_str ) == 0 || ( strlen( local_str ) == 1 && *local_str == ';' )) { /* connection-string ::= empty-string [;] */ free( local_str ); return 0; } ptr = local_str; while(( cp = __get_pair( &ptr )) != NULL ) { if ( strcasecmp( cp -> keyword, "DSN" ) == 0 ) { if ( got_driver ) continue; got_dsn = 1; } else if ( strcasecmp( cp -> keyword, "DRIVER" ) == 0 || strcasecmp( cp -> keyword, "FILEDSN" ) == 0 ) { if ( got_dsn ) continue; got_driver = 1; } __append_pair( con_str, cp -> keyword, cp -> attribute ); free( cp -> keyword ); free( cp -> attribute ); free( cp ); } free( local_str ); return 0; } SQLRETURN SQLDriverConnectW( SQLHDBC hdbc, SQLHWND hwnd, SQLWCHAR *conn_str_in, SQLSMALLINT len_conn_str_in, SQLWCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion ) { DMHDBC connection = (DMHDBC)hdbc; struct con_struct con_struct; char *driver = NULL, *dsn = NULL; char lib_name[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver_name[ INI_MAX_PROPERTY_VALUE + 1 ]; SQLWCHAR local_conn_string[ 1024 ]; SQLCHAR local_conn_str_in[ 1024 ]; SQLRETURN ret_from_connect; SQLCHAR s1[ 2048 ]; int warnings = 0; /* * check connection */ strcpy( driver_name, "" ); if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDBC parent_connection; parent_connection = find_parent_handle( connection, SQL_HANDLE_DBC ); if ( parent_connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLDRIVERCONNECTW( parent_connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLDRIVERCONNECTW( parent_connection, connection, hwnd, conn_str_in, len_conn_str_in, conn_str_out, conn_str_out_max, ptr_conn_str_out, driver_completion ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tWindow Hdl = %p\ \n\t\t\tStr In = %s\ \n\t\t\tStr Out = %p\ \n\t\t\tStr Out Max = %d\ \n\t\t\tStr Out Ptr = %p\ \n\t\t\tCompletion = %d", connection, hwnd, __wstring_with_length_hide_pwd( s1, conn_str_in, len_conn_str_in ), conn_str_out, conn_str_out_max, ptr_conn_str_out, driver_completion ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( len_conn_str_in < 0 && len_conn_str_in != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( driver_completion == SQL_DRIVER_PROMPT && hwnd == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( driver_completion != SQL_DRIVER_PROMPT && driver_completion != SQL_DRIVER_COMPLETE && driver_completion != SQL_DRIVER_COMPLETE_REQUIRED && driver_completion != SQL_DRIVER_NOPROMPT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY110" ); __post_internal_error( &connection -> error, ERROR_HY110, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } /* * check the state of the connection */ if ( connection -> state != STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } /* * parse the connection string */ if ( driver_completion == SQL_DRIVER_NOPROMPT ) { char *ansi_conn_str_in; if ( !conn_str_in ) { ansi_conn_str_in = "DSN=DEFAULT;"; len_conn_str_in = strlen( ansi_conn_str_in ); ansi_to_unicode_copy( local_conn_string, ansi_conn_str_in, len_conn_str_in, connection, NULL ); conn_str_in = local_conn_string; __parse_connection_string( &con_struct, ansi_conn_str_in, len_conn_str_in ); } else { __parse_connection_string_w( &con_struct, conn_str_in, len_conn_str_in ); } } else { char *ansi_conn_str_in; if ( !conn_str_in ) { ansi_conn_str_in = ""; len_conn_str_in = strlen( ansi_conn_str_in ); __parse_connection_string( &con_struct, ansi_conn_str_in, len_conn_str_in ); } else { __parse_connection_string_w( &con_struct, conn_str_in, len_conn_str_in ); } if ( !__get_attribute_value( &con_struct, "DSN" ) && !__get_attribute_value( &con_struct, "DRIVER" ) && !__get_attribute_value( &con_struct, "FILEDSN" )) { int ret; SQLWCHAR returned_wdsn[ 1025 ]; SQLCHAR *prefix, *target, returned_dsn[ 1025 ]; /* * try and call GUI to obtain a DSN */ ret = _SQLDriverConnectPromptW( hwnd, returned_wdsn, sizeof( returned_wdsn )); if ( !ret || returned_wdsn[ 0 ] == 0 ) { __append_pair( &con_struct, "DSN", "DEFAULT" ); } else { unicode_to_ansi_copy((char*) returned_dsn, sizeof( returned_dsn ), returned_wdsn, SQL_NTS, connection, NULL ); prefix = returned_dsn; target = (SQLCHAR*)strchr( (char*)returned_dsn, '=' ); if ( target ) { *target = '\0'; target ++; __append_pair( &con_struct, (char*)prefix, (char*)target ); } else { __append_pair( &con_struct, "DSN", (char*)returned_dsn ); } } /* * regenerate to pass to driver */ __generate_connection_string( &con_struct, (char*)local_conn_str_in, sizeof( local_conn_str_in )); len_conn_str_in = strlen((char*) local_conn_str_in ); ansi_to_unicode_copy( local_conn_string, (char*)local_conn_str_in, len_conn_str_in, connection, NULL ); conn_str_in = local_conn_string; } } /* * look for some keywords * * TO_DO FILEDSN's * * have we got a DRIVER= attribute */ driver = __get_attribute_value( &con_struct, "DRIVER" ); if ( driver ) { /* * look up the driver in the ini file */ strcpy( driver_name, driver ); #ifdef PLATFORM64 SQLGetPrivateProfileString( driver, "Driver64", "", lib_name, sizeof( lib_name ), "ODBCINST.INI" ); if ( lib_name[ 0 ] == '\0' ) { SQLGetPrivateProfileString( driver, "Driver", "", lib_name, sizeof( lib_name ), "ODBCINST.INI" ); } #else SQLGetPrivateProfileString( driver, "Driver", "", lib_name, sizeof( lib_name ), "ODBCINST.INI" ); #endif /* * Assume if it's not in a odbcinst.ini then it's a direct reference */ if ( lib_name[ 0 ] == '\0' ) { strcpy( lib_name, driver ); } strcpy( connection -> dsn, "" ); __handle_attr_extensions( connection, NULL, driver_name ); } else { dsn = __get_attribute_value( &con_struct, "DSN" ); if ( !dsn ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( strlen( dsn ) > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM012" ); __post_internal_error( &connection -> error, ERROR_IM012, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } /* * look up the dsn in the ini file */ if ( !__find_lib_name( dsn, lib_name, driver_name )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } strcpy( connection -> dsn, dsn ); __handle_attr_extensions( connection, dsn, driver_name ); } if ( dsn ) { /* * do we have any Environment, Connection, or Statement attributes set in the ini ? */ __handle_attr_extensions( connection, dsn, driver_name ); } else { /* * the attributes may be in the connection string */ __handle_attr_extensions_cs( connection, &con_struct ); } __release_conn( &con_struct ); /* * we have now got the name of a lib to load */ if ( !__connect_part_one( connection, lib_name, driver_name, &warnings )) { __disconnect_part_four( connection ); /* release unicode handles */ return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( !CHECK_SQLDRIVERCONNECTW( connection ) && !CHECK_SQLDRIVERCONNECT( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( CHECK_SQLDRIVERCONNECTW( connection )) { if ( CHECK_SQLSETCONNECTATTR( connection )) { SQLSETCONNECTATTR( connection, connection -> driver_dbc, SQL_ATTR_ANSI_APP, SQL_AA_FALSE, 0 ); } ret_from_connect = SQLDRIVERCONNECTW( connection, connection -> driver_dbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out, conn_str_out_max, ptr_conn_str_out, driver_completion ); if ( ret_from_connect != SQL_SUCCESS ) { SQLWCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLWCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; /* * get the errors from the driver before * loseing the connection */ if ( CHECK_SQLERRORW( connection )) { do { ret = SQLERRORW( connection, SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex_w_noprefix( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGRECW( connection )) { int rec = 1; do { ret = SQLGETDIAGRECW( connection, SQL_HANDLE_DBC, connection -> driver_dbc, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex_w_noprefix( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while( SQL_SUCCEEDED( ret )); } /* * if it was a error then return now */ if ( !SQL_SUCCEEDED( ret_from_connect )) { __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return( SQL_HANDLE_DBC, connection, ret_from_connect, DEFER_R0 ); } } connection -> unicode_driver = 1; } else { char *in_str, *out_str; int in_len, len; if ( conn_str_in ) { if ( len_conn_str_in == SQL_NTS ) { len = wide_strlen( conn_str_in ); } else { len = len_conn_str_in; } in_len = len + 1; in_str = malloc( in_len ); unicode_to_ansi_copy( in_str, in_len, conn_str_in, len, connection, NULL ); } else { in_str = NULL; } if ( conn_str_out && conn_str_out_max > 0 ) { out_str = malloc( conn_str_out_max + sizeof( SQLWCHAR ) ); } else { out_str = NULL; } ret_from_connect = SQLDRIVERCONNECT( connection, connection -> driver_dbc, hwnd, (SQLCHAR*)in_str, len_conn_str_in, (SQLCHAR*)out_str, conn_str_out_max, ptr_conn_str_out, driver_completion ); if ( in_str ) { free( in_str ); } if ( out_str ) { if ( SQL_SUCCEEDED( ret_from_connect )) { ansi_to_unicode_copy( conn_str_out, out_str, SQL_NTS, connection, NULL ); } free( out_str ); } if ( ret_from_connect != SQL_SUCCESS ) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; /* * get the errors from the driver before * loseing the connection */ if ( CHECK_SQLERROR( connection )) { do { ret = SQLERROR( connection, SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex_noprefix( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGREC( connection )) { int rec = 1; do { ret = SQLGETDIAGREC( connection, SQL_HANDLE_DBC, connection -> driver_dbc, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex_noprefix( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } } while( SQL_SUCCEEDED( ret )); } /* * if it was a error then return now */ if ( !SQL_SUCCEEDED( ret_from_connect )) { __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return( SQL_HANDLE_DBC, connection, ret_from_connect, DEFER_R0 ); } } connection -> unicode_driver = 0; } /* * we should be connected now */ connection -> state = STATE_C4; /* * did we get the type we wanted */ if ( connection -> driver_version != connection -> environment -> requested_version ) { connection -> driver_version = connection -> environment -> requested_version; __post_internal_error( &connection -> error, ERROR_01000, "Driver does not support the requested version", connection -> environment -> requested_version ); ret_from_connect = SQL_SUCCESS_WITH_INFO; } if ( !__connect_part_two( connection )) { __disconnect_part_two( connection ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( log_info.log_flag ) { if ( conn_str_out && wide_strlen( conn_str_out ) > 64 ) { sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tConnection Out [%.64s...]", __get_return_status( ret_from_connect, s1 ), __wstring_with_length_hide_pwd( s1, conn_str_out, SQL_NTS )); } else { char null[ 20 ]; strcpy( null, "NULL" ); sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tConnection Out [%s]", __get_return_status( ret_from_connect, s1 ), __wstring_with_length_hide_pwd( s1, conn_str_out, SQL_NTS )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } if ( warnings && ret_from_connect == SQL_SUCCESS ) { ret_from_connect = SQL_SUCCESS_WITH_INFO; } return function_return_nodrv( SQL_HANDLE_DBC, connection, ret_from_connect ); } unixODBC-2.3.9/DriverManager/SQLTablePrivileges.c0000644000175000017500000002702613303466667016441 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLTablePrivileges.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLTablePrivileges.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.7 2006/07/26 16:29:48 lurcher * Fix unicode translation for SQLTablePrivileges * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:40 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:56 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLTablePrivileges.c,v $ $Revision: 1.9 $"; SQLRETURN SQLTablePrivilegesA( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_table_name, SQLSMALLINT cb_table_name ) { return SQLTablePrivileges( statement_handle, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); } SQLRETURN SQLTablePrivileges( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_table_name, SQLSMALLINT cb_table_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s", statement, __string_with_length( s1, sz_catalog_name, cb_catalog_name ), __string_with_length( s2, sz_schema_name, cb_schema_name ), __string_with_length( s3, sz_table_name, cb_table_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( sz_catalog_name && cb_catalog_name < 0 && cb_catalog_name != SQL_NTS ) || ( sz_schema_name && cb_schema_name < 0 && cb_schema_name != SQL_NTS ) || ( sz_table_name && cb_table_name < 0 && cb_table_name != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLTABLEPRIVILEGES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3; int wlen; if ( !CHECK_SQLTABLEPRIVILEGESW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( sz_catalog_name, cb_catalog_name, statement -> connection, &wlen ); cb_catalog_name = wlen; s2 = ansi_to_unicode_alloc( sz_schema_name, cb_schema_name, statement -> connection, &wlen ); cb_schema_name = wlen; s3 = ansi_to_unicode_alloc( sz_table_name, cb_table_name, statement -> connection, &wlen ); cb_table_name = wlen; ret = SQLTABLEPRIVILEGESW( statement -> connection , statement -> driver_stmt, s1, cb_catalog_name, s2, cb_schema_name, s3, cb_table_name ); if( s1 ) free( s1 ); if( s2 ) free( s2 ); if( s3 ) free( s3 ); } else { if ( !CHECK_SQLTABLEPRIVILEGES( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLTABLEPRIVILEGES( statement -> connection , statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLTABLEPRIVILEGES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLDescribeColW.c0000644000175000017500000003454713303466667015673 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDescribeColW.c,v 1.14 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDescribeColW.c,v $ * Revision 1.14 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.13 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.12 2008/05/20 13:43:47 lurcher * Vms fixes * * Revision 1.11 2007/04/02 10:50:18 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.10 2007/02/28 15:37:47 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.9 2007/01/02 10:27:50 lurcher * Fix descriptor leak with unicode only driver * * Revision 1.8 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.7 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.5 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.4 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/05/21 14:19:44 lurcher * * * Update libtool to escape from AIX build problem * * Add fix to avoid file handle limitations * * Add more UNICODE changes, it looks like it is native 16 representation * the old way can be reproduced by defining UCS16BE * * Add iusql, its just the same as isql but uses the wide functions * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/03/21 12:26:27 nick * * Alter def for SQLDescribeColW * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDescribeColW.c,v $"; SQLRETURN SQLDescribeColW( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLWCHAR *column_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length, SQLSMALLINT *data_type, SQLULEN *column_size, SQLSMALLINT *decimal_digits, SQLSMALLINT *nullable ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s5[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s6[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLDESCRIBECOLW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLDESCRIBECOLW( parent_statement -> connection, statement_handle, column_number, column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Number = %d\ \n\t\t\tColumn Name = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tName Length = %p\ \n\t\t\tData Type = %p\ \n\t\t\tColumn Size = %p\ \n\t\t\tDecimal Digits = %p\ \n\t\t\tNullable = %p", statement, column_number, column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( column_number == 0 && statement -> bookmarks_on == SQL_UB_OFF && statement -> connection -> bookmarks_on == SQL_UB_OFF ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLDESCRIBECOL ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * sadly we can't trust the numcols value * if ( statement -> numcols < column_number ) { __post_internal_error( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ if ( buffer_length < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * This seems to be down to the driver in the MS DM * else if ( statement -> state == STATE_S2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07005" ); __post_internal_error( &statement -> error, ERROR_07005, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ else if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLDESCRIBECOL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver || CHECK_SQLDESCRIBECOLW( statement -> connection )) { if ( !CHECK_SQLDESCRIBECOLW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLDESCRIBECOLW( statement -> connection, statement -> driver_stmt, column_number, column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); } else { SQLCHAR *as1 = NULL; if ( !CHECK_SQLDESCRIBECOL( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( buffer_length > 0 && column_name ) { as1 = malloc( buffer_length + 1 ); } ret = SQLDESCRIBECOL( statement -> connection, statement -> driver_stmt, column_number, as1 ? as1 : (SQLCHAR*)column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); if ( column_name && as1 ) { ansi_to_unicode_copy( column_name, (char*) as1, SQL_NTS, statement -> connection, NULL ); } if ( as1 ) { free( as1 ); } } if ( (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) && data_type ) { *data_type=__map_type(MAP_SQL_D2DM,statement->connection, *data_type); } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLDESCRIBECOL; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } if ( log_info.log_flag ) { if ( !SQL_SUCCEEDED( ret )) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s6 )); } else { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tColumn Name = %s\ \n\t\t\tData Type = %s\ \n\t\t\tColumn Size = %s\ \n\t\t\tDecimal Digits = %s\ \n\t\t\tNullable = %s", __get_return_status( ret, s6 ), __sdata_as_string( s1, SQL_WCHAR, name_length, column_name ), __sptr_as_string( s2, data_type ), __ptr_as_string( s3, (SQLLEN*)column_size ), __sptr_as_string( s4, decimal_digits ), __sptr_as_string( s5, nullable )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLProcedureColumnsW.c0000644000175000017500000002726013303466667017000 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLProcedureColumnsW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLProcedureColumnsW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLProcedureColumnsW.c,v $"; SQLRETURN SQLProcedureColumnsW( SQLHSTMT statement_handle, SQLWCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLWCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLWCHAR *sz_proc_name, SQLSMALLINT cb_proc_name, SQLWCHAR *sz_column_name, SQLSMALLINT cb_column_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLPROCEDURECOLUMNSW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLPROCEDURECOLUMNSW( parent_statement -> connection, statement_handle, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name, sz_column_name, cb_column_name ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tProc Name = %s\ \n\t\t\tColumn Type = %s", statement, __wstring_with_length( s1, sz_catalog_name, cb_catalog_name ), __wstring_with_length( s2, sz_schema_name, cb_schema_name ), __wstring_with_length( s3, sz_proc_name, cb_proc_name ), __wstring_with_length( s4, sz_column_name, cb_column_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( sz_catalog_name && cb_catalog_name < 0 && cb_catalog_name != SQL_NTS ) || ( sz_schema_name && cb_schema_name < 0 && cb_schema_name != SQL_NTS ) || ( sz_proc_name && cb_proc_name < 0 && cb_proc_name != SQL_NTS ) || ( sz_column_name && cb_column_name < 0 && cb_column_name != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPROCEDURECOLUMNS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLPROCEDURECOLUMNSW( statement -> connection )) { if ( !CHECK_SQLPROCEDURECOLUMNSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPROCEDURECOLUMNSW( statement -> connection , statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name, sz_column_name, cb_column_name ); } else { SQLCHAR *as1, *as2, *as3, *as4; int clen; if ( !CHECK_SQLPROCEDURECOLUMNS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( sz_catalog_name, cb_catalog_name, statement -> connection, &clen ); cb_catalog_name = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( sz_schema_name, cb_schema_name, statement -> connection, &clen ); cb_schema_name = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( sz_proc_name, cb_proc_name, statement -> connection, &clen ); cb_proc_name = clen; as4 = (SQLCHAR*) unicode_to_ansi_alloc( sz_column_name, cb_column_name, statement -> connection, &clen ); cb_column_name = clen; ret = SQLPROCEDURECOLUMNS( statement -> connection , statement -> driver_stmt, as1, cb_catalog_name, as2, cb_schema_name, as3, cb_proc_name, as4, cb_column_name ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); if ( as4 ) free( as4 ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPROCEDURECOLUMNS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLExecute.c0000644000175000017500000002444013303466667014757 00000000000000/********************************************************************e * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLExecute.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLExecute.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2004/07/25 00:42:02 peteralexharvey * for OS2 port * * Revision 1.7 2004/07/24 17:55:37 lurcher * Sync up CVS * * Revision 1.6 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/07/18 15:21:57 lurcher * * Fix problem with SQLExecute/SQLExecDirect returning SQL_NO_DATA * * Revision 1.3 2002/04/22 02:03:13 peteralexharvey * - added demo flag to DM because Apple MUST have demo versions of all * software they list on their web * * Revision 1.2 2001/11/21 16:58:25 lurcher * * Assorted fixes to make the MAX OSX build work nicer * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/08/17 11:03:35 nick * * Fix final state from SQLExecute if error happens * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.11 2000/06/20 12:43:58 ngorham * * Fix bug that caused a success with info message from SQLExecute or * SQLExecDirect to be lost if used with a ODBC 3 driver and the application * called SQLGetDiagRec * * Revision 1.10 2000/06/16 16:52:17 ngorham * * Stop info messages being lost when calling SQLExecute etc on ODBC 3 * drivers, the SQLNumResultCols were clearing the error before * function return had a chance to get to them * * Revision 1.9 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.7 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.4 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.3 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.2 1999/06/19 17:51:40 ngorham * * Applied assorted minor bug fixes * * Revision 1.1.1.1 1999/05/29 13:41:06 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.5 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLExecute.c,v $ $Revision: 1.9 $"; SQLRETURN SQLExecute( SQLHSTMT statement_handle ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p", statement ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { if ( statement -> prepared ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); } return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S1 || statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLEXECUTE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( !CHECK_SQLEXECUTE( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLEXECUTE( statement -> connection , statement -> driver_stmt ); if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE SQLRETURN local_ret; /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } local_ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); if ( statement -> numcols > 0 ) statement -> state = STATE_S5; else statement -> state = STATE_S4; #else /* * We don't know for sure */ statement -> hascols = 1; statement -> state = STATE_S5; #endif } else if ( ret == SQL_NO_DATA ) { statement -> state = STATE_S4; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLEXECUTE; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( ret == SQL_NEED_DATA ) { statement -> interupted_func = SQL_API_SQLEXECUTE; statement -> interupted_state = statement -> state; statement -> state = STATE_S8; } else if ( ret == SQL_PARAM_DATA_AVAILABLE ) { statement -> interupted_func = SQL_API_SQLEXECUTE; statement -> interupted_state = statement -> state; statement -> state = STATE_S13; } else { statement -> state = STATE_S2; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLSetDescField.c0000644000175000017500000002740313303466667015655 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetDescField.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetDescField.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2007/05/25 16:42:32 lurcher * Sync up * * Revision 1.5 2005/11/21 17:25:43 lurcher * A few DM fixes for Oracle's ODBC driver * * Revision 1.4 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2003/02/27 12:19:40 lurcher * * Add the A functions as well as the W * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/17 16:29:39 nick * * More checks and autotest fixes * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetDescField.c,v $ $Revision: 1.7 $"; SQLRETURN SQLSetDescFieldA( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length ) { return SQLSetDescField( descriptor_handle, rec_number, field_identifier, value, buffer_length ); } SQLRETURN SQLSetDescField( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length ) { /* * not quite sure how the descriptor can be * allocated to a statement, all the documentation talks * about state transitions on statement states, but the * descriptor may be allocated with more than one statement * at one time. Which one should I check ? */ DMHDESC descriptor = (DMHDESC) descriptor_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; int isStrField = 0; /* * check descriptor */ if ( !__validate_desc( descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( descriptor ); if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tEntry:\ \n\t\t\tDescriptor = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tField Ident = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Length = %d", descriptor, rec_number, __desc_attr_as_string( s1, field_identifier ), value, (int)buffer_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } thread_protect( SQL_HANDLE_DESC, descriptor ); if ( descriptor -> connection -> state < STATE_C4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } /* * check status of statements associated with this descriptor */ if( __check_stmt_from_desc( descriptor, STATE_S8 ) || __check_stmt_from_desc( descriptor, STATE_S9 ) || __check_stmt_from_desc( descriptor, STATE_S10 ) || __check_stmt_from_desc( descriptor, STATE_S11 ) || __check_stmt_from_desc( descriptor, STATE_S12 ) || __check_stmt_from_desc( descriptor, STATE_S13 ) || __check_stmt_from_desc( descriptor, STATE_S14 ) || __check_stmt_from_desc( descriptor, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( rec_number < 0 ) { __post_internal_error( &descriptor -> error, ERROR_07009, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } switch ( field_identifier ) { /* Fixed-length fields: buffer_length is ignored */ case SQL_DESC_ALLOC_TYPE: case SQL_DESC_ARRAY_SIZE: case SQL_DESC_ARRAY_STATUS_PTR: case SQL_DESC_BIND_OFFSET_PTR: case SQL_DESC_BIND_TYPE: case SQL_DESC_COUNT: case SQL_DESC_ROWS_PROCESSED_PTR: case SQL_DESC_AUTO_UNIQUE_VALUE: case SQL_DESC_CASE_SENSITIVE: case SQL_DESC_CONCISE_TYPE: case SQL_DESC_DATA_PTR: case SQL_DESC_DATETIME_INTERVAL_CODE: case SQL_DESC_DATETIME_INTERVAL_PRECISION: case SQL_DESC_DISPLAY_SIZE: case SQL_DESC_FIXED_PREC_SCALE: case SQL_DESC_INDICATOR_PTR: case SQL_DESC_LENGTH: case SQL_DESC_NULLABLE: case SQL_DESC_NUM_PREC_RADIX: case SQL_DESC_OCTET_LENGTH: case SQL_DESC_OCTET_LENGTH_PTR: case SQL_DESC_PARAMETER_TYPE: case SQL_DESC_PRECISION: case SQL_DESC_ROWVER: case SQL_DESC_SCALE: case SQL_DESC_SEARCHABLE: case SQL_DESC_TYPE: case SQL_DESC_UNNAMED: case SQL_DESC_UNSIGNED: case SQL_DESC_UPDATABLE: isStrField = 0; break; /* Pointer to data: buffer_length must be valid */ case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: isStrField = 1; break; default: isStrField = buffer_length != SQL_IS_POINTER && buffer_length != SQL_IS_INTEGER && buffer_length != SQL_IS_UINTEGER && buffer_length != SQL_IS_SMALLINT && buffer_length != SQL_IS_USMALLINT; } if ( isStrField && buffer_length < 0 && buffer_length != SQL_NTS) { __post_internal_error( &descriptor -> error, ERROR_HY090, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( field_identifier == SQL_DESC_COUNT && (intptr_t)value < 0 ) { __post_internal_error( &descriptor -> error, ERROR_07009, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( field_identifier == SQL_DESC_PARAMETER_TYPE && (intptr_t)value != SQL_PARAM_INPUT && (intptr_t)value != SQL_PARAM_OUTPUT && (intptr_t)value != SQL_PARAM_INPUT_OUTPUT && (intptr_t)value != SQL_PARAM_INPUT_OUTPUT_STREAM && (intptr_t)value != SQL_PARAM_OUTPUT_STREAM ) { __post_internal_error( &descriptor -> error, ERROR_HY105, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( CHECK_SQLSETDESCFIELD( descriptor -> connection )) { ret = SQLSETDESCFIELD( descriptor -> connection, descriptor -> driver_desc, rec_number, field_identifier, value, buffer_length ); } else if ( CHECK_SQLSETDESCFIELDW( descriptor -> connection )) { SQLWCHAR *s1 = NULL; if (isStrField) { s1 = ansi_to_unicode_alloc( value, buffer_length, descriptor -> connection, NULL ); if (SQL_NTS != buffer_length) { buffer_length *= sizeof(SQLWCHAR); } } else { s1 = value; } ret = SQLSETDESCFIELDW( descriptor -> connection, descriptor -> driver_desc, rec_number, field_identifier, s1, buffer_length ); if (isStrField) { if (s1) free(s1); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } return function_return( SQL_HANDLE_DESC, descriptor, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLSetStmtOptionW.c0000644000175000017500000003306313303466667016301 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetStmtOptionW.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetStmtOptionW.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.4 2007/11/29 12:00:31 lurcher * Add 64 bit type changes to SQLExtendedFetch etc * * Revision 1.3 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.2 2006/04/18 10:24:47 lurcher * Add a couple of changes from Mark Vanderwiel * * Revision 1.1 2005/05/02 20:37:31 lurcher * Add missing SQLSetStmtOptionW.c * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 2000/06/20 13:30:12 ngorham * * Fix problems when using bookmarks * * Revision 1.7 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.4 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:21 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetStmtOptionW.c,v $ $Revision: 1.6 $"; SQLRETURN SQLSetStmtOptionW( SQLHSTMT statement_handle, SQLUSMALLINT option, SQLULEN value ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; SQLWCHAR buffer[ 512 ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLSETSTMTOPTIONW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLSETSTMTOPTIONW( parent_statement -> connection, statement_handle, option, value ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tOption = %s\ \n\t\t\tValue = %d", statement, __stmt_attr_as_string( s1, option ), (int)value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( option == SQL_CONCURRENCY || option == SQL_CURSOR_TYPE || option == SQL_SIMULATE_CURSOR || option == SQL_USE_BOOKMARKS ) { if ( statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1011" ); __post_internal_error( &statement -> error, ERROR_S1011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { if ( statement -> prepared ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1011" ); __post_internal_error( &statement -> error, ERROR_S1011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1010" ); __post_internal_error( &statement -> error, ERROR_S1010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } } else { if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1010" ); __post_internal_error( &statement -> error, ERROR_S1010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( option == SQL_ATTR_IMP_ROW_DESC || option == SQL_ATTR_IMP_PARAM_DESC ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &statement -> error, ERROR_HY017, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * is it a legitimate value */ ret = dm_check_statement_attrs( statement, option, (SQLPOINTER)value ); if ( ret != SQL_SUCCESS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &statement -> error, ERROR_HY024, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * is it something overridden */ value = (SQLULEN) __attr_override_wide( statement, SQL_HANDLE_STMT, option, (void*) value, NULL, buffer ); if ( CHECK_SQLSETSTMTOPTIONW( statement -> connection )) { ret = SQLSETSTMTOPTIONW( statement -> connection, statement -> driver_stmt, option, value ); } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { switch ( option ) { case SQL_ATTR_APP_PARAM_DESC: if ( value ) memcpy( &statement -> apd, (void*)value, sizeof( statement -> apd )); ret = SQL_SUCCESS; break; case SQL_ATTR_APP_ROW_DESC: if ( value ) memcpy( &statement -> ard, (void*)value, sizeof( statement -> ard )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_PARAM_DESC: if ( value ) memcpy( &statement -> ipd, (void*)value, sizeof( statement -> ipd )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_ROW_DESC: if ( value ) memcpy( &statement -> ird, (void*)value, sizeof( statement -> ird )); ret = SQL_SUCCESS; break; default: ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, option, value, SQL_NTS ); break; } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * take notice of this */ if ( option == SQL_USE_BOOKMARKS && SQL_SUCCEEDED( ret )) { statement -> bookmarks_on = (SQLULEN) value; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLNumParams.c0000644000175000017500000001536513303466667015266 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLNumParams.c,v 1.4 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLNumParams.c,v $ * Revision 1.4 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLNumParams.c,v $ $Revision: 1.4 $"; SQLRETURN SQLNumParams( SQLHSTMT statement_handle, SQLSMALLINT *pcpar ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tParam Count = %p", statement, pcpar ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLNUMPARAMS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( !CHECK_SQLNUMPARAMS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLNUMPARAMS( statement -> connection, statement -> driver_stmt, pcpar ); if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLNUMPARAMS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tCount = %s", __get_return_status( ret, s2 ), __sptr_as_string( s1, pcpar )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetStmtAttr.c0000644000175000017500000004031013470563742015566 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetStmtAttr.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetStmtAttr.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.6 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/16 13:08:18 lurcher * * Filter attribute values from SQLSetStmtAttr to SQLSetStmtOption to fit * within ODBC 2 * Make DSN's double clickable in ODBCConfig * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.4 2001/04/18 15:03:37 nick * * Fix problem when going to DB2 unicode driver * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.11 2000/06/24 18:45:09 ngorham * * Fix for SQLExtendedFetch on big endian platforms. the row count pointer * was declared as a small not a int. * * Revision 1.10 2000/02/06 23:26:10 ngorham * * Fix bug with missing '&' with SQLGetStmtAttr * * Revision 1.9 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/10/29 21:07:40 ngorham * * Fix some stupid bugs in the DM * Make the postgres driver work via unix sockets * * Revision 1.7 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.4 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.3 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.2 1999/06/19 17:51:40 ngorham * * Applied assorted minor bug fixes * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.4 1999/06/02 23:48:45 ngorham * * Added more 3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetStmtAttr.c,v $ $Revision: 1.8 $"; SQLRETURN SQLGetStmtAttrA( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { return SQLGetStmtAttr( statement_handle, attribute, value, buffer_length, string_length ); } SQLRETURN SQLGetStmtAttr( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen = %p", statement, __stmt_attr_as_string( s1, attribute ), value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( attribute == SQL_ATTR_ROW_NUMBER || attribute == SQL_GET_BOOKMARK ) { if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 || statement -> state == STATE_S4 || statement -> state == STATE_S5 || (( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) && statement -> eod )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * states S5 - S7 are handled by the driver */ if ( statement -> connection -> unicode_driver ) { if ( !CHECK_SQLGETSTMTATTRW( statement -> connection ) && !CHECK_SQLGETSTMTOPTIONW( statement -> connection ) && !CHECK_SQLGETSTMTATTR( statement -> connection ) && !CHECK_SQLGETSTMTOPTION( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { if ( !CHECK_SQLGETSTMTATTR( statement -> connection ) && !CHECK_SQLGETSTMTOPTION( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * map descriptors to our copies */ if ( attribute == SQL_ATTR_APP_ROW_DESC ) { if ( value ) memcpy( value, &statement -> ard, sizeof( statement -> ard )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_APP_PARAM_DESC ) { if ( value ) memcpy( value, &statement -> apd, sizeof( SQLHANDLE )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_IMP_ROW_DESC ) { if ( value ) memcpy( value, &statement -> ird, sizeof( SQLHANDLE )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_IMP_PARAM_DESC ) { if ( value ) memcpy( value, &statement -> ipd, sizeof( SQLHANDLE )); ret = SQL_SUCCESS; } /* * does the call need mapping from 3 to 2 */ else if ( attribute == SQL_ATTR_FETCH_BOOKMARK_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection )) { if ( value ) memcpy( value, &statement -> fetch_bm_ptr, sizeof( SQLULEN * )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROW_STATUS_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection )) { if ( value ) memcpy( value, &statement -> row_st_arr, sizeof( SQLULEN * )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROWS_FETCHED_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection )) { if ( value ) memcpy( value, &statement -> row_ct_ptr, sizeof( SQLULEN * )); ret = SQL_SUCCESS; } else if ( statement -> connection -> unicode_driver && attribute == SQL_ATTR_ROW_ARRAY_SIZE && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 ) { if ( CHECK_SQLGETSTMTATTRW( statement -> connection )) { ret = SQLGETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value, buffer_length, string_length ); } else { ret = SQLGETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value, buffer_length, string_length ); } } else if ( !statement -> connection -> unicode_driver && attribute == SQL_ATTR_ROW_ARRAY_SIZE && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLGETSTMTATTR( statement -> connection )) { ret = SQLGETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value, buffer_length, string_length ); } else if ( attribute == SQL_ATTR_ROW_ARRAY_SIZE && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 ) { if ( statement -> connection -> unicode_driver && CHECK_SQLGETSTMTOPTIONW( statement -> connection )) { ret = SQLGETSTMTOPTIONW( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value ); } else { ret = SQLGETSTMTOPTION( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value ); } } else if ( statement -> connection -> unicode_driver && ( CHECK_SQLGETSTMTATTRW( statement -> connection ) || CHECK_SQLGETSTMTATTR( statement -> connection ))) { if ( CHECK_SQLGETSTMTATTR( statement -> connection )) { ret = SQLGETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, value, buffer_length, string_length ); } else { ret = SQLGETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, value, buffer_length, string_length ); } } else if ( !statement -> connection -> unicode_driver && CHECK_SQLGETSTMTATTR( statement -> connection )) { ret = SQLGETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, value, buffer_length, string_length ); } else if ( statement -> connection -> unicode_driver && CHECK_SQLGETSTMTOPTIONW( statement -> connection )) { /* * Is it in the legal range of values */ if ( attribute < SQL_STMT_DRIVER_MIN && ( attribute > SQL_ROW_NUMBER || attribute < SQL_QUERY_TIMEOUT )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &statement -> error, ERROR_HY092, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLGETSTMTOPTIONW( statement -> connection, statement -> driver_stmt, attribute, value ); } else { /* * Is it in the legal range of values */ if ( attribute < SQL_STMT_DRIVER_MIN && ( attribute > SQL_ROW_NUMBER || attribute < SQL_QUERY_TIMEOUT )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &statement -> error, ERROR_HY092, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLGETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, value ); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLEndTran.c0000644000175000017500000004354713303466667014721 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLEndTran.c,v 1.11 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLEndTran.c,v $ * Revision 1.11 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.10 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.9 2006/05/31 17:35:34 lurcher * Add unicode ODBCINST entry points * * Revision 1.8 2004/06/16 14:42:03 lurcher * * * Fix potential corruption with threaded use and SQLEndTran * * Revision 1.7 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.6 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.5 2002/09/18 14:49:32 lurcher * * DataManagerII additions and some more threading fixes * * Revision 1.3 2002/08/20 12:41:07 lurcher * * Fix incorrect return state from SQLEndTran/SQLTransact * * Revision 1.2 2002/08/12 16:20:44 lurcher * * Make it try and find a working iconv set of encodings * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 2000/08/16 15:57:51 ngorham * * Fix bug where it falled if called in state C4 * * Revision 1.8 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.4 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.3 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.2 1999/06/19 17:51:40 ngorham * * Applied assorted minor bug fixes * * Revision 1.1.1.1 1999/05/29 13:41:06 sShandyb * first go at it * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLEndTran.c,v $ $Revision: 1.11 $"; SQLRETURN SQLEndTran( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT completion_type ) { SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; if ( handle_type != SQL_HANDLE_ENV && handle_type != SQL_HANDLE_DBC ) { DMHSTMT statement; DMHDESC descriptor; if ( handle_type == SQL_HANDLE_STMT ) { if ( !__validate_stmt(( DMHSTMT ) handle )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } statement = (DMHSTMT) handle; function_entry( statement ); thread_protect( SQL_HANDLE_STMT, statement ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &statement -> error, ERROR_HY092, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( handle_type == SQL_HANDLE_DESC ) { if ( !__validate_desc(( DMHDESC ) handle )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } descriptor = (DMHDESC) handle; function_entry( descriptor ); thread_protect( SQL_HANDLE_DESC, descriptor ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &descriptor -> error, ERROR_HY092, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } } if ( handle_type == SQL_HANDLE_ENV ) { DMHENV environment = (DMHENV) handle; DMHDBC connection; SQLRETURN ret; if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p\ \n\t\t\tCompletion Type = %d", (void*)environment, (int)completion_type ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); if ( completion_type != SQL_COMMIT && completion_type != SQL_ROLLBACK ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY012" ); __post_internal_error( &environment -> error, ERROR_HY012, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( environment -> state == STATE_E2 ) { /* * check that none of the connections are in a need data state */ connection = __get_dbc_root(); while( connection ) { if ( connection -> environment == environment && connection -> state > STATE_C4 ) { if( __check_stmt_from_dbc_v( connection, 8, STATE_S8, STATE_S9, STATE_S10, STATE_S11, STATE_S12, STATE_S13, STATE_S14, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &environment -> error, ERROR_HY010, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } } connection = connection -> next_class_list; } /* * for each connection on this env */ connection = __get_dbc_root(); while( connection ) { if ( connection -> environment == environment && connection -> state > STATE_C4 ) { if ( CHECK_SQLENDTRAN( connection )) { ret = SQLENDTRAN( connection, SQL_HANDLE_DBC, connection -> driver_dbc, completion_type ); if ( !SQL_SUCCEEDED( ret )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 25S01" ); __post_internal_error( &environment -> error, ERROR_25S01, NULL, environment -> requested_version ); return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR, DEFER_R0 ); } } else if ( CHECK_SQLTRANSACT( connection )) { ret = SQLTRANSACT( connection, SQL_NULL_HENV, connection -> driver_dbc, completion_type ); if ( !SQL_SUCCEEDED( ret )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 25S01" ); __post_internal_error( &environment -> error, ERROR_25S01, NULL, environment -> requested_version ); return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR, DEFER_R0 ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } } connection = connection -> next_class_list; } } sprintf( environment -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); return function_return( SQL_HANDLE_ENV, environment, SQL_SUCCESS, DEFER_R0 ); } else if ( handle_type == SQL_HANDLE_DBC ) { DMHDBC connection = (DMHDBC) handle; SQLRETURN ret; if ( !__validate_dbc( connection )) { return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tCompletion Type = %d", (void*)connection, (int)completion_type ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C1 || connection -> state == STATE_C2 || connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * check status of statements belonging to this connection */ if( __check_stmt_from_dbc_v( connection, 8, STATE_S8, STATE_S9, STATE_S10, STATE_S11, STATE_S12, STATE_S13, STATE_S14, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( completion_type != SQL_COMMIT && completion_type != SQL_ROLLBACK ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY012" ); __post_internal_error( &connection -> error, ERROR_HY012, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( CHECK_SQLENDTRAN( connection )) { ret = SQLENDTRAN( connection, handle_type, connection -> driver_dbc, completion_type ); } else if ( CHECK_SQLTRANSACT( connection )) { ret = SQLTRANSACT( connection, SQL_NULL_HENV, connection -> driver_dbc, completion_type ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if( SQL_SUCCEEDED(ret) ) { SQLSMALLINT cb_value; SQLSMALLINT cb_value_length = sizeof(SQLSMALLINT); SQLRETURN ret1; /* * for each statement belonging to this connection set its state * relative to the commit or rollback behavior */ if ( connection -> cbs_found == 0 ) { /* release thread so we can get the info */ thread_release( SQL_HANDLE_DBC, connection ); ret1 = SQLGetInfo(connection, SQL_CURSOR_COMMIT_BEHAVIOR, &connection -> ccb_value, sizeof( SQLSMALLINT ), &cb_value_length); if ( SQL_SUCCEEDED( ret1 )) { ret1 = SQLGetInfo(connection, SQL_CURSOR_ROLLBACK_BEHAVIOR, &connection -> crb_value, sizeof( SQLSMALLINT ), &cb_value_length); } /* protect thread again */ thread_protect( SQL_HANDLE_DBC, connection ); if ( SQL_SUCCEEDED( ret1 )) { connection -> cbs_found = 1; } } if( completion_type == SQL_COMMIT ) { cb_value = connection -> ccb_value; } else { cb_value = connection -> crb_value; } if( connection -> cbs_found ) { __set_stmt_state( connection, cb_value ); } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R0 ); } else { /* * the book here indicates that we can return a HY092 error * here, but on what handle ? */ return SQL_INVALID_HANDLE; } } unixODBC-2.3.9/DriverManager/SQLSetEnvAttr.c0000644000175000017500000002517613303466667015423 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetEnvAttr.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetEnvAttr.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.7 2004/06/21 10:01:11 lurcher * * Fix a couple of 64 bit issues * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.4 2003/01/23 15:33:25 lurcher * * Fix problems with using putenv() * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/02/21 18:44:09 lurcher * * Fix bug on 32 bit platforms without long long support * Add option to set environment variables from the ini file * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.5 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/14 18:10:19 nick * * Add connection pooling * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetEnvAttr.c,v $ $Revision: 1.9 $"; SQLRETURN SQLSetEnvAttr( SQLHENV environment_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { DMHENV environment = (DMHENV) environment_handle; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * we may do someting with these later */ if ( !environment_handle && ( attribute == SQL_ATTR_CONNECTION_POOLING || attribute == SQL_ATTR_CP_MATCH )) { return SQL_SUCCESS; } /* * check environment */ if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tStrLen = %d", environment, __env_attr_as_string( s1, attribute ), value, (int)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); switch ( attribute ) { case SQL_ATTR_CONNECTION_POOLING: { #ifdef HAVE_PTRDIFF_T SQLUINTEGER ptr = (ptrdiff_t) value; #else SQLUINTEGER ptr = (SQLUINTEGER) value; #endif if ( ptr != SQL_CP_OFF && ptr != SQL_CP_ONE_PER_DRIVER && ptr != SQL_CP_ONE_PER_HENV ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &environment -> error, ERROR_HY024, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } environment -> connection_pooling = ptr; } break; case SQL_ATTR_CP_MATCH: { #ifdef HAVE_PTRDIFF_T SQLUINTEGER ptr = (ptrdiff_t) value; #else SQLUINTEGER ptr = (SQLUINTEGER) value; #endif if ( ptr != SQL_CP_STRICT_MATCH && ptr != SQL_CP_RELAXED_MATCH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &environment -> error, ERROR_HY024, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } environment -> cp_match = ptr; } break; case SQL_ATTR_ODBC_VERSION: { #ifdef HAVE_PTRDIFF_T SQLUINTEGER ptr = (ptrdiff_t) value; #else SQLUINTEGER ptr = (SQLUINTEGER) value; #endif if ( ptr != SQL_OV_ODBC2 && ptr != SQL_OV_ODBC3 && ptr != SQL_OV_ODBC3_80 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &environment -> error, ERROR_HY024, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } else { if ( environment -> connection_count > 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1010" ); __post_internal_error( &environment -> error, ERROR_S1010, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } environment -> requested_version = ptr; environment -> version_set = 1; } } break; case SQL_ATTR_OUTPUT_NTS: { #ifdef HAVE_PTRDIFF_T SQLUINTEGER ptr = (ptrdiff_t) value; #else SQLUINTEGER ptr = (SQLUINTEGER) value; #endif /* * this must be one of the most brain dead atribute, * it can be set, but only to TRUE, any other value * (ie FALSE) returns a error. It's almost as if it's not * settable :-) */ if ( ptr == SQL_FALSE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HYC00" ); __post_internal_error( &environment -> error, ERROR_HYC00, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } } break; /* * unixODBC additions */ case SQL_ATTR_UNIXODBC_ENVATTR: if ( value ) { char *str = (char*) value; /* * its a memory leak, but not much I can do, see "man putenv" */ putenv( strdup( str )); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } break; /* * Third party extensions */ case 1064: /* SQL_ATTR_APP_UNICODE_TYPE */ break; default: dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &environment -> error, ERROR_HY092, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_SUCCESS ); } unixODBC-2.3.9/DriverManager/SQLConnect.c0000664000175000017500000040077313616771766014765 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLConnect.c,v 1.66 2009/05/15 15:23:56 lurcher Exp $ * * $Log: SQLConnect.c,v $ * Revision 1.66 2009/05/15 15:23:56 lurcher * Fix pooled connection thread problems * * Revision 1.65 2009/03/26 14:39:21 lurcher * Fix typo in isql * * Revision 1.64 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.63 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.62 2009/01/13 10:54:13 lurcher * Allow setting of default Threading level * * Revision 1.61 2008/11/24 12:44:23 lurcher * Try and tidu up the connection version checking * * Revision 1.60 2008/09/29 14:02:43 lurcher * Fix missing dlfcn group option * * Revision 1.59 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.58 2008/06/17 16:14:13 lurcher * Fix for iconv memory leak and some fixes for CYGWIN * * Revision 1.57 2008/05/30 12:04:55 lurcher * Fix a couple of build problems and get ready for the next release * * Revision 1.56 2007/07/13 14:01:18 lurcher * Fix problem when not using iconv * * Revision 1.55 2007/03/13 10:35:38 lurcher * clear the iconv handles after use * * Revision 1.54 2007/03/07 22:53:29 lurcher * Fix pooling iconv leak, and try and allow the W entry point in a setup lib to be used * * Revision 1.53 2007/01/02 10:27:50 lurcher * Fix descriptor leak with unicode only driver * * Revision 1.52 2006/10/13 08:43:10 lurcher * * * Remove debug printf * * Revision 1.51 2006/06/28 08:08:41 lurcher * Add timestamp with timezone to Postgres7.1 driver * * Revision 1.50 2006/04/11 10:22:56 lurcher * Fix a data type check * * Revision 1.49 2005/11/08 09:37:10 lurcher * Allow the driver and application to have different length handles * * Revision 1.48 2005/10/06 08:50:58 lurcher * Fix problem with SQLDrivers not returning first entry * * Revision 1.47 2005/07/08 12:11:23 lurcher * * Fix a cursor lib problem (it was broken if you did metadata calls) * Alter the params to SQLParamOptions to use SQLULEN * * Revision 1.46 2005/05/24 16:51:57 lurcher * Fix potential for the driver to no have its handle closed * * Revision 1.45 2005/03/01 14:24:40 lurcher * Change DontDLClose default * * Revision 1.44 2005/02/01 10:24:23 lurcher * Cope if SHLIBEXT is not set * * Revision 1.43 2004/12/20 18:06:13 lurcher * Fix small typo in SQLConnect * * Revision 1.42 2004/09/22 09:13:38 lurcher * Replaced crypt auth in postgres with md5 for 7.1 Postgres driver * * Revision 1.41 2004/09/08 16:38:53 lurcher * * Get ready for a 2.2.10 release * * Revision 1.40 2004/07/25 00:42:02 peteralexharvey * for OS2 port * * Revision 1.39 2004/07/24 17:55:37 lurcher * Sync up CVS * * Revision 1.38 2004/06/16 14:42:03 lurcher * * * Fix potential corruption with threaded use and SQLEndTran * * Revision 1.37 2004/05/10 15:58:52 lurcher * * Stop the driver manager calling free handle twice * * Revision 1.36 2004/04/01 12:34:26 lurcher * * Fix minor memory leak * Add support for 64bit HPUX * * Revision 1.35 2004/02/26 15:52:03 lurcher * * Fix potential to call SQLFreeEnv in driver twice * Set default value if call to SQLGetPrivateProfileString fails because * the odbcinst.ini file is not found, and can't be created * * Revision 1.34 2004/02/18 15:47:44 lurcher * * Fix a leak in the iconv code * * Revision 1.33 2004/02/17 11:05:35 lurcher * * 2.2.8 release * * Revision 1.32 2004/02/02 10:10:45 lurcher * * Fix some connection pooling problems * Include sqlucode in sqlext * * Revision 1.31 2003/12/01 16:37:17 lurcher * * Fix a bug in SQLWritePrivateProfileString * * Revision 1.30 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.29 2003/10/06 15:43:46 lurcher * * Fix cursor lib to work with SQLFetch as well as the other fetch calls * Update README.OSX to detail building the cursor lib * * Revision 1.28 2003/09/08 15:34:29 lurcher * * A couple of small but perfectly formed fixes * * Revision 1.27 2003/08/15 17:34:43 lurcher * * Remove some unneeded ODBC2->3 attribute conversions * * Revision 1.26 2003/08/08 11:14:21 lurcher * * Fix UNICODE problem in SQLDriverConnectW * * Revision 1.25 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.24 2003/02/26 13:05:42 lurcher * * Update for new autoconf * * Revision 1.23 2003/02/25 13:28:28 lurcher * * Allow errors on the drivers AllocHandle to be reported * Fix a problem that caused errors to not be reported in the log * Remove a redundant line from the spec file * * Revision 1.22 2003/02/06 18:13:01 lurcher * * Another HP_UX twiddle * * Revision 1.21 2003/02/06 12:58:25 lurcher * * Fix a speeling problem :-) * * Revision 1.20 2002/12/20 11:36:46 lurcher * * Update DMEnvAttr code to allow setting in the odbcinst.ini entry * * Revision 1.19 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.18 2002/11/19 18:52:27 lurcher * * Alter the cursor lib to not require linking to the driver manager. * * Revision 1.17 2002/11/13 15:59:20 lurcher * * More VMS changes * * Revision 1.16 2002/08/27 08:49:02 lurcher * * New version number and fix for cursor lib loading * * Revision 1.15 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.14 2002/08/12 13:17:52 lurcher * * Replicate the way the MS DM handles loading of driver libs, and allocating * handles in the driver. usage counting in the driver means that dlopen is * only called for the first use, and dlclose for the last. AllocHandle for * the driver environment is only called for the first time per driver * per application environment. * * Revision 1.13 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.12 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.11 2002/07/12 09:01:37 lurcher * * Fix problem, with SAPDB where if the connection specifies ODBC 2, the * don't make use of the ODBC 3 method of SQLGetFunctions * * Revision 1.10 2002/07/04 17:27:56 lurcher * * Small bug fixes * * Revision 1.8 2002/05/24 12:42:49 lurcher * * Alter NEWS and ChangeLog to match their correct usage * Additional UNICODE tweeks * * Revision 1.7 2002/03/26 09:35:46 lurcher * * Extend naming of cursor lib to work on non linux platforms * (it expected a .so) * * Revision 1.6 2002/02/21 18:44:09 lurcher * * Fix bug on 32 bit platforms without long long support * Add option to set environment variables from the ini file * * Revision 1.5 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.4 2001/12/19 15:55:53 lurcher * * Add option to disable calling of SQLGetFunctions in driver * * Revision 1.3 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.2 2001/11/21 16:58:25 lurcher * * Assorted fixes to make the MAX OSX build work nicer * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.31 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.30 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.29 2001/08/03 15:19:00 nick * * Add changes to set values before connect * * Revision 1.28 2001/07/31 12:03:46 nick * * Fix how the DM gets the CLI year for SQLGetInfo * Fix small bug in strncasecmp * * Revision 1.27 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.26 2001/06/25 12:55:15 nick * * Fix threading problem with multiple ENV's * * Revision 1.25 2001/06/13 11:23:11 nick * * Fix a couple of portability problems * * Revision 1.24 2001/05/31 16:05:55 nick * * Fix problems with postgres closing local sockets * Make odbctest build with QT 3 (it doesn't work due to what I think are bugs * in QT 3) * Fix a couple of problems in the cursor lib * * Revision 1.23 2001/05/23 11:44:44 nick * * Fix typo * * Revision 1.22 2001/05/09 11:56:47 nick * * Add support for libtool 1.4 * * Revision 1.21 2001/04/18 15:03:37 nick * * Fix problem when going to DB2 unicode driver * * Revision 1.20 2001/04/16 22:35:10 nick * * More tweeks to the AutoTest code * * Revision 1.19 2001/04/16 15:41:24 nick * * Fix some problems calling non existing error funcs * * Revision 1.18 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.17 2001/04/04 11:30:38 nick * * Fix a memory leak in Postgre7.1 * Fix a problem with timed out pooled connections * Add time to live option for pooled connections * * Revision 1.16 2001/04/03 16:34:12 nick * * Add support for strangly broken unicode drivers * * Revision 1.15 2001/03/30 08:35:39 nick * * Fix a couple of pooling problems * * Revision 1.14 2001/03/02 14:24:23 nick * * Fix thread detection for Solaris * * Revision 1.13 2001/02/12 11:20:22 nick * * Add supoort for calling SQLDriverLoad and SQLDriverUnload * * Revision 1.12 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.11 2000/12/18 13:02:13 nick * * More buf fixes * * Revision 1.10 2000/12/17 11:02:37 nick * * Fix extra '*' * * Revision 1.9 2000/12/17 11:00:32 nick * * Add thread safe bits to pooling * * Revision 1.8 2000/12/14 18:10:19 nick * * Add connection pooling * * Revision 1.7 2000/11/29 11:26:18 nick * * Add unicode bits * * Revision 1.6 2000/11/22 18:35:43 nick * * Check input handle before touching output handle * * Revision 1.5 2000/11/22 17:19:32 nick * * Fix tracing problem in SQLConnect * * Revision 1.4 2000/11/14 10:15:27 nick * * Add test for localtime_r * * Revision 1.3 2000/10/25 08:58:55 nick * * Fix crash when null server and SQL_NTS is passed in * * Revision 1.2 2000/10/13 15:18:49 nick * * Change string length parameter from SQLINTEGER to SQLSMALLINT * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.30 2000/07/28 14:57:29 ngorham * * Don't copy the function pointers for ColAttribute, ColAttributes just * set can_supply * * Revision 1.29 2000/06/27 17:34:09 ngorham * * Fix a problem when the second part of the connect failed a seg fault * was generated in the error reporting * * Revision 1.28 2001/05/26 19:11:37 ngorham * * Add SQLCopyDesc functionality and fix bug that was stopping messages * coming out of SQLConnect * * Revision 1.27 2000/05/21 21:49:19 ngorham * * Assorted fixes * * Revision 1.26 2000/04/27 20:49:03 ngorham * * Fixes to work with Star Office 5.2 * * Revision 1.25 2000/04/19 22:00:57 ngorham * * We can always supply SQLGetFunctions * * Revision 1.24 2000/03/11 15:55:47 ngorham * * A few more changes and bug fixes (see NEWS) * * Revision 1.23 2000/02/25 00:02:00 ngorham * * Add a patch to support IBM DB2, and Solaris threads * * Revision 1.22 2000/02/02 07:55:20 ngorham * * Add flag to disable SQLFetch -> SQLExtendedFetch mapping * * Revision 1.21 1999/12/28 15:05:00 ngorham * * Fix bug that caused StarOffice to fail. A SQLConnect, SQLDisconnect, * followed by another SQLConnect on the same DBC would fail. * * Revision 1.20 1999/12/17 09:40:30 ngorham * * Change a error return from HY004 to IM004 * * Revision 1.19 1999/12/14 19:02:25 ngorham * * Mask out the password fields in the logging * * Revision 1.18 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.17 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.16 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.15 1999/10/14 06:49:24 ngorham * * Remove @all_includes@ from Drivers/MiniSQL/Makefile.am * * Revision 1.14 1999/10/09 00:15:58 ngorham * * Add mapping from SQL_TYPE_X to SQL_X and SQL_C_TYPE_X to SQL_C_X * when the driver is a ODBC 2 one * * Revision 1.13 1999/10/07 20:39:25 ngorham * * Added .cvsignore files and fixed a couple of bugs in the DM * * Revision 1.12 1999/10/06 07:10:46 ngorham * * As the book says check dlerror after a dl func * * Revision 1.11 1999/10/06 07:01:25 ngorham * * Added more support for non linux platforms * * Revision 1.10 1999/09/26 18:55:03 ngorham * * Fixed a problem where the cursor lib was being used by default * * Revision 1.9 1999/09/24 22:54:52 ngorham * * Fixed some unchanged dlopen,dlsym,dlclose functions * * Revision 1.8 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.7 1999/09/20 21:46:49 ngorham * * Added support for libtld dlopen replace * * Revision 1.6 1999/09/19 22:24:33 ngorham * * Added support for the cursor library * * Revision 1.5 1999/08/03 21:47:39 shandyb * Moving to automake: changed files in DriverManager * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.4 1999/06/07 01:29:30 pharvey * *** empty log message *** * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.7 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.6 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.5 1999/05/03 19:50:43 nick * Another check point * * Revision 1.4 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.3 1999/04/29 21:40:58 nick * End of another night :-) * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #ifdef HAVE_SYS_TIME_H #include #elif defined(HAVE_TIME_H) #include #endif #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLConnect.c,v $ $Revision: 1.66 $"; #ifdef __OS2__ #define CURSOR_LIB "ODBCCR" #else #define CURSOR_LIB "libodbccr" #endif #ifndef CURSOR_LIB_VER #ifdef DEFINE_CURSOR_LIB_VER #define CURSOR_LIB_VER "2" #endif #endif /* * structure to contain the loaded lib entry points */ static struct driver_func template_func[] = { /* 00 */ { SQL_API_SQLALLOCCONNECT, "SQLAllocConnect", (void*)SQLAllocConnect }, /* 01 */ { SQL_API_SQLALLOCENV, "SQLAllocEnv", (void*)SQLAllocEnv }, /* 02 */ { SQL_API_SQLALLOCHANDLE, "SQLAllocHandle", (void*)SQLAllocHandle }, /* 03 */ { SQL_API_SQLALLOCSTMT, "SQLAllocStmt", (void*)SQLAllocStmt }, /* 04 */ { SQL_API_SQLALLOCHANDLESTD, "SQLAllocHandleStd", (void*)SQLAllocHandleStd }, /* 05 */ { SQL_API_SQLBINDCOL, "SQLBindCol", (void*)SQLBindCol }, /* 06 */ { SQL_API_SQLBINDPARAM, "SQLBindParam", (void*)SQLBindParam }, /* 07 */ { SQL_API_SQLBINDPARAMETER, "SQLBindParameter", (void*)SQLBindParameter }, /* 08 */ { SQL_API_SQLBROWSECONNECT, "SQLBrowseConnect", (void*)SQLBrowseConnect, (void*)SQLBrowseConnectW }, /* 09 */ { SQL_API_SQLBULKOPERATIONS, "SQLBulkOperations", (void*)SQLBulkOperations }, /* 10 */ { SQL_API_SQLCANCEL, "SQLCancel", (void*)SQLCancel }, /* 11 */ { SQL_API_SQLCLOSECURSOR, "SQLCloseCursor", (void*)SQLCloseCursor }, /* 12 */ { SQL_API_SQLCOLATTRIBUTE, "SQLColAttribute", (void*)SQLColAttribute, (void*)SQLColAttributeW }, /* 13 */ { SQL_API_SQLCOLATTRIBUTES, "SQLColAttributes", (void*)SQLColAttributes, (void*)SQLColAttributesW }, /* 14 */ { SQL_API_SQLCOLUMNPRIVILEGES, "SQLColumnPrivileges", (void*)SQLColumnPrivileges, (void*)SQLColumnPrivilegesW }, /* 15 */ { SQL_API_SQLCOLUMNS, "SQLColumns", (void*)SQLColumns, (void*)SQLColumnsW }, /* 16 */ { SQL_API_SQLCONNECT, "SQLConnect", (void*)SQLConnect, (void*)SQLConnectW }, /* 17 */ { SQL_API_SQLCOPYDESC, "SQLCopyDesc", (void*)SQLCopyDesc }, /* 18 */ { SQL_API_SQLDATASOURCES, "SQLDataSources", (void*)SQLDataSources, (void*)SQLDataSourcesW }, /* 19 */ { SQL_API_SQLDESCRIBECOL, "SQLDescribeCol", (void*)SQLDescribeCol, (void*)SQLDescribeColW }, /* 20 */ { SQL_API_SQLDESCRIBEPARAM, "SQLDescribeParam", (void*)SQLDescribeParam }, /* 21 */ { SQL_API_SQLDISCONNECT, "SQLDisconnect", (void*)SQLDisconnect }, /* 22 */ { SQL_API_SQLDRIVERCONNECT, "SQLDriverConnect", (void*)SQLDriverConnect, (void*)SQLDriverConnectW }, /* 23 */ { SQL_API_SQLDRIVERS, "SQLDrivers", (void*)SQLDrivers, (void*)SQLDriversW }, /* 24 */ { SQL_API_SQLENDTRAN, "SQLEndTran", (void*)SQLEndTran }, /* 25 */ { SQL_API_SQLERROR, "SQLError", (void*)SQLError, (void*)SQLErrorW }, /* 26 */ { SQL_API_SQLEXECDIRECT, "SQLExecDirect", (void*)SQLExecDirect, (void*)SQLExecDirectW }, /* 27 */ { SQL_API_SQLEXECUTE, "SQLExecute", (void*)SQLExecute }, /* 28 */ { SQL_API_SQLEXTENDEDFETCH, "SQLExtendedFetch", (void*)SQLExtendedFetch }, /* 29 */ { SQL_API_SQLFETCH, "SQLFetch", (void*)SQLFetch }, /* 30 */ { SQL_API_SQLFETCHSCROLL, "SQLFetchScroll", (void*)SQLFetchScroll }, /* 31 */ { SQL_API_SQLFOREIGNKEYS, "SQLForeignKeys", (void*)SQLForeignKeys, (void*)SQLForeignKeysW }, /* 32 */ { SQL_API_SQLFREEENV, "SQLFreeEnv", (void*)SQLFreeEnv }, /* 33 */ { SQL_API_SQLFREEHANDLE, "SQLFreeHandle", (void*)SQLFreeHandle }, /* 34 */ { SQL_API_SQLFREESTMT, "SQLFreeStmt", (void*)SQLFreeStmt }, /* 35 */ { SQL_API_SQLFREECONNECT, "SQLFreeConnect", (void*)SQLFreeConnect }, /* 36 */ { SQL_API_SQLGETCONNECTATTR, "SQLGetConnectAttr", (void*)SQLGetConnectAttr, (void*)SQLGetConnectAttrW }, /* 37 */ { SQL_API_SQLGETCONNECTOPTION, "SQLGetConnectOption", (void*)SQLGetConnectOption, (void*)SQLGetConnectOptionW }, /* 38 */ { SQL_API_SQLGETCURSORNAME, "SQLGetCursorName", (void*)SQLGetCursorName, (void*)SQLGetCursorNameW }, /* 39 */ { SQL_API_SQLGETDATA, "SQLGetData", (void*)SQLGetData }, /* 40 */ { SQL_API_SQLGETDESCFIELD, "SQLGetDescField", (void*)SQLGetDescField, (void*)SQLGetDescFieldW }, /* 41 */ { SQL_API_SQLGETDESCREC, "SQLGetDescRec", (void*)SQLGetDescRec, (void*)SQLGetDescRecW }, /* 42 */ { SQL_API_SQLGETDIAGFIELD, "SQLGetDiagField", (void*)SQLGetDiagField, (void*)SQLGetDiagFieldW }, /* 43 */ { SQL_API_SQLGETENVATTR, "SQLGetEnvAttr", (void*)SQLGetEnvAttr }, /* 44 */ { SQL_API_SQLGETFUNCTIONS, "SQLGetFunctions", (void*)SQLGetFunctions }, /* 45 */ { SQL_API_SQLGETINFO, "SQLGetInfo", (void*)SQLGetInfo, (void*)SQLGetInfoW }, /* 46 */ { SQL_API_SQLGETSTMTATTR, "SQLGetStmtAttr", (void*)SQLGetStmtAttr, (void*)SQLGetStmtAttrW }, /* 47 */ { SQL_API_SQLGETSTMTOPTION, "SQLGetStmtOption", (void*)SQLGetStmtOption }, /* 48 */ { SQL_API_SQLGETTYPEINFO, "SQLGetTypeInfo", (void*)SQLGetTypeInfo, (void*)SQLGetTypeInfoW }, /* 49 */ { SQL_API_SQLMORERESULTS, "SQLMoreResults", (void*)SQLMoreResults }, /* 50 */ { SQL_API_SQLNATIVESQL, "SQLNativeSql", (void*)SQLNativeSql, (void*)SQLNativeSqlW }, /* 51 */ { SQL_API_SQLNUMPARAMS, "SQLNumParams", (void*)SQLNumParams }, /* 52 */ { SQL_API_SQLNUMRESULTCOLS, "SQLNumResultCols", (void*)SQLNumResultCols }, /* 53 */ { SQL_API_SQLPARAMDATA, "SQLParamData", (void*)SQLParamData }, /* 54 */ { SQL_API_SQLPARAMOPTIONS, "SQLParamOptions", (void*)SQLParamOptions }, /* 55 */ { SQL_API_SQLPREPARE, "SQLPrepare", (void*)SQLPrepare, (void*)SQLPrepareW }, /* 56 */ { SQL_API_SQLPRIMARYKEYS, "SQLPrimaryKeys", (void*)SQLPrimaryKeys, (void*)SQLPrimaryKeysW }, /* 57 */ { SQL_API_SQLPROCEDURECOLUMNS, "SQLProcedureColumns", (void*)SQLProcedureColumns, (void*)SQLProcedureColumnsW }, /* 58 */ { SQL_API_SQLPROCEDURES, "SQLProcedures", (void*)SQLProcedures, (void*)SQLProceduresW }, /* 59 */ { SQL_API_SQLPUTDATA, "SQLPutData", (void*)SQLPutData }, /* 60 */ { SQL_API_SQLROWCOUNT, "SQLRowCount", (void*)SQLRowCount }, /* 61 */ { SQL_API_SQLSETCONNECTATTR, "SQLSetConnectAttr", (void*)SQLSetConnectAttr, (void*)SQLSetConnectAttrW }, /* 62 */ { SQL_API_SQLSETCONNECTOPTION, "SQLSetConnectOption", (void*)SQLSetConnectOption, (void*)SQLSetConnectOptionW }, /* 63 */ { SQL_API_SQLSETCURSORNAME, "SQLSetCursorName", (void*)SQLSetCursorName, (void*)SQLSetCursorNameW }, /* 64 */ { SQL_API_SQLSETDESCFIELD, "SQLSetDescField", (void*)SQLSetDescField, (void*)SQLSetDescFieldW }, /* 65 */ { SQL_API_SQLSETDESCREC, "SQLSetDescRec", (void*)SQLSetDescRec }, /* 66 */ { SQL_API_SQLSETENVATTR, "SQLSetEnvAttr", (void*)SQLSetEnvAttr }, /* 67 */ { SQL_API_SQLSETPARAM, "SQLSetParam", (void*)SQLSetParam }, /* 68 */ { SQL_API_SQLSETPOS, "SQLSetPos", (void*)SQLSetPos }, /* 69 */ { SQL_API_SQLSETSCROLLOPTIONS, "SQLSetScrollOptions", (void*)SQLSetScrollOptions }, /* 70 */ { SQL_API_SQLSETSTMTATTR, "SQLSetStmtAttr", (void*)SQLSetStmtAttr, (void*)SQLSetStmtAttrW }, /* 71 */ { SQL_API_SQLSETSTMTOPTION, "SQLSetStmtOption", (void*)SQLSetStmtOption }, /* 72 */ { SQL_API_SQLSPECIALCOLUMNS, "SQLSpecialColumns", (void*)SQLSpecialColumns, (void*)SQLSpecialColumnsW }, /* 73 */ { SQL_API_SQLSTATISTICS, "SQLStatistics", (void*)SQLStatistics, (void*)SQLStatisticsW }, /* 74 */ { SQL_API_SQLTABLEPRIVILEGES, "SQLTablePrivileges", (void*)SQLTablePrivileges, (void*)SQLTablePrivilegesW }, /* 75 */ { SQL_API_SQLTABLES, "SQLTables", (void*)SQLTables, (void*)SQLTablesW }, /* 76 */ { SQL_API_SQLTRANSACT, "SQLTransact", (void*)SQLTransact }, /* 77 */ { SQL_API_SQLGETDIAGREC, "SQLGetDiagRec", (void*)SQLGetDiagRec, (void*)SQLGetDiagRecW }, /* 78 */ { SQL_API_SQLCANCELHANDLE, "SQLCancelHandle", (void*)SQLCancelHandle }, }; /* * connection pooling stuff */ CPOOL *pool_head = NULL; int pooling_enabled = 0; /* * helper function and macro to make setting any values set before connection * simplier */ #define DO_ATTR( connection, value, attr3, attr2 ) \ do_attr( connection, connection -> value, connection -> value##_set, attr3, \ attr2 ) static void do_attr( DMHDBC connection, int value, int value_set, int attr3, int attr2 ) { if ( value_set ) { if (CHECK_SQLSETCONNECTATTR( connection )) { SQLSETCONNECTATTR(connection, connection -> driver_dbc, attr3, value, sizeof( value )); } else if (CHECK_SQLSETCONNECTOPTION(connection) && attr2 ) { SQLSETCONNECTOPTION(connection, connection -> driver_dbc, attr2, value ); } else if (CHECK_SQLSETCONNECTATTRW( connection )) /* they are int values, so this should be safe */ { SQLSETCONNECTATTRW(connection, connection -> driver_dbc, attr3, value, sizeof( value )); } else if (CHECK_SQLSETCONNECTOPTIONW(connection) && attr2 ) { SQLSETCONNECTOPTIONW(connection, connection -> driver_dbc, attr2, value ); } } } /* * implement reference counting for driver libs */ struct lib_count { char *lib_name; int count; void *handle; struct lib_count *next; }; /* * I hate statics, but there is little option here, there can be multiple envs * so I can't save it in them, I do use a single static instance, this avoid * a potential leak if libodbc.so is dynamically loaded */ static struct lib_count *lib_list = NULL; static struct lib_count single_lib_count; static char single_lib_name[ INI_MAX_PROPERTY_VALUE + 1 ]; static void *odbc_dlopen( char *libname, char **err ) { void *hand; struct lib_count *list; mutex_lib_entry(); /* * have we already got it ? */ list = lib_list; while( list ) { if ( strcmp( list -> lib_name, libname ) == 0 ) { break; } list = list -> next; } if ( list ) { list -> count ++; hand = list -> handle; } else { hand = lt_dlopen( libname ); if ( hand ) { /* * If only one, then use the static space */ if ( lib_list == NULL ) { list = &single_lib_count; list -> next = lib_list; lib_list = list; list -> count = 1; list -> lib_name = single_lib_name; strcpy( single_lib_name, libname ); list -> handle = hand; } else { list = malloc( sizeof( struct lib_count )); list -> next = lib_list; lib_list = list; list -> count = 1; list -> lib_name = strdup( libname ); list -> handle = hand; } } else { if ( err ) { *err = (char*) lt_dlerror(); } } } mutex_lib_exit(); return hand; } static void odbc_dlclose( void *handle ) { struct lib_count *list, *prev; mutex_lib_entry(); /* * look for list entry */ list = lib_list; prev = NULL; while( list ) { if ( list -> handle == handle ) { break; } prev = list; list = list -> next; } /* * it should always be found, but you never know... */ if ( list ) { list -> count --; if ( list -> count < 1 ) { if ( list == &single_lib_count ) { if ( prev ) { prev -> next = list -> next; } else { lib_list = list -> next; } lt_dlclose( list -> handle ); } else { free( list -> lib_name ); lt_dlclose( list -> handle ); if ( prev ) { prev -> next = list -> next; } else { lib_list = list -> next; } free( list ); } } } else { lt_dlclose( handle ); } mutex_lib_exit(); } /* * open the library, extract the names, and do setup * before the actual connect. */ int __connect_part_one( DMHDBC connection, char *driver_lib, char *driver_name, int *warnings ) { int i; int ret; int threading_level; char threading_string[ 50 ]; char mapping_string[ 50 ]; char disable_gf[ 50 ]; char fake_string[ 50 ]; int fake_unicode; char *err; struct env_lib_struct *env_lib_list, *env_lib_prev; /* * check to see if we want to alter the default threading level * before opening the lib */ /* * if the driver comes from odbc.ini not via odbcinst.ini the driver name will be empty * so only look for the entry if it's set */ if ( driver_name[ 0 ] != '\0' ) { SQLGetPrivateProfileString( driver_name, "Threading", "99", threading_string, sizeof( threading_string ), "ODBCINST.INI" ); threading_level = atoi( threading_string ); } else { threading_level = 99; } /* * look for default in [ODBC] section */ if ( threading_level == 99 ) { SQLGetPrivateProfileString( "ODBC", "Threading", "0", threading_string, sizeof( threading_string ), "ODBCINST.INI" ); threading_level = atoi( threading_string ); } if ( threading_level >= 0 && threading_level <= 3 ) { dbc_change_thread_support( connection, threading_level ); } connection -> threading_level = threading_level; /* * do we want to disable the SQLFetch -> SQLExtendedFetch * mapping ? */ SQLGetPrivateProfileString( driver_name, "ExFetchMapping", "1", mapping_string, sizeof( mapping_string ), "ODBCINST.INI" ); connection -> ex_fetch_mapping = atoi( mapping_string ); /* * Does the driver have support for SQLGetFunctions ? */ SQLGetPrivateProfileString( driver_name, "DisableGetFunctions", "0", disable_gf, sizeof( disable_gf ), "ODBCINST.INI" ); connection -> disable_gf = atoi( disable_gf ); /* * do we want to keep hold of the lib handle, DB2 fails if we close */ SQLGetPrivateProfileString( driver_name, "DontDLClose", "1", mapping_string, sizeof( mapping_string ), "ODBCINST.INI" ); connection -> dont_dlclose = atoi( mapping_string ) != 0; /* * can we pool this one */ SQLGetPrivateProfileString( driver_name, "CPTimeout", "0", mapping_string, sizeof( mapping_string ), "ODBCINST.INI" ); connection -> pooling_timeout = atoi( mapping_string ); /* * have we got a time-to-live value for the pooling */ SQLGetPrivateProfileString( driver_name, "CPTimeToLive", "0", mapping_string, sizeof( mapping_string ), "ODBCINST.INI" ); connection -> ttl = atoi( mapping_string ); /* * Is there a check SQL statement */ SQLGetPrivateProfileString( driver_name, "CPProbe", "", connection -> probe_sql, sizeof( connection -> probe_sql ), "ODBCINST.INI" ); /* * if pooling then leave the dlopen */ if ( connection -> pooling_timeout > 0 ) { connection -> dont_dlclose = 1; } SQLGetPrivateProfileString( driver_name, "FakeUnicode", "0", fake_string, sizeof( fake_string ), "ODBCINST.INI" ); fake_unicode = atoi( fake_string ); #ifdef ENABLE_DRIVER_ICONV #ifdef HAVE_ICONV SQLGetPrivateProfileString( driver_name, "IconvEncoding", DEFAULT_ICONV_ENCODING, connection->unicode_string, sizeof( connection->unicode_string ), "ODBCINST.INI" ); #endif /* * initialize unicode */ if ( !unicode_setup( connection )) { char txt[ 256 ]; sprintf( txt, "Can't initiate unicode conversion" ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, txt ); __post_internal_error( &connection -> error, ERROR_IM003, txt, connection -> environment -> requested_version ); *warnings = TRUE; } #endif /* * initialize libtool */ mutex_lib_entry(); /* warning, this doesn't protect from other libs in the application */ /* in their own threads calling dlinit(); */ lt_dlinit(); mutex_lib_exit(); /* * open the lib */ connection -> driver_env = (DRV_SQLHANDLE)NULL; connection -> driver_dbc = (DRV_SQLHANDLE)NULL; connection -> functions = NULL; connection -> dl_handle = NULL; if ( !(connection -> dl_handle = odbc_dlopen( driver_lib, &err ))) { char txt[ 2048 ]; sprintf( txt, "Can't open lib '%s' : %s", driver_lib, err ? err : "NULL ERROR RETURN" ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, txt ); __post_internal_error( &connection -> error, ERROR_01000, txt, connection -> environment -> requested_version ); return 0; } /* * try and extract the ini and fini functions, and call ini if it's * found */ connection -> ini_func.func = (SQLRETURN (*)()) lt_dlsym( connection -> dl_handle, ODBC_INI_FUNCTION ); connection -> fini_func.func = (SQLRETURN (*)()) lt_dlsym( connection -> dl_handle, ODBC_FINI_FUNCTION ); if ( connection -> ini_func.func ) { connection -> ini_func.func(); } /* * extract all the function entry points */ if ( !(connection -> functions = malloc( sizeof( template_func )))) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_HY001, NULL, connection -> environment -> requested_version ); return 0; } memcpy( connection -> functions, template_func, sizeof( template_func )); for ( i = 0; i < sizeof( template_func ) / sizeof( template_func[ 0 ] ); i ++ ) { char name[ 128 ]; connection -> functions[ i ].func = (SQLRETURN (*)()) lt_dlsym( connection -> dl_handle, connection -> functions[ i ].name ); if ( connection -> functions[ i ].dm_funcW ) { /* * get ANSI version from driver */ if ( fake_unicode ) { sprintf( name, "%sW", connection -> functions[ i ].name ); } else { sprintf( name, "%sA", connection -> functions[ i ].name ); } connection -> functions[ i ].funcA = (SQLRETURN (*)()) lt_dlsym( connection -> dl_handle, name ); if ( connection -> functions[ i ].funcA && !connection -> functions[ i ].func ) { connection -> functions[ i ].func = connection -> functions[ i ].funcA; } else if ( connection -> functions[ i ].func && !connection -> functions[ i ].funcA ) { connection -> functions[ i ].funcA = connection -> functions[ i ].func; } /* * get UNICODE version from driver */ sprintf( name, "%sW", connection -> functions[ i ].name ); connection -> functions[ i ].funcW = (SQLRETURN (*)()) lt_dlsym( connection -> dl_handle, name ); } else { connection -> functions[ i ].funcA = connection -> functions[ i ].funcW = NULL; } /* * blank out ones that are in the DM to fix a big * with glib 2.0.6 */ if ( connection -> functions[ i ].func && (void*)connection -> functions[ i ].func == (void*)connection -> functions[ i ].dm_func ) { connection -> functions[ i ].func = NULL; } if ( connection -> functions[ i ].funcW && (void*)connection -> functions[ i ].funcW == (void*)connection -> functions[ i ].dm_funcW ) { connection -> functions[ i ].funcW = NULL; } connection -> functions[ i ].can_supply = ( connection -> functions[ i ].func != NULL ) || ( connection -> functions[ i ].funcW != NULL ); } /* * check if this is the first time this driver has been loaded under this * lib, if not then reuse the env, else get the env from the driver */ mutex_lib_entry(); env_lib_list = connection -> environment -> env_lib_list; env_lib_prev = NULL; while( env_lib_list ) { if ( strcmp( driver_lib, env_lib_list -> lib_name ) == 0 ) { break; } env_lib_prev = env_lib_list; env_lib_list = env_lib_list -> next; } connection -> driver_act_ver = 0; if ( env_lib_list ) { /* * Fix by qcai@starquest.com */ SQLUINTEGER actual_version = 0; int ret; env_lib_list -> count ++; connection -> driver_env = env_lib_list -> env_handle; connection -> env_list_ent = env_lib_list; /* * Fix by qcai@starquest.com, Feb 5, 2003 * * Since the driver was already loaded before, the version number * has been properly figured out. This connection just need to get * it from priviously set value. Without it, the version number is * at initial value of 0 which causes this and subsequence connection * to return a warning message "Driver does not support the requested * version". */ /* * Change from Rafie Einstein to check SQLGETENVATTR is valid */ if ((CHECK_SQLGETENVATTR( connection ))) { ret = SQLGETENVATTR( connection, connection -> driver_env, SQL_ATTR_ODBC_VERSION, &actual_version, 0, NULL ); } else { ret = SQL_SUCCESS; actual_version = SQL_OV_ODBC2; } if ( !ret ) { connection -> driver_version = actual_version; } else { connection -> driver_version = connection -> environment -> requested_version; } /* end of fix */ /* * get value that has been pushed up by the initial connection to this driver */ connection -> driver_act_ver = connection -> environment -> driver_act_ver; } else { env_lib_list = calloc( 1, sizeof( struct env_lib_struct )); env_lib_list -> count = 1; env_lib_list -> next = connection -> environment -> env_lib_list; env_lib_list -> lib_name = strdup( driver_lib ); connection -> env_list_ent = env_lib_list; connection -> environment -> env_lib_list = env_lib_list; __set_local_attributes( connection, SQL_HANDLE_ENV ); /* * allocate a env handle */ if ( CHECK_SQLALLOCHANDLE( connection )) { ret = SQLALLOCHANDLE( connection, SQL_HANDLE_ENV, SQL_NULL_HENV, &connection -> driver_env, connection ); connection -> driver_act_ver = SQL_OV_ODBC3; } else if ( CHECK_SQLALLOCENV( connection )) { ret = SQLALLOCENV( connection, &connection -> driver_env ); connection -> driver_act_ver = SQL_OV_ODBC2; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM004" ); __post_internal_error( &connection -> error, ERROR_IM004, NULL, connection -> environment -> requested_version ); if ( env_lib_list -> count == 1 ) { if ( env_lib_prev ) { env_lib_prev -> next = env_lib_list -> next; } else { connection -> environment -> env_lib_list = env_lib_list -> next; } free( env_lib_list -> lib_name ); free( env_lib_list ); } else { env_lib_list -> count --; } mutex_lib_exit(); return 0; } /* * push up to environment to be reused */ connection -> environment -> driver_act_ver = connection -> driver_act_ver; env_lib_list -> env_handle = connection -> driver_env; if ( ret ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM004" ); __post_internal_error( &connection -> error, ERROR_IM004, NULL, connection -> environment -> requested_version ); if ( env_lib_list -> count == 1 ) { if ( env_lib_prev ) { env_lib_prev -> next = env_lib_list -> next; } else { connection -> environment -> env_lib_list = env_lib_list -> next; } free( env_lib_list -> lib_name ); free( env_lib_list ); } else { env_lib_list -> count --; } mutex_lib_exit(); return 0; } /* * if it looks like a 3.x driver, try setting the interface type * to 3.x */ if ( connection -> driver_act_ver >= SQL_OV_ODBC3 && CHECK_SQLSETENVATTR( connection )) { ret = SQLSETENVATTR( connection, connection -> driver_env, SQL_ATTR_ODBC_VERSION, connection -> environment -> requested_version, 0 ); /* * if it don't set then assume a 2.x driver */ if ( ret ) { connection -> driver_version = SQL_OV_ODBC2; } else { if ( CHECK_SQLGETENVATTR( connection )) { SQLINTEGER actual_version; ret = SQLGETENVATTR( connection, connection -> driver_env, SQL_ATTR_ODBC_VERSION, &actual_version, 0, NULL ); if ( !ret ) { connection -> driver_version = actual_version; } else { connection -> driver_version = connection -> environment -> requested_version; } } else { connection -> driver_version = connection -> environment -> requested_version; } } } else { connection -> driver_version = SQL_OV_ODBC2; } /* * set any env attributes */ __set_attributes( connection, SQL_HANDLE_ENV ); } mutex_lib_exit(); /* * allocate a connection handle */ if ( connection -> driver_version >= SQL_OV_ODBC3 ) { ret = SQL_SUCCESS; if ( CHECK_SQLALLOCHANDLE( connection )) { ret = SQLALLOCHANDLE( connection, SQL_HANDLE_DBC, connection -> driver_env, &connection -> driver_dbc, connection ); if ( ret ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM005" ); __post_internal_error( &connection -> error, ERROR_IM005, NULL, connection -> environment -> requested_version ); } } else if ( CHECK_SQLALLOCCONNECT( connection )) { ret = SQLALLOCCONNECT( connection, connection -> driver_env, &connection -> driver_dbc ); if ( ret ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM005" ); __post_internal_error( &connection -> error, ERROR_IM005, NULL, connection -> environment -> requested_version ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM005" ); __post_internal_error( &connection -> error, ERROR_IM005, NULL, connection -> environment -> requested_version ); return 0; } if ( ret ) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; /* * get the errors from the driver before * loseing the connection */ if ( CHECK_SQLGETDIAGREC( connection )) { int rec = 1; do { ret = SQLGETDIAGREC( connection, SQL_HANDLE_ENV, connection -> driver_env, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, message_text ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLERROR( connection )) { do { ret = SQLERROR( connection, connection -> driver_env, SQL_NULL_HDBC, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, message_text ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } return 0; } } else { ret = SQL_SUCCESS; if ( CHECK_SQLALLOCCONNECT( connection )) { ret = SQLALLOCCONNECT( connection, connection -> driver_env, &connection -> driver_dbc ); if ( ret ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM005" ); __post_internal_error( &connection -> error, ERROR_IM005, NULL, connection -> environment -> requested_version ); } } else if ( CHECK_SQLALLOCHANDLE( connection )) { ret = SQLALLOCHANDLE( connection, SQL_HANDLE_DBC, connection -> driver_env, &connection -> driver_dbc, connection ); if ( ret ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM005" ); __post_internal_error( &connection -> error, ERROR_IM005, NULL, connection -> environment -> requested_version ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM005" ); __post_internal_error( &connection -> error, ERROR_IM005, NULL, connection -> environment -> requested_version ); return 0; } if ( ret ) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; /* * get the errors from the driver before * loseing the connection */ if ( CHECK_SQLERROR( connection )) { do { ret = SQLERROR( connection, connection -> driver_env, SQL_NULL_HDBC, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, message_text ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGREC( connection )) { int rec = 1; do { ret = SQLGETDIAGREC( connection, SQL_HANDLE_ENV, connection -> driver_env, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, message_text ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } return 0; } } /* * set any connection atributes */ DO_ATTR( connection, access_mode, SQL_ATTR_ACCESS_MODE, SQL_ACCESS_MODE ); DO_ATTR( connection, login_timeout, SQL_ATTR_LOGIN_TIMEOUT, SQL_LOGIN_TIMEOUT ); DO_ATTR( connection, auto_commit, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT ); DO_ATTR( connection, async_enable, SQL_ATTR_ASYNC_ENABLE, SQL_ASYNC_ENABLE ); DO_ATTR( connection, auto_ipd, SQL_ATTR_AUTO_IPD, 0 ); DO_ATTR( connection, connection_timeout, SQL_ATTR_CONNECTION_TIMEOUT, 0 ); DO_ATTR( connection, metadata_id, SQL_ATTR_METADATA_ID, 0 ); DO_ATTR( connection, packet_size, SQL_ATTR_PACKET_SIZE, SQL_PACKET_SIZE ); DO_ATTR( connection, quite_mode, SQL_ATTR_QUIET_MODE, SQL_QUIET_MODE ); DO_ATTR( connection, txn_isolation, SQL_ATTR_TXN_ISOLATION, SQL_TXN_ISOLATION ); while ( connection -> save_attr ) { struct save_attr *sa; sa = connection -> save_attr; if ( sa -> str_attr ) { if (CHECK_SQLSETCONNECTATTR( connection )) { SQLSETCONNECTATTR(connection, connection -> driver_dbc, sa -> attr_type, sa -> str_attr, sa -> str_len ); } else if (CHECK_SQLSETCONNECTOPTION(connection)) { SQLSETCONNECTOPTION(connection, connection -> driver_dbc, sa -> attr_type, sa -> str_attr ); } else if (CHECK_SQLSETCONNECTATTRW( connection )) { SQLSETCONNECTATTRW(connection, connection -> driver_dbc, sa -> attr_type, sa -> str_attr, sa -> str_len ); } else if (CHECK_SQLSETCONNECTOPTIONW(connection)) { SQLSETCONNECTOPTIONW(connection, connection -> driver_dbc, sa -> attr_type, sa -> str_attr ); } free( sa -> str_attr ); } else { if (CHECK_SQLSETCONNECTATTR( connection )) { SQLSETCONNECTATTR(connection, connection -> driver_dbc, sa -> attr_type, sa -> intptr_attr, sa -> str_len ); } else if (CHECK_SQLSETCONNECTOPTION(connection)) { SQLSETCONNECTOPTION(connection, connection -> driver_dbc, sa -> attr_type, sa -> intptr_attr ); } else if (CHECK_SQLSETCONNECTATTRW( connection )) { SQLSETCONNECTATTRW(connection, connection -> driver_dbc, sa -> attr_type, sa -> intptr_attr, sa -> str_len ); } else if (CHECK_SQLSETCONNECTOPTIONW(connection)) { SQLSETCONNECTOPTIONW(connection, connection -> driver_dbc, sa -> attr_type, sa -> intptr_attr ); } } connection -> save_attr = sa -> next; free( sa ); } /* * set any preset connection attributes */ __set_attributes( connection, SQL_HANDLE_DBC ); return 1; } /* * extract the available functions and call SQLSetConnectAttr */ int __connect_part_two( DMHDBC connection ) { int i, use_cursor; /* * Call SQLFunctions to get the supported list and * mask out those that are exported but not supported */ if ( CHECK_SQLGETFUNCTIONS( connection ) && !connection -> disable_gf ) { SQLRETURN ret; SQLUSMALLINT supported_funcs[ SQL_API_ODBC3_ALL_FUNCTIONS_SIZE ]; SQLUSMALLINT supported_array[ 100 ]; /* * try using fast version, but only if the driver is set to ODBC 3, * some drivers (SAPDB) fail to return the correct values in this situation */ if ( connection -> driver_act_ver >= SQL_OV_ODBC3 ) { ret = SQLGETFUNCTIONS( connection, connection -> driver_dbc, SQL_API_ODBC3_ALL_FUNCTIONS, supported_funcs ); } else { ret = SQLGETFUNCTIONS( connection, connection -> driver_dbc, SQL_API_ALL_FUNCTIONS, supported_array ); } if ( ret == SQL_SUCCESS ) { for ( i = 0; i < sizeof( template_func ) / sizeof( template_func[ 0 ] ); i ++ ) { if ( connection -> functions[ i ].func ) { SQLRETURN ret; SQLUSMALLINT supported; if ( connection -> driver_act_ver >= SQL_OV_ODBC3 ) { supported = SQL_FUNC_EXISTS( supported_funcs, connection -> functions[ i ].ordinal ); if ( supported == SQL_FALSE ) { connection -> functions[ i ].func = NULL; connection -> functions[ i ].can_supply = 0; } } else { if ( connection -> functions[ i ].ordinal >= 100 ) { ret = SQLGETFUNCTIONS( connection, connection -> driver_dbc, connection -> functions[ i ].ordinal, &supported ); } else { supported = supported_array[ connection -> functions[ i ].ordinal ]; ret = SQL_SUCCESS; } if ( supported == SQL_FALSE || ret != SQL_SUCCESS ) { connection -> functions[ i ].func = NULL; connection -> functions[ i ].can_supply = 0; } } } } } else { for ( i = 0; i < sizeof( template_func ) / sizeof( template_func[ 0 ] ); i ++ ) { if ( connection -> functions[ i ].func ) { SQLRETURN ret; SQLUSMALLINT supported; ret = SQLGETFUNCTIONS( connection, connection -> driver_dbc, connection -> functions[ i ].ordinal, &supported ); if ( supported == SQL_FALSE || ret != SQL_SUCCESS ) { connection -> functions[ i ].func = NULL; connection -> functions[ i ].can_supply = 0; } } } } } /* * CoLAttributes is the same as ColAttribute */ if ( connection -> functions[ DM_SQLCOLATTRIBUTE ].func && !connection -> functions[ DM_SQLCOLATTRIBUTES ].func ) { connection -> functions[ DM_SQLCOLATTRIBUTES ].can_supply = 1; } if ( connection -> functions[ DM_SQLCOLATTRIBUTES ].func && !connection -> functions[ DM_SQLCOLATTRIBUTE ].func ) { connection -> functions[ DM_SQLCOLATTRIBUTE ].can_supply = 1; } /* * mark the functions that the driver manager does */ /* * SQLDatasources */ connection -> functions[ DM_SQLDATASOURCES ].can_supply = 1; /* * SQLDrivers */ connection -> functions[ DM_SQLDRIVERS ].can_supply = 1; /* * SQLAllocHandleStd */ connection -> functions[ DM_SQLALLOCHANDLESTD ].can_supply = 1; /* * add all the functions that are supported via ODBC 2<->3 * issues */ if ( !connection -> functions[ DM_SQLALLOCENV ].func && connection -> functions[ DM_SQLALLOCHANDLE ].func ) { connection -> functions[ DM_SQLALLOCENV ].can_supply = 1; } if ( !connection -> functions[ DM_SQLALLOCCONNECT ].func && connection -> functions[ DM_SQLALLOCHANDLE ].func ) { connection -> functions[ DM_SQLALLOCCONNECT ].can_supply = 1; } if ( !connection -> functions[ DM_SQLALLOCSTMT ].func && connection -> functions[ DM_SQLALLOCHANDLE ].func ) { connection -> functions[ DM_SQLALLOCSTMT ].can_supply = 1; } if ( !connection -> functions[ DM_SQLFREEENV ].func && connection -> functions[ DM_SQLFREEHANDLE ].func ) { connection -> functions[ DM_SQLFREEENV ].can_supply = 1; } if ( !connection -> functions[ DM_SQLFREECONNECT ].func && connection -> functions[ DM_SQLFREEHANDLE ].func ) { connection -> functions[ DM_SQLFREECONNECT ].can_supply = 1; } if ( !connection -> functions[ DM_SQLGETDIAGREC ].func && connection -> functions[ DM_SQLERROR ].func ) { connection -> functions[ DM_SQLGETDIAGREC ].can_supply = 1; } if ( !connection -> functions[ DM_SQLGETDIAGFIELD ].func && connection -> functions[ DM_SQLERROR ].func ) { connection -> functions[ DM_SQLGETDIAGFIELD ].can_supply = 1; } if ( !connection -> functions[ DM_SQLERROR ].func && connection -> functions[ DM_SQLGETDIAGREC ].func ) { connection -> functions[ DM_SQLERROR ].can_supply = 1; } /* * ODBC 3 still needs SQLFreeStmt */ /* * this is only partial, as we can't support a descriptor alloc */ if ( !connection -> functions[ DM_SQLALLOCHANDLE ].func && connection -> functions[ DM_SQLALLOCENV ].func && connection -> functions[ DM_SQLALLOCCONNECT ].func && connection -> functions[ DM_SQLALLOCHANDLE ].func ) { connection -> functions[ DM_SQLALLOCHANDLE ].can_supply = 1; } if ( !connection -> functions[ DM_SQLFREEHANDLE ].func && connection -> functions[ DM_SQLFREEENV ].func && connection -> functions[ DM_SQLFREECONNECT ].func && connection -> functions[ DM_SQLFREEHANDLE ].func ) { connection -> functions[ DM_SQLFREEHANDLE ].can_supply = 1; } if ( !connection -> functions[ DM_SQLBINDPARAM ].func && connection -> functions[ DM_SQLBINDPARAMETER ].func ) { connection -> functions[ DM_SQLBINDPARAM ].can_supply = 1; } else if ( !connection -> functions[ DM_SQLBINDPARAMETER ].func && connection -> functions[ DM_SQLBINDPARAM ].func ) { connection -> functions[ DM_SQLBINDPARAMETER ].can_supply = 1; } if ( !connection -> functions[ DM_SQLGETCONNECTOPTION ].func && connection -> functions[ DM_SQLGETCONNECTATTR ].func ) { connection -> functions[ DM_SQLGETCONNECTOPTION ].can_supply = 1; } else if ( !connection -> functions[ DM_SQLGETCONNECTATTR ].func && connection -> functions[ DM_SQLGETCONNECTOPTION ].func ) { connection -> functions[ DM_SQLGETCONNECTATTR ].can_supply = 1; } if ( !connection -> functions[ DM_SQLGETSTMTOPTION ].func && connection -> functions[ DM_SQLGETSTMTATTR ].func ) { connection -> functions[ DM_SQLGETSTMTOPTION ].can_supply = 1; } else if ( !connection -> functions[ DM_SQLGETSTMTATTR ].func && connection -> functions[ DM_SQLGETSTMTOPTION ].func ) { connection -> functions[ DM_SQLGETSTMTATTR ].can_supply = 1; } if ( !connection -> functions[ DM_SQLPARAMOPTIONS ].func && connection -> functions[ DM_SQLSETSTMTATTR ].func ) { connection -> functions[ DM_SQLPARAMOPTIONS ].can_supply = 1; } if ( !connection -> functions[ DM_SQLSETCONNECTOPTION ].func && connection -> functions[ DM_SQLSETCONNECTATTR ].func ) { connection -> functions[ DM_SQLSETCONNECTOPTION ].can_supply = 1; } else if ( !connection -> functions[ DM_SQLSETCONNECTATTR ].func && connection -> functions[ DM_SQLSETCONNECTOPTION ].func ) { connection -> functions[ DM_SQLSETCONNECTATTR ].can_supply = 1; } if ( !connection -> functions[ DM_SQLSETPARAM ].func && connection -> functions[ DM_SQLBINDPARAMETER ].func ) { connection -> functions[ DM_SQLSETPARAM ].can_supply = 1; } if ( !connection -> functions[ DM_SQLSETSCROLLOPTIONS ].func && connection -> functions[ DM_SQLSETSTMTATTR ].func ) { connection -> functions[ DM_SQLSETSCROLLOPTIONS ].can_supply = 1; } if ( !connection -> functions[ DM_SQLSETSTMTOPTION ].func && connection -> functions[ DM_SQLSETSTMTATTR ].func ) { connection -> functions[ DM_SQLSETSTMTOPTION ].can_supply = 1; } else if ( !connection -> functions[ DM_SQLSETSTMTATTR ].func && connection -> functions[ DM_SQLSETSTMTOPTION ].func ) { connection -> functions[ DM_SQLSETSTMTATTR ].can_supply = 1; } if ( !connection -> functions[ DM_SQLTRANSACT ].func && connection -> functions[ DM_SQLENDTRAN ].func ) { connection -> functions[ DM_SQLTRANSACT ].can_supply = 1; } else if ( !connection -> functions[ DM_SQLENDTRAN ].func && connection -> functions[ DM_SQLTRANSACT ].func ) { connection -> functions[ DM_SQLENDTRAN ].can_supply = 1; } /* * we can always do this */ if ( !connection -> functions[ DM_SQLGETFUNCTIONS ].func ) { connection -> functions[ DM_SQLGETFUNCTIONS ].can_supply = 1; } /* * TO_DO get some driver settings, such as the GETDATA_EXTENSTION * it supports */ if ( CHECK_SQLGETINFO( connection ) || CHECK_SQLGETINFOW( connection )) { char txt[ 20 ]; SQLRETURN ret; if ( connection -> driver_act_ver >= SQL_OV_ODBC3 ) { ret = __SQLGetInfo( connection, SQL_XOPEN_CLI_YEAR, txt, sizeof( connection -> cli_year ), NULL ); if ( SQL_SUCCEEDED( ret )) { strcpy( connection -> cli_year, txt ); } } } /* * TO_DO now we should pass any SQLSetEnvAttr settings */ /* * now we have a connection handle, and we can check to see if * we need to use the cursor library */ if ( connection -> cursors == SQL_CUR_USE_ODBC ) { use_cursor = 1; } else if ( connection -> cursors == SQL_CUR_USE_IF_NEEDED ) { /* * get scrollable info */ if ( !CHECK_SQLGETINFO( connection ) && !CHECK_SQLGETINFOW( connection )) { /* * bit of a retarded driver, better give up */ use_cursor = 0; } else { SQLRETURN ret; SQLUINTEGER val; /* * check if static cursors support scrolling */ if ( connection -> driver_act_ver >= SQL_OV_ODBC3 ) { ret = __SQLGetInfo( connection, SQL_STATIC_CURSOR_ATTRIBUTES1, &val, sizeof( val ), NULL ); if ( ret != SQL_SUCCESS ) { use_cursor = 1; } else { /* * do we need it ? */ if ( !( val & SQL_CA1_ABSOLUTE )) { use_cursor = 1; } else { use_cursor = 0; } } } else { ret = __SQLGetInfo( connection, SQL_FETCH_DIRECTION, &val, sizeof( val ), NULL ); if ( ret != SQL_SUCCESS ) { use_cursor = 1; } else { /* * are we needed */ if ( !( val & SQL_FD_FETCH_PRIOR )) { use_cursor = 1; } else { use_cursor = 0; } } } } } else { use_cursor = 0; } /* * if required connect to the cursor lib */ if ( use_cursor ) { char ext[ 32 ]; char name[ ODBC_FILENAME_MAX * 2 + 1 ]; int (*cl_connect)(void*, struct driver_helper_funcs*); char *err; struct driver_helper_funcs dh; /* * SHLIBEXT can end up unset on some distributions (suze) */ if ( strlen( SHLIBEXT ) == 0 ) { strcpy( ext, ".so" ); } else { if ( strlen( SHLIBEXT ) + 1 > sizeof( ext )) { fprintf( stderr, "internal error, unexpected SHLIBEXT value ('%s') may indicate a problem with configure\n", SHLIBEXT ); abort(); } strcpy( ext, SHLIBEXT ); } #ifdef CURSOR_LIB_VER sprintf( name, "%s%s.%s", CURSOR_LIB, ext, CURSOR_LIB_VER ); #else sprintf( name, "%s%s", CURSOR_LIB, ext ); #endif if ( !(connection -> cl_handle = odbc_dlopen( name, &err ))) { char b1[ ODBC_FILENAME_MAX + 1 ]; /* * try again */ #ifdef CURSOR_LIB_VER #ifdef __VMS sprintf( name, "%s:%s%s.%s", odbcinst_system_file_path( b1 ), CURSOR_LIB, ext, CURSOR_LIB_VER ); #else #ifdef __OS2__ /* OS/2 does not use the system_lib_path or version defines to construct a name */ sprintf( name, "%s.%s", CURSOR_LIB, ext ); #else sprintf( name, "%s/%s%s.%s", odbcinst_system_file_path( b1 ), CURSOR_LIB, ext, CURSOR_LIB_VER ); #endif #endif #else #ifdef __VMS sprintf( name, "%s:%s%s", odbcinst_system_file_path( b1 ), CURSOR_LIB, ext ); #else #ifdef __OS2__ /* OS/2 does not use the system_lib_path or version defines to construct a name */ sprintf( name, "%s%s", CURSOR_LIB, ext ); #else sprintf( name, "%s/%s%s", odbcinst_system_file_path( b1 ), CURSOR_LIB, ext ); #endif #endif #endif if ( !(connection -> cl_handle = odbc_dlopen( name, &err ))) { char txt[ 256 ]; sprintf( txt, "Can't open cursor lib '%s' : %s", name, err ? err : "NULL ERROR RETURN" ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, txt ); __post_internal_error( &connection -> error, ERROR_01000, txt, connection -> environment -> requested_version ); return 0; } } if ( !( cl_connect = (int(*)(void*, struct driver_helper_funcs* ))lt_dlsym( connection -> cl_handle, "CLConnect" ))) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 01000 Unable to load Cursor Lib" ); __post_internal_error( &connection -> error, ERROR_01000, "Unable to load cursor library", connection -> environment -> requested_version ); odbc_dlclose( connection -> cl_handle ); connection -> cl_handle = NULL; return 0; } /* * setup helper functions */ dh.__post_internal_error_ex = __post_internal_error_ex; dh.__post_internal_error = __post_internal_error; dh.dm_log_write = dm_log_write; if ( cl_connect( connection, &dh ) != SQL_SUCCESS ) { odbc_dlclose( connection -> cl_handle ); connection -> cl_handle = NULL; return 0; } } else { connection -> cl_handle = NULL; } return 1; } static void release_env( DMHDBC connection ) { struct env_lib_struct *env_lib_list, *env_lib_prev; int ret; if ( connection -> driver_env ) { env_lib_prev = env_lib_list = NULL; mutex_lib_entry(); if ( connection -> env_list_ent && connection -> environment ) { env_lib_list = connection -> environment -> env_lib_list; while( env_lib_list ) { if ( env_lib_list == connection -> env_list_ent ) { break; } env_lib_prev = env_lib_list; env_lib_list = env_lib_list -> next; } } if ( env_lib_list && env_lib_list -> count > 1 ) { env_lib_list -> count --; } else { if ( connection -> driver_version >= SQL_OV_ODBC3 ) { ret = SQL_ERROR; if ( CHECK_SQLFREEHANDLE( connection )) { ret = SQLFREEHANDLE( connection, SQL_HANDLE_ENV, connection -> driver_env ); } else if ( CHECK_SQLFREEENV( connection )) { ret = SQLFREEENV( connection, connection -> driver_env ); } if ( !ret ) connection -> driver_env = (DRV_SQLHANDLE)NULL; } else { ret = SQL_ERROR; if ( CHECK_SQLFREEENV( connection )) { ret = SQLFREEENV( connection, connection -> driver_env ); } else if ( CHECK_SQLFREEHANDLE( connection )) { ret = SQLFREEHANDLE( connection, SQL_HANDLE_ENV, connection -> driver_env ); } if ( !ret ) connection -> driver_env = (DRV_SQLHANDLE)NULL; } /* * remove the entry */ if ( env_lib_prev && env_lib_list ) { env_lib_prev -> next = env_lib_list -> next; } else { if ( env_lib_list ) { connection -> environment -> env_lib_list = env_lib_list -> next; } } if ( env_lib_list ) { free( env_lib_list -> lib_name ); free( env_lib_list ); } } mutex_lib_exit(); } } /* * clean up after the first part of the connect */ void __disconnect_part_one( DMHDBC connection ) { int ret = SQL_ERROR; /* * try a version 3 disconnect first on the connection */ if ( connection -> driver_dbc ) { if ( connection -> driver_version >= SQL_OV_ODBC3 ) { if ( CHECK_SQLFREEHANDLE( connection )) { ret = SQLFREEHANDLE( connection, SQL_HANDLE_DBC, connection -> driver_dbc ); } else if ( CHECK_SQLFREECONNECT( connection )) { ret = SQLFREECONNECT( connection, connection -> driver_dbc ); } if ( !ret ) { connection -> driver_dbc = (DRV_SQLHANDLE)NULL; } } else { if ( CHECK_SQLFREECONNECT( connection )) { ret = SQLFREECONNECT( connection, connection -> driver_dbc ); } else if ( CHECK_SQLFREEHANDLE( connection )) { ret = SQLFREEHANDLE( connection, SQL_HANDLE_DBC, connection -> driver_dbc ); } if ( !ret ) { connection -> driver_dbc = (DRV_SQLHANDLE)NULL; } } connection -> driver_dbc = (DRV_SQLHANDLE)NULL; } /* * now disconnect the environment, if it's the last usage on the connection */ if ( connection -> driver_env ) { release_env( connection ); } connection -> driver_env = (DRV_SQLHANDLE)NULL; /* * unload the lib */ if ( connection -> cl_handle ) { odbc_dlclose( connection -> cl_handle ); connection -> cl_handle = NULL; } if ( connection -> dl_handle ) { if ( !connection -> dont_dlclose ) { /* * call fini function if found */ if ( connection -> fini_func.func ) { connection -> fini_func.func(); } odbc_dlclose( connection -> dl_handle ); } connection -> dl_handle = NULL; } /* * free some memory */ if ( connection -> functions ) { free( connection -> functions ); connection -> functions = NULL; } } void __disconnect_part_two( DMHDBC connection ) { if ( CHECK_SQLDISCONNECT( connection )) { SQLDISCONNECT( connection, connection -> driver_dbc ); } } /* * final clean up */ void __disconnect_part_four( DMHDBC connection ) { /* * now disconnect the environment, if it's the last usage on the connection */ release_env( connection ); connection -> driver_env = (DRV_SQLHANDLE)NULL; /* * unload the lib */ if ( connection -> cl_handle ) { odbc_dlclose( connection -> cl_handle ); connection -> cl_handle = NULL; } if ( connection -> dl_handle ) { /* * this is safe, because the dlopen function will reuse the handle if we * open the same lib again */ if ( !connection -> dont_dlclose ) { if ( connection -> fini_func.func ) { connection -> fini_func.func(); } odbc_dlclose( connection -> dl_handle ); } connection -> dl_handle = NULL; } /* * free some memory */ if ( connection -> functions ) { free( connection -> functions ); connection -> functions = NULL; } connection -> state = STATE_C2; /* * now clean up any statements that are left about */ __clean_stmt_from_dbc( connection ); __clean_desc_from_dbc( connection ); } /* * normal disconnect */ void __disconnect_part_three( DMHDBC connection ) { if ( connection -> driver_version >= SQL_OV_ODBC3 ) { if ( CHECK_SQLFREEHANDLE( connection )) { SQLFREEHANDLE( connection, SQL_HANDLE_DBC, connection -> driver_dbc ); } else if ( CHECK_SQLFREECONNECT( connection )) { SQLFREECONNECT( connection, connection -> driver_dbc ); } } else { if ( CHECK_SQLFREECONNECT( connection )) { SQLFREECONNECT( connection, connection -> driver_dbc ); } else if ( CHECK_SQLFREEHANDLE( connection )) { SQLFREEHANDLE( connection, SQL_HANDLE_DBC, connection -> driver_dbc ); } } connection -> driver_dbc = (DRV_SQLHANDLE)NULL; __disconnect_part_four( connection ); } /* * interface for SQLGetFunctions */ void __check_for_function( DMHDBC connection, SQLUSMALLINT function_id, SQLUSMALLINT *supported ) { int i; if ( !supported ) { return; } if ( function_id == SQL_API_ODBC3_ALL_FUNCTIONS ) { for ( i = 0; i < SQL_API_ODBC3_ALL_FUNCTIONS_SIZE; i ++ ) { supported[ i ] = 0x0000; } for ( i = 0; i < sizeof( template_func ) / sizeof( template_func[ 0 ] ); i ++ ) { int id = connection -> functions[ i ].ordinal; if ( connection -> functions[ i ].can_supply ) supported[ id >> 4 ] |= ( 1 << ( id & 0x000F )); } } else if ( function_id == SQL_API_ALL_FUNCTIONS ) { for ( i = 0; i < 100; i ++ ) { supported[ i ] = SQL_FALSE; } for ( i = 0; i < sizeof( template_func ) / sizeof( template_func[ 0 ] ); i ++ ) { if ( connection -> functions[ i ].ordinal < 100 ) { if ( connection -> functions[ i ].can_supply ) supported[ connection -> functions[ i ].ordinal ] = SQL_TRUE; } } } else { *supported = SQL_FALSE; for ( i = 0; i < sizeof( template_func ) / sizeof( template_func[ 0 ] ); i ++ ) { if ( connection->functions[ i ].ordinal == function_id ) { if ( connection -> functions[ i ].can_supply ) *supported = SQL_TRUE; break; } } } } static int sql_strcmp( SQLCHAR *s1, SQLCHAR *s2, SQLSMALLINT l1, SQLSMALLINT l2 ) { if ( l1 != l2 ) { return 1; } if ( l1 == SQL_NTS ) { return strcmp((char*) s1, (char*)s2 ); } else { return memcmp( s1, s2, l1 ); } } static void close_pooled_connection( CPOOL *ptr ) { SQLRETURN ret; /* * disconnect from the driver */ if ( !CHECK_SQLDISCONNECT(( &ptr->connection ))) { return; } ret = SQLDISCONNECT(( &ptr -> connection ), ptr -> connection.driver_dbc ); if ( SQL_SUCCEEDED( ret )) { /* * complete disconnection from driver */ if ( ptr -> connection.driver_version >= SQL_OV_ODBC3 ) { if ( CHECK_SQLFREEHANDLE(( &ptr -> connection ))) { SQLFREEHANDLE(( &ptr -> connection ), SQL_HANDLE_DBC, ptr -> connection.driver_dbc ); } else if ( CHECK_SQLFREECONNECT(( &ptr -> connection ))) { SQLFREECONNECT(( &ptr -> connection ), ptr -> connection.driver_dbc ); } } else { if ( CHECK_SQLFREECONNECT(( &ptr -> connection ))) { SQLFREECONNECT(( &ptr -> connection ), ptr -> connection.driver_dbc ); } else if ( CHECK_SQLFREEHANDLE(( &ptr -> connection ))) { SQLFREEHANDLE(( &ptr -> connection ), SQL_HANDLE_DBC, ptr -> connection.driver_dbc ); } } ptr -> connection.driver_dbc = (DRV_SQLHANDLE)NULL; /* * Only call freeenv if it's the last connection to the driver */ release_env( &ptr -> connection ); ptr -> connection.driver_env = (DRV_SQLHANDLE)NULL; /* * unload the lib */ if ( ptr -> connection.cl_handle ) { odbc_dlclose( ptr -> connection.cl_handle ); ptr -> connection.cl_handle = NULL; } if ( ptr -> connection.dl_handle ) { /* * this is safe, because the dlopen function will reuse the handle if we * open the same lib again */ if ( !ptr -> connection.dont_dlclose ) { /* * call fini function if found */ if ( ptr -> connection.fini_func.func ) { ptr -> connection.fini_func.func(); } odbc_dlclose( ptr -> connection.dl_handle ); } ptr -> connection.dl_handle = NULL; } /* * free some memory */ if ( ptr -> connection.functions ) { free( ptr -> connection.functions ); ptr -> connection.functions = NULL; } } else { /* * All we can do is tidy up */ ptr -> connection.driver_dbc = (DRV_SQLHANDLE)NULL; ptr -> connection.driver_env = (DRV_SQLHANDLE)NULL; /* * unload the lib */ if ( ptr -> connection.cl_handle ) { odbc_dlclose( ptr -> connection.cl_handle ); ptr -> connection.cl_handle = NULL; } if ( ptr -> connection.dl_handle ) { /* * this is safe, because the dlopen function will reuse the handle if we * open the same lib again */ if ( !ptr -> connection.dont_dlclose ) { /* * call fini function if found */ if ( ptr -> connection.fini_func.func ) { ptr -> connection.fini_func.func(); } odbc_dlclose( ptr -> connection.dl_handle ); } ptr -> connection.dl_handle = NULL; } /* * free some memory */ if ( ptr -> connection.functions ) { free( ptr -> connection.functions ); ptr -> connection.functions = NULL; } } /* * now clean up any statements that are left about */ __clean_stmt_from_dbc( &ptr -> connection ); __clean_desc_from_dbc( &ptr -> connection ); } /* * if a environment gets released from the application, we need to remove any referenvce to that environment * in pooled connections that belong to that environment */ void __strip_from_pool( DMHENV env ) { CPOOL *ptr; mutex_pool_entry(); /* * look in the list of connections for one that matches */ for( ptr = pool_head; ptr; ptr = ptr -> next ) { if ( ptr -> connection.environment == env ) { ptr -> connection.environment = NULL; } } mutex_pool_exit(); } int search_for_pool( DMHDBC connection, SQLCHAR *server_name, SQLSMALLINT name_length1, SQLCHAR *user_name, SQLSMALLINT name_length2, SQLCHAR *authentication, SQLSMALLINT name_length3, SQLCHAR *connect_string, SQLSMALLINT connect_string_length ) { time_t current_time; SQLUINTEGER dead; CPOOL *ptr, *prev; int has_checked = 0; mutex_pool_entry(); current_time = time( NULL ); /* * look in the list of connections for one that matches */ restart:; for( ptr = pool_head, prev = NULL; ptr; prev = ptr, ptr = ptr -> next ) { SQLRETURN ret; has_checked = 0; if ( ptr -> in_use ) { continue; } /* * has it expired ? Do some cleaning up first */ if ( ptr -> expiry_time < current_time ) { /* * disconnect and remove */ close_pooled_connection( ptr ); if ( prev ) { prev -> next = ptr -> next; free( ptr ); } else { pool_head = ptr -> next; free( ptr ); } goto restart; } /* * has the time-to-live got to one ? */ if ( ptr -> ttl == 1 ) { /* * disconnect and remove */ close_pooled_connection( ptr ); if ( prev ) { prev -> next = ptr -> next; free( ptr ); } else { pool_head = ptr -> next; free( ptr ); } goto restart; } else if ( ptr -> ttl > 1 ) { ptr -> ttl --; } if ( server_name ) { if ( ptr -> server_length == 0 ) { continue; } if ( ptr -> server_length != name_length1 || sql_strcmp( server_name, (SQLCHAR*)ptr -> server, name_length1, ptr -> server_length )) { continue; } if ( ptr -> user_length != name_length2 || sql_strcmp( user_name, (SQLCHAR*)ptr -> user, name_length2, ptr -> user_length )) { continue; } if ( ptr -> password_length != name_length3 || sql_strcmp( authentication, (SQLCHAR*)ptr -> password, name_length3, ptr -> password_length )) { continue; } } else { if ( ptr -> dsn_length == 0 ) { continue; } if ( ptr -> dsn_length != connect_string_length || sql_strcmp( connect_string, (SQLCHAR*)ptr -> driver_connect_string, connect_string_length, ptr -> dsn_length )) { continue; } } /* * is it the same cursor usage ? */ if ( ptr -> cursors != connection -> cursors ) { continue; } /* * ok so far, is it still alive ? */ if ((CHECK_SQLGETCONNECTATTR(( &ptr -> connection )) && SQL_SUCCEEDED( ret = SQLGETCONNECTATTR(( &ptr -> connection ), ptr -> connection.driver_dbc, SQL_ATTR_CONNECTION_DEAD, &dead, 0, 0 ))) || (CHECK_SQLGETCONNECTATTRW(( &ptr -> connection )) && SQL_SUCCEEDED( ret = SQLGETCONNECTATTRW(( &ptr -> connection ), ptr -> connection.driver_dbc, SQL_ATTR_CONNECTION_DEAD, &dead, 0, 0 ))) || (CHECK_SQLGETCONNECTOPTION(( &ptr -> connection )) && SQL_SUCCEEDED( ret = SQLGETCONNECTOPTION(( &ptr->connection ), ptr -> connection.driver_dbc, SQL_ATTR_CONNECTION_DEAD, &dead ))) || (CHECK_SQLGETCONNECTOPTIONW(( &ptr -> connection )) && SQL_SUCCEEDED( ret = SQLGETCONNECTOPTIONW(( &ptr->connection ), ptr -> connection.driver_dbc, SQL_ATTR_CONNECTION_DEAD, &dead ))) ) { /* * if it failed assume that it's because it doesn't support * it, but it's ok */ if ( dead == SQL_CD_TRUE ) { /* * disconnect and remove */ close_pooled_connection( ptr ); if ( prev ) { prev -> next = ptr -> next; free( ptr ); goto restart; } else { pool_head = ptr -> next; free( ptr ); goto restart; } } has_checked = 1; } /* * Need some other way of checking, This isn't safe to pool... * But it needs to be something thats not slower than connecting... * I have put this off, so its after the check that the server_name and all * the rest is ok to avoid waiting time, as the check could take time */ if ( !has_checked ) { if ( strlen( connection -> probe_sql ) > 0 ) { /* * Execute the query, check we have all we need */ if ( CHECK_SQLEXECDIRECT(( &ptr -> connection )) && ( CHECK_SQLALLOCHANDLE(( &ptr -> connection )) || CHECK_SQLALLOCSTMT(( &ptr -> connection ))) && CHECK_SQLNUMRESULTCOLS(( &ptr -> connection )) && CHECK_SQLFETCH(( &ptr -> connection )) && CHECK_SQLFREESTMT(( &ptr -> connection ))) { DMHSTMT statement; int ret; int check_failed = 0; statement = __alloc_stmt(); if ( CHECK_SQLALLOCHANDLE(( &ptr -> connection ))) { ret = SQLALLOCHANDLE(( &ptr -> connection ), SQL_HANDLE_STMT, ptr -> connection.driver_dbc, ( &statement -> driver_stmt ), statement ); } else { ret = SQLALLOCSTMT(( &ptr -> connection ), ptr -> connection.driver_dbc, ( &statement -> driver_stmt ), statement ); } if ( !SQL_SUCCEEDED( ret )) { check_failed = 1; } else { ret = SQLEXECDIRECT(( &ptr -> connection ), statement -> driver_stmt, connection -> probe_sql, SQL_NTS ); if ( !SQL_SUCCEEDED( ret )) { check_failed = 1; } else { SQLSMALLINT column_count; /* * Check if there is a result set */ ret = SQLNUMRESULTCOLS(( &ptr -> connection ), statement -> driver_stmt, &column_count ); if ( !SQL_SUCCEEDED( ret )) { check_failed = 1; } else if ( column_count > 0 ) { do { ret = SQLFETCH(( &ptr -> connection ), statement -> driver_stmt ); } while( SQL_SUCCEEDED( ret )); if ( ret != SQL_NO_DATA ) { check_failed = 1; } ret = SQLFREESTMT(( &ptr -> connection ), statement -> driver_stmt, SQL_CLOSE ); if ( !SQL_SUCCEEDED( ret )) { check_failed = 1; } } } ret = SQLFREESTMT(( &ptr -> connection ), statement -> driver_stmt, SQL_DROP ); if ( !SQL_SUCCEEDED( ret )) { check_failed = 1; } } __release_stmt( statement ); if ( check_failed ) { /* * disconnect and remove */ close_pooled_connection( ptr ); if ( prev ) { prev -> next = ptr -> next; free( ptr ); } else { pool_head = ptr -> next; free( ptr ); } goto restart; } else { has_checked = 1; } } } } if ( !has_checked ) { /* * We can't know for sure if the connection is still valid ... */ } /* * at this point we have something that should work, lets use it */ ptr -> in_use = 1; ptr -> expiry_time = current_time + ptr -> timeout; connection -> pooling_timeout = ptr -> timeout; /* * copy all the info over */ connection -> pooled_connection = ptr; connection -> state = ptr -> connection.state; connection -> dl_handle = ptr -> connection.dl_handle; connection -> functions = ptr -> connection.functions; connection -> unicode_driver = ptr -> connection.unicode_driver; connection -> driver_env = ptr -> connection.driver_env; connection -> driver_dbc = ptr -> connection.driver_dbc; connection -> driver_version = ptr -> connection.driver_version; connection -> driver_act_ver = ptr -> connection.driver_act_ver; connection -> statement_count = 0; connection -> access_mode = ptr -> connection.access_mode; connection -> access_mode_set = ptr -> connection.access_mode_set; connection -> login_timeout = ptr -> connection.login_timeout; connection -> login_timeout_set = ptr -> connection.login_timeout_set; connection -> auto_commit = ptr -> connection.auto_commit; connection -> auto_commit_set = ptr -> connection.auto_commit_set; connection -> async_enable = ptr -> connection.async_enable; connection -> async_enable_set = ptr -> connection.async_enable_set; connection -> auto_ipd = ptr -> connection.auto_ipd; connection -> auto_ipd_set = ptr -> connection.auto_ipd_set; connection -> connection_timeout = ptr -> connection.connection_timeout; connection -> connection_timeout_set = ptr -> connection.connection_timeout_set; connection -> metadata_id = ptr -> connection.metadata_id; connection -> metadata_id_set = ptr -> connection.metadata_id_set; connection -> packet_size = ptr -> connection.packet_size; connection -> packet_size_set = ptr -> connection.packet_size_set; connection -> quite_mode = ptr -> connection.quite_mode; connection -> quite_mode_set = ptr -> connection.quite_mode_set; connection -> txn_isolation = ptr -> connection.txn_isolation; connection -> txn_isolation_set = ptr -> connection.txn_isolation_set; connection -> cursors = ptr -> connection.cursors; connection -> cl_handle = ptr -> connection.cl_handle; connection -> env_list_ent = ptr -> connection.env_list_ent; strcpy( connection -> probe_sql, ptr -> connection.probe_sql ); connection -> ex_fetch_mapping = ptr -> connection.ex_fetch_mapping; connection -> dont_dlclose = ptr -> connection.dont_dlclose; connection -> bookmarks_on = ptr -> connection.bookmarks_on; #ifdef HAVE_ICONV connection -> iconv_cd_uc_to_ascii = ptr -> connection.iconv_cd_uc_to_ascii; connection -> iconv_cd_ascii_to_uc = ptr -> connection.iconv_cd_ascii_to_uc; #endif /* * copy current environment into the pooled connection */ ptr -> connection.environment = connection -> environment; strcpy( connection -> dsn, ptr -> connection.dsn ); #if defined( HAVE_LIBPTH ) || defined( HAVE_LIBPTHREAD ) || defined( HAVE_LIBTHREAD ) dbc_change_thread_support(connection, ptr -> connection.protection_level); #endif mutex_pool_exit(); return TRUE; } mutex_pool_exit(); return FALSE; } void return_to_pool( DMHDBC connection ) { CPOOL *ptr; time_t current_time; mutex_pool_entry(); ptr = connection -> pooled_connection; current_time = time( NULL ); /* * is it a old entry ? */ if ( connection -> pooled_connection ) { ptr -> in_use = 0; ptr -> expiry_time = current_time + ptr -> timeout; #ifdef HAVE_ICONV connection -> iconv_cd_uc_to_ascii = (iconv_t) -1; connection -> iconv_cd_ascii_to_uc = (iconv_t) -1; #endif } else { ptr = calloc( sizeof( CPOOL ), 1 ); if ( !ptr ) { mutex_pool_exit(); return; } /* * copy everything over */ ptr -> in_use = 0; ptr -> expiry_time = current_time + connection -> pooling_timeout; ptr -> timeout = connection -> pooling_timeout; ptr -> ttl = connection -> ttl; ptr -> cursors = connection -> cursors; /* * copy all the info over */ ptr -> connection.state = connection -> state; ptr -> connection.dl_handle = connection -> dl_handle; ptr -> connection.functions = connection -> functions; ptr -> connection.driver_env = connection -> driver_env; ptr -> connection.driver_dbc = connection -> driver_dbc; ptr -> connection.driver_version = connection -> driver_version; ptr -> connection.driver_act_ver = connection -> driver_act_ver; ptr -> connection.access_mode = connection -> access_mode; ptr -> connection.access_mode_set = connection -> access_mode_set; ptr -> connection.login_timeout = connection -> login_timeout; ptr -> connection.login_timeout_set = connection -> login_timeout_set; ptr -> connection.auto_commit = connection -> auto_commit; ptr -> connection.auto_commit_set = connection -> auto_commit_set; ptr -> connection.async_enable = connection -> async_enable; ptr -> connection.async_enable_set = connection -> async_enable_set; ptr -> connection.auto_ipd = connection -> auto_ipd; ptr -> connection.auto_ipd_set = connection -> auto_ipd_set; ptr -> connection.connection_timeout = connection -> connection_timeout; ptr -> connection.connection_timeout_set = connection -> connection_timeout_set; ptr -> connection.metadata_id = connection -> metadata_id; ptr -> connection.metadata_id_set = connection -> metadata_id_set; ptr -> connection.packet_size = connection -> packet_size; ptr -> connection.packet_size_set = connection -> packet_size_set; ptr -> connection.quite_mode = connection -> quite_mode; ptr -> connection.quite_mode_set = connection -> quite_mode_set; ptr -> connection.txn_isolation = connection -> txn_isolation; ptr -> connection.txn_isolation_set = connection -> txn_isolation_set; ptr -> connection.unicode_driver = connection ->unicode_driver; ptr -> connection.cursors = connection -> cursors; ptr -> connection.cl_handle = connection -> cl_handle; #ifdef HAVE_LIBPTHREAD ptr -> connection.mutex = connection -> mutex; ptr -> connection.protection_level = connection -> protection_level; #elif HAVE_LIBTHREAD ptr -> connection.mutex = connection -> mutex; ptr -> connection.protection_level = connection -> protection_level; #endif ptr -> connection.pooling_timeout = ptr -> timeout; ptr -> connection.ex_fetch_mapping = connection -> ex_fetch_mapping; ptr -> connection.dont_dlclose = connection -> dont_dlclose; ptr -> connection.bookmarks_on = connection -> bookmarks_on; ptr -> connection.env_list_ent = connection -> env_list_ent; ptr -> connection.environment = connection -> environment; strcpy( ptr -> connection.probe_sql, connection -> probe_sql ); #ifdef HAVE_ICONV ptr -> connection.iconv_cd_uc_to_ascii = connection -> iconv_cd_uc_to_ascii; ptr -> connection.iconv_cd_ascii_to_uc = connection -> iconv_cd_ascii_to_uc; connection -> iconv_cd_uc_to_ascii = (iconv_t) -1; connection -> iconv_cd_ascii_to_uc = (iconv_t) -1; #endif if ( connection -> server_length < 0 ) { strcpy( ptr -> server, connection -> server ); } else { memcpy( ptr -> server, connection -> server, connection -> server_length ); } ptr -> server_length = connection -> server_length; if ( connection -> user_length < 0 ) { strcpy( ptr -> user, connection -> user ); } else { memcpy( ptr -> user, connection -> user, connection -> user_length ); } ptr -> user_length = connection -> user_length; if ( connection -> password_length < 0 ) { strcpy( ptr -> password, connection -> password ); } else { memcpy( ptr -> password, connection -> password, connection -> password_length ); } ptr -> password_length = connection -> password_length; if ( connection -> dsn_length < 0 ) { strcpy( ptr -> driver_connect_string, connection -> driver_connect_string ); } else { memcpy( ptr -> driver_connect_string, connection -> driver_connect_string, connection -> dsn_length ); } ptr -> dsn_length = connection -> dsn_length; strcpy( ptr -> connection.dsn, connection -> dsn ); /* * add to the list */ ptr -> next = pool_head; pool_head = ptr; } /* * allow the driver to reset itself if it's a 3.8 driver */ if ( connection -> driver_version == SQL_OV_ODBC3_80 ) { if ( CHECK_SQLSETCONNECTATTR( connection )) { SQLSETCONNECTATTR( connection, connection -> driver_dbc, SQL_ATTR_RESET_CONNECTION, SQL_RESET_CONNECTION_YES, 0 ); } } /* * remove all information from the connection */ connection -> state = STATE_C2; connection -> driver_env = 0; connection -> driver_dbc = 0; connection -> dl_handle = 0; connection -> cl_handle = 0; connection -> functions = 0; connection -> pooled_connection = 0; mutex_pool_exit(); } void __handle_attr_extensions( DMHDBC connection, char *dsn, char *driver_name ) { char txt[ 1024 ]; if ( dsn && strlen( dsn )) { SQLGetPrivateProfileString( dsn, "DMEnvAttr", "", txt, sizeof( txt ), "ODBC.INI" ); if ( strlen( txt )) { __parse_attribute_string( &connection -> env_attribute, txt, strlen( txt )); } SQLGetPrivateProfileString( dsn, "DMConnAttr", "", txt, sizeof( txt ), "ODBC.INI" ); if ( strlen( txt )) { __parse_attribute_string( &connection -> dbc_attribute, txt, strlen( txt )); } SQLGetPrivateProfileString( dsn, "DMStmtAttr", "", txt, sizeof( txt ), "ODBC.INI" ); if ( strlen( txt )) { __parse_attribute_string( &connection -> stmt_attribute, txt, strlen( txt )); } } if ( driver_name && strlen( driver_name )) { SQLGetPrivateProfileString( driver_name, "DMEnvAttr", "", txt, sizeof( txt ), "ODBCINST.INI" ); if ( strlen( txt )) { __parse_attribute_string( &connection -> env_attribute, txt, strlen( txt )); } } } SQLRETURN SQLConnectA( SQLHDBC connection_handle, SQLCHAR *server_name, SQLSMALLINT name_length1, SQLCHAR *user_name, SQLSMALLINT name_length2, SQLCHAR *authentication, SQLSMALLINT name_length3 ) { return SQLConnect( connection_handle, server_name, name_length1, user_name, name_length2, authentication, name_length3 ); } SQLRETURN SQLConnect( SQLHDBC connection_handle, SQLCHAR *server_name, SQLSMALLINT name_length1, SQLCHAR *user_name, SQLSMALLINT name_length2, SQLCHAR *authentication, SQLSMALLINT name_length3 ) { DMHDBC connection = (DMHDBC)connection_handle; int len, ret_from_connect; char dsn[ SQL_MAX_DSN_LENGTH + 1 ]; char lib_name[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver_name[ INI_MAX_PROPERTY_VALUE + 1 ]; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; int warnings; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tServer Name = %s\ \n\t\t\tUser Name = %s\ \n\t\t\tAuthentication = %s", connection, __string_with_length( s1, server_name, name_length1 ), __string_with_length( s2, user_name, name_length2 ), __string_with_length_pass( s3, authentication, name_length3 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS ) || ( name_length3 < 0 && name_length3 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * check the state of the connection */ if ( connection -> state != STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( name_length1 && server_name ) { if ( name_length1 == SQL_NTS ) { len = strlen((char*) server_name ); if ( len > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { len = name_length1; if ( len > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } memcpy( dsn, server_name, len ); dsn[ len ] ='\0'; } else if ( name_length1 > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM010" ); __post_internal_error( &connection -> error, ERROR_IM010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { strcpy( dsn, "DEFAULT" ); } /* * can we find a pooled connection to use here ? */ connection -> pooled_connection = NULL; if ( pooling_enabled && search_for_pool( connection, server_name, name_length1, user_name, name_length2, authentication, name_length3, NULL, 0 )) { ret_from_connect = SQL_SUCCESS; if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } connection -> state = STATE_C4; return function_return_nodrv( SQL_HANDLE_DBC, connection, ret_from_connect ); } /* * else safe the info for later */ if ( pooling_enabled ) { connection -> dsn_length = 0; if ( server_name ) { if ( name_length1 < 0 ) { strcpy( connection -> server, (char*)server_name ); } else { memcpy( connection -> server, server_name, name_length1 ); } } else { strcpy( connection -> server, "" ); } connection -> server_length = name_length1; if ( user_name ) { if ( name_length2 < 0 ) { strcpy( connection -> user, (char*)user_name ); } else { memcpy( connection -> user, user_name, name_length2 ); } } else { strcpy( connection -> user, "" ); } connection -> user_length = name_length2; if ( authentication ) { if ( name_length3 ) { strcpy( connection -> password, (char*)authentication ); } else { memcpy( connection -> password, authentication, name_length3 ); } } else { strcpy( connection -> password, "" ); } connection -> password_length = name_length3; } if ( !*dsn || !__find_lib_name( dsn, lib_name, driver_name )) { /* * if not found look for a default */ if ( !__find_lib_name( "DEFAULT", lib_name, driver_name )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } /* * do we have any Environment, Connection, or Statement attributes set in the ini ? */ __handle_attr_extensions( connection, dsn, driver_name ); /* * if necessary change the threading level */ warnings = 0; if ( !__connect_part_one( connection, lib_name, driver_name, &warnings )) { __disconnect_part_four( connection ); /* release unicode handles */ return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( !CHECK_SQLCONNECT( connection ) && !CHECK_SQLCONNECTW( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( CHECK_SQLCONNECT( connection )) { /* if ( CHECK_SQLSETCONNECTATTR( connection )) { int lret; lret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, SQL_ATTR_ANSI_APP, SQL_AA_TRUE, 0 ); } */ ret_from_connect = SQLCONNECT( connection, connection -> driver_dbc, dsn, SQL_NTS, user_name, name_length2, authentication, name_length3 ); if ( ret_from_connect != SQL_SUCCESS ) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; /* * get the errors from the driver before * loseing the connection */ if ( CHECK_SQLERROR( connection )) { do { ret = SQLERROR( connection, SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, message_text ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGREC( connection )) { int rec = 1; do { ret = SQLGETDIAGREC( connection, SQL_HANDLE_DBC, connection -> driver_dbc, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, message_text ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } } /* * if it was a error then return now */ if ( !SQL_SUCCEEDED( ret_from_connect )) { __disconnect_part_one( connection ); __disconnect_part_four( connection ); sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return( SQL_HANDLE_DBC, connection, ret_from_connect, DEFER_R0 ); } connection -> unicode_driver = 0; } else { SQLWCHAR * uc_dsn, *uc_user, *uc_auth; uc_dsn = ansi_to_unicode_alloc((SQLCHAR*) dsn, SQL_NTS, connection, NULL ); uc_user = ansi_to_unicode_alloc( user_name, name_length2, connection, NULL ); uc_auth = ansi_to_unicode_alloc( authentication, name_length3, connection, NULL ); if ( CHECK_SQLSETCONNECTATTR( connection )) { SQLSETCONNECTATTR( connection, connection -> driver_dbc, SQL_ATTR_ANSI_APP, SQL_AA_FALSE, 0 ); } ret_from_connect = SQLCONNECTW( connection, connection -> driver_dbc, uc_dsn, SQL_NTS, uc_user, name_length2, uc_auth, name_length3 ); if ( uc_dsn ) free( uc_dsn ); if ( uc_user ) free( uc_user ); if ( uc_auth ) free( uc_auth ); if ( ret_from_connect != SQL_SUCCESS ) { SQLWCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLWCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; /* * get the errors from the driver before * looseing the connection */ if ( CHECK_SQLERRORW( connection )) { do { ret = SQLERRORW( connection, SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text )/sizeof(SQLWCHAR), &ind ); if ( SQL_SUCCEEDED( ret )) { SQLCHAR *as1, *as2; __post_internal_error_ex_w( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); as1 = (SQLCHAR *) unicode_to_ansi_alloc( sqlstate, SQL_NTS, connection, NULL ); as2 = (SQLCHAR *) unicode_to_ansi_alloc( message_text, SQL_NTS, connection, NULL ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", as1, as2 ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGRECW( connection )) { int rec = 1; do { ret = SQLGETDIAGRECW( connection, SQL_HANDLE_DBC, connection -> driver_dbc, rec ++, sqlstate, &native_error, message_text, sizeof( message_text )/sizeof(SQLWCHAR), &ind ); if ( SQL_SUCCEEDED( ret )) { SQLCHAR *as1, *as2; __post_internal_error_ex_w( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); as1 = (SQLCHAR *) unicode_to_ansi_alloc( sqlstate, SQL_NTS, connection, NULL ); as2 = (SQLCHAR *) unicode_to_ansi_alloc( message_text, SQL_NTS, connection, NULL ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", as1, as2 ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } } /* * if it was a error then return now */ if ( !SQL_SUCCEEDED( ret_from_connect )) { __disconnect_part_one( connection ); __disconnect_part_four( connection ); sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return( SQL_HANDLE_DBC, connection, ret_from_connect, DEFER_R0 ); } connection -> unicode_driver = 1; } /* * we should be connected now */ connection -> state = STATE_C4; strcpy( connection -> dsn, dsn ); /* * did we get the type we wanted */ if ( connection -> driver_version != connection -> environment -> requested_version ) { connection -> driver_version = connection -> environment -> requested_version; __post_internal_error( &connection -> error, ERROR_01000, "Driver does not support the requested version", connection -> environment -> requested_version ); ret_from_connect = SQL_SUCCESS_WITH_INFO; } if ( !__connect_part_two( connection )) { /* * the cursor lib can kill us here, so be careful */ __disconnect_part_two( connection ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); connection -> state = STATE_C3; return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } if ( warnings && ret_from_connect == SQL_SUCCESS ) { ret_from_connect = SQL_SUCCESS_WITH_INFO; } return function_return_nodrv( SQL_HANDLE_DBC, connection, ret_from_connect ); } /* * connection pooling setup, just stubs for the moment */ BOOL ODBCSetTryWaitValue ( DWORD dwValue ) { return 0; } #ifdef __cplusplus DWORD ODBCGetTryWaitValue ( ) #else DWORD ODBCGetTryWaitValue ( void ) #endif { return 0; } unixODBC-2.3.9/DriverManager/SQLGetDiagFieldW.c0000644000175000017500000006675113364071466015763 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDiagFieldW.c,v 1.10 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetDiagFieldW.c,v $ * Revision 1.10 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.9 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.8 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.7 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/11/11 17:10:14 lurcher * * VMS changes * * Revision 1.5 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.4 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/04 13:16:25 nick * * Add support for GNU portable threads and tidy up some UNICODE compile * warnings * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetDiagFieldW.c,v $"; #define ODBC30_SUBCLASS "01S00,01S01,01S02,01S06,01S07,07S01,08S01,21S01,\ 21S02,25S01,25S02,25S03,42S01,42S02,42S11,42S12,42S21,42S22,HY095,HY097,HY098,\ HY099,HY100,HY101,HY105,HY107,HY109,HY110,HY111,HYT00,HYT01,IM001,IM002,IM003,\ IM004,IM005,IM006,IM007,IM008,IM010,IM011,IM012" SQLRETURN extract_parent_handle_field( SQLHANDLE handle, int handle_type, SQLSMALLINT rec_number, SQLSMALLINT diag_identifier, SQLPOINTER diag_info_ptr, SQLSMALLINT buffer_length, SQLSMALLINT *string_length_ptr ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); if ( handle_type != SQL_HANDLE_ENV ) { #ifdef WITH_HANDLE_REDIRECT { DMHDBC *parent_handle_dbc; DMHSTMT *parent_handle_stmt; DMHDESC *parent_handle_desc; switch ( handle_type ) { case SQL_HANDLE_DBC: { parent_handle_dbc = find_parent_handle( handle, handle_type ); } break; case SQL_HANDLE_STMT: { parent_handle_stmt = find_parent_handle( handle, handle_type ); parent_handle_dbc = parent_handle_stmt->connection; } break; case SQL_HANDLE_DESC: { parent_handle_desc = find_parent_handle( handle, handle_type ); parent_handle_dbc = parent_handle_desc->connection; } break; default: { return SQL_INVALID_HANDLE; } } if ( parent_handle_dbc ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETDIAGFIELDW( parent_handle_dbc )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETDIAGFIELDW( parent_handle_dbc, handle_type, handle, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); } } } #endif } return SQL_INVALID_HANDLE; } /* * is it a diag identifier that we have to convert from unicode to ansi */ static int is_char_diag( int diag_identifier ) { switch( diag_identifier ) { case SQL_DIAG_CLASS_ORIGIN: case SQL_DIAG_CONNECTION_NAME: case SQL_DIAG_DYNAMIC_FUNCTION: case SQL_DIAG_MESSAGE_TEXT: case SQL_DIAG_SERVER_NAME: case SQL_DIAG_SQLSTATE: case SQL_DIAG_SUBCLASS_ORIGIN: return 1; default: return 0; } } static SQLRETURN extract_sql_error_field_w( EHEAD *head, SQLSMALLINT rec_number, SQLSMALLINT diag_identifier, SQLPOINTER diag_info_ptr, SQLSMALLINT buffer_length, SQLSMALLINT *string_length_ptr ) { ERROR *ptr; if ( is_char_diag( diag_identifier ) && buffer_length < 0 ) { return SQL_ERROR; } /* * check the header fields first */ switch( diag_identifier ) { case SQL_DIAG_CURSOR_ROW_COUNT: case SQL_DIAG_ROW_COUNT: { SQLINTEGER val; SQLRETURN ret; if ( rec_number > 0 || head -> handle_type != SQL_HANDLE_STMT ) { return SQL_ERROR; } else if ( head -> header_set ) { switch( diag_identifier ) { case SQL_DIAG_CURSOR_ROW_COUNT: if ( SQL_SUCCEEDED( head -> diag_cursor_row_count_ret ) && diag_info_ptr ) { *((SQLINTEGER*)diag_info_ptr) = head -> diag_cursor_row_count; } return head -> diag_cursor_row_count_ret; case SQL_DIAG_ROW_COUNT: if ( SQL_SUCCEEDED( head -> diag_row_count_ret ) && diag_info_ptr ) { *((SQLINTEGER*)diag_info_ptr) = head -> diag_row_count; } return head -> diag_row_count_ret; } } else if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELDW( __get_connection( head ))) { ret = SQLGETDIAGFIELDW( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELD( __get_connection( head ))) { ret = SQLGETDIAGFIELD( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else if ( CHECK_SQLROWCOUNT( __get_connection( head ))) { ret = DEF_SQLROWCOUNT( __get_connection( head ), __get_driver_handle( head ), &val ); if ( !SQL_SUCCEEDED( ret )) { return ret; } } else { val = 0; } if ( diag_info_ptr ) { memcpy( diag_info_ptr, &val, sizeof( val )); } } return SQL_SUCCESS; case SQL_DIAG_DYNAMIC_FUNCTION: { SQLRETURN ret; if ( rec_number > 0 ) { return SQL_ERROR; } else if ( head -> handle_type != SQL_HANDLE_STMT ) { if ( diag_info_ptr ) { *((SQLWCHAR*)diag_info_ptr) = 0; } if ( string_length_ptr ) { *string_length_ptr = 0; } return SQL_SUCCESS; } else if ( head -> header_set ) { if ( SQL_SUCCEEDED( head -> diag_dynamic_function_ret ) && diag_info_ptr ) { wide_strncpy( diag_info_ptr, head -> diag_dynamic_function, buffer_length ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( head -> diag_dynamic_function ) * sizeof( SQLWCHAR ); } } return head -> diag_dynamic_function_ret; } else if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELDW( __get_connection( head ))) { ret = SQLGETDIAGFIELDW( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELD( __get_connection( head ))) { SQLCHAR *as1 = NULL; if ( buffer_length > 0 && diag_info_ptr ) { as1 = malloc( buffer_length + 1 ); } ret = SQLGETDIAGFIELD( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, as1 ? as1 : diag_info_ptr, buffer_length / 2, string_length_ptr ); if ( SQL_SUCCEEDED( ret ) && as1 && diag_info_ptr ) { ansi_to_unicode_copy( diag_info_ptr, (char*) as1, SQL_NTS, __get_connection( head ), NULL); } if ( SQL_SUCCEEDED( ret ) && string_length_ptr ) { *string_length_ptr *= sizeof( SQLWCHAR ); } if ( as1 ) { free( as1 ); } return ret; } if ( diag_info_ptr ) { strcpy( diag_info_ptr, "" ); } } return SQL_SUCCESS; case SQL_DIAG_DYNAMIC_FUNCTION_CODE: { SQLINTEGER val; SQLRETURN ret; if ( rec_number > 0 ) { return SQL_ERROR; } else if ( head -> handle_type != SQL_HANDLE_STMT ) { *((SQLINTEGER*)diag_info_ptr) = 0; return SQL_SUCCESS; } else if ( head -> header_set ) { if ( SQL_SUCCEEDED( head -> diag_dynamic_function_code_ret ) && diag_info_ptr ) { *((SQLINTEGER*)diag_info_ptr) = head -> diag_dynamic_function_code; } return head -> diag_dynamic_function_code_ret; } else if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELDW( __get_connection( head ))) { ret = SQLGETDIAGFIELDW( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELD( __get_connection( head ))) { ret = SQLGETDIAGFIELD( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else { val = SQL_DIAG_UNKNOWN_STATEMENT; } if ( diag_info_ptr ) { memcpy( diag_info_ptr, &val, sizeof( val )); } } return SQL_SUCCESS; case SQL_DIAG_NUMBER: { SQLINTEGER val; if ( rec_number > 0 ) { return SQL_ERROR; } val = head -> sql_diag_head.internal_count + head -> sql_diag_head.error_count; if ( diag_info_ptr ) { memcpy( diag_info_ptr, &val, sizeof( val )); } } return SQL_SUCCESS; case SQL_DIAG_RETURNCODE: { if ( diag_info_ptr ) { memcpy( diag_info_ptr, &head -> return_code, sizeof( head -> return_code )); } } return SQL_SUCCESS; } /* * else check the records */ if ( rec_number < 1 || (( diag_identifier == SQL_DIAG_COLUMN_NUMBER || diag_identifier == SQL_DIAG_ROW_NUMBER ) && head -> handle_type != SQL_HANDLE_STMT )) { return SQL_ERROR; } if ( rec_number <= head -> sql_diag_head.internal_count ) { /* * local errors */ ptr = head -> sql_diag_head.internal_list_head; while( rec_number > 1 ) { ptr = ptr -> next; rec_number --; } if ( !ptr ) { return SQL_NO_DATA; } } else if ( rec_number <= head -> sql_diag_head.internal_count + head -> sql_diag_head.error_count ) { rec_number -= head -> sql_diag_head.internal_count; if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELDW( __get_connection( head ))) { SQLRETURN ret; ret = SQLGETDIAGFIELDW( __get_connection( head ), head -> handle_type, __get_driver_handle( head ), rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); if ( SQL_SUCCEEDED( ret ) && diag_identifier == SQL_DIAG_SQLSTATE ) { /* * map 3 to 2 if required */ if ( diag_info_ptr ) __map_error_state_w( diag_info_ptr, __get_version( head )); } return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELD( __get_connection( head ))) { SQLRETURN ret; SQLCHAR *as1 = NULL; if ( is_char_diag( diag_identifier ) && diag_info_ptr && buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } ret = SQLGETDIAGFIELD( __get_connection( head ), head -> handle_type, __get_driver_handle( head ), rec_number, diag_identifier, as1 ? as1 : diag_info_ptr, buffer_length, string_length_ptr ); if ( SQL_SUCCEEDED( ret ) && diag_identifier == SQL_DIAG_SQLSTATE ) { /* * map 3 to 2 if required */ if ( diag_info_ptr && as1 ) { __map_error_state( (char*) as1, __get_version( head )); ansi_to_unicode_copy( diag_info_ptr, (char*) as1, SQL_NTS, __get_connection( head ), NULL ); } } if ( as1 ) { free( as1 ); } return ret; } else { ptr = head -> sql_diag_head.error_list_head; while( rec_number > 1 ) { ptr = ptr -> next; rec_number --; } if ( !ptr ) { return SQL_NO_DATA; } } } else { return SQL_NO_DATA; } /* * if we are here ptr should point to the error * record */ switch( diag_identifier ) { case SQL_DIAG_CLASS_ORIGIN: { if ( SQL_SUCCEEDED( ptr -> diag_class_origin_ret )) { wide_strncpy( diag_info_ptr, ptr -> diag_class_origin, buffer_length ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( ptr -> diag_class_origin ) * sizeof( SQLWCHAR ); } return ptr -> diag_class_origin_ret; } else { return ptr -> diag_class_origin_ret; } } break; case SQL_DIAG_COLUMN_NUMBER: { if ( diag_info_ptr ) { memcpy( diag_info_ptr, &ptr -> diag_column_number, sizeof( SQLINTEGER )); } return SQL_SUCCESS; } break; case SQL_DIAG_CONNECTION_NAME: { if ( SQL_SUCCEEDED( ptr -> diag_connection_name_ret )) { wide_strcpy( diag_info_ptr, ptr -> diag_connection_name ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( ptr -> diag_connection_name ) * sizeof( SQLWCHAR ); } return ptr -> diag_connection_name_ret; } else { return ptr -> diag_connection_name_ret; } } break; case SQL_DIAG_MESSAGE_TEXT: { SQLWCHAR *str; int ret = SQL_SUCCESS; str = ptr -> msg; if ( diag_info_ptr ) { if ( buffer_length >= wide_strlen( str ) + 1 ) { wide_strcpy( diag_info_ptr, str ); } else { ret = SQL_SUCCESS_WITH_INFO; memcpy( diag_info_ptr, str, ( buffer_length - 1 ) * 2 ); (( SQLWCHAR * ) diag_info_ptr )[ buffer_length - 1 ] = '\0'; } } if ( string_length_ptr ) { *string_length_ptr = wide_strlen( str ) * sizeof( SQLWCHAR ); } return ret; } break; case SQL_DIAG_NATIVE: { if ( diag_info_ptr ) { memcpy( diag_info_ptr, &ptr -> native_error, sizeof( SQLINTEGER )); } return SQL_SUCCESS; } break; case SQL_DIAG_ROW_NUMBER: { if ( diag_info_ptr ) { memcpy( diag_info_ptr, &ptr -> diag_row_number, sizeof( SQLINTEGER )); } return SQL_SUCCESS; } break; case SQL_DIAG_SERVER_NAME: { if ( SQL_SUCCEEDED( ptr -> diag_server_name_ret )) { wide_strcpy( diag_info_ptr, ptr -> diag_server_name ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( ptr -> diag_server_name ) * sizeof( SQLWCHAR ); } return ptr -> diag_server_name_ret; } else { return ptr -> diag_server_name_ret; } } break; case SQL_DIAG_SQLSTATE: { SQLWCHAR *str; int ret = SQL_SUCCESS; str = ptr -> sqlstate; if ( diag_info_ptr ) { if ( buffer_length >= wide_strlen( str ) + 1 ) { wide_strcpy( diag_info_ptr, str ); } else { ret = SQL_SUCCESS_WITH_INFO; memcpy( diag_info_ptr, str, ( buffer_length - 1 ) * 2 ); (( SQLWCHAR * ) diag_info_ptr )[ buffer_length - 1 ] = '\0'; } /* * map 3 to 2 if required */ if ( diag_info_ptr ) __map_error_state_w( diag_info_ptr, __get_version( head )); } if ( string_length_ptr ) { *string_length_ptr = wide_strlen( str ) * sizeof( SQLWCHAR ); } return ret; } break; case SQL_DIAG_SUBCLASS_ORIGIN: { if ( SQL_SUCCEEDED( ptr -> diag_subclass_origin_ret )) { wide_strcpy( diag_info_ptr, ptr -> diag_subclass_origin ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( ptr -> diag_subclass_origin ) * sizeof( SQLWCHAR ); } return ptr -> diag_subclass_origin_ret; } else { return ptr -> diag_subclass_origin_ret; } } break; } return SQL_SUCCESS; } SQLRETURN SQLGetDiagFieldW( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLSMALLINT diag_identifier, SQLPOINTER diag_info_ptr, SQLSMALLINT buffer_length, SQLSMALLINT *string_length_ptr ) { SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; DMHENV environment = ( DMHENV ) handle; DMHDBC connection = NULL; DMHSTMT statement = NULL; DMHDESC descriptor = NULL; EHEAD *herror; char *handle_msg; const char *handle_type_ptr; switch ( handle_type ) { case SQL_HANDLE_ENV: { if ( !__validate_env( environment )) { return extract_parent_handle_field( environment, handle_type, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); } herror = &environment->error; handle_msg = environment->msg; handle_type_ptr = "Environment"; } break; case SQL_HANDLE_DBC: { connection = ( DMHDBC ) handle; if ( !__validate_dbc( connection )) { return extract_parent_handle_field( connection, handle_type, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); } herror = &connection->error; handle_msg = connection->msg; handle_type_ptr = "Connection"; } break; case SQL_HANDLE_STMT: { statement = ( DMHSTMT ) handle; if ( !__validate_stmt( statement )) { return extract_parent_handle_field( statement, handle_type, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); } connection = statement->connection; herror = &statement->error; handle_msg = statement->msg; handle_type_ptr = "Statement"; } break; case SQL_HANDLE_DESC: { descriptor = ( DMHDESC ) handle; if ( !__validate_desc( descriptor )) { return extract_parent_handle_field( descriptor, handle_type, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); } connection = descriptor->connection; herror = &descriptor->error; handle_msg = descriptor->msg; handle_type_ptr = "Descriptor"; } break; default: { return SQL_NO_DATA; } } thread_protect( handle_type, handle ); if ( log_info.log_flag ) { sprintf( handle_msg, "\n\t\tEntry:\ \n\t\t\t%s = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tDiag Ident = %d\ \n\t\t\tDiag Info Ptr = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tString Len Ptr = %p", handle_type_ptr, handle, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } /* * Do diag extraction here if defer flag is set. * Clean the flag after extraction. */ if ( connection && herror->defer_extract ) { extract_error_from_driver( herror, connection, herror->ret_code_deferred, 0 ); herror->defer_extract = 0; herror->ret_code_deferred = 0; } ret = extract_sql_error_field_w( herror, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); if ( log_info.log_flag ) { sprintf( handle_msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } thread_release( handle_type, handle ); return ret; } unixODBC-2.3.9/DriverManager/SQLParamOptions.c0000644000175000017500000001777513303466667016006 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLParamOptions.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLParamOptions.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2005/11/23 08:29:16 lurcher * Add cleanup in postgres driver * * Revision 1.4 2005/07/08 12:11:23 lurcher * * Fix a cursor lib problem (it was broken if you did metadata calls) * Alter the params to SQLParamOptions to use SQLULEN * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.4 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLParamOptions.c,v $ $Revision: 1.6 $"; /* * This one is strictly ODBC 2 */ SQLRETURN SQLParamOptions( SQLHSTMT statement_handle, SQLULEN crow, SQLULEN *pirow ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCrow = %d\ \n\t\t\tPirow = %p", statement, (int)crow, (void*)pirow ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( crow == 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1107" ); __post_internal_error( &statement -> error, ERROR_S1107, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1010" ); __post_internal_error( &statement -> error, ERROR_S1010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( CHECK_SQLPARAMOPTIONS( statement -> connection )) { ret = SQLPARAMOPTIONS( statement -> connection, statement -> driver_stmt, crow, pirow ); } else if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ATTR_PARAMSET_SIZE, crow, 0 ); if ( SQL_SUCCEEDED( ret )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, SQL_ATTR_PARAMS_PROCESSED_PTR, pirow, 0 ); } } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ATTR_PARAMSET_SIZE, crow, 0 ); if ( SQL_SUCCEEDED( ret )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ATTR_PARAMS_PROCESSED_PTR, pirow, 0 ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLTables.c0000644000175000017500000003111013303466667014557 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLTables.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLTables.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:40 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 2000/08/16 14:31:11 ngorham * * Add fix for broken version of EXCEL * * Revision 1.7 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:56 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.2 1999/06/07 01:29:31 pharvey * *** empty log message *** * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLTables.c,v $ $Revision: 1.7 $"; SQLRETURN SQLTablesA( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *table_type, SQLSMALLINT name_length4 ) { return SQLTables( statement_handle, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, table_type, name_length4 ); } SQLRETURN SQLTables( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *table_type, SQLSMALLINT name_length4 ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tTable Type = %s", statement, __string_with_length( s1, catalog_name, name_length1 ), __string_with_length( s2, schema_name, name_length2 ), __string_with_length( s3, table_name, name_length3 ), __string_with_length( s4, table_type, name_length4 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * this is a fix for old version of EXCEL */ if ( !catalog_name ) name_length1 = 0; if ( !schema_name ) name_length2 = 0; if ( !table_name ) name_length3 = 0; if ( !table_type ) name_length4 = 0; if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS ) || ( name_length3 < 0 && name_length3 != SQL_NTS ) || ( name_length4 < 0 && name_length4 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLTABLES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { int wlen; SQLWCHAR *s1, *s2, *s3, *s4; if ( !CHECK_SQLTABLESW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( catalog_name, name_length1, statement -> connection, &wlen ); name_length1 = wlen; s2 = ansi_to_unicode_alloc( schema_name, name_length2, statement -> connection, &wlen ); name_length2 = wlen; s3 = ansi_to_unicode_alloc( table_name, name_length3, statement -> connection, &wlen ); name_length3 = wlen; s4 = ansi_to_unicode_alloc( table_type, name_length4, statement -> connection, &wlen ); name_length4 = wlen; ret = SQLTABLESW( statement -> connection , statement -> driver_stmt, s1, name_length1, s2, name_length2, s3, name_length3, s4, name_length4 ); if( s1 ) free( s1 ); if( s2 ) free( s2 ); if( s3 ) free( s3 ); if( s4 ) free( s4 ); } else { if ( !CHECK_SQLTABLES( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLTABLES( statement -> connection , statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, table_type, name_length4 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* * There is no point in doing this as we can't trust the value * from SQLPrepare, so we can't perform checks on the column number * ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); */ statement -> numcols = 1; /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLTABLES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/odbc.pc.in0000664000175000017500000000070013545647523014464 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ odbcversion=3 longodbcversion=3.52 odbcini=@SYSTEM_FILE_PATH@/odbc.ini odbcinstini=@SYSTEM_FILE_PATH@/odbcinst.ini ulen=@ODBC_ULEN@ build_cflags=@ODBC_CFLAGS@ Name: odbc (@PACKAGE_NAME@) Description: unixODBC Driver Manager library URL: http://unixodbc.org Version: @PACKAGE_VERSION@ Cflags: -I${includedir} Libs: -L${libdir} -lodbc Libs.private: @LIBLTDL@ @LIBS@ unixODBC-2.3.9/DriverManager/SQLSpecialColumnsW.c0000644000175000017500000003362513364072423016420 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSpecialColumnsW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSpecialColumnsW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:49 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSpecialColumnsW.c,v $"; SQLRETURN SQLSpecialColumnsW( SQLHSTMT statement_handle, SQLUSMALLINT identifier_type, SQLWCHAR *catalog_name, SQLSMALLINT name_length1, SQLWCHAR *schema_name, SQLSMALLINT name_length2, SQLWCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT scope, SQLUSMALLINT nullable ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLSPECIALCOLUMNSW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLSPECIALCOLUMNSW( parent_statement -> connection, statement_handle, identifier_type, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, scope, nullable ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tIdentifier Type = %d\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tScope = %d\ \n\t\t\tNullable = %d", statement, identifier_type, __wstring_with_length( s1, catalog_name, name_length1 ), __wstring_with_length( s2, schema_name, name_length2 ), __wstring_with_length( s3, table_name, name_length3 ), scope, nullable ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( identifier_type != SQL_BEST_ROWID && identifier_type != SQL_ROWVER ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY097" ); __post_internal_error( &statement -> error, ERROR_HY097, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS )) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( table_name == NULL ) { __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( name_length3 < 0 && name_length3 != SQL_NTS ) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> metadata_id == SQL_TRUE && schema_name == NULL ) { __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( scope != SQL_SCOPE_CURROW && scope != SQL_SCOPE_TRANSACTION && scope != SQL_SCOPE_SESSION ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY098" ); __post_internal_error( &statement -> error, ERROR_HY098, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( nullable != SQL_NO_NULLS && nullable != SQL_NULLABLE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY099" ); __post_internal_error( &statement -> error, ERROR_HY099, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if ( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 2400" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLSPECIALCOLUMNS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver || CHECK_SQLSPECIALCOLUMNSW( statement -> connection )) { if ( !CHECK_SQLSPECIALCOLUMNSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLSPECIALCOLUMNSW( statement -> connection , statement -> driver_stmt, identifier_type, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, scope, nullable ); } else { SQLCHAR *as1, *as2, *as3; int clen; if ( !CHECK_SQLSPECIALCOLUMNS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( catalog_name, name_length1, statement -> connection, &clen ); name_length1 = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( schema_name, name_length2, statement -> connection, &clen ); name_length2 = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( table_name, name_length3, statement -> connection, &clen ); name_length3 = clen; ret = SQLSPECIALCOLUMNS( statement -> connection , statement -> driver_stmt, identifier_type, as1, name_length1, as2, name_length2, as3, name_length3, scope, nullable ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); */ statement -> numcols = 1; /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLSPECIALCOLUMNS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLRowCount.c0000644000175000017500000001631613303466667015140 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLRowCount.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLRowCount.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2007/04/02 10:50:19 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.3 2002/08/12 13:17:52 lurcher * * Replicate the way the MS DM handles loading of driver libs, and allocating * handles in the driver. usage counting in the driver means that dlopen is * only called for the first use, and dlclose for the last. AllocHandle for * the driver environment is only called for the first time per driver * per application environment. * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLRowCount.c,v $ $Revision: 1.8 $"; SQLRETURN SQLRowCount( SQLHSTMT statement_handle, SQLLEN *rowcount ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { if ( rowcount ) { *rowcount = -1; } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tRow Count = %p", statement, rowcount ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 || statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { if ( rowcount ) { *rowcount = -1; } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( !CHECK_SQLROWCOUNT( statement -> connection )) { if ( rowcount ) { *rowcount = -1; } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = DEF_SQLROWCOUNT( statement -> connection, statement -> driver_stmt, rowcount ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tRow Count = %s", __get_return_status( ret, s1 ), __ptr_as_string( s1, rowcount )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLSetConnectAttr.c0000644000175000017500000006542613364064453016260 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetConnectAttr.c,v 1.17 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetConnectAttr.c,v $ * Revision 1.17 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.16 2006/04/11 10:22:56 lurcher * Fix a data type check * * Revision 1.15 2005/03/01 15:50:50 lurcher * Add Eric's SQLSetConnectAttr patch * * Revision 1.14 2004/06/21 10:01:11 lurcher * * Fix a couple of 64 bit issues * * Revision 1.13 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.12 2003/03/05 09:48:44 lurcher * * Add some 64 bit fixes * * Revision 1.11 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.10 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.9 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.8 2002/07/16 13:08:18 lurcher * * Filter attribute values from SQLSetStmtAttr to SQLSetStmtOption to fit * within ODBC 2 * Make DSN's double clickable in ODBCConfig * * Revision 1.7 2002/07/04 17:27:56 lurcher * * Small bug fixes * * Revision 1.5 2002/01/30 12:20:02 lurcher * * Add MyODBC 3 driver source * * Revision 1.4 2002/01/10 11:17:20 lurcher * * Allow SQL_ATTR_LOGIN_TIMEOUT to be set when connected to mirror what the * MS DM does * * Revision 1.3 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.2 2001/11/14 12:33:20 lurcher * * Remove the comments around the tracing code * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.12 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.11 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.10 2001/08/03 15:19:00 nick * * Add changes to set values before connect * * Revision 1.9 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.8 2001/04/25 14:29:36 nick * * remove comment * * Revision 1.7 2001/04/23 13:58:43 nick * * Assorted tweeks to text driver to get it to work with StarOffice * * Revision 1.6 2001/04/20 13:58:13 nick * * Add txt driver * * Revision 1.5 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.4 2001/02/06 18:43:38 nick * * Fix problem with SQLSetConnectAttr.c looking for UNICODE versions in * ansi side of call * * Revision 1.3 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.2 2000/11/14 10:15:27 nick * * Add test for localtime_r * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.11 2000/06/20 13:30:09 ngorham * * Fix problems when using bookmarks * * Revision 1.10 2000/05/21 21:49:19 ngorham * * Assorted fixes * * Revision 1.9 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/11/10 03:51:34 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.7 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/09/19 22:24:34 ngorham * * Added support for the cursor library * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetConnectAttr.c,v $ $Revision: 1.17 $"; SQLRETURN SQLSetConnectAttrA( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { return SQLSetConnectAttr( connection_handle, attribute, value, string_length ); } SQLRETURN SQLSetConnectAttr( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { DMHDBC connection = (DMHDBC)connection_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * doesn't require a handle */ if ( attribute == SQL_ATTR_TRACE ) { if ((SQLLEN) value != SQL_OPT_TRACE_OFF && (SQLLEN) value != SQL_OPT_TRACE_ON ) { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); function_entry( connection ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } if ((SQLLEN) value == SQL_OPT_TRACE_OFF ) { char force_string[ 30 ]; SQLGetPrivateProfileString( "ODBC", "ForceTrace", "0", force_string, sizeof( force_string ), "ODBCINST.INI" ); if ( force_string[ 0 ] == '1' || toupper( force_string[ 0 ] ) == 'Y' || ( toupper( force_string[ 0 ] ) == 'O' && toupper( force_string[ 1 ] ) == 'N' )) { if ( log_info.log_flag ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Application tried to turn logging off" ); } } else { if ( log_info.log_flag ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Application turning logging off" ); } log_info.log_flag = 0; } } else { log_info.log_flag = 1; } return SQL_SUCCESS; } else if ( attribute == SQL_ATTR_TRACEFILE ) { if ( value ) { if (((SQLCHAR*)value)[ 0 ] == '\0' ) { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); function_entry( connection ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } else { if ( log_info.log_file_name ) { free( log_info.log_file_name ); } log_info.log_file_name = strdup( value ); } } else { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); function_entry( connection ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } return SQL_SUCCESS; } /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tStrLen = %d", connection, __con_attr_as_string( s1, attribute ), value, (int)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C2 ) { if ( attribute == SQL_ATTR_TRANSLATE_OPTION || attribute == SQL_ATTR_TRANSLATE_LIB ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( connection -> state == STATE_C4 || connection -> state == STATE_C5 || connection -> state == STATE_C6 ) { if ( attribute == SQL_ATTR_ODBC_CURSORS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( attribute == SQL_ATTR_PACKET_SIZE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &connection -> error, ERROR_HY011, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } /* * is it a legitimate value */ ret = dm_check_connection_attrs( connection, attribute, value ); if ( ret != SQL_SUCCESS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * is it a connection attribute or statement, check state of any active connections */ switch( attribute ) { /* ODBC 3.x statement attributes are not settable at the connection level */ case SQL_ATTR_APP_PARAM_DESC: case SQL_ATTR_APP_ROW_DESC: case SQL_ATTR_CURSOR_SCROLLABLE: case SQL_ATTR_CURSOR_SENSITIVITY: case SQL_ATTR_ENABLE_AUTO_IPD: case SQL_ATTR_FETCH_BOOKMARK_PTR: case SQL_ATTR_IMP_PARAM_DESC: case SQL_ATTR_IMP_ROW_DESC: case SQL_ATTR_PARAM_BIND_OFFSET_PTR: case SQL_ATTR_PARAM_BIND_TYPE: case SQL_ATTR_PARAM_OPERATION_PTR: case SQL_ATTR_PARAM_STATUS_PTR: case SQL_ATTR_PARAMS_PROCESSED_PTR: case SQL_ATTR_PARAMSET_SIZE: case SQL_ATTR_ROW_ARRAY_SIZE: case SQL_ATTR_ROW_BIND_OFFSET_PTR: case SQL_ATTR_ROW_OPERATION_PTR: case SQL_ATTR_ROW_STATUS_PTR: case SQL_ATTR_ROWS_FETCHED_PTR: __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); case SQL_ATTR_CONCURRENCY: case SQL_BIND_TYPE: case SQL_ATTR_CURSOR_TYPE: case SQL_ATTR_MAX_LENGTH: case SQL_MAX_ROWS: case SQL_ATTR_KEYSET_SIZE: case SQL_ROWSET_SIZE: case SQL_ATTR_NOSCAN: case SQL_ATTR_QUERY_TIMEOUT: case SQL_ATTR_RETRIEVE_DATA: case SQL_ATTR_SIMULATE_CURSOR: case SQL_ATTR_USE_BOOKMARKS: if( __check_stmt_from_dbc_v( connection, 5, STATE_S8, STATE_S9, STATE_S10, STATE_S11, STATE_S12 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &connection -> error, ERROR_24000, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } break; default: if( __check_stmt_from_dbc_v( connection, 5, STATE_S8, STATE_S9, STATE_S10, STATE_S11, STATE_S12 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } break; } /* * is it something overridden */ value = __attr_override( connection, SQL_HANDLE_DBC, attribute, value, &string_length ); /* * we need to save this even if connected so we can use it for the next connect */ if ( attribute == SQL_ATTR_LOGIN_TIMEOUT ) { connection -> login_timeout = ( SQLLEN ) value; connection -> login_timeout_set = 1; } /* * if connected, call the driver * otherwise we need to save the states and set them when we * do connect */ if ( connection -> state == STATE_C2 ) { /* * is it for us */ if ( attribute == SQL_ATTR_ODBC_CURSORS ) { connection -> cursors = ( SQLLEN ) value; } else if ( attribute == SQL_ATTR_ACCESS_MODE ) { connection -> access_mode = ( SQLLEN ) value; connection -> access_mode_set = 1; } else if ( attribute == SQL_ATTR_ASYNC_ENABLE ) { connection -> async_enable = ( SQLLEN ) value; connection -> async_enable_set = 1; } else if ( attribute == SQL_ATTR_AUTO_IPD ) { connection -> auto_ipd = ( SQLLEN ) value; connection -> auto_ipd_set = 1; } else if ( attribute == SQL_ATTR_AUTOCOMMIT ) { connection -> auto_commit = ( SQLLEN ) value; connection -> auto_commit_set = 1; } else if ( attribute == SQL_ATTR_CONNECTION_TIMEOUT ) { connection -> connection_timeout = ( SQLLEN ) value; connection -> connection_timeout_set = 1; } else if ( attribute == SQL_ATTR_METADATA_ID ) { connection -> metadata_id = ( SQLLEN ) value; connection -> metadata_id_set = 1; } else if ( attribute == SQL_ATTR_PACKET_SIZE ) { connection -> packet_size = ( SQLLEN ) value; connection -> packet_size_set = 1; } else if ( attribute == SQL_ATTR_QUIET_MODE ) { connection -> quite_mode = ( SQLLEN ) value; connection -> quite_mode_set = 1; } else if ( attribute == SQL_ATTR_TXN_ISOLATION ) { connection -> txn_isolation = ( SQLLEN ) value; connection -> txn_isolation_set = 1; } else if ( attribute != SQL_ATTR_LOGIN_TIMEOUT ) { /* * save any unknown attributes untill connect */ struct save_attr *sa = calloc( 1, sizeof( struct save_attr )); sa -> attr_type = attribute; if ( string_length > 0 ) { sa -> str_attr = malloc( string_length ); memcpy( sa -> str_attr, value, string_length ); sa -> str_len = string_length; } else if ( string_length == SQL_NTS ) { if (!value) { __post_internal_error( &connection -> error, ERROR_HY024, "Invalid argument value", connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { sa -> str_attr = strdup( value ); sa -> str_len = string_length; } } else { sa -> intptr_attr = (intptr_t) value; sa -> str_len = string_length; } sa -> next = connection -> save_attr; connection -> save_attr = sa; } sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } else { if ( !connection -> unicode_driver ) { if ( !CHECK_SQLSETCONNECTATTR( connection )) { if ( CHECK_SQLSETCONNECTOPTION( connection )) { /* * Is it in the legal range of values */ if ( attribute < SQL_CONN_DRIVER_MIN && ( attribute > SQL_PACKET_SIZE || attribute < SQL_ACCESS_MODE )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } ret = SQLSETCONNECTOPTION( connection, connection -> driver_dbc, attribute, value ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { ret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, attribute, value, string_length ); } } else { if ( !CHECK_SQLSETCONNECTATTRW( connection )) { if ( CHECK_SQLSETCONNECTOPTIONW( connection )) { SQLWCHAR *s1; /* * Is it in the legal range of values */ if ( attribute < SQL_CONN_DRIVER_MIN && ( attribute > SQL_PACKET_SIZE || attribute < SQL_ACCESS_MODE )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: s1 = ansi_to_unicode_alloc( value, SQL_NTS, connection, NULL ); ret = SQLSETCONNECTOPTIONW( connection, connection -> driver_dbc, attribute, s1 ); if ( s1 ) free( s1 ); break; default: ret = SQLSETCONNECTOPTIONW( connection, connection -> driver_dbc, attribute, value ); break; } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { SQLWCHAR *s1; switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: s1 = ansi_to_unicode_alloc( value, string_length, connection, NULL ); ret = SQLSETCONNECTATTRW( connection, connection -> driver_dbc, attribute, s1, string_length == SQL_NTS ? SQL_NTS : string_length * sizeof( SQLWCHAR )); if ( s1 ) free( s1 ); break; default: ret = SQLSETCONNECTATTRW( connection, connection -> driver_dbc, attribute, value, string_length ); break; } } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } } /* * catch this */ if ( attribute == SQL_ATTR_USE_BOOKMARKS && SQL_SUCCEEDED( ret )) { connection -> bookmarks_on = (SQLLEN) value; } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetTypeInfoW.c0000644000175000017500000002106113303466667015675 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetTypeInfoW.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetTypeInfoW.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.5 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.4 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetTypeInfoW.c,v $"; SQLRETURN SQLGetTypeInfoW( SQLHSTMT statement_handle, SQLSMALLINT data_type ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETTYPEINFOW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETTYPEINFOW( parent_statement -> connection, statement_handle, data_type ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tData Type = %s", statement, __type_as_string( s1, data_type )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLGETTYPEINFO ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLGETTYPEINFOW( statement -> connection )) { if ( !CHECK_SQLGETTYPEINFOW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLGETTYPEINFOW( statement -> connection , statement -> driver_stmt, data_type ); } else { if ( !CHECK_SQLGETTYPEINFO( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLGETTYPEINFO( statement -> connection , statement -> driver_stmt, data_type ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLGETTYPEINFO; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/__stats.c0000644000175000017500000005504613303466667014437 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: __stats.c,v 1.4 2009/02/18 17:59:09 lurcher Exp $ * * $Log: __stats.c,v $ * Revision 1.4 2009/02/18 17:59:09 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.2 2004/05/07 09:53:13 lurcher * * * Fix potential problrm in stats if creating a semaphore fails * Alter state after SQLParamData from S4 to S5 * * Revision 1.1.1.1 2001/10/17 16:40:09 lurcher * * First upload to SourceForge * * Revision 1.11 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.10 2001/06/04 15:24:49 nick * * Add port to MAC OSX and QT3 changes * * Revision 1.9 2001/05/15 13:56:29 jason * * semaphore header file not requires unless COLLECT_STATS is defined * * Revision 1.8 2001/05/15 13:29:07 jason * * * Moved COLLECT_STATS define to allow compilation on OpenVMS. * * Revision 1.7 2001/01/03 10:15:16 martin * * Fix bug in uodbc_update_stats() which attempted to use the shared memory * ID to release the semaphore if the array of process info full. * Fix bug in release_sem_lock() which called semop saying there were 2 ops * when there was really only one. * * Revision 1.6 2000/12/21 16:18:37 martin * * Add the promised support to return a list of process IDs currently attached * to the DM. * * Revision 1.5 2000/12/21 15:58:35 martin * * Fix problems with any app exiting clearing all stats. * * Revision 1.4 2000/12/20 12:00:52 nick * * Add uodbc_update_stats to the non stats build * * Revision 1.3 2000/12/19 10:28:29 martin * * Return "not built with stats" in uodbc_error() if stats function called * when stats not built. * Add uodbc_update_stats() calls to SQLFreeHandle. * * Revision 1.1 2000/12/18 11:53:51 martin * * handle statistic API. * * **********************************************************************/ #include #ifdef HAVE_SYS_SEM_H #include #include #include #include #include #include #include #include #endif /* HAVE_SYS_SEM_H */ #ifdef COLLECT_STATS #include #include #include #endif #include #include "__stats.h" #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: __stats.c,v $ $Revision: 1.4 $"; #ifdef COLLECT_STATS #ifdef HAVE_LIBPTHREAD #include #endif /* * PROJECT_ID is used in the call to ftok(). * The PROJECT_ID reduces the chance of a class between processes using IPC. * Do not change thisnumber as it will make different versions of unixODBC * incompatible. */ #define PROJECT_ID 121 /* * Permssions on sempahore/shared memory * These needs to be world readable/writeable or different apps running under * different users we not be able to update/read the stats. */ #define IPC_ACCESS_MODE (S_IRUSR | S_IWUSR \ | S_IRGRP | S_IWGRP \ | S_IROTH | S_IWOTH) static char errmsg[512]=""; static int release_sem_lock(int sem_id); static int acquire_sem_lock(int sem_id); int uodbc_open_stats( void **rh, unsigned int mode) { key_t ipc_key; int shm_created = 0; uodbc_stats_handle_t *h = NULL; uodbc_stats_handle_t lh; char odbcini[1024]; unsigned int i; int shmflg; if (!rh) { return -1; } #ifdef STATS_FTOK_NAME if ( strcmp( STATS_FTOK_NAME, "odbc.ini" ) == 0 ) { if (!_odbcinst_SystemINI(odbcini, FALSE)) { snprintf(errmsg, sizeof(errmsg), "Failed to find system odbc.ini"); return -1; } } else { strcpy( odbcini, STATS_FTOK_NAME ); } #else if (!_odbcinst_SystemINI(odbcini, FALSE)) { snprintf(errmsg, sizeof(errmsg), "Failed to find system odbc.ini"); return -1; } #endif memset(&lh, '\0', sizeof(lh)); memcpy(lh.id, UODBC_STATS_ID, 5); lh.shm_id = -1; lh.sem_id = -1; lh.pid = getpid(); /* * Check the odbc.ini file used in ftok() exists. */ if (access(odbcini, F_OK) < 0) { snprintf(errmsg, sizeof(errmsg), "Cannot locate %s", odbcini); return -1; } /* * Get a unique IPC key. */ if ((ipc_key = ftok(odbcini, (char)PROJECT_ID)) < 0) { snprintf(errmsg, sizeof(errmsg), "Failed to obtain IPC key - %s", strerror(errno)); return -1; } /* * See if the semaphore exists and create if it doesn't. */ lh.sem_id = semget(ipc_key, 1, IPC_ACCESS_MODE | IPC_CREAT | IPC_EXCL); if (lh.sem_id < 0) { if (errno != EEXIST) { snprintf(errmsg, sizeof(errmsg), "Failed to get semaphore ID - %s", strerror(errno)); return -1; } lh.sem_id = semget(ipc_key, 1, IPC_ACCESS_MODE | IPC_CREAT); if (lh.sem_id < 0) { snprintf(errmsg, sizeof(errmsg), "Failed to create semaphore - %s", strerror(errno)); return -1; } } /* * Create/map shared memory */ if (mode & UODBC_STATS_WRITE) shmflg = IPC_ACCESS_MODE | IPC_CREAT | IPC_EXCL; else shmflg = IPC_ACCESS_MODE; lh.shm_id = shmget(ipc_key, sizeof(uodbc_stats_t), shmflg); if (lh.shm_id < 0) { if (mode & UODBC_STATS_READ) { snprintf(errmsg, sizeof(errmsg), "No statistics available yet"); return -1; } if (errno == EEXIST) { lh.shm_id = shmget(ipc_key, sizeof(uodbc_stats_t), IPC_ACCESS_MODE); if (lh.shm_id < 0) { snprintf(errmsg, sizeof(errmsg), "Shared memory exists but cannot map it - %s", strerror(errno)); return -1; } } else { snprintf(errmsg, sizeof(errmsg), "Failed to get shared memory ID - %s", strerror(errno)); return -1; } } else { if (mode & UODBC_STATS_WRITE) shm_created = 1; } lh.stats = (uodbc_stats_t *)shmat(lh.shm_id, 0, 0); if (lh.stats == (uodbc_stats_t *)-1) { snprintf(errmsg, sizeof(errmsg), "Failed to attach to shared memory - %s", strerror(errno)); return -1; } else if (shm_created) { unsigned int i; int lk; lk = acquire_sem_lock(lh.sem_id); memset(lh.stats, '\0', sizeof(uodbc_stats_t)); for (i = 0; i < (sizeof(lh.stats->perpid) / sizeof(lh.stats->perpid[0])); i++) { lh.stats->perpid[i].pid = (pid_t)0; } if (lk == 0) release_sem_lock(lh.sem_id); } if ((h = calloc(1, sizeof(uodbc_stats_handle_t))) == NULL) return -1; memcpy(h, &lh, sizeof(uodbc_stats_handle_t)); /* * If caller asked for write access it is assumed it is going to * change the statistics and so it needs an entry in the stats. */ if (mode & UODBC_STATS_WRITE) { int lk; lk = acquire_sem_lock(lh.sem_id); for (i = 0; i < (sizeof(h->stats->perpid) / sizeof(h->stats->perpid[0])); i++) { if (h->stats->perpid[i].pid == (pid_t)0) { h->stats->perpid[i].pid = getpid(); h->stats->perpid[i].n_env = 0; h->stats->perpid[i].n_dbc = 0; h->stats->perpid[i].n_stmt = 0; h->stats->perpid[i].n_desc = 0; break; } } if (lk == 0) release_sem_lock(lh.sem_id); } *(uodbc_stats_handle_t **)rh = h; return 0; } /************************************************************************/ /* */ /* uodbc_close_stats */ /* ================= */ /* */ /************************************************************************/ int uodbc_close_stats( void *h) { uodbc_stats_handle_t *sh; sh = (uodbc_stats_handle_t *)h; if (!sh) { snprintf(errmsg, sizeof(errmsg), "NULL stats handle"); return -1; } if (memcmp(sh->id, UODBC_STATS_ID, sizeof(sh->id)) != 0) { snprintf(errmsg, sizeof(errmsg), "Invalid stats handle %p", sh); return -1; } if ((sh->shm_id != -1) && (sh->stats)) { unsigned int i; for (i = 0; i < (sizeof(sh->stats->perpid) / sizeof(sh->stats->perpid[0])); i++) { if (sh->stats->perpid[i].pid == sh->pid) { sh->stats->perpid[i].pid = (pid_t) 0; break; } } shmdt((char *)sh->stats); sh->stats = NULL; sh->shm_id = -1; } /* * Should we examine attach count and delete shared memory? */ memset(sh->id, '\0', sizeof(sh->id)); free(sh); return 0; } /************************************************************************/ /* */ /* uodbc_update_stats */ /* ================== */ /* */ /************************************************************************/ int uodbc_update_stats(void *h, unsigned int stats_type_mask, void *value) { unsigned long type; unsigned int i; uodbc_stats_handle_t *sh; int lk; sh = (uodbc_stats_handle_t *)h; if (!sh) { snprintf(errmsg, sizeof(errmsg), "NULL stats handle"); return -1; } if (memcmp(sh->id, UODBC_STATS_ID, sizeof(sh->id)) != 0) { snprintf(errmsg, sizeof(errmsg), "Invalid stats handle %p", h); return -1; } if (!sh->stats) { snprintf(errmsg, sizeof(errmsg), "stats memory not mapped"); return -1; } lk = acquire_sem_lock(sh->sem_id); /* * Find this PID in array */ for (i = 0; i < (sizeof(sh->stats->perpid) / sizeof(sh->stats->perpid[0])); i++) { if (sh->stats->perpid[i].pid == sh->pid) break; } /* * Check if array full. */ if ( i >= (sizeof(sh->stats->perpid) / sizeof(sh->stats->perpid[0]))) { /* * array full - process not entered. */ if (lk == 0) release_sem_lock(sh->sem_id); return 0; } type = stats_type_mask & UODBC_STATS_TYPE_TYPE_MASK; switch(type) { case UODBC_STATS_TYPE_HENV: { sh->stats->perpid[i].n_env += (long)value; break; } case UODBC_STATS_TYPE_HDBC: { sh->stats->perpid[i].n_dbc += (long)value; break; } case UODBC_STATS_TYPE_HSTMT: { sh->stats->perpid[i].n_stmt += (long)value; break; } case UODBC_STATS_TYPE_HDESC: { sh->stats->perpid[i].n_desc += (long)value; break; } default: { break; } } if (lk == 0) release_sem_lock(sh->sem_id); return 0; } /************************************************************************/ /* */ /* uodbc_stats_error */ /* ================= */ /* */ /************************************************************************/ char *uodbc_stats_error( char *buf, size_t buflen) { if (!buf) return NULL; if (strlen(errmsg) > buflen) { memcpy(buf, errmsg, buflen - 1); buf[buflen - 1] = '\0'; } else { strcpy(buf, errmsg); } return buf; } /************************************************************************/ /* */ /* uodbc_get_stats */ /* =============== */ /* */ /* This function should be provided with an array of statistic */ /* structures which will be filled with the required statistics */ /* records. */ /* */ /* ret_stats = uodbc_get_stats(h, request_pid, s, n_stats); */ /* */ /* h = a statistics handle returned from uodbc_open_stats(). */ /* request_pid = */ /* -1 = return stats on all attached processes. */ /* n (n > 0) = return stats on specific process request_pid. */ /* 0 = return list of processes attached. */ /* s = ptr to array of statistics structures. */ /* n_stats = number of statistics structures at s. */ /* ret_stats = number of stats structures filled in at s. */ /* */ /************************************************************************/ int uodbc_get_stats( void *h, pid_t request_pid, uodbc_stats_retentry *s, int n_stats) { uodbc_stats_handle_t *sh; unsigned int i; long n_env=0; long n_dbc=0; long n_stmt=0; long n_desc=0; int cur_stat; sh = (uodbc_stats_handle_t *)h; if (!sh) { snprintf(errmsg, sizeof(errmsg), "NULL stats return ptr supplied"); return -1; } if (n_stats < 1) { snprintf(errmsg, sizeof(errmsg), "No stats return structures supplied"); return -1; } if (!sh) { snprintf(errmsg, sizeof(errmsg), "NULL stats handle"); return -1; } if (memcmp(sh->id, UODBC_STATS_ID, sizeof(sh->id)) != 0) { snprintf(errmsg, sizeof(errmsg), "Invalid stats handle %p", sh); return -1; } if (!sh->stats) { snprintf(errmsg, sizeof(errmsg), "stats memory not mapped"); return -1; } cur_stat = 0; for (i = 0; i < (sizeof(sh->stats->perpid) / sizeof(sh->stats->perpid[0])); i++) { if (sh->stats->perpid[i].pid > 0) { int sts; /* * Check this process still exists and if not zero counts. */ sts = kill(sh->stats->perpid[i].pid, 0); if ((sts == 0) || ((sts < 0) && (errno == EPERM))) { ; } else { sh->stats->perpid[i].pid = 0; sh->stats->perpid[i].n_env = 0; sh->stats->perpid[i].n_dbc = 0; sh->stats->perpid[i].n_stmt = 0; sh->stats->perpid[i].n_desc = 0; } } if (((request_pid == (pid_t)-1) && (sh->stats->perpid[i].pid > 0)) || (sh->stats->perpid[i].pid == request_pid)) { n_env += sh->stats->perpid[i].n_env; n_dbc += sh->stats->perpid[i].n_dbc; n_stmt += sh->stats->perpid[i].n_stmt; n_desc += sh->stats->perpid[i].n_desc; } else if (request_pid == (pid_t)0) { s[cur_stat].type = UODBC_STAT_LONG; s[cur_stat].value.l_value = sh->stats->perpid[i].pid; strcpy(s[cur_stat].name, "PID"); if (++cur_stat > n_stats) return cur_stat; } } if (request_pid == (pid_t)0) return cur_stat; s[cur_stat].type = UODBC_STAT_LONG; s[cur_stat].value.l_value = n_env; strcpy(s[cur_stat].name, "Environments"); if (++cur_stat > n_stats) return cur_stat; s[cur_stat].type = UODBC_STAT_LONG; s[cur_stat].value.l_value = n_dbc; strcpy(s[cur_stat].name, "Connections"); if (++cur_stat > n_stats) return cur_stat; s[cur_stat].type = UODBC_STAT_LONG; s[cur_stat].value.l_value = n_stmt; strcpy(s[cur_stat].name, "Statements"); if (++cur_stat > n_stats) return cur_stat; s[cur_stat].type = UODBC_STAT_LONG; s[cur_stat].value.l_value = n_desc; strcpy(s[cur_stat].name, "Descriptors"); if (++cur_stat > n_stats) return cur_stat; return cur_stat; } /************************************************************************/ /* */ /* acquire_sem_lock */ /* ================ */ /* */ /* This function locks other threads/processes out whilst a change to */ /* to the statistics is made. It uses a global semaphore which was */ /* created in uodbc_open_stats(). The semaphore set contains only the */ /* one semaphore which is incremented to 1 when locked. All semops */ /* are performed with SEM_UNDO so if the process unexepctedly exits */ /* sempahore operations are undone. */ /* */ /* NOTE: some older platforms have a kernel limit on the number of */ /* SEM_UNDOs structures that may be used. If you run out, you will */ /* either have to increase the limit or take out the SEM_UNDO in this */ /* function and release_sem_lock() and hope uodbc_update_stats() never */ /* causes a preature exit. */ /* */ /************************************************************************/ static int acquire_sem_lock(int sem_id) { /* * Semaphore operations: */ /* lock the semaphore */ struct sembuf op_lock[2] = { {0, 0, 0}, /* Wait for [0] (lock) to equal 0 */ {0, 1, SEM_UNDO} /* increment [0] to lock */ }; if (semop(sem_id, &op_lock[0], 2) < 0) { return -1; } return 0; } /************************************************************************/ /* */ /* release_sem_lock */ /* ================ */ /* */ /* This function unlocks the semaphore used to lock other */ /* threads/processes out whilst a change to the statistics is made. */ /* It uses a global semaphore which was created in uodbc_open_stats(). */ /* The semaphore set contains only the one semaphore which is */ /* incremented to 1 when locked and decremented when unlocked. */ /* All semops are performed with SEM_UNDO so if the process */ /* unexepctedly exits sempahore operations are undone. */ /* */ /* NOTE: some older platforms have a kernel limit on the number of */ /* SEM_UNDOs structures that may be used. If you run out, you will */ /* either have to increase the limit or take out the SEM_UNDO in this */ /* function and acquire_sem_lock() and hope uodbc_update_stats() never */ /* causes a preature exit. */ /* */ /************************************************************************/ static int release_sem_lock(int sem_id) { /* * Semaphore operations: */ /* unlock the semaphore */ struct sembuf op_unlock[1] = { {0, -1, SEM_UNDO}, /* Decrement [0] lock back to zero */ }; if (semop(sem_id, &op_unlock[0], 1) < 0) { return -1; } return 0; } #else int uodbc_open_stats( void **rh, unsigned int mode) { return -1; } int uodbc_close_stats( void *h) { return -1; } char *uodbc_stats_error( char *buf, size_t buflen) { const char *notbuilt="unixODBC not built with statistics code"; if (!buf) return NULL; if (strlen(notbuilt) > buflen) { memcpy(buf, notbuilt, buflen - 1); buf[buflen - 1] = '\0'; } else { strcpy(buf, notbuilt); } return buf; } int uodbc_get_stats( void *h, pid_t request_pid, uodbc_stats_retentry *s, int n_stats) { return -1; } int uodbc_update_stats(void *h, unsigned int stats_type_mask, void *value) { return -1; } #endif /* COLLECT_STATS */ unixODBC-2.3.9/DriverManager/SQLTransact.c0000644000175000017500000004111313303466667015130 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLTransact.c,v 1.11 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLTransact.c,v $ * Revision 1.11 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.10 2007/08/30 12:54:17 lurcher * Add -3 option to isql to use ODBC3 calls * * Revision 1.9 2006/05/31 17:35:34 lurcher * Add unicode ODBCINST entry points * * Revision 1.8 2004/06/16 14:42:03 lurcher * * * Fix potential corruption with threaded use and SQLEndTran * * Revision 1.7 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.6 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.5 2002/09/18 14:49:32 lurcher * * DataManagerII additions and some more threading fixes * * Revision 1.3 2002/08/20 12:41:07 lurcher * * Fix incorrect return state from SQLEndTran/SQLTransact * * Revision 1.2 2002/08/12 16:20:44 lurcher * * Make it try and find a working iconv set of encodings * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.10 2000/08/16 15:57:51 ngorham * * Fix bug where it falled if called in state C4 * * Revision 1.9 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.7 1999/10/20 19:45:15 ngorham * * Added fix to SQLTransact in the DM * * Revision 1.6 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.4 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.3 1999/06/30 23:56:56 ngorham * * Add initial thread safety code * * Revision 1.2 1999/06/19 17:51:40 ngorham * * Applied assorted minor bug fixes * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:21 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLTransact.c,v $ $Revision: 1.11 $"; SQLRETURN SQLTransact( SQLHENV environment_handle, SQLHDBC connection_handle, SQLUSMALLINT completion_type ) { SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check either handle first */ if ( connection_handle != SQL_NULL_HDBC ) { DMHDBC connection = (DMHDBC) connection_handle; if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } } if ( environment_handle != SQL_NULL_HENV ) { DMHENV environment = (DMHENV) environment_handle; if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } } if ( connection_handle != SQL_NULL_HDBC ) { DMHDBC connection = (DMHDBC) connection_handle; SQLRETURN ret; function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p\ \n\t\t\tConnection = %p\ \n\t\t\tCompletion Type = %d", (void*)environment_handle, (void*)connection_handle, (int)completion_type ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C1 || connection -> state == STATE_C2 || connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * check status of statements belonging to this connection */ if( __check_stmt_from_dbc_v( connection, 8, STATE_S8, STATE_S9, STATE_S10, STATE_S11, STATE_S12, STATE_S13, STATE_S14, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( completion_type != SQL_COMMIT && completion_type != SQL_ROLLBACK ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY012" ); __post_internal_error( &connection -> error, ERROR_HY012, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( CHECK_SQLTRANSACT( connection )) { ret = SQLTRANSACT( connection, SQL_NULL_HENV, connection -> driver_dbc, completion_type ); } else if ( CHECK_SQLENDTRAN( connection )) { ret = SQLENDTRAN( connection, SQL_HANDLE_DBC, connection -> driver_dbc, completion_type ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if( SQL_SUCCEEDED(ret) && connection -> auto_commit == SQL_AUTOCOMMIT_OFF ) { SQLSMALLINT cb_value; SQLSMALLINT cb_value_length = sizeof(SQLSMALLINT); SQLRETURN ret1; /* * for each statement belonging to this connection set its state * relative to the commit or rollback behavior */ if ( connection -> cbs_found == 0 ) { /* release thread so we can get the info */ thread_release( SQL_HANDLE_DBC, connection ); ret1 = SQLGetInfo(connection, SQL_CURSOR_COMMIT_BEHAVIOR, &connection -> ccb_value, sizeof( SQLSMALLINT ), &cb_value_length); if ( SQL_SUCCEEDED( ret1 )) { ret1 = SQLGetInfo(connection, SQL_CURSOR_ROLLBACK_BEHAVIOR, &connection -> crb_value, sizeof( SQLSMALLINT ), &cb_value_length); } /* protect thread again */ thread_protect( SQL_HANDLE_DBC, connection ); if ( SQL_SUCCEEDED( ret1 )) { connection -> cbs_found = 1; } } if( completion_type == SQL_COMMIT ) { cb_value = connection -> ccb_value; } else { cb_value = connection -> crb_value; } if( connection -> cbs_found ) { __set_stmt_state( connection, cb_value ); } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R0 ); } else if ( environment_handle != SQL_NULL_HENV ) { DMHENV environment = (DMHENV) environment_handle; DMHDBC connection; SQLRETURN ret; function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p\ \n\t\t\tConnection = %p\ \n\t\t\tCompletion Type = %d", (void*)environment_handle, (void*)connection_handle, (int)completion_type ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); if ( completion_type != SQL_COMMIT && completion_type != SQL_ROLLBACK ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY012" ); __post_internal_error( &environment -> error, ERROR_HY012, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( environment -> state == STATE_E2 ) { /* * check that none of the connections are in a need data state */ connection = __get_dbc_root(); while( connection ) { if ( connection -> environment == environment && connection -> state > STATE_C4 ) { if( __check_stmt_from_dbc_v( connection, 8, STATE_S8, STATE_S9, STATE_S10, STATE_S11, STATE_S12, STATE_S13, STATE_S14, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &environment -> error, ERROR_HY010, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } } connection = connection -> next_class_list; } /* * for each connection on this env */ connection = __get_dbc_root(); while( connection ) { if ( connection -> environment == environment && connection -> state > STATE_C4 ) { if ( CHECK_SQLTRANSACT( connection )) { ret = SQLTRANSACT( connection, SQL_NULL_HENV, connection -> driver_dbc, completion_type ); if ( !SQL_SUCCEEDED( ret )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24S01" ); __post_internal_error( &environment -> error, ERROR_25S01, NULL, environment -> requested_version ); thread_release( SQL_HANDLE_ENV, environment ); return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR, DEFER_R0 ); } } else if ( CHECK_SQLENDTRAN( connection )) { ret = SQLENDTRAN( connection, SQL_HANDLE_DBC, connection -> driver_dbc, completion_type ); if ( !SQL_SUCCEEDED( ret )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24S01" ); __post_internal_error( &environment -> error, ERROR_25S01, NULL, environment -> requested_version ); return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR, DEFER_R0 ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &environment -> error, ERROR_IM001, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } } connection = connection -> next_class_list; } } if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_release( SQL_HANDLE_ENV, environment ); return SQL_SUCCESS; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } } unixODBC-2.3.9/DriverManager/SQLStatistics.c0000644000175000017500000003331013303466667015503 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLStatistics.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLStatistics.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2005/02/07 14:17:07 lurcher * Fix small typo in SQLStatistics * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:40 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:56 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLStatistics.c,v $ $Revision: 1.8 $"; SQLRETURN SQLStatisticsA( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT unique, SQLUSMALLINT reserved ) { return SQLStatistics( statement_handle, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, unique, reserved ); } SQLRETURN SQLStatistics( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT unique, SQLUSMALLINT reserved ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tUnique = %d\ \n\t\t\tReserved = %d", statement, __string_with_length( s1, catalog_name, name_length1 ), __string_with_length( s2, schema_name, name_length2 ), __string_with_length( s3, table_name, name_length3 ), unique, reserved ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS ) || ( name_length3 < 0 && name_length3 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( reserved != SQL_ENSURE && reserved != SQL_QUICK ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY101" ); __post_internal_error( &statement -> error, ERROR_HY101, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( unique != SQL_INDEX_UNIQUE && unique != SQL_INDEX_ALL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY100" ); __post_internal_error( &statement -> error, ERROR_HY100, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if ( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLSTATISTICS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( table_name == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> metadata_id == SQL_TRUE ) { if ( schema_name == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3; int wlen; if ( !CHECK_SQLSTATISTICSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( catalog_name, name_length1, statement -> connection, &wlen ); name_length1 = wlen; s2 = ansi_to_unicode_alloc( schema_name, name_length2, statement -> connection, &wlen ); name_length2 = wlen; s3 = ansi_to_unicode_alloc( table_name, name_length3, statement -> connection, &wlen ); name_length3 = wlen; ret = SQLSTATISTICSW( statement -> connection, statement -> driver_stmt, s1, name_length1, s2, name_length2, s3, name_length3, unique, reserved ); if( s1 ) free( s1 ); if( s2 ) free( s2 ); if( s3 ) free( s3 ); } else { if ( !CHECK_SQLSTATISTICS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLSTATISTICS( statement -> connection, statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, unique, reserved ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); */ statement -> numcols = 1; /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLSTATISTICS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLFreeConnect.c0000755000175000017500000000417713303466667015560 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFreeConnect.c,v 1.2 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLFreeConnect.c,v $ * Revision 1.2 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLFreeConnect.c,v $ $Revision: 1.2 $"; SQLRETURN SQLFreeConnect( SQLHDBC connection_handle ) { return __SQLFreeHandle( SQL_HANDLE_DBC, connection_handle ); } unixODBC-2.3.9/DriverManager/SQLColumnPrivilegesW.c0000644000175000017500000003002413303466667016766 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColumnPrivilegesW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLColumnPrivilegesW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:47 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLColumnPrivilegesW.c,v $"; SQLRETURN SQLColumnPrivilegesW( SQLHSTMT statement_handle, SQLWCHAR *catalog_name, SQLSMALLINT name_length1, SQLWCHAR *schema_name, SQLSMALLINT name_length2, SQLWCHAR *table_name, SQLSMALLINT name_length3, SQLWCHAR *column_name, SQLSMALLINT name_length4 ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLCOLUMNPRIVILEGESW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLCOLUMNPRIVILEGESW( parent_statement -> connection, statement_handle, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tColumn Name = %s", statement, __wstring_with_length( s1, catalog_name, name_length1 ), __wstring_with_length( s2, schema_name, name_length2 ), __wstring_with_length( s3, table_name, name_length3 ), __wstring_with_length( s4, column_name, name_length4 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( table_name == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS ) || ( name_length3 < 0 && name_length3 != SQL_NTS ) || ( name_length4 < 0 && name_length4 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLCOLUMNPRIVILEGES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLCOLUMNPRIVILEGESW( statement -> connection )) { if ( !CHECK_SQLCOLUMNPRIVILEGESW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLCOLUMNPRIVILEGESW( statement -> connection , statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); } else { SQLCHAR *as1, *as2, *as3, *as4; int clen; if ( !CHECK_SQLCOLUMNPRIVILEGES( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * The MS book says do this in place, but that causes more problems * than we need */ as1 = (SQLCHAR*) unicode_to_ansi_alloc( catalog_name, name_length1, statement -> connection, &clen ); name_length1 = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( schema_name, name_length2, statement -> connection, &clen ); name_length2 = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( table_name, name_length3, statement -> connection, &clen ); name_length3 = clen; as4 = (SQLCHAR*) unicode_to_ansi_alloc( column_name, name_length4, statement -> connection, &clen ); name_length4 = clen; ret = SQLCOLUMNPRIVILEGES( statement -> connection , statement -> driver_stmt, as1, name_length1, as2, name_length2, as3, name_length3, as4, name_length4 ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); if ( as4 ) free( as4 ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLCOLUMNPRIVILEGES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLConnectW.c0000644000175000017500000005153713364071206015070 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLConnectW.c,v 1.15 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLConnectW.c,v $ * Revision 1.15 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.14 2008/09/29 14:02:44 lurcher * Fix missing dlfcn group option * * Revision 1.13 2007/02/28 15:37:47 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.12 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.11 2002/12/20 11:36:46 lurcher * * Update DMEnvAttr code to allow setting in the odbcinst.ini entry * * Revision 1.10 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.9 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.8 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.7 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.6 2002/05/28 13:30:34 lurcher * * Tidy up for AIX * * Revision 1.5 2002/05/24 12:42:50 lurcher * * Alter NEWS and ChangeLog to match their correct usage * Additional UNICODE tweeks * * Revision 1.4 2002/04/10 11:04:36 lurcher * * Fix endian issue with 4 byte unicode support * * Revision 1.3 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/04 13:16:25 nick * * Add support for GNU portable threads and tidy up some UNICODE compile * warnings * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLConnectW.c,v $"; SQLRETURN SQLConnectW( SQLHDBC connection_handle, SQLWCHAR *server_name, SQLSMALLINT name_length1, SQLWCHAR *user_name, SQLSMALLINT name_length2, SQLWCHAR *authentication, SQLSMALLINT name_length3 ) { DMHDBC connection = (DMHDBC)connection_handle; int len, ret_from_connect; SQLWCHAR dsn[ SQL_MAX_DSN_LENGTH + 1 ]; char lib_name[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver_name[ INI_MAX_PROPERTY_VALUE + 1 ]; SQLCHAR ansi_dsn[ SQL_MAX_DSN_LENGTH + 1 ]; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], ansi_user[ SQL_MAX_DSN_LENGTH + 1 ], ansi_pwd[ SQL_MAX_DSN_LENGTH + 1 ]; int warnings; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDBC parent_connection; parent_connection = find_parent_handle( connection, SQL_HANDLE_DBC ); if ( parent_connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLCONNECTW( parent_connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLCONNECTW( parent_connection, connection_handle, server_name, name_length1, user_name, name_length2, authentication, name_length3 ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tServer Name = %s\ \n\t\t\tUser Name = %s\ \n\t\t\tAuthentication = %s", connection, __wstring_with_length( s1, server_name, name_length1 ), __wstring_with_length( s2, user_name, name_length2 ), __wstring_with_length_pass( s3, authentication, name_length3 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS ) || ( name_length3 < 0 && name_length3 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * check the state of the connection */ if ( connection -> state != STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( name_length1 && server_name ) { if ( name_length1 == SQL_NTS ) { len = wide_strlen( server_name ); if ( len > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { len = name_length1; if ( len > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } memcpy( dsn, server_name, sizeof( dsn[ 0 ] ) * len ); dsn[ len ] = (SQLWCHAR) 0; } else if ( name_length1 > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM010" ); __post_internal_error( &connection -> error, ERROR_IM010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { int i; for ( i = 0; i < 8; i ++ ) dsn[ i ] = "DEFAULT"[i]; } /* * No pooling for UNICODE at the moment */ connection -> pooled_connection = NULL; unicode_to_ansi_copy((char*) ansi_dsn, sizeof( ansi_dsn ), dsn, sizeof( ansi_dsn ), NULL, NULL ); if ( !*ansi_dsn || !__find_lib_name((char*) ansi_dsn, lib_name, driver_name )) { /* * if not found look for a default */ if ( !__find_lib_name( "DEFAULT", lib_name, driver_name )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } /* * do we have any Environment, Connection, or Statement attributes set in the ini ? */ __handle_attr_extensions( connection, (char*) ansi_dsn, driver_name ); /* * if necessary change the threading level */ warnings = 0; if ( !__connect_part_one( connection, lib_name, driver_name, &warnings )) { __disconnect_part_four( connection ); /* release unicode handles */ return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( !CHECK_SQLCONNECTW( connection ) && !CHECK_SQLCONNECT( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( CHECK_SQLCONNECTW( connection )) { if ( CHECK_SQLSETCONNECTATTR( connection )) { SQLSETCONNECTATTR( connection, connection -> driver_dbc, SQL_ATTR_ANSI_APP, SQL_AA_FALSE, 0 ); } ret_from_connect = SQLCONNECTW( connection, connection -> driver_dbc, dsn, SQL_NTS, user_name, name_length2, authentication, name_length3 ); connection -> unicode_driver = 1; } else { if ( user_name ) { if ( name_length2 == SQL_NTS ) unicode_to_ansi_copy((char*) ansi_user, sizeof( ansi_user ),user_name, sizeof( ansi_user ), connection, NULL); else unicode_to_ansi_copy((char*) ansi_user, sizeof( ansi_user ),user_name, name_length2, connection, NULL ); } if ( authentication ) { if ( name_length3 == SQL_NTS ) unicode_to_ansi_copy((char*) ansi_pwd, sizeof( ansi_pwd ), authentication, sizeof( ansi_pwd ), connection, NULL); else unicode_to_ansi_copy((char*) ansi_pwd, sizeof( ansi_pwd ), authentication, name_length3, connection, NULL ); } /* if ( CHECK_SQLSETCONNECTATTR( connection )) { int lret; lret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, SQL_ATTR_ANSI_APP, SQL_AA_TRUE, 0 ); } */ ret_from_connect = SQLCONNECT( connection, connection -> driver_dbc, ansi_dsn, SQL_NTS, user_name ? ansi_user : NULL, name_length2, authentication ? ansi_pwd : NULL, name_length3 ); connection -> unicode_driver = 0; } if ( ret_from_connect != SQL_SUCCESS ) { /* * get the errors from the driver before * loseing the connection */ if ( connection -> unicode_driver ) { SQLWCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLWCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; if ( CHECK_SQLERRORW( connection )) { do { ret = SQLERRORW( connection, SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text )/sizeof(SQLWCHAR), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex_w( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGRECW( connection )) { int rec = 1; do { ret = SQLGETDIAGRECW( connection, SQL_HANDLE_DBC, connection -> driver_dbc, rec ++, sqlstate, &native_error, message_text, sizeof( message_text )/sizeof(SQLWCHAR), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex_w( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } while( SQL_SUCCEEDED( ret )); } } else { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; if ( CHECK_SQLERROR( connection )) { do { ret = SQLERROR( connection, SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGREC( connection )) { int rec = 1; do { ret = SQLGETDIAGREC( connection, SQL_HANDLE_DBC, connection -> driver_dbc, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); } sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } while( SQL_SUCCEEDED( ret )); } } /* * if it was a error then return now */ if ( !SQL_SUCCEEDED( ret_from_connect )) { __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ return function_return( SQL_HANDLE_DBC, connection, ret_from_connect, DEFER_R0 ); } } /* * we should be connected now */ connection -> state = STATE_C4; strcpy( connection -> dsn, (char*)ansi_dsn ); /* * did we get the type we wanted */ if ( connection -> driver_version != connection -> environment -> requested_version ) { connection -> driver_version = connection -> environment -> requested_version; __post_internal_error( &connection -> error, ERROR_01000, "Driver does not support the requested version", connection -> environment -> requested_version ); ret_from_connect = SQL_SUCCESS_WITH_INFO; } if ( !__connect_part_two( connection )) { /* * the cursor lib can kill us here, so be careful */ __disconnect_part_two( connection ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ connection -> state = STATE_C3; return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } if ( warnings && ret_from_connect == SQL_SUCCESS ) { ret_from_connect = SQL_SUCCESS_WITH_INFO; } return function_return_nodrv( SQL_HANDLE_DBC, connection, ret_from_connect ); } unixODBC-2.3.9/DriverManager/SQLSetStmtOption.c0000644000175000017500000003405013303466667016147 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetStmtOption.c,v 1.10 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetStmtOption.c,v $ * Revision 1.10 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.9 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.8 2007/11/29 12:00:31 lurcher * Add 64 bit type changes to SQLExtendedFetch etc * * Revision 1.7 2005/11/23 08:29:16 lurcher * Add cleanup in postgres driver * * Revision 1.6 2005/04/05 09:11:31 lurcher * The config string being passed into ConfigDsn was wrong, removed semicolon, and added terminating double null * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 2000/06/20 13:30:12 ngorham * * Fix problems when using bookmarks * * Revision 1.7 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:26 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.4 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:21 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetStmtOption.c,v $ $Revision: 1.10 $"; SQLRETURN SQLSetStmtOptionA( SQLHSTMT statement_handle, SQLUSMALLINT option, SQLULEN value ) { return SQLSetStmtOption( statement_handle, option, value ); } SQLRETURN SQLSetStmtOption( SQLHSTMT statement_handle, SQLUSMALLINT option, SQLULEN value ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tOption = %s\ \n\t\t\tValue = %d", statement, __stmt_attr_as_string( s1, option ), (int)value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( option == SQL_CONCURRENCY || option == SQL_CURSOR_TYPE || option == SQL_SIMULATE_CURSOR || option == SQL_USE_BOOKMARKS ) { if ( statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1011" ); __post_internal_error( &statement -> error, ERROR_S1011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { if ( statement -> prepared ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1011" ); __post_internal_error( &statement -> error, ERROR_S1011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1010" ); __post_internal_error( &statement -> error, ERROR_S1010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } } else { if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1010" ); __post_internal_error( &statement -> error, ERROR_S1010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( option == SQL_ATTR_IMP_ROW_DESC || option == SQL_ATTR_IMP_PARAM_DESC ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &statement -> error, ERROR_HY017, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * is it a legitimate value */ ret = dm_check_statement_attrs( statement, option, (SQLPOINTER)value ); if ( ret != SQL_SUCCESS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &statement -> error, ERROR_HY024, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * is it something overridden */ value = (SQLULEN) __attr_override( statement, SQL_HANDLE_STMT, option, (void*) value, NULL ); if ( CHECK_SQLSETSTMTOPTION( statement -> connection )) { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, option, value ); } else if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { switch ( option ) { case SQL_ATTR_APP_PARAM_DESC: if ( value ) memcpy( &statement -> apd, (void*)value, sizeof( statement -> apd )); ret = SQL_SUCCESS; break; case SQL_ATTR_APP_ROW_DESC: if ( value ) memcpy( &statement -> ard, (void*)value, sizeof( statement -> ard )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_PARAM_DESC: if ( value ) memcpy( &statement -> ipd, (void*)value, sizeof( statement -> ipd )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_ROW_DESC: if ( value ) memcpy( &statement -> ird, (void*)value, sizeof( statement -> ird )); ret = SQL_SUCCESS; break; default: ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, option, value, SQL_NTS ); break; } } else if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { switch ( option ) { case SQL_ATTR_APP_PARAM_DESC: if ( value ) memcpy( &statement -> apd, (void*)value, sizeof( statement -> apd )); ret = SQL_SUCCESS; break; case SQL_ATTR_APP_ROW_DESC: if ( value ) memcpy( &statement -> ard, (void*)value, sizeof( statement -> ard )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_PARAM_DESC: if ( value ) memcpy( &statement -> ipd, (void*)value, sizeof( statement -> ipd )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_ROW_DESC: if ( value ) memcpy( &statement -> ird, (void*)value, sizeof( statement -> ird )); ret = SQL_SUCCESS; break; default: ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, option, value, SQL_NTS ); break; } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * take notice of this */ if ( option == SQL_USE_BOOKMARKS && SQL_SUCCEEDED( ret )) { statement -> bookmarks_on = (SQLULEN) value; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLDataSources.c0000644000175000017500000002640113441432674015563 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDataSources.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDataSources.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/06/30 08:40:48 lurcher * Few more tweeks towards a release * * Revision 1.7 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.6 2003/04/10 13:45:51 lurcher * * Alter the way that SQLDataSources returns the description field (again) * * Revision 1.5 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/07/08 11:40:35 lurcher * * Merge two config tests * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.10 2000/08/10 15:12:17 ngorham * * Fix incorrect return from SQLDataSources * * Revision 1.9 2000/05/04 15:08:29 ngorham * * Update SQLDataSource.c * * Revision 1.8 2000/05/04 12:57:03 ngorham * * Fix problem in SQLDataSource, the description is from the Driver not the * DSN * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDataSources.c,v $ $Revision: 1.9 $"; #define BUFFERSIZE 1024*4 SQLRETURN SQLDataSourcesA( SQLHENV environment_handle, SQLUSMALLINT direction, SQLCHAR *server_name, SQLSMALLINT buffer_length1, SQLSMALLINT *name_length1, SQLCHAR *description, SQLSMALLINT buffer_length2, SQLSMALLINT *name_length2 ) { return SQLDataSources( environment_handle, direction, server_name, buffer_length1, name_length1, description, buffer_length2, name_length2 ); } SQLRETURN SQLDataSources( SQLHENV environment_handle, SQLUSMALLINT direction, SQLCHAR *server_name, SQLSMALLINT buffer_length1, SQLSMALLINT *name_length1, SQLCHAR *description, SQLSMALLINT buffer_length2, SQLSMALLINT *name_length2 ) { DMHENV environment = (DMHENV) environment_handle; SQLRETURN ret; char buffer[ BUFFERSIZE + 1 ]; char object[ INI_MAX_OBJECT_NAME + 1 ]; char property[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver[ INI_MAX_PROPERTY_VALUE + 1 ]; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p", environment ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); /* * check that a version has been requested */ if ( environment -> requested_version == 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &environment -> error, ERROR_HY010, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( buffer_length1 < 0 || buffer_length2 < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &environment -> error, ERROR_HY090, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( direction != SQL_FETCH_FIRST && direction != SQL_FETCH_FIRST_USER && direction != SQL_FETCH_FIRST_SYSTEM && direction != SQL_FETCH_NEXT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY103" ); __post_internal_error( &environment -> error, ERROR_HY103, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } /* * for this function USER = "~/.odbc.ini" and * SYSTEM = "/usr/odbc.ini */ if ( direction == SQL_FETCH_FIRST ) { environment -> fetch_mode = ODBC_BOTH_DSN; environment -> entry = 0; } else if ( direction == SQL_FETCH_FIRST_USER ) { environment -> fetch_mode = ODBC_USER_DSN; environment -> entry = 0; } else if ( direction == SQL_FETCH_FIRST_SYSTEM ) { environment -> fetch_mode = ODBC_SYSTEM_DSN; environment -> entry = 0; } /* * this is lifted from Peters code */ memset( buffer, 0, sizeof( buffer )); memset( object, 0, sizeof( object )); SQLSetConfigMode( environment -> fetch_mode ); SQLGetPrivateProfileString( NULL, NULL, NULL, buffer, sizeof( buffer ), "ODBC.INI" ); if ( iniElement( buffer, '\0', '\0', environment -> entry, object, sizeof( object )) != INI_SUCCESS ) { environment -> entry = 0; ret = SQL_NO_DATA; } else { memset( buffer, 0, sizeof( buffer )); memset( property, 0, sizeof( property )); memset( driver, 0, sizeof( driver )); SQLGetPrivateProfileString( object, "Driver", "", driver, sizeof( driver ), "ODBC.INI" ); if ( strlen( driver ) > 0 ) { /* * Make this return the description from the driver setup, this is * the way its done in Windows SQLGetPrivateProfileString( driver, "Description", driver, property, sizeof( property ), "ODBCINST.INI" ); */ /* * even though the string is called description, it should * actually be the driver name entry from odbcinst.ini on windows * there is no separate Description line */ strcpy( property, driver ); } else { /* * May as well try and get something */ SQLGetPrivateProfileString( object, "Description", "", property, sizeof( property ), "ODBC.INI" ); } environment -> entry++; if (( server_name && buffer_length1 <= strlen( object )) || ( description && buffer_length2 <= strlen( property ))) { __post_internal_error( &environment -> error, ERROR_01004, NULL, environment -> requested_version ); ret = SQL_SUCCESS_WITH_INFO; } else { ret = SQL_SUCCESS; } if ( server_name ) { if ( buffer_length1 <= strlen( object )) { memcpy( server_name, object, buffer_length1 ); server_name[ buffer_length1 - 1 ] = '\0'; } else { strcpy((char*) server_name, object ); } } if ( description ) { if ( buffer_length2 <= strlen( property )) { memcpy( description, property, buffer_length2 ); description[ buffer_length2 - 1 ] = '\0'; } else { strcpy((char*) description, property ); } } if ( name_length1 ) { *name_length1 = strlen( object ); } if ( name_length2 ) { *name_length2 = strlen( property ); } } /* NEVER FORGET TO RESET THIS TO ODBC_BOTH_DSN */ SQLSetConfigMode( ODBC_BOTH_DSN ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } return function_return_nodrv( SQL_HANDLE_ENV, environment, ret ); } unixODBC-2.3.9/DriverManager/SQLPrimaryKeysW.c0000644000175000017500000002755013303466667015770 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLPrimaryKeysW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLPrimaryKeysW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLPrimaryKeysW.c,v $"; SQLRETURN SQLPrimaryKeysW( SQLHSTMT statement_handle, SQLWCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLWCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLWCHAR *sz_table_name, SQLSMALLINT cb_table_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLPRIMARYKEYSW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLPRIMARYKEYSW( parent_statement -> connection, statement_handle, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Type = %s", statement, __wstring_with_length( s1, sz_catalog_name, cb_catalog_name ), __wstring_with_length( s2, sz_schema_name, cb_schema_name ), __wstring_with_length( s3, sz_table_name, cb_table_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( cb_catalog_name < 0 && cb_catalog_name != SQL_NTS ) || ( cb_schema_name < 0 && cb_schema_name != SQL_NTS ) || ( cb_table_name < 0 && cb_table_name != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPRIMARYKEYS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( sz_table_name == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLPRIMARYKEYSW( statement -> connection )) { if ( !CHECK_SQLPRIMARYKEYSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPRIMARYKEYSW( statement -> connection , statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); } else { SQLCHAR *as1, *as2, *as3; int clen; if ( !CHECK_SQLPRIMARYKEYS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( sz_catalog_name, cb_catalog_name, statement -> connection, &clen ); cb_catalog_name = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( sz_schema_name, cb_schema_name, statement -> connection, &clen ); cb_schema_name = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( sz_table_name, cb_table_name, statement -> connection, &clen ); cb_table_name = clen; ret = SQLPRIMARYKEYS( statement -> connection , statement -> driver_stmt, as1, cb_catalog_name, as2, cb_schema_name, as3, cb_table_name ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPRIMARYKEYS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/__handles.c0000664000175000017500000012074413303466667014717 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: __handles.c,v 1.13 2009/05/15 15:23:56 lurcher Exp $ * * $Log: __handles.c,v $ * Revision 1.13 2009/05/15 15:23:56 lurcher * Fix pooled connection thread problems * * Revision 1.12 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.11 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.10 2007/02/28 15:37:49 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.9 2006/05/31 17:35:34 lurcher * Add unicode ODBCINST entry points * * Revision 1.8 2004/09/28 08:44:46 lurcher * Fix memory leak in pthread descriptor code * * Revision 1.7 2004/07/24 17:55:37 lurcher * Sync up CVS * * Revision 1.6 2003/06/04 12:49:45 lurcher * * Further PID logging tweeks * * Revision 1.5 2003/06/02 16:51:36 lurcher * * Add TracePid option * * Revision 1.4 2002/08/12 16:20:44 lurcher * * Make it try and find a working iconv set of encodings * * Revision 1.3 2002/08/12 13:17:52 lurcher * * Replicate the way the MS DM handles loading of driver libs, and allocating * handles in the driver. usage counting in the driver means that dlopen is * only called for the first use, and dlclose for the last. AllocHandle for * the driver environment is only called for the first time per driver * per application environment. * * Revision 1.2 2002/02/22 10:23:22 lurcher * * s/Trace File/TraceFile * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.14 2001/06/25 12:55:15 nick * * Fix threading problem with multiple ENV's * * Revision 1.13 2001/06/04 15:24:49 nick * * Add port to MAC OSX and QT3 changes * * Revision 1.12 2001/05/15 13:33:44 jason * * Wrapped calls to stats with COLLECT_STATS * * Revision 1.11 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.10 2001/03/02 14:24:23 nick * * Fix thread detection for Solaris * * Revision 1.9 2001/01/04 13:16:25 nick * * Add support for GNU portable threads and tidy up some UNICODE compile * warnings * * Revision 1.8 2000/12/18 11:51:59 martin * * stats specific mode to uodbc_open_stats. * * Revision 1.7 2000/12/18 11:03:58 martin * * Add support for the collection and retrieval of handle statistics. * * Revision 1.6 2000/12/17 11:17:22 nick * * Remove typo * * Revision 1.5 2000/12/17 11:00:32 nick * * Add thread safe bits to pooling * * Revision 1.4 2000/11/29 17:53:59 nick * * Fix race condition * * Revision 1.3 2000/10/25 09:39:42 nick * * Clear handles out, to avoid reuse * * Revision 1.2 2000/09/08 08:58:17 nick * * Add SQL_DRIVER_HDESC to SQLGetinfo * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.16 2000/06/29 17:27:52 ngorham * * Add fast validate option * * Revision 1.15 2000/06/27 17:34:12 ngorham * * Fix a problem when the second part of the connect failed a seg fault * was generated in the error reporting * * Revision 1.14 2001/03/28 23:09:57 ngorham * * Fix logging * * Revision 1.13 2000/03/11 15:55:47 ngorham * * A few more changes and bug fixes (see NEWS) * * Revision 1.12 2000/02/25 00:02:00 ngorham * * Add a patch to support IBM DB2, and Solaris threads * * Revision 1.11 2000/02/22 22:14:45 ngorham * * Added support for solaris threads * Added check to overcome bug in PHP4 * Fixed bug in descriptors and ODBC 3 drivers * * Revision 1.10 1999/12/11 13:01:57 ngorham * * Add some fixes to the Postgres driver for long types * * Revision 1.9 1999/12/01 09:20:07 ngorham * * Fix some threading problems * * Revision 1.8 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/11/10 03:51:34 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.6 1999/08/05 18:59:49 ngorham * * Typo error found by Greg Bentz * * Revision 1.5 1999/08/03 21:47:39 shandyb * Moving to automake: changed files in DriverManager * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:56 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include #include "drivermanager.h" #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) #include "__stats.h" #include #endif static char const rcsid[]= "$RCSfile: __handles.c,v $ $Revision: 1.13 $"; /* * these are used to enable us to check if a handle is * valid without the danger of a seg-vio. */ static DMHENV environment_root; static DMHDBC connection_root; static DMHSTMT statement_root; static DMHDESC descriptor_root; /* * use just one mutex for all the lists, this avoids any issues * with deadlocks, the performance issue should be minimal, if it * turns out to be a problem, we can readdress this * * We also have a mutex to protect the connection pooling code * * If compiled with thread support the DM allows four different * thread strategies: * * Level 0 - Only the DM internal structures are protected. * The driver is assumed to take care of itself * * Level 1 - The driver is protected down to the statement level. * Each statement will be protected, and the same for the connect * level for connect functions. Note that descriptors are considered * equal to statements when it comes to thread protection. * * Level 2 - The driver is protected at the connection level. Only * one thread can be in a particular driver at one time. * * Level 3 - The driver is protected at the env level, only one thing * at a time. * * By default the driver opens connections with lock level 0; drivers * are expected to be thread safe now. This can be changed by adding * the line * * Threading = N * * to the driver entry in odbcinst.ini, where N is the locking level * (0-3) * */ #ifdef HAVE_LIBPTH #include static pth_mutex_t mutex_lists = PTH_MUTEX_INIT; static pth_mutex_t mutex_env = PTH_MUTEX_INIT; static pth_mutex_t mutex_pool = PTH_MUTEX_INIT; static pth_mutex_t mutex_iconv = PTH_MUTEX_INIT; static int pth_init_called = 0; static int local_mutex_entry( pth_mutex_t *mutex ) { if ( !pth_init_called ) { pth_init(); pth_init_called = 1; } return pth_mutex_acquire( mutex, 0, NULL ); } static int local_mutex_exit( pth_mutex_t *mutex ) { return pth_mutex_release( mutex ); } #elif HAVE_LIBPTHREAD #include static pthread_mutex_t mutex_lists = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t mutex_env = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t mutex_pool = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t mutex_iconv = PTHREAD_MUTEX_INITIALIZER; static int local_mutex_entry( pthread_mutex_t *mutex ) { return pthread_mutex_lock( mutex ); } static int local_mutex_exit( pthread_mutex_t *mutex ) { return pthread_mutex_unlock( mutex ); } #elif HAVE_LIBTHREAD #include static mutex_t mutex_lists; static mutex_t mutex_env; static mutex_t mutex_pool; static mutex_t mutex_iconv; static int local_mutex_entry( mutex_t *mutex ) { return mutex_lock( mutex ); } static int local_mutex_exit( mutex_t *mutex ) { return mutex_unlock( mutex ); } #else #define local_mutex_entry(x) #define local_mutex_exit(x) #endif /* * protection for connection pooling */ void mutex_pool_entry( void ) { local_mutex_entry( &mutex_pool ); } void mutex_pool_exit( void ) { local_mutex_exit( &mutex_pool ); } /* * protection for iconv */ void mutex_iconv_entry( void ) { local_mutex_entry( &mutex_iconv ); } void mutex_iconv_exit( void ) { local_mutex_exit( &mutex_iconv ); } /* * protection for lib loading and counting, reuse the lists mutex as this * is the lowest level protection the DM uses */ void mutex_lib_entry( void ) { local_mutex_entry( &mutex_lists ); } void mutex_lib_exit( void ) { local_mutex_exit( &mutex_lists ); } /* * allocate and register a environment handle */ DMHENV __alloc_env( void ) { DMHENV environment = NULL; local_mutex_entry( &mutex_lists ); environment = calloc( sizeof( *environment ), 1 ); if ( environment ) { char tracing_string[ 64 ]; char tracing_file[ 64 ]; #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) if (uodbc_open_stats(&environment->sh, UODBC_STATS_WRITE) != 0) { ; } uodbc_update_stats(environment->sh, UODBC_STATS_TYPE_HENV, (void *)1); #endif /* * add to list of env handles */ environment -> next_class_list = environment_root; environment_root = environment; environment -> type = HENV_MAGIC; SQLGetPrivateProfileString( "ODBC", "Trace", "No", tracing_string, sizeof( tracing_string ), "odbcinst.ini" ); if ( tracing_string[ 0 ] == '1' || toupper( tracing_string[ 0 ] ) == 'Y' || ( toupper( tracing_string[ 0 ] ) == 'O' && toupper( tracing_string[ 1 ] ) == 'N' )) { SQLGetPrivateProfileString( "ODBC", "TraceFile", "/tmp/sql.log", tracing_file, sizeof( tracing_file ), "odbcinst.ini" ); /* * start logging */ SQLGetPrivateProfileString( "ODBC", "TracePid", "No", tracing_string, sizeof( tracing_string ), "odbcinst.ini" ); if ( tracing_string[ 0 ] == '1' || toupper( tracing_string[ 0 ] ) == 'Y' || ( toupper( tracing_string[ 0 ] ) == 'O' && toupper( tracing_string[ 1 ] ) == 'N' )) { dm_log_open( "ODBC", tracing_file, 1 ); } else { dm_log_open( "ODBC", tracing_file, 0 ); } sprintf( environment -> msg, "\n\t\tExit:[SQL_SUCCESS]\n\t\t\tEnvironment = %p", environment ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } setup_error_head( &environment -> error, environment, SQL_HANDLE_ENV ); } local_mutex_exit( &mutex_lists ); return environment; } /* * check that a env is real */ int __validate_env( DMHENV env ) { #ifdef FAST_HANDLE_VALIDATE if ( env && *(( int * ) env ) == HENV_MAGIC ) return 1; else return 0; #else DMHENV ptr; int ret = 0; local_mutex_entry( &mutex_lists ); ptr = environment_root; while( ptr ) { if ( ptr == env ) { ret = 1; break; } ptr = ptr -> next_class_list; } local_mutex_exit( &mutex_lists ); return ret; #endif } /* * remove from list */ void __release_env( DMHENV environment ) { DMHENV last = NULL; DMHENV ptr; local_mutex_entry( &mutex_lists ); ptr = environment_root; while( ptr ) { if ( environment == ptr ) { break; } last = ptr; ptr = ptr -> next_class_list; } if ( ptr ) { if ( last ) { last -> next_class_list = ptr -> next_class_list; } else { environment_root = ptr -> next_class_list; } } clear_error_head( &environment -> error ); /* * free log */ dm_log_close(); #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) if (environment->sh) uodbc_close_stats(environment->sh); #endif /* * clear just to make sure */ memset( environment, 0, sizeof( *environment )); free( environment ); local_mutex_exit( &mutex_lists ); } /* * get the root, for use in SQLEndTran and SQLTransact */ DMHDBC __get_dbc_root( void ) { return connection_root; } /* * allocate and register a connection handle */ DMHDBC __alloc_dbc( void ) { DMHDBC connection = NULL; local_mutex_entry( &mutex_lists ); connection = calloc( sizeof( *connection ), 1 ); if ( connection ) { /* * add to list of connection handles */ connection -> next_class_list = connection_root; connection_root = connection; connection -> type = HDBC_MAGIC; setup_error_head( &connection -> error, connection, SQL_HANDLE_DBC ); #ifdef HAVE_LIBPTH pth_mutex_init( &connection -> mutex ); /* * for the moment protect at the environment level */ connection -> protection_level = TS_LEVEL3; #elif HAVE_LIBPTHREAD pthread_mutex_init( &connection -> mutex, NULL ); /* * for the moment protect at the environment level */ connection -> protection_level = TS_LEVEL3; #elif HAVE_LIBTHREAD mutex_init( &connection -> mutex, USYNC_THREAD, NULL ); connection -> protection_level = TS_LEVEL3; #endif #ifdef HAVE_ICONV connection -> iconv_cd_uc_to_ascii = (iconv_t)(-1); connection -> iconv_cd_ascii_to_uc = (iconv_t)(-1); #endif } local_mutex_exit( &mutex_lists ); return connection; } /* * adjust the threading level */ void dbc_change_thread_support( DMHDBC connection, int level ) { #if defined ( HAVE_LIBPTHREAD ) || defined( HAVE_LIBTHREAD ) || defined( HAVE_LIBPTH ) int old_level; if ( connection -> protection_level == level ) return; old_level = connection -> protection_level; connection -> protection_level = level; if ( level == TS_LEVEL3 ) { /* * if we are moving from level 3 we may have to release the existing * connection lock, and create the env lock */ if(old_level != TS_LEVEL0) local_mutex_exit( &connection -> mutex ); local_mutex_entry( &mutex_env ); } else if ( old_level == TS_LEVEL3 ) { /* * if we are moving from level 3 we may have to create the new * connection lock, and remove the env lock */ if(level != TS_LEVEL0) local_mutex_entry( &connection -> mutex ); local_mutex_exit( &mutex_env ); } #endif } /* * check that a connection is real */ int __validate_dbc( DMHDBC connection ) { #ifdef FAST_HANDLE_VALIDATE if ( connection && *(( int * ) connection ) == HDBC_MAGIC ) return 1; else return 0; #else DMHDBC ptr; int ret = 0; local_mutex_entry( &mutex_lists ); ptr = connection_root; while( ptr ) { if ( ptr == connection ) { ret = 1; break; } ptr = ptr -> next_class_list; } local_mutex_exit( &mutex_lists ); return ret; #endif } /* * remove from list */ void __release_dbc( DMHDBC connection ) { DMHDBC last = NULL; DMHDBC ptr; local_mutex_entry( &mutex_lists ); ptr = connection_root; while( ptr ) { if ( connection == ptr ) { break; } last = ptr; ptr = ptr -> next_class_list; } if ( ptr ) { if ( last ) { last -> next_class_list = ptr -> next_class_list; } else { connection_root = ptr -> next_class_list; } } clear_error_head( &connection -> error ); /* * shutdown unicode */ unicode_shutdown( connection ); #ifdef HAVE_LIBPTH #elif HAVE_LIBPTHREAD pthread_mutex_destroy( &connection -> mutex ); #elif HAVE_LIBTHREAD mutex_destroy( &connection -> mutex ); #endif /* * clear just to make sure */ memset( connection, 0, sizeof( *connection )); free( connection ); local_mutex_exit( &mutex_lists ); } /* * allocate and register a statement handle */ DMHSTMT __alloc_stmt( void ) { DMHSTMT statement = NULL; local_mutex_entry( &mutex_lists ); statement = calloc( sizeof( *statement ), 1 ); if ( statement ) { /* * add to list of statement handles */ statement -> next_class_list = statement_root; #ifdef FAST_HANDLE_VALIDATE if ( statement_root ) { statement_root -> prev_class_list = statement; } #endif statement_root = statement; statement -> type = HSTMT_MAGIC; setup_error_head( &statement -> error, statement, SQL_HANDLE_STMT ); #ifdef HAVE_LIBPTH pth_mutex_init( &statement -> mutex ); #elif HAVE_LIBPTHREAD pthread_mutex_init( &statement -> mutex, NULL ); #elif HAVE_LIBTHREAD mutex_init( &statement -> mutex, USYNC_THREAD, NULL ); #endif } local_mutex_exit( &mutex_lists ); return statement; } /* * assigns a statements to the connection */ void __register_stmt ( DMHDBC connection, DMHSTMT statement ) { local_mutex_entry( &mutex_lists ); connection -> statement_count ++; statement -> connection = connection; #ifdef FAST_HANDLE_VALIDATE statement -> next_conn_list = connection -> statements; connection -> statements = statement; #endif local_mutex_exit( &mutex_lists ); } /* * Sets statement state after commit or rollback transaction */ void __set_stmt_state ( DMHDBC connection, SQLSMALLINT cb_value ) { DMHSTMT statement; SQLINTEGER stmt_remaining; local_mutex_entry( &mutex_lists ); #ifdef FAST_HANDLE_VALIDATE statement = connection -> statements; while ( statement ) { if ( (statement -> state == STATE_S2 || statement -> state == STATE_S3) && cb_value == SQL_CB_DELETE ) { statement -> state = STATE_S1; statement -> prepared = 0; } else if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) { if( !statement -> prepared && (cb_value == SQL_CB_DELETE || cb_value == SQL_CB_CLOSE) ) { statement -> state = STATE_S1; } else if( statement -> prepared ) { if( cb_value == SQL_CB_DELETE ) { statement -> state = STATE_S1; statement -> prepared = 0; } else if( cb_value == SQL_CB_CLOSE ) { if ( statement -> state == STATE_S4 ) statement -> state = STATE_S2; else statement -> state = STATE_S3; } } } statement = statement -> next_conn_list; } #else statement = statement_root; stmt_remaining = connection -> statement_count; while ( statement && stmt_remaining > 0 ) { if ( statement -> connection == connection ) { if ( (statement -> state == STATE_S2 || statement -> state == STATE_S3) && cb_value == SQL_CB_DELETE ) { statement -> state = STATE_S1; statement -> prepared = 0; } else if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) { if( !statement -> prepared && (cb_value == SQL_CB_DELETE || cb_value == SQL_CB_CLOSE) ) { statement -> state = STATE_S1; } else if( statement -> prepared ) { if( cb_value == SQL_CB_DELETE ) { statement -> state = STATE_S1; statement -> prepared = 0; } else if( cb_value == SQL_CB_CLOSE ) { if ( statement -> state == STATE_S4 ) statement -> state = STATE_S2; else statement -> state = STATE_S3; } } } stmt_remaining --; } statement = statement -> next_class_list; } #endif local_mutex_exit( &mutex_lists ); } /* * clear all statements on a DBC */ int __clean_stmt_from_dbc( DMHDBC connection ) { DMHSTMT ptr, last; int ret = 0; local_mutex_entry( &mutex_lists ); #ifdef FAST_HANDLE_VALIDATE while ( connection -> statements ) { ptr = connection -> statements; last = connection -> statements -> prev_class_list; connection -> statements = ptr -> next_conn_list; if ( last ) { last -> next_class_list = ptr -> next_class_list; if ( last -> next_class_list ) { last -> next_class_list -> prev_class_list = last; } } else { statement_root = ptr -> next_class_list; if ( statement_root ) { statement_root -> prev_class_list = NULL; } } clear_error_head( &ptr -> error ); #ifdef HAVE_LIBPTH #elif HAVE_LIBPTHREAD pthread_mutex_destroy( &ptr -> mutex ); #elif HAVE_LIBTHREAD mutex_destroy( &ptr -> mutex ); #endif free( ptr ); } #else last = NULL; ptr = statement_root; while( ptr ) { if ( ptr -> connection == connection ) { if ( last ) { last -> next_class_list = ptr -> next_class_list; } else { statement_root = ptr -> next_class_list; } clear_error_head( &ptr -> error ); #ifdef HAVE_LIBPTH #elif HAVE_LIBPTHREAD pthread_mutex_destroy( &ptr -> mutex ); #elif HAVE_LIBTHREAD mutex_destroy( &ptr -> mutex ); #endif free( ptr ); /* * go back to the start */ last = NULL; ptr = statement_root; } else { last = ptr; ptr = ptr -> next_class_list; } } #endif local_mutex_exit( &mutex_lists ); return ret; } int __check_stmt_from_dbc_v( DMHDBC connection, int statecount, ... ) { va_list ap; int states[ MAX_STATE_ARGS ]; DMHSTMT ptr; int found = 0; int i; va_start (ap, statecount); for ( i = 0; i < statecount; i ++ ) { states[ i ] = va_arg (ap, int ); } va_end (ap); local_mutex_entry( &mutex_lists ); #ifdef FAST_HANDLE_VALIDATE ptr = connection -> statements; while( !found && ptr ) { for ( i = 0; i < statecount; i ++ ) { if ( ptr -> state == states[ i ] ) { found = 1; break; } } ptr = ptr -> next_conn_list; } #else ptr = statement_root; while( !found && ptr ) { if ( ptr -> connection == connection ) { for ( i = 0; i < statecount; i ++ ) { if ( ptr -> state == states[ i ] ) { found = 1; break; } } } ptr = ptr -> next_class_list; } #endif local_mutex_exit( &mutex_lists ); return found; } /* * check if any statements on this connection are in a given state */ int __check_stmt_from_dbc( DMHDBC connection, int state ) { DMHSTMT ptr; int found = 0; local_mutex_entry( &mutex_lists ); #ifdef FAST_HANDLE_VALIDATE ptr = connection -> statements; while( ptr ) { if ( ptr -> state == state ) { found = 1; break; } ptr = ptr -> next_conn_list; } #else ptr = statement_root; while( ptr ) { if ( ptr -> connection == connection ) { if ( ptr -> state == state ) { found = 1; break; } } ptr = ptr -> next_class_list; } #endif local_mutex_exit( &mutex_lists ); return found; } int __check_stmt_from_desc( DMHDESC desc, int state ) { DMHDBC connection; DMHSTMT ptr; int found = 0; local_mutex_entry( &mutex_lists ); connection = desc -> connection; #ifdef FAST_HANDLE_VALIDATE ptr = connection -> statements; while( ptr ) { if ( ptr -> ipd == desc || ptr -> ird == desc || ptr -> apd == desc || ptr -> ard == desc ) { if ( ptr -> state == state ) { found = 1; break; } } ptr = ptr -> next_conn_list; } #else ptr = statement_root; while( ptr ) { if ( ptr -> connection == connection ) { if ( ptr -> ipd == desc || ptr -> ird == desc || ptr -> apd == desc || ptr -> ard == desc ) { if ( ptr -> state == state ) { found = 1; break; } } } ptr = ptr -> next_class_list; } #endif local_mutex_exit( &mutex_lists ); return found; } int __check_stmt_from_desc_ird( DMHDESC desc, int state ) { DMHDBC connection; DMHSTMT ptr; int found = 0; local_mutex_entry( &mutex_lists ); connection = desc -> connection; #ifdef FAST_HANDLE_VALIDATE ptr = connection -> statements; while( ptr ) { if ( ptr -> ird == desc ) { if ( ptr -> state == state ) { found = 1; break; } } ptr = ptr -> next_conn_list; } #else ptr = statement_root; while( ptr ) { if ( ptr -> connection == connection ) { if ( ptr -> ird == desc ) { if ( ptr -> state == state ) { found = 1; break; } } } ptr = ptr -> next_class_list; } #endif local_mutex_exit( &mutex_lists ); return found; } /* * check any statements that are associated with a descriptor */ /* * check that a statement is real */ int __validate_stmt( DMHSTMT statement ) { #ifdef FAST_HANDLE_VALIDATE if ( statement && *(( int * ) statement ) == HSTMT_MAGIC ) return 1; else return 0; #else DMHSTMT ptr; int ret = 0; local_mutex_entry( &mutex_lists ); ptr = statement_root; while( ptr ) { if ( ptr == statement ) { ret = 1; break; } ptr = ptr -> next_class_list; } local_mutex_exit( &mutex_lists ); return ret; #endif } /* * remove from list */ void __release_stmt( DMHSTMT statement ) { DMHSTMT last = NULL; DMHSTMT ptr; local_mutex_entry( &mutex_lists ); #ifdef FAST_HANDLE_VALIDATE /* * A check never mind */ if ( statement && ( *(( int * ) statement ) == HSTMT_MAGIC )) { ptr = statement; last = statement->prev_class_list; if ( statement -> connection ) { DMHDBC connection = statement -> connection; DMHSTMT conn_last = NULL; DMHSTMT conn_ptr = connection -> statements; while ( conn_ptr ) { if ( statement == conn_ptr ) { break; } conn_last = conn_ptr; conn_ptr = conn_ptr -> next_conn_list; } if ( conn_ptr ) { if ( conn_last ) { conn_last -> next_conn_list = conn_ptr -> next_conn_list; } else { connection -> statements = conn_ptr -> next_conn_list; } } } } else { ptr = NULL; last = NULL; } #else ptr = statement_root; while( ptr ) { if ( statement == ptr ) { break; } last = ptr; ptr = ptr -> next_class_list; } #endif if ( ptr ) { if ( last ) { last -> next_class_list = ptr -> next_class_list; #ifdef FAST_HANDLE_VALIDATE if ( last -> next_class_list ) { last -> next_class_list -> prev_class_list = last; } #endif } else { statement_root = ptr -> next_class_list; #ifdef FAST_HANDLE_VALIDATE if ( statement_root ) { statement_root -> prev_class_list = NULL; } #endif } } clear_error_head( &statement -> error ); #ifdef HAVE_LIBPTH #elif HAVE_LIBPTHREAD pthread_mutex_destroy( &statement -> mutex ); #elif HAVE_LIBTHREAD mutex_destroy( &statement -> mutex ); #endif /* * clear just to make sure */ memset( statement, 0, sizeof( *statement )); free( statement ); local_mutex_exit( &mutex_lists ); } /* * allocate and register a descriptor handle */ DMHDESC __alloc_desc( void ) { DMHDESC descriptor; local_mutex_entry( &mutex_lists ); descriptor = calloc( sizeof( *descriptor ), 1 ); if ( descriptor ) { /* * add to list of descriptor handles */ descriptor -> next_class_list = descriptor_root; #ifdef FAST_HANDLE_VALIDATE if ( descriptor_root ) { descriptor_root -> prev_class_list = descriptor; } #endif descriptor_root = descriptor; descriptor -> type = HDESC_MAGIC; setup_error_head( &descriptor -> error, descriptor, SQL_HANDLE_DESC ); #ifdef HAVE_LIBPTH pth_mutex_init( &descriptor -> mutex ); #elif HAVE_LIBPTHREAD pthread_mutex_init( &descriptor -> mutex, NULL ); #elif HAVE_LIBTHREAD mutex_init( &descriptor -> mutex, USYNC_THREAD, NULL ); #endif } local_mutex_exit( &mutex_lists ); return descriptor; } /* * check that a descriptor is real */ int __validate_desc( DMHDESC descriptor ) { #ifdef FAST_HANDLE_VALIDATE if ( descriptor && *(( int * ) descriptor ) == HDESC_MAGIC ) return 1; else return 0; #else DMHDESC ptr; int ret = 0; local_mutex_entry( &mutex_lists ); ptr = descriptor_root; while( ptr ) { if ( ptr == descriptor ) { ret = 1; break; } ptr = ptr -> next_class_list; } local_mutex_exit( &mutex_lists ); return ret; #endif } /* * clear all descriptors on a DBC */ int __clean_desc_from_dbc( DMHDBC connection ) { DMHDESC ptr, last; int ret = 0; local_mutex_entry( &mutex_lists ); last = NULL; ptr = descriptor_root; while( ptr ) { if ( ptr -> connection == connection ) { if ( last ) { last -> next_class_list = ptr -> next_class_list; #ifdef FAST_HANDLE_VALIDATE if ( last -> next_class_list ) { last -> next_class_list -> prev_class_list = last; } #endif } else { descriptor_root = ptr -> next_class_list; #ifdef FAST_HANDLE_VALIDATE if ( descriptor_root ) { descriptor_root -> prev_class_list = NULL; } #endif } clear_error_head( &ptr -> error ); #ifdef HAVE_LIBPTH #elif HAVE_LIBPTHREAD pthread_mutex_destroy( &ptr -> mutex ); #elif HAVE_LIBTHREAD mutex_destroy( &ptr -> mutex ); #endif free( ptr ); /* * go back to the start */ last = NULL; ptr = descriptor_root; } else { last = ptr; ptr = ptr -> next_class_list; } } local_mutex_exit( &mutex_lists ); return ret; } /* * remove from list */ void __release_desc( DMHDESC descriptor ) { DMHDESC last = NULL; DMHDESC ptr; DMHSTMT assoc_stmt; local_mutex_entry( &mutex_lists ); #ifdef FAST_HANDLE_VALIDATE /* * A check never mind */ if ( descriptor && ( *(( int * ) descriptor ) == HDESC_MAGIC )) { ptr = descriptor; last = descriptor->prev_class_list; } else { ptr = NULL; last = NULL; } #else ptr = descriptor_root; while( ptr ) { if ( descriptor == ptr ) { break; } last = ptr; ptr = ptr -> next_class_list; } #endif if ( ptr ) { if ( last ) { last -> next_class_list = ptr -> next_class_list; #ifdef FAST_HANDLE_VALIDATE if ( last -> next_class_list ) { last -> next_class_list -> prev_class_list = last; } #endif } else { descriptor_root = ptr -> next_class_list; #ifdef FAST_HANDLE_VALIDATE if ( descriptor_root ) { descriptor_root -> prev_class_list = NULL; } #endif } } clear_error_head( &descriptor -> error ); /* If there are any statements still pointing to this descriptor, revert them to implicit */ assoc_stmt = statement_root; while ( assoc_stmt ) { DMHDESC *pDesc[] = { &assoc_stmt -> ipd, &assoc_stmt -> apd, &assoc_stmt -> ird, &assoc_stmt -> ard }; DMHDESC impDesc[] = { assoc_stmt -> implicit_ipd, assoc_stmt -> implicit_apd, assoc_stmt -> implicit_ird, assoc_stmt -> implicit_ard }; int i; for ( i = 0; i < 4; i++ ) { if ( *pDesc[i] == descriptor ) { *pDesc[i] = impDesc[i]; } } assoc_stmt = assoc_stmt -> next_class_list; } #ifdef HAVE_LIBPTH #elif HAVE_LIBPTHREAD pthread_mutex_destroy( &descriptor -> mutex ); #elif HAVE_LIBTHREAD mutex_destroy( &descriptor -> mutex ); #endif /* * clear just to make sure */ memset( descriptor, 0, sizeof( *descriptor )); free( descriptor ); local_mutex_exit( &mutex_lists ); } #if defined ( HAVE_LIBPTHREAD ) || defined ( HAVE_LIBTHREAD ) || defined( HAVE_LIBPTH ) void thread_protect( int type, void *handle ) { DMHDBC connection; DMHSTMT statement; DMHDESC descriptor; switch( type ) { case SQL_HANDLE_ENV: local_mutex_entry( &mutex_env ); break; case SQL_HANDLE_DBC: connection = handle; if ( connection -> protection_level == TS_LEVEL3 ) { local_mutex_entry( &mutex_env ); } else if ( connection -> protection_level == TS_LEVEL2 || connection -> protection_level == TS_LEVEL1 ) { local_mutex_entry( &connection -> mutex ); } break; case SQL_HANDLE_STMT: statement = handle; if ( statement -> connection -> protection_level == TS_LEVEL3 ) { local_mutex_entry( &mutex_env ); } else if ( statement -> connection -> protection_level == TS_LEVEL2 ) { local_mutex_entry( &statement -> connection -> mutex ); } else if ( statement -> connection -> protection_level == TS_LEVEL1 ) { local_mutex_entry( &statement -> mutex ); } break; case SQL_HANDLE_DESC: descriptor = handle; if ( descriptor -> connection -> protection_level == TS_LEVEL3 ) { local_mutex_entry( &mutex_env ); } if ( descriptor -> connection -> protection_level == TS_LEVEL2 ) { local_mutex_entry( &descriptor -> connection -> mutex ); } if ( descriptor -> connection -> protection_level == TS_LEVEL1 ) { local_mutex_entry( &descriptor -> mutex ); } break; } } void thread_release( int type, void *handle ) { DMHDBC connection; DMHSTMT statement; DMHDESC descriptor; switch( type ) { case SQL_HANDLE_ENV: local_mutex_exit( &mutex_env ); break; case SQL_HANDLE_DBC: connection = handle; if ( connection -> protection_level == TS_LEVEL3 ) { local_mutex_exit( &mutex_env ); } else if ( connection -> protection_level == TS_LEVEL2 || connection -> protection_level == TS_LEVEL1 ) { local_mutex_exit( &connection -> mutex ); } break; case SQL_HANDLE_STMT: statement = handle; if ( statement -> connection -> protection_level == TS_LEVEL3 ) { local_mutex_exit( &mutex_env ); } else if ( statement -> connection -> protection_level == TS_LEVEL2 ) { local_mutex_exit( &statement -> connection -> mutex ); } else if ( statement -> connection -> protection_level == TS_LEVEL1 ) { local_mutex_exit( &statement -> mutex ); } break; case SQL_HANDLE_DESC: descriptor = handle; if ( descriptor -> connection -> protection_level == TS_LEVEL3 ) { local_mutex_exit( &mutex_env ); } else if ( descriptor -> connection -> protection_level == TS_LEVEL2 ) { local_mutex_exit( &descriptor -> connection -> mutex ); } else if ( descriptor -> connection -> protection_level == TS_LEVEL1 ) { local_mutex_exit( &descriptor -> mutex ); } break; } } #endif #ifdef WITH_HANDLE_REDIRECT /* * try and find a handle that has the suplied handle as the driver handle * there will be threading issues with this, so be carefull. * However it will normally only get used with "broken" drivers. */ void *find_parent_handle( DRV_SQLHANDLE drv_hand, int type ) { void *found_handle = NULL; local_mutex_entry( &mutex_lists ); switch( type ) { case SQL_HANDLE_DBC: { DMHDBC hand = connection_root; while( hand ) { if ( hand -> driver_dbc == drv_hand ) { found_handle = hand; break; } hand = hand -> next_class_list; } } break; case SQL_HANDLE_STMT: { DMHSTMT hand = statement_root; while( hand ) { if ( hand -> driver_stmt == drv_hand ) { found_handle = hand; break; } hand = hand -> next_class_list; } } break; case SQL_HANDLE_DESC: { DMHDESC hand = descriptor_root; while( hand ) { if ( hand -> driver_desc == drv_hand ) { found_handle = hand; break; } hand = hand -> next_class_list; } } break; default: break; } local_mutex_exit( &mutex_lists ); return found_handle; } #endif unixODBC-2.3.9/DriverManager/TODO0000755000175000017500000000104412262474474013315 00000000000000Add explicit descriptor allocation and release. Keep track of bound columns to check if SQLGetData is valid. (may not be posible). Pass any connect and env attr onto driver when connected. Handle Env attrs (Set/Get EnvAttr). GetDescField needs finishing. Manage file DSN's. Interface to Cursor and Translator libs. Clear errors at the start of each function. Handle SQLCopyDesc where the source and destination is on different connections. SQLBulkoperations needs some conditions testing. SQLBrowseConnect needs some conditions testing. unixODBC-2.3.9/DriverManager/SQLFreeHandle.c0000664000175000017500000004560713616771773015370 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFreeHandle.c,v 1.12 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLFreeHandle.c,v $ * Revision 1.12 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.11 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.10 2007/12/17 13:13:03 lurcher * Fix a couple of descriptor typo's * * Revision 1.9 2007/01/02 10:27:50 lurcher * Fix descriptor leak with unicode only driver * * Revision 1.8 2006/04/18 10:24:47 lurcher * Add a couple of changes from Mark Vanderwiel * * Revision 1.7 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.6 2003/05/14 09:42:25 lurcher * * Fix bug in stats collection * * Revision 1.5 2003/04/09 08:42:18 lurcher * * Allow setting of odbcinstQ lib from odbcinst.ini and Environment * * Revision 1.4 2002/09/18 14:49:32 lurcher * * DataManagerII additions and some more threading fixes * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.7 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.6 2001/06/04 15:24:49 nick * * Add port to MAC OSX and QT3 changes * * Revision 1.5 2001/05/15 13:33:44 jason * * Wrapped calls to stats with COLLECT_STATS * * Revision 1.4 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2000/12/19 10:28:29 martin * * Return "not built with stats" in uodbc_error() if stats function called * when stats not built. * Add uodbc_update_stats() calls to SQLFreeHandle. * * Revision 1.2 2000/11/23 09:43:29 nick * * Fix deadlock posibility * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.12 2000/06/27 17:34:10 ngorham * * Fix a problem when the second part of the connect failed a seg fault * was generated in the error reporting * * Revision 1.11 2000/05/21 21:49:19 ngorham * * Assorted fixes * * Revision 1.10 1999/11/17 21:11:59 ngorham * * Fix bug where the check for a valid handle was after the code had * used it. * * Revision 1.9 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.7 1999/10/09 00:15:58 ngorham * * Add mapping from SQL_TYPE_X to SQL_X and SQL_C_TYPE_X to SQL_C_X * when the driver is a ODBC 2 one * * Revision 1.6 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/08/03 21:47:39 shandyb * Moving to automake: changed files in DriverManager * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.2 1999/06/07 01:29:31 pharvey * *** empty log message *** * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.5 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) #include "__stats.h" #include #endif static char const rcsid[]= "$RCSfile: SQLFreeHandle.c,v $ $Revision: 1.12 $"; SQLRETURN __SQLFreeHandle( SQLSMALLINT handle_type, SQLHANDLE handle ) { switch( handle_type ) { case SQL_HANDLE_ENV: case SQL_HANDLE_SENV: { DMHENV environment = (DMHENV)handle; /* * check environment */ if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\n\t\t\tHandle Type = %d\n\t\t\tInput Handle = %p", handle_type, (void*)handle ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); /* * check states */ if ( environment -> state != STATE_E1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &environment -> error, ERROR_HY010, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } thread_release( SQL_HANDLE_ENV, environment ); /* * release any pooled connections that are using this environment */ __strip_from_pool( environment ); __release_env( environment ); return SQL_SUCCESS; } break; case SQL_HANDLE_DBC: { DMHDBC connection = (DMHDBC)handle; DMHENV environment; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); environment = connection -> environment; if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\n\t\t\tHandle Type = %d\n\t\t\tInput Handle = %p", handle_type, (void*)handle ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); /* * check states */ if ( connection -> state != STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } environment -> connection_count --; if ( environment -> connection_count == 0 ) { environment -> state = STATE_E1; } environment = connection -> environment; __release_attr_str( &connection -> env_attribute ); __release_attr_str( &connection -> dbc_attribute ); __release_attr_str( &connection -> stmt_attribute ); __disconnect_part_one( connection ); __release_dbc( connection ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[SQL_SUCCESS]" ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) uodbc_update_stats(environment->sh, UODBC_STATS_TYPE_HDBC, (void *)-1); #endif thread_release( SQL_HANDLE_ENV, environment ); return SQL_SUCCESS; } break; case SQL_HANDLE_STMT: { DMHSTMT statement = (DMHSTMT)handle; DMHDBC connection; SQLRETURN ret; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); connection = statement -> connection; if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\n\t\t\tHandle Type = %d\n\t\t\tInput Handle = %p", handle_type, (void*)handle ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( !CHECK_SQLFREEHANDLE( statement -> connection )) { if ( !CHECK_SQLFREESTMT( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else { ret = SQLFREESTMT( statement -> connection, statement -> driver_stmt, SQL_DROP ); } } else { ret = SQLFREEHANDLE( statement -> connection, handle_type, statement -> driver_stmt ); } if ( SQL_SUCCEEDED( ret )) { /* * release the implicit descriptors, * this matches the tests in SQLAllocHandle */ if (( statement -> connection -> driver_act_ver == 3 && CHECK_SQLGETSTMTATTR( connection )) || CHECK_SQLGETSTMTATTRW( connection )) { if ( statement -> implicit_ard ) __release_desc( statement -> implicit_ard ); if ( statement -> implicit_apd ) __release_desc( statement -> implicit_apd ); if ( statement -> implicit_ird ) __release_desc( statement -> implicit_ird ); if ( statement -> implicit_ipd ) __release_desc( statement -> implicit_ipd ); } statement -> connection -> statement_count --; thread_release( SQL_HANDLE_STMT, statement ); #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) uodbc_update_stats(connection->environment->sh, UODBC_STATS_TYPE_HSTMT, (void *)-1); #endif __release_stmt( statement ); } else { thread_release( SQL_HANDLE_STMT, statement ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[SQL_SUCCESS]" ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( IGNORE_THREAD, connection, ret, DEFER_R0 ); } break; case SQL_HANDLE_DESC: { DMHDESC descriptor = (DMHDESC)handle; DMHDBC connection; /* * check descriptor */ if ( !__validate_desc( descriptor )) { return SQL_INVALID_HANDLE; } function_entry( descriptor ); connection = descriptor -> connection; if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tEntry:\n\t\t\tHandle Type = %d\n\t\t\tInput Handle = %p", handle_type, (void*)handle ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } if ( descriptor -> implicit ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &descriptor -> error, ERROR_HY017, NULL, connection -> environment -> requested_version ); return function_return_nodrv( IGNORE_THREAD, descriptor, SQL_ERROR ); } thread_protect( SQL_HANDLE_DESC, descriptor ); if ( !CHECK_SQLFREEHANDLE( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } else { SQLFREEHANDLE( connection, handle_type, descriptor -> driver_desc ); } /* * check status of statements associated with this descriptor */ if( __check_stmt_from_desc( descriptor, STATE_S8 ) || __check_stmt_from_desc( descriptor, STATE_S9 ) || __check_stmt_from_desc( descriptor, STATE_S10 ) || __check_stmt_from_desc( descriptor, STATE_S11 ) || __check_stmt_from_desc( descriptor, STATE_S12 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DESC, descriptor, SQL_ERROR, DEFER_R0 ); } thread_release( SQL_HANDLE_DESC, descriptor ); __release_desc( descriptor ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[SQL_SUCCESS]" ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } #if defined ( COLLECT_STATS ) && defined( HAVE_SYS_SEM_H ) uodbc_update_stats(connection->environment->sh, UODBC_STATS_TYPE_HDESC, (void *)-1); #endif return function_return( IGNORE_THREAD, connection, SQL_SUCCESS, DEFER_R0 ); } break; default: /* * there is nothing to report a error on */ return SQL_INVALID_HANDLE; } } SQLRETURN SQLFreeHandle( SQLSMALLINT handle_type, SQLHANDLE handle ) { return __SQLFreeHandle( handle_type, handle ); } unixODBC-2.3.9/DriverManager/SQLSetCursorNameW.c0000644000175000017500000001702513303466667016237 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetCursorNameW.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetCursorNameW.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetCursorNameW.c,v $"; SQLRETURN SQLSetCursorNameW( SQLHSTMT statement_handle, SQLWCHAR *cursor_name, SQLSMALLINT name_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCursor name = %s", statement, __wstring_with_length( s1, cursor_name, name_length )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( !cursor_name || (name_length < 0 && name_length != SQL_NTS ) ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> connection -> unicode_driver || CHECK_SQLSETCURSORNAMEW( statement -> connection )) { if ( !CHECK_SQLSETCURSORNAMEW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLSETCURSORNAMEW( statement -> connection, statement -> driver_stmt, cursor_name, name_length ); } else { SQLCHAR *as1; int clen; if ( !CHECK_SQLSETCURSORNAME( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( cursor_name, name_length, statement -> connection, &clen ); name_length = clen; ret = SQLSETCURSORNAME( statement -> connection, statement -> driver_stmt, as1, name_length ); if ( as1 ) free( as1 ); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLSetConnectAttrW.c0000644000175000017500000006377613470516610016410 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetConnectAttrW.c,v 1.14 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetConnectAttrW.c,v $ * Revision 1.14 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.13 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.12 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.11 2006/04/18 10:24:47 lurcher * Add a couple of changes from Mark Vanderwiel * * Revision 1.10 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.9 2003/03/05 09:48:44 lurcher * * Add some 64 bit fixes * * Revision 1.8 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.7 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.6 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.5 2002/07/16 13:08:18 lurcher * * Filter attribute values from SQLSetStmtAttr to SQLSetStmtOption to fit * within ODBC 2 * Make DSN's double clickable in ODBCConfig * * Revision 1.4 2002/07/04 17:27:56 lurcher * * Small bug fixes * * Revision 1.3 2002/01/30 12:20:02 lurcher * * Add MyODBC 3 driver source * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.7 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.6 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.5 2001/08/03 15:19:00 nick * * Add changes to set values before connect * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/05/23 13:48:37 nick * * Remove unwanted include * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetConnectAttrW.c,v $"; SQLRETURN SQLSetConnectAttrW( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { DMHDBC connection = (DMHDBC)connection_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; SQLWCHAR buffer[ 512 ]; /* * doesn't require a handle */ if ( attribute == SQL_ATTR_TRACE ) { if ((SQLLEN) value != SQL_OPT_TRACE_OFF && (SQLLEN) value != SQL_OPT_TRACE_ON ) { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); function_entry( connection ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } if ((SQLLEN) value == SQL_OPT_TRACE_OFF ) { char force_string[ 30 ]; SQLGetPrivateProfileString( "ODBC", "ForceTrace", "0", force_string, sizeof( force_string ), "ODBCINST.INI" ); if ( force_string[ 0 ] == '1' || toupper( force_string[ 0 ] ) == 'Y' || ( toupper( force_string[ 0 ] ) == 'O' && toupper( force_string[ 1 ] ) == 'N' )) { if ( log_info.log_flag ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Application tried to turn logging off" ); } } else { if ( log_info.log_flag ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Application turning logging off" ); } log_info.log_flag = 0; } } else { log_info.log_flag = 1; } return SQL_SUCCESS; } else if ( attribute == SQL_ATTR_TRACEFILE ) { if ( value ) { if (((SQLWCHAR*)value)[ 0 ] == 0 ) { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); function_entry( connection ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } else { if ( log_info.log_file_name ) { free( log_info.log_file_name ); } log_info.log_file_name = unicode_to_ansi_alloc((SQLWCHAR *) value, SQL_NTS, connection, NULL ); } } else { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); function_entry( connection ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } return SQL_SUCCESS; } /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDBC parent_connection; parent_connection = find_parent_handle( connection, SQL_HANDLE_DBC ); if ( parent_connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLSETCONNECTATTRW( parent_connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLSETCONNECTATTRW( parent_connection, connection_handle, attribute, value, string_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tStrLen = %d", connection, __con_attr_as_string( s1, attribute ), value, (int)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C2 ) { if ( attribute == SQL_ATTR_TRANSLATE_OPTION || attribute == SQL_ATTR_TRANSLATE_LIB ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( connection -> state == STATE_C4 || connection -> state == STATE_C5 || connection -> state == STATE_C6 ) { if ( attribute == SQL_ATTR_ODBC_CURSORS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( attribute == SQL_ATTR_PACKET_SIZE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &connection -> error, ERROR_HY011, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } /* * is it a legitimate value */ ret = dm_check_connection_attrs( connection, attribute, value ); if ( ret != SQL_SUCCESS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * is it a connection attribute or statement, check state of any active connections */ switch( attribute ) { /* ODBC 3.x statement attributes are not settable at the connection level */ case SQL_ATTR_APP_PARAM_DESC: case SQL_ATTR_APP_ROW_DESC: case SQL_ATTR_CURSOR_SCROLLABLE: case SQL_ATTR_CURSOR_SENSITIVITY: case SQL_ATTR_ENABLE_AUTO_IPD: case SQL_ATTR_FETCH_BOOKMARK_PTR: case SQL_ATTR_IMP_PARAM_DESC: case SQL_ATTR_IMP_ROW_DESC: case SQL_ATTR_PARAM_BIND_OFFSET_PTR: case SQL_ATTR_PARAM_BIND_TYPE: case SQL_ATTR_PARAM_OPERATION_PTR: case SQL_ATTR_PARAM_STATUS_PTR: case SQL_ATTR_PARAMS_PROCESSED_PTR: case SQL_ATTR_PARAMSET_SIZE: case SQL_ATTR_ROW_ARRAY_SIZE: case SQL_ATTR_ROW_BIND_OFFSET_PTR: case SQL_ATTR_ROW_OPERATION_PTR: case SQL_ATTR_ROW_STATUS_PTR: case SQL_ATTR_ROWS_FETCHED_PTR: __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); case SQL_ATTR_CONCURRENCY: case SQL_BIND_TYPE: case SQL_ATTR_CURSOR_TYPE: case SQL_ATTR_MAX_LENGTH: case SQL_MAX_ROWS: case SQL_ATTR_KEYSET_SIZE: case SQL_ROWSET_SIZE: case SQL_ATTR_NOSCAN: case SQL_ATTR_QUERY_TIMEOUT: case SQL_ATTR_RETRIEVE_DATA: case SQL_ATTR_SIMULATE_CURSOR: case SQL_ATTR_USE_BOOKMARKS: if( __check_stmt_from_dbc_v( connection, 8, STATE_S8, STATE_S9, STATE_S10, STATE_S11, STATE_S12, STATE_S13, STATE_S14, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &connection -> error, ERROR_24000, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } break; default: if( __check_stmt_from_dbc_v( connection, 8, STATE_S8, STATE_S9, STATE_S10, STATE_S11, STATE_S12, STATE_S13, STATE_S14, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } break; } /* * is it something overridden */ value = __attr_override_wide( connection, SQL_HANDLE_DBC, attribute, value, &string_length, buffer ); /* * we need to save this even if connected so we can use it for the next connect */ if ( attribute == SQL_ATTR_LOGIN_TIMEOUT ) { connection -> login_timeout = ( SQLLEN ) value; connection -> login_timeout_set = 1; } /* * if connected, call the driver * otherwise we need to save the states and set them when we * do connect */ if ( connection -> state == STATE_C2 ) { /* * is it for us */ if ( attribute == SQL_ATTR_ODBC_CURSORS ) { connection -> cursors = ( SQLLEN ) value; } else if ( attribute == SQL_ATTR_ACCESS_MODE ) { connection -> access_mode = ( SQLLEN ) value; connection -> access_mode_set = 1; } else if ( attribute == SQL_ATTR_ASYNC_ENABLE ) { connection -> async_enable = ( SQLLEN ) value; connection -> async_enable_set = 1; } else if ( attribute == SQL_ATTR_AUTO_IPD ) { connection -> auto_ipd = ( SQLLEN ) value; connection -> auto_ipd_set = 1; } else if ( attribute == SQL_ATTR_AUTOCOMMIT ) { connection -> auto_commit = ( SQLLEN ) value; connection -> auto_commit_set = 1; } else if ( attribute == SQL_ATTR_CONNECTION_TIMEOUT ) { connection -> connection_timeout = ( SQLLEN ) value; connection -> connection_timeout_set = 1; } else if ( attribute == SQL_ATTR_METADATA_ID ) { connection -> metadata_id = ( SQLLEN ) value; connection -> metadata_id_set = 1; } else if ( attribute == SQL_ATTR_PACKET_SIZE ) { connection -> packet_size = ( SQLLEN ) value; connection -> packet_size_set = 1; } else if ( attribute == SQL_ATTR_QUIET_MODE ) { connection -> quite_mode = ( SQLLEN ) value; connection -> quite_mode_set = 1; } else if ( attribute == SQL_ATTR_TXN_ISOLATION ) { connection -> txn_isolation = ( SQLLEN ) value; connection -> txn_isolation_set = 1; } else if ( attribute != SQL_ATTR_LOGIN_TIMEOUT ) { /* * save any unknown attributes untill connect */ struct save_attr *sa = calloc( 1, sizeof( struct save_attr )); sa -> attr_type = attribute; if ( string_length > 0 ) { sa -> str_attr = malloc( string_length ); memcpy( sa -> str_attr, value, string_length ); sa -> str_len = string_length; } else if ( string_length == SQL_NTS ) { if (!value) { __post_internal_error( &connection -> error, ERROR_HY024, "Invalid argument value", connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { sa -> str_attr = unicode_to_ansi_alloc( value, string_length, connection, NULL ); sa -> str_len = string_length; } } else { sa -> intptr_attr = (intptr_t) value; sa -> str_len = string_length; } sa -> next = connection -> save_attr; connection -> save_attr = sa; } sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } else { if ( connection -> unicode_driver || CHECK_SQLSETCONNECTATTRW( connection )) { if ( !CHECK_SQLSETCONNECTATTRW( connection )) { if ( CHECK_SQLSETCONNECTOPTIONW( connection )) { /* * Is it in the legal range of values */ if ( attribute < SQL_CONN_DRIVER_MIN && ( attribute > SQL_PACKET_SIZE || attribute < SQL_ACCESS_MODE )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } ret = SQLSETCONNECTOPTIONW( connection, connection -> driver_dbc, attribute, value ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { ret = SQLSETCONNECTATTRW( connection, connection -> driver_dbc, attribute, value, string_length ); } } else { if ( !CHECK_SQLSETCONNECTATTR( connection )) { if ( CHECK_SQLSETCONNECTOPTION( connection )) { SQLCHAR *as1 = NULL; /* * Is it in the legal range of values */ if ( attribute < SQL_CONN_DRIVER_MIN && ( attribute > SQL_PACKET_SIZE || attribute < SQL_ACCESS_MODE )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( value ) { as1 = (SQLCHAR*) unicode_to_ansi_alloc( value, SQL_NTS, connection, NULL ); } break; } ret = SQLSETCONNECTOPTION( connection, connection -> driver_dbc, attribute, as1 ? as1 : value ); if ( as1 ) free( as1 ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { SQLCHAR *as1 = NULL; switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( value ) { if ( string_length > 0 ) { as1 = (SQLCHAR*) unicode_to_ansi_alloc( value, string_length, connection, NULL ); } else if ( string_length == SQL_NTS ) { as1 = (SQLCHAR*) unicode_to_ansi_alloc( value, SQL_NTS, connection, NULL ); } } ret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, attribute, as1 ? as1 : value, string_length / sizeof( SQLWCHAR )); if ( as1 ) { free( as1 ); } break; default: ret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, attribute, value, string_length ); break; } } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } } /* * catch this */ if ( attribute == SQL_ATTR_USE_BOOKMARKS && SQL_SUCCEEDED( ret )) { connection -> bookmarks_on = (SQLULEN) value; } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetDiagRec.c0000644000175000017500000004565713303466667015330 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDiagRec.c,v 1.21 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetDiagRec.c,v $ * Revision 1.21 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.20 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.19 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.18 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.17 2008/05/20 13:43:47 lurcher * Vms fixes * * Revision 1.16 2007/02/12 11:49:34 lurcher * Add QT4 support to existing GUI parts * * Revision 1.15 2006/11/27 14:08:34 lurcher * Sync up dirs * * Revision 1.14 2006/05/31 17:35:34 lurcher * Add unicode ODBCINST entry points * * Revision 1.13 2006/04/24 08:42:10 lurcher * Handle resetting statement descriptors to implicit values, by passing in NULL or the implicit descrptor to SQLSetStmtAttr with the attribute SQL_ATTR_APP_PARAM_DESC or SQL_ATTR_APP_ROW_DESC. Also catch trying to call SQLGetDescField on a closed connection * * Revision 1.12 2005/12/19 18:43:26 lurcher * Add new parts to contrib and alter how the errors are returned from the driver * * Revision 1.11 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.10 2003/02/25 13:28:30 lurcher * * Allow errors on the drivers AllocHandle to be reported * Fix a problem that caused errors to not be reported in the log * Remove a redundant line from the spec file * * Revision 1.9 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.8 2002/11/13 15:59:20 lurcher * * More VMS changes * * Revision 1.7 2002/11/11 17:10:15 lurcher * * VMS changes * * Revision 1.6 2002/10/14 09:46:10 lurcher * * Remove extra return * * Revision 1.5 2002/10/08 13:36:07 lurcher * * Fix memory leak * * Revision 1.4 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.11 2000/06/23 16:11:38 ngorham * * Map ODBC 2 SQLSTATE values to ODBC 3 * * Revision 1.10 1999/12/01 09:20:07 ngorham * * Fix some threading problems * * Revision 1.9 1999/11/17 21:08:58 ngorham * * Fix Bug with the ODBC 3 error handling * * Revision 1.8 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/11/10 22:15:48 ngorham * * Fix some bugs with the DM and error reporting. * * Revision 1.6 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/14 19:46:04 ngorham * * Fix the error logging when SQLError or SQLGetDiagRec returns SQL_NO_DATA * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.1 1999/04/30 16:22:47 nick * Another checkpoint * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetDiagRec.c,v $ $Revision: 1.21 $"; int __is_env( EHEAD * head ) { int type; memcpy( &type, head -> owning_handle, sizeof( type )); return type == HENV_MAGIC; } DMHDBC __get_connection( EHEAD * head ) { int type; memcpy( &type, head -> owning_handle, sizeof( type )); switch ( type ) { case HDBC_MAGIC: { DMHDBC connection = ( DMHDBC ) head -> owning_handle; return connection; } case HSTMT_MAGIC: { DMHSTMT statement = ( DMHSTMT ) head -> owning_handle; return statement -> connection; } case HDESC_MAGIC: { DMHDESC descriptor = ( DMHDESC ) head -> owning_handle; return descriptor -> connection; } } return NULL; } int __get_version( EHEAD * head ) { int type; memcpy( &type, head -> owning_handle, sizeof( type )); switch ( type ) { case HENV_MAGIC: { DMHENV environment = ( DMHENV ) head -> owning_handle; return environment -> requested_version; } case HDBC_MAGIC: { DMHDBC connection = ( DMHDBC ) head -> owning_handle; return connection -> environment -> requested_version; } case HSTMT_MAGIC: { DMHSTMT statement = ( DMHSTMT ) head -> owning_handle; return statement -> connection -> environment -> requested_version; } case HDESC_MAGIC: { DMHDESC descriptor = ( DMHDESC ) head -> owning_handle; return descriptor -> connection -> environment -> requested_version; } } return 0; } DRV_SQLHANDLE __get_driver_handle( EHEAD * head ) { int type; memcpy( &type, head -> owning_handle, sizeof( type )); switch ( type ) { case HDBC_MAGIC: { DMHDBC connection = ( DMHDBC ) head -> owning_handle; return connection -> driver_dbc; } case HSTMT_MAGIC: { DMHSTMT statement = ( DMHSTMT ) head -> owning_handle; return statement -> driver_stmt; } case HDESC_MAGIC: { DMHDESC descriptor = ( DMHDESC ) head -> owning_handle; return descriptor -> driver_desc; } } return ( SQLHANDLE ) 0; } static SQLRETURN extract_sql_error_rec( EHEAD *head, SQLCHAR *sqlstate, SQLINTEGER rec_number, SQLINTEGER *native_error, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ) { SQLRETURN ret; if ( sqlstate ) strcpy((char*) sqlstate, "00000" ); if ( rec_number <= head -> sql_diag_head.internal_count ) { ERROR *ptr; SQLCHAR *as1 = NULL; ptr = head -> sql_diag_head.internal_list_head; while( rec_number > 1 ) { ptr = ptr -> next; rec_number --; } if ( !ptr ) { return SQL_NO_DATA; } as1 = (SQLCHAR*) unicode_to_ansi_alloc( ptr -> msg, SQL_NTS, __get_connection( head ), NULL ); if ( sqlstate ) { unicode_to_ansi_copy((char*) sqlstate, 6, ptr -> sqlstate, SQL_NTS, __get_connection( head ), NULL ); } if ( buffer_length < strlen((char*) as1 ) + 1 ) { ret = SQL_SUCCESS_WITH_INFO; } else { ret = SQL_SUCCESS; } if ( message_text && as1 ) { if ( ret == SQL_SUCCESS ) { strcpy((char*) message_text, (char*) as1 ); } else { memcpy( message_text, as1, buffer_length ); message_text[ buffer_length - 1 ] = '\0'; } } if ( text_length && as1 ) { *text_length = strlen((char*) as1 ); } if ( native_error ) { *native_error = ptr -> native_error; } /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) __map_error_state( (char*) sqlstate, __get_version( head )); if ( as1 ) { free( as1 ); } return ret; } else if ( !__is_env( head ) && __get_connection( head ) -> state != STATE_C2 && head->sql_diag_head.error_count ) { ERROR *ptr; SQLWCHAR *s1 = NULL, *s2 = NULL; rec_number -= head -> sql_diag_head.internal_count; s1 = malloc( sizeof( SQLWCHAR ) * ( 6 + 1 )); if ( buffer_length > 0 ) { s2 = malloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 )); } if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGRECW( __get_connection( head ))) { ret = SQLGETDIAGRECW( __get_connection( head ), head -> handle_type, __get_driver_handle( head ), rec_number, s1, native_error, s2, buffer_length, text_length ); /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) { if ( sqlstate ) { unicode_to_ansi_copy((char*) sqlstate, 6, s1, SQL_NTS, __get_connection( head ), NULL ); __map_error_state((char*) sqlstate, __get_version( head )); } if ( message_text ) { unicode_to_ansi_copy((char*) message_text, buffer_length, s2, SQL_NTS, __get_connection( head ), NULL ); } } } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGREC( __get_connection( head ))) { ret = SQLGETDIAGREC( __get_connection( head ), head -> handle_type, __get_driver_handle( head ), rec_number, sqlstate, native_error, message_text, buffer_length, text_length ); /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) __map_error_state((char*) sqlstate, __get_version( head )); } else { SQLCHAR *as1 = NULL; ptr = head -> sql_diag_head.error_list_head; while( rec_number > 1 ) { ptr = ptr -> next; rec_number --; } if ( !ptr ) { if ( s1 ) free( s1 ); if ( s2 ) free( s2 ); return SQL_NO_DATA; } as1 = (SQLCHAR*) unicode_to_ansi_alloc( ptr -> msg, SQL_NTS, __get_connection( head ), NULL ); if ( sqlstate ) { unicode_to_ansi_copy((char*) sqlstate, 6, ptr -> sqlstate, SQL_NTS, __get_connection( head ), NULL ); } if ( as1 && buffer_length < strlen((char*) as1 ) + 1 ) { ret = SQL_SUCCESS_WITH_INFO; } else { ret = SQL_SUCCESS; } if ( message_text && as1 ) { if ( ret == SQL_SUCCESS ) { strcpy((char*) message_text,(char*) as1 ); } else { memcpy( message_text, as1, buffer_length ); message_text[ buffer_length - 1 ] = '\0'; } } if ( text_length && as1 ) { *text_length = strlen((char*) as1 ); } if ( native_error ) { *native_error = ptr -> native_error; } /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) __map_error_state((char*) sqlstate, __get_version( head )); if ( as1 ) { free( as1 ); } } if ( s1 ) free( s1 ); if ( s2 ) free( s2 ); return ret; } else { return SQL_NO_DATA; } } SQLRETURN SQLGetDiagRecA( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLCHAR *sqlstate, SQLINTEGER *native, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length_ptr ) { return SQLGetDiagRec( handle_type, handle, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr ); } SQLRETURN SQLGetDiagRec( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLCHAR *sqlstate, SQLINTEGER *native, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length_ptr ) { SQLRETURN ret; SQLCHAR s0[ 32 ], s1[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; DMHENV environment = ( DMHENV ) handle; DMHDBC connection = NULL; DMHSTMT statement = NULL; DMHDESC descriptor = NULL; EHEAD *herror; char *handle_msg; const char *handle_type_ptr; if ( rec_number < 1 ) { return SQL_ERROR; } switch ( handle_type ) { case SQL_HANDLE_ENV: { if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } herror = &environment->error; handle_msg = environment->msg; handle_type_ptr = "Environment"; } break; case SQL_HANDLE_DBC: { connection = ( DMHDBC ) handle; if (!__validate_dbc(connection)) { return SQL_INVALID_HANDLE; } herror = &connection->error; handle_msg = connection->msg; handle_type_ptr = "Connection"; } break; case SQL_HANDLE_STMT: { statement = ( DMHSTMT ) handle; if ( !__validate_stmt( statement )) { return SQL_INVALID_HANDLE; } connection = statement->connection; herror = &statement->error; handle_msg = statement->msg; handle_type_ptr = "Statement"; } break; case SQL_HANDLE_DESC: { descriptor = ( DMHDESC ) handle; if ( !__validate_desc( descriptor )) { return SQL_INVALID_HANDLE; } connection = descriptor->connection; herror = &descriptor->error; handle_msg = descriptor->msg; handle_type_ptr = "Descriptor"; } break; default: { return SQL_NO_DATA; } } thread_protect( handle_type, handle ); if ( log_info.log_flag ) { sprintf( handle_msg, "\n\t\tEntry:\ \n\t\t\t%s = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tSQLState = %p\ \n\t\t\tNative = %p\ \n\t\t\tMessage Text = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tText Len Ptr = %p", handle_type_ptr, handle, rec_number, sqlstate, native, message_text, buffer_length, text_length_ptr ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } /* * Do diag extraction here if defer flag is set. * Clean the flag after extraction. */ if ( connection && herror->defer_extract ) { extract_error_from_driver( herror, connection, herror->ret_code_deferred, 0 ); herror->defer_extract = 0; herror->ret_code_deferred = 0; } ret = extract_sql_error_rec( herror, sqlstate, rec_number, native, message_text, buffer_length, text_length_ptr ); if ( log_info.log_flag ) { if ( SQL_SUCCEEDED( ret )) { sprintf( handle_msg, "\n\t\tExit:[%s]\ \n\t\t\tSQLState = %s\ \n\t\t\tNative = %s\ \n\t\t\tMessage Text = %s", __get_return_status( ret, s2 ), sqlstate ? sqlstate : (SQLCHAR *)"NULL", __iptr_as_string( s0, native ), __sdata_as_string( s1, SQL_CHAR, text_length_ptr, message_text )); } else { sprintf( handle_msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } thread_release( handle_type, handle ); return ret; } unixODBC-2.3.9/DriverManager/SQLGetInfo.c0000644000175000017500000004371113464250054014677 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetInfo.c,v 1.14 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetInfo.c,v $ * Revision 1.14 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.13 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.12 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.11 2007/01/02 10:29:18 lurcher * Fix descriptor leak with unicode only driver * * Revision 1.10 2006/08/31 12:44:52 lurcher * Check in for 2.2.12 release * * Revision 1.9 2006/01/06 18:44:35 lurcher * Couple of unicode fixes * * Revision 1.8 2005/10/06 08:50:58 lurcher * Fix problem with SQLDrivers not returning first entry * * Revision 1.7 2004/11/22 17:02:49 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2003/03/05 09:48:44 lurcher * * Add some 64 bit fixes * * Revision 1.4 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.9 2001/07/31 12:03:46 nick * * Fix how the DM gets the CLI year for SQLGetInfo * Fix small bug in strncasecmp * * Revision 1.8 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.7 2001/04/23 13:58:43 nick * * Assorted tweeks to text driver to get it to work with StarOffice * * Revision 1.6 2001/04/18 15:03:37 nick * * Fix problem when going to DB2 unicode driver * * Revision 1.5 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.4 2001/01/12 19:43:12 nick * * Fixed UNICODE conversion bug in SQLGetInfo * * Revision 1.3 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.2 2000/09/08 08:58:17 nick * * Add SQL_DRIVER_HDESC to SQLGetinfo * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/11/10 03:51:34 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.7 1999/10/29 21:07:40 ngorham * * Fix some stupid bugs in the DM * Make the postgres driver work via unix sockets * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetInfo.c,v $ $Revision: 1.14 $"; SQLRETURN SQLGetInfoA( SQLHDBC connection_handle, SQLUSMALLINT info_type, SQLPOINTER info_value, SQLSMALLINT buffer_length, SQLSMALLINT *string_length ) { return SQLGetInfo( connection_handle, info_type, info_value, buffer_length, string_length ); } SQLRETURN SQLGetInfoInternal( SQLHDBC connection_handle, SQLUSMALLINT info_type, SQLPOINTER info_value, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, int do_checks ) { DMHDBC connection = (DMHDBC)connection_handle; SQLRETURN ret = SQL_SUCCESS; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; int type; SQLUSMALLINT sval; char txt[ 30 ], *cptr; SQLPOINTER *ptr; if ( do_checks ) { if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tInfo Type = %s (%d)\ \n\t\t\tInfo Value = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen = %p", connection, __info_as_string( s1, info_type ), info_type, info_value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( info_type != SQL_ODBC_VER && info_type != SQL_DM_VER && connection -> state == STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( buffer_length < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } switch ( info_type ) { case SQL_DATA_SOURCE_NAME: type = 1; cptr = connection -> dsn; break; case SQL_DM_VER: type = 1; sprintf( txt, "%02d.%02d.%04d.%04d", SQL_SPEC_MAJOR, SQL_SPEC_MINOR, atoi( VERSION ), atoi( VERSION + 2 )); cptr = txt; break; case SQL_ODBC_VER: type = 1; sprintf( txt, "%02d.%02d", SQL_SPEC_MAJOR, SQL_SPEC_MINOR ); cptr = txt; break; case SQL_DRIVER_HDBC: type = 2; ptr = (SQLPOINTER) connection -> driver_dbc; break; case SQL_DRIVER_HENV: type = 2; ptr = (SQLPOINTER) connection -> driver_env; break; case SQL_DRIVER_HDESC: { DMHDESC hdesc; if ( info_value && __validate_desc ( hdesc = *(DMHDESC*) info_value ) ) { type = 2; ptr = (SQLPOINTER) hdesc -> driver_desc; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return do_checks ? function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ) : SQL_ERROR; } } break; case SQL_DRIVER_HLIB: type = 2; ptr = connection -> dl_handle; break; case SQL_DRIVER_HSTMT: { DMHSTMT hstmt; if ( info_value && __validate_stmt( hstmt = *(DMHSTMT*)info_value ) ) { type = 2; ptr = (SQLPOINTER) hstmt -> driver_stmt; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return do_checks ? function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ) : SQL_ERROR; } } break; case SQL_XOPEN_CLI_YEAR: type = 1; cptr = connection -> cli_year; break; case SQL_ATTR_DRIVER_THREADING: type = 3; sval = connection -> threading_level; break; default: /* * pass all the others on */ if ( connection -> unicode_driver ) { SQLWCHAR *s1 = NULL; if ( !CHECK_SQLGETINFOW( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return do_checks ? function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ) : SQL_ERROR; } switch( info_type ) { case SQL_ACCESSIBLE_PROCEDURES: case SQL_ACCESSIBLE_TABLES: case SQL_CATALOG_NAME: case SQL_CATALOG_NAME_SEPARATOR: case SQL_CATALOG_TERM: case SQL_COLLATION_SEQ: case SQL_COLUMN_ALIAS: case SQL_DATA_SOURCE_NAME: case SQL_DATA_SOURCE_READ_ONLY: case SQL_DATABASE_NAME: case SQL_DBMS_NAME: case SQL_DBMS_VER: case SQL_DESCRIBE_PARAMETER: case SQL_DRIVER_NAME: case SQL_DRIVER_ODBC_VER: case SQL_DRIVER_VER: case SQL_ODBC_VER: case SQL_EXPRESSIONS_IN_ORDERBY: case SQL_IDENTIFIER_QUOTE_CHAR: case SQL_INTEGRITY: case SQL_KEYWORDS: case SQL_LIKE_ESCAPE_CLAUSE: case SQL_MAX_ROW_SIZE_INCLUDES_LONG: case SQL_MULT_RESULT_SETS: case SQL_MULTIPLE_ACTIVE_TXN: case SQL_NEED_LONG_DATA_LEN: case SQL_ORDER_BY_COLUMNS_IN_SELECT: case SQL_PROCEDURE_TERM: case SQL_PROCEDURES: case SQL_ROW_UPDATES: case SQL_SCHEMA_TERM: case SQL_SEARCH_PATTERN_ESCAPE: case SQL_SERVER_NAME: case SQL_SPECIAL_CHARACTERS: case SQL_TABLE_TERM: case SQL_USER_NAME: case SQL_XOPEN_CLI_YEAR: case SQL_OUTER_JOINS: if ( info_value && buffer_length > 0 ) { buffer_length = sizeof( SQLWCHAR ) * ( buffer_length + 1 ); s1 = malloc( buffer_length ); } break; } ret = SQLGETINFOW( connection, connection -> driver_dbc, info_type, s1 ? s1 : info_value, buffer_length, string_length ); switch( info_type ) { case SQL_ACCESSIBLE_PROCEDURES: case SQL_ACCESSIBLE_TABLES: case SQL_CATALOG_NAME: case SQL_CATALOG_NAME_SEPARATOR: case SQL_CATALOG_TERM: case SQL_COLLATION_SEQ: case SQL_COLUMN_ALIAS: case SQL_DATA_SOURCE_NAME: case SQL_DATA_SOURCE_READ_ONLY: case SQL_DATABASE_NAME: case SQL_DBMS_NAME: case SQL_DBMS_VER: case SQL_DESCRIBE_PARAMETER: case SQL_DRIVER_NAME: case SQL_DRIVER_ODBC_VER: case SQL_DRIVER_VER: case SQL_ODBC_VER: case SQL_EXPRESSIONS_IN_ORDERBY: case SQL_IDENTIFIER_QUOTE_CHAR: case SQL_INTEGRITY: case SQL_KEYWORDS: case SQL_LIKE_ESCAPE_CLAUSE: case SQL_MAX_ROW_SIZE_INCLUDES_LONG: case SQL_MULT_RESULT_SETS: case SQL_MULTIPLE_ACTIVE_TXN: case SQL_NEED_LONG_DATA_LEN: case SQL_ORDER_BY_COLUMNS_IN_SELECT: case SQL_PROCEDURE_TERM: case SQL_PROCEDURES: case SQL_ROW_UPDATES: case SQL_SCHEMA_TERM: case SQL_SEARCH_PATTERN_ESCAPE: case SQL_SERVER_NAME: case SQL_SPECIAL_CHARACTERS: case SQL_TABLE_TERM: case SQL_USER_NAME: case SQL_XOPEN_CLI_YEAR: case SQL_OUTER_JOINS: if ( SQL_SUCCEEDED( ret ) && info_value && s1 ) { unicode_to_ansi_copy( info_value, buffer_length, s1, SQL_NTS, connection, NULL ); } if ( SQL_SUCCEEDED( ret ) && string_length && info_value ) { *string_length = strlen(info_value); } break; } if ( s1 ) { free( s1 ); } } else { if ( !CHECK_SQLGETINFO( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return do_checks ? function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ) : SQL_ERROR; } ret = SQLGETINFO( connection, connection -> driver_dbc, info_type, info_value, buffer_length, string_length ); } return do_checks ? function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ) : ret; } if ( type == 1 ) { if ( string_length ) *string_length = strlen( cptr ); if ( info_value ) { if ( buffer_length > strlen( cptr ) + 1 ) { strcpy( info_value, cptr ); } else { memcpy( info_value, cptr, buffer_length - 1 ); ((char*)info_value)[ buffer_length - 1 ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } } } else if ( type == 2 ) { if ( info_value ) *((void **)info_value) = ptr; if ( string_length ) *string_length = sizeof( SQLPOINTER ); } else if ( type == 3 ) { if ( info_value ) *((SQLUSMALLINT *)info_value) = sval; if ( string_length ) *string_length = sizeof( SQLUSMALLINT ); } return do_checks ? function_return_nodrv( SQL_HANDLE_DBC, connection, ret ) : ret; } SQLRETURN __SQLGetInfo( SQLHDBC connection_handle, SQLUSMALLINT info_type, SQLPOINTER info_value, SQLSMALLINT buffer_length, SQLSMALLINT *string_length ) { return SQLGetInfoInternal( connection_handle, info_type, info_value, buffer_length, string_length, 0); } SQLRETURN SQLGetInfo( SQLHDBC connection_handle, SQLUSMALLINT info_type, SQLPOINTER info_value, SQLSMALLINT buffer_length, SQLSMALLINT *string_length ) { return SQLGetInfoInternal( connection_handle, info_type, info_value, buffer_length, string_length, 1); } unixODBC-2.3.9/DriverManager/SQLBindParam.c0000644000175000017500000002351413303466667015213 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBindParam.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLBindParam.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2007/03/05 09:49:23 lurcher * Get it to build on VMS again * * Revision 1.7 2006/04/11 10:22:56 lurcher * Fix a data type check * * Revision 1.6 2006/03/08 11:22:13 lurcher * Add check for valid C_TYPE * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.2 2001/12/13 13:00:31 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.7 1999/10/09 00:56:16 ngorham * * Added Manush's patch to map ODBC 3-2 datetime values * * Revision 1.6 1999/10/09 00:15:58 ngorham * * Add mapping from SQL_TYPE_X to SQL_X and SQL_C_TYPE_X to SQL_C_X * when the driver is a ODBC 2 one * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLBindParam.c,v $ $Revision: 1.9 $"; SQLRETURN SQLBindParam( SQLHSTMT statement_handle, SQLUSMALLINT parameter_number, SQLSMALLINT value_type, SQLSMALLINT parameter_type, SQLULEN length_precision, SQLSMALLINT parameter_scale, SQLPOINTER parameter_value, SQLLEN *strlen_or_ind) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tParam Number = %d\ \n\t\t\tValue Type = %d %s\ \n\t\t\tParameter Type = %d %s\ \n\t\t\tLength Precision = %d\ \n\t\t\tParameter Scale = %d\ \n\t\t\tParameter Value = %p\ \n\t\t\tStrLen Or Ind = %p", statement, parameter_number, value_type, __c_as_text( value_type ), parameter_type, __sql_as_text( parameter_type ), (int)length_precision, (int)parameter_scale, (void*)parameter_value, (void*)strlen_or_ind ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( parameter_number < 1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLBINDPARAM ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( parameter_value == NULL && strlen_or_ind == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check valid C_TYPE */ if ( !check_target_type( value_type, statement -> connection -> environment -> requested_version )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY003" ); __post_internal_error( &statement -> error, ERROR_HY003, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( CHECK_SQLBINDPARAM( statement -> connection )) { ret = SQLBINDPARAM( statement -> connection, statement -> driver_stmt, parameter_number, __map_type(MAP_C_DM2D,statement->connection,value_type), __map_type(MAP_SQL_DM2D,statement->connection,parameter_type), length_precision, parameter_scale, parameter_value, strlen_or_ind ); } else { /* * map to odbc 3 operation */ if ( !CHECK_SQLBINDPARAMETER( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * this probably needs to work out the * buffer length */ ret = SQLBINDPARAMETER( statement -> connection, statement -> driver_stmt, parameter_number, SQL_PARAM_INPUT, __map_type(MAP_C_DM2D,statement->connection,value_type), __map_type(MAP_SQL_DM2D,statement->connection,parameter_type), length_precision, parameter_scale, parameter_value, 0, strlen_or_ind ); } if ( log_info.log_flag ) { SQLCHAR buf[ 128 ]; sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, buf )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLColAttributes.c0000644000175000017500000004650713303466667016151 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColAttributes.c,v 1.15 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLColAttributes.c,v $ * Revision 1.15 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.14 2008/09/29 14:02:43 lurcher * Fix missing dlfcn group option * * Revision 1.13 2006/03/08 09:18:41 lurcher * fix silly typo that was using sizeof( SQL_WCHAR ) instead of SQLWCHAR * * Revision 1.12 2006/01/06 18:44:35 lurcher * Couple of unicode fixes * * Revision 1.11 2004/11/22 17:02:48 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.10 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.9 2003/08/15 17:34:43 lurcher * * Remove some unneeded ODBC2->3 attribute conversions * * Revision 1.8 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.7 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.5 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.4 2002/04/25 15:16:46 lurcher * * Fix bug with SQLCOlAttribute(s)(W) where a column of zero could not be * used to get the count value * * Revision 1.3 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.2 2001/11/16 11:39:17 lurcher * * Add mapping between ODBC 2 and ODBC 3 types for SQLColAttribute(s)(W) * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.11 2000/07/31 20:48:01 ngorham * * Fix bugs in SQLGetDiagField and with SQLColAttributes * * Revision 1.10 2000/07/28 16:34:52 ngorham * * Fix problems with SQLColAttributes, and SQLDescribeParam * * Revision 1.9 2000/06/20 13:30:09 ngorham * * Fix problems when using bookmarks * * Revision 1.8 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.2 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLColAttributes.c,v $ $Revision: 1.15 $"; SQLINTEGER map_ca_odbc2_to_3( SQLINTEGER field_identifier ) { switch( field_identifier ) { case SQL_COLUMN_COUNT: field_identifier = SQL_DESC_COUNT; break; /* case SQL_COLUMN_TYPE: field_identifier = SQL_DESC_TYPE; break; case SQL_COLUMN_LENGTH: field_identifier = SQL_DESC_LENGTH; break; case SQL_COLUMN_PRECISION: field_identifier = SQL_DESC_PRECISION; break; case SQL_COLUMN_SCALE: field_identifier = SQL_DESC_SCALE; break; */ case SQL_COLUMN_NULLABLE: field_identifier = SQL_DESC_NULLABLE; break; case SQL_COLUMN_NAME: field_identifier = SQL_DESC_NAME; break; default: break; } return field_identifier; } SQLRETURN SQLColAttributesA( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ) { return SQLColAttributes( statement_handle, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } SQLRETURN SQLColAttributes( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; int isStringAttr; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Number = %d\ \n\t\t\tField Identifier = %s\ \n\t\t\tCharacter Attr = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tString Length = %p\ \n\t\t\tNumeric Attribute = %p", statement, column_number, __col_attr_as_string( s1, field_identifier ), character_attribute, buffer_length, string_length, numeric_attribute ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( column_number == 0 && statement -> bookmarks_on == SQL_UB_OFF && statement -> connection -> bookmarks_on == SQL_UB_OFF && field_identifier != SQL_COLUMN_COUNT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLCOLATTRIBUTES ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * Commented out for now because most drivers can not calc num cols * before Execute (they have no parse). - PAH * if ( field_identifier != SQL_DESC_COUNT && statement -> numcols < column_number ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ /* * check states */ if ( statement -> state == STATE_S1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* else if ( statement -> state == STATE_S2 && field_identifier != SQL_DESC_COUNT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07005" ); __post_internal_error( &statement -> error, ERROR_07005, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ else if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLCOLATTRIBUTES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } switch( field_identifier ) { case SQL_COLUMN_AUTO_INCREMENT: case SQL_COLUMN_CASE_SENSITIVE: case SQL_COLUMN_COUNT: case SQL_COLUMN_DISPLAY_SIZE: case SQL_COLUMN_LENGTH: case SQL_COLUMN_MONEY: case SQL_COLUMN_NULLABLE: case SQL_COLUMN_PRECISION: case SQL_COLUMN_SCALE: case SQL_COLUMN_SEARCHABLE: case SQL_COLUMN_TYPE: case SQL_COLUMN_UNSIGNED: case SQL_COLUMN_UPDATABLE: isStringAttr = 0; break; case SQL_COLUMN_LABEL: case SQL_COLUMN_NAME: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: if ( buffer_length < 0 ) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } default: isStringAttr = buffer_length >= 0; break; } if ( statement -> connection -> unicode_driver ) { if ( !CHECK_SQLCOLATTRIBUTESW( statement -> connection )) { if ( CHECK_SQLCOLATTRIBUTEW( statement -> connection )) { SQLWCHAR *s1 = NULL; SQLSMALLINT unibuf_len; /* * map to the ODBC3 function */ field_identifier = map_ca_odbc2_to_3( field_identifier ); if ( isStringAttr && character_attribute && buffer_length > 0 ) { s1 = calloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 ), 1); /* Do not overflow, since SQLSMALLINT can only hold -32768 <= x <= 32767 */ unibuf_len = buffer_length > 16383 ? buffer_length : sizeof( SQLWCHAR ) * buffer_length; } ret = SQLCOLATTRIBUTEW( statement -> connection, statement -> driver_stmt, column_number, field_identifier, s1 ? s1 : character_attribute, s1 ? unibuf_len : buffer_length, string_length, numeric_attribute ); if ( SQL_SUCCEEDED( ret ) && isStringAttr && character_attribute && buffer_length > 0 && s1 ) { if ( string_length && ret == SQL_SUCCESS ) { *string_length /= sizeof ( SQLWCHAR ); } unicode_to_ansi_copy( character_attribute, buffer_length, s1, SQL_NTS, statement -> connection, NULL ); } if ( s1 ) { free( s1 ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { SQLWCHAR *s1 = NULL; if ( character_attribute && buffer_length > 0 ) { s1 = calloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 ), 1); } ret = SQLCOLATTRIBUTESW( statement -> connection, statement -> driver_stmt, column_number, field_identifier, s1 ? s1 : character_attribute, buffer_length, string_length, numeric_attribute ); if ( SQL_SUCCEEDED( ret ) && character_attribute ) { unicode_to_ansi_copy( character_attribute, buffer_length, s1, SQL_NTS, statement -> connection, NULL ); } if ( SQL_SUCCEEDED( ret ) && string_length && character_attribute ) { *string_length /= sizeof( SQLWCHAR ); } if ( s1 ) { free( s1 ); } } } else { if ( !CHECK_SQLCOLATTRIBUTES( statement -> connection )) { if ( CHECK_SQLCOLATTRIBUTE( statement -> connection )) { /* * map to the ODBC3 function */ field_identifier = map_ca_odbc2_to_3( field_identifier ); ret = SQLCOLATTRIBUTE( statement -> connection, statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { ret = SQLCOLATTRIBUTES( statement -> connection, statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLCOLATTRIBUTES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( SQL_SUCCEEDED( ret )) { /* * map ODBC 3 datetime fields to ODBC2 */ if ( field_identifier == SQL_COLUMN_TYPE && numeric_attribute && statement -> connection -> driver_version == SQL_OV_ODBC2 ) { SQLINTEGER na; memcpy( &na, numeric_attribute, sizeof( na )); switch( na ) { case SQL_TYPE_TIME: na = SQL_TIME; memcpy( numeric_attribute, &na, sizeof( na )); break; case SQL_TYPE_DATE: na = SQL_DATE; memcpy( numeric_attribute, &na, sizeof( na )); break; case SQL_TYPE_TIMESTAMP: na = SQL_TIMESTAMP; memcpy( numeric_attribute, &na, sizeof( na )); break; } } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLNativeSqlW.c0000644000175000017500000002436413303466667015417 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLNativeSqlW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLNativeSqlW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/02 09:55:04 nick * * More unicode bits * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLNativeSqlW.c,v $"; SQLRETURN SQLNativeSqlW( SQLHDBC hdbc, SQLWCHAR *sz_sql_str_in, SQLINTEGER cb_sql_str_in, SQLWCHAR *sz_sql_str, SQLINTEGER cb_sql_str_max, SQLINTEGER *pcb_sql_str ) { DMHDBC connection = (DMHDBC)hdbc; SQLRETURN ret; SQLCHAR *s1; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDBC parent_connection; parent_connection = find_parent_handle( connection, SQL_HANDLE_DBC ); if ( parent_connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLNATIVESQLW( parent_connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLNATIVESQLW( parent_connection, connection, sz_sql_str_in, cb_sql_str_in, sz_sql_str, cb_sql_str_max, pcb_sql_str ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { /* * allocate some space for the buffer */ if ( sz_sql_str_in && cb_sql_str_in == SQL_NTS ) { s1 = malloc(( wide_strlen( sz_sql_str_in ) * 2 ) + 100 ); } else if ( sz_sql_str_in ) { s1 = malloc( cb_sql_str_in + 100 ); } else { s1 = malloc( 101 ); } sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tSQL In = %s\ \n\t\t\tSQL Out = %p\ \n\t\t\tSQL Out Len = %d\ \n\t\t\tSQL Len Ptr = %p", connection, __wstring_with_length( s1, sz_sql_str_in, cb_sql_str_in ), sz_sql_str, (int)cb_sql_str_max, pcb_sql_str ); free( s1 ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( !sz_sql_str_in ) { __post_internal_error( &connection -> error, ERROR_HY009, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( cb_sql_str_in < 0 && cb_sql_str_in != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( sz_sql_str && cb_sql_str_max < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( connection -> state == STATE_C2 || connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( connection -> unicode_driver || CHECK_SQLNATIVESQLW( connection )) { if ( !CHECK_SQLNATIVESQLW( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } ret = SQLNATIVESQLW( connection, connection -> driver_dbc, sz_sql_str_in, cb_sql_str_in, sz_sql_str, cb_sql_str_max, pcb_sql_str ); } else { SQLCHAR *as1 = NULL, *as2 = NULL; int clen; if ( !CHECK_SQLNATIVESQL( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( sz_sql_str_in, cb_sql_str_in, connection, &clen ); cb_sql_str_in = clen; if ( cb_sql_str_max > 0 && sz_sql_str ) { as2 = malloc( cb_sql_str_max + 1 ); } ret = SQLNATIVESQL( connection, connection -> driver_dbc, as1 ? as1 : (SQLCHAR*) sz_sql_str_in, cb_sql_str_in, as2 ? as2 : (SQLCHAR*) sz_sql_str, cb_sql_str_max, pcb_sql_str ); if ( SQL_SUCCEEDED( ret ) && as2 && sz_sql_str ) { ansi_to_unicode_copy( sz_sql_str, (char*) as2, SQL_NTS, connection, NULL ); } if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); } if ( log_info.log_flag ) { /* * allocate some space for the buffer */ if ( sz_sql_str && pcb_sql_str && *pcb_sql_str == SQL_NTS ) { s1 = malloc( wide_strlen( sz_sql_str ) * 2 + 100 ); } else if ( sz_sql_str && pcb_sql_str ) { s1 = malloc( *pcb_sql_str + 100 ); } else if ( sz_sql_str ) { s1 = malloc( wide_strlen( sz_sql_str ) * 2 + 100 ); } else { s1 = malloc( 101 ); } sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tSQL Out = %s", __get_return_status( ret, s2 ), __idata_as_string( s1, SQL_CHAR, pcb_sql_str, sz_sql_str )); free( s1 ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLDriverConnect.c0000644000175000017500000014605613616247762016132 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDriverConnect.c,v 1.28 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDriverConnect.c,v $ * Revision 1.28 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.27 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.26 2009/01/16 11:02:38 lurcher * Interface to GUI for DSN selection * * Revision 1.25 2009/01/14 10:01:42 lurcher * remove debug printf * * Revision 1.24 2009/01/12 15:18:15 lurcher * Add interface into odbcinstQ to allow for a dialog if SQLDriverConnect is called without a DSN= * * Revision 1.23 2008/11/24 12:44:23 lurcher * Try and tidu up the connection version checking * * Revision 1.22 2008/09/29 14:02:44 lurcher * Fix missing dlfcn group option * * Revision 1.21 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.20 2007/03/05 09:49:23 lurcher * Get it to build on VMS again * * Revision 1.19 2004/10/22 09:10:19 lurcher * Fix a couple of problems with FILEDSN's * * Revision 1.18 2004/09/08 16:38:54 lurcher * * Get ready for a 2.2.10 release * * Revision 1.17 2004/07/27 13:04:41 lurcher * * Strip FILEDSN from connection string before passing to driver * * Revision 1.16 2004/02/18 15:47:44 lurcher * * Fix a leak in the iconv code * * Revision 1.15 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.14 2003/09/08 15:34:29 lurcher * * A couple of small but perfectly formed fixes * * Revision 1.13 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.12 2003/01/23 15:33:24 lurcher * * Fix problems with using putenv() * * Revision 1.11 2002/12/20 11:36:46 lurcher * * Update DMEnvAttr code to allow setting in the odbcinst.ini entry * * Revision 1.10 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.9 2002/10/14 09:46:10 lurcher * * Remove extra return * * Revision 1.8 2002/10/02 09:28:33 lurcher * * Fix uninitialised pointer in SQLDriverConnect.c * * Revision 1.7 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.6 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.5 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.4 2002/05/24 12:42:50 lurcher * * Alter NEWS and ChangeLog to match their correct usage * Additional UNICODE tweeks * * Revision 1.3 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.22 2001/10/16 10:37:32 nick * * Getting ready for 2.0.10 * * Revision 1.21 2001/10/09 13:23:30 nick * * Add filedsn support to ODBCConfig * * Revision 1.20 2001/10/08 13:38:35 nick * * Add support for FILEDSN's * * Revision 1.19 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.18 2001/07/20 13:20:44 nick * *** empty log message *** * * Revision 1.17 2001/07/20 12:35:09 nick * * Fix SQLBrowseConnect operation * * Revision 1.16 2001/05/15 10:57:44 nick * * Add initial support for VMS * * Revision 1.15 2001/04/18 15:03:37 nick * * Fix problem when going to DB2 unicode driver * * Revision 1.14 2001/04/16 22:35:10 nick * * More tweeks to the AutoTest code * * Revision 1.13 2001/04/16 15:41:24 nick * * Fix some problems calling non existing error funcs * * Revision 1.12 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.11 2001/04/03 16:34:12 nick * * Add support for strangly broken unicode drivers * * Revision 1.10 2001/01/03 12:02:03 nick * * Add missing __ * * Revision 1.9 2001/01/03 11:57:26 nick * * Fix some name collisions * * Revision 1.8 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.7 2000/12/18 13:02:13 nick * * More buf fixes * * Revision 1.6 2000/12/18 12:53:29 nick * * More pooling tweeks * * Revision 1.5 2000/12/18 12:27:50 nick * * Fix missing check for SQL_NTS * * Revision 1.4 2000/12/14 18:10:19 nick * * Add connection pooling * * Revision 1.3 2000/10/13 15:18:49 nick * * Change string length parameter from SQLINTEGER to SQLSMALLINT * * Revision 1.2 2000/10/06 08:49:38 nick * * Fix duplicated error messages on connect * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.15 2000/08/11 12:11:27 ngorham * * Make SQLDriverConnect return all the stacked errors from the driver, not * just one * * Revision 1.14 2000/07/13 13:27:24 ngorham * * remove _ from odbcinst_system_file_path() * * Revision 1.13 2000/06/21 08:58:26 ngorham * * Stop SQLDriverConnect dumping core when passed a null dsn string * * Revision 1.12 2000/02/20 10:18:47 ngorham * * Add support for ODBCINI environment override for Applix. * * Revision 1.11 1999/12/14 19:02:25 ngorham * * Mask out the password fields in the logging * * Revision 1.10 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.9 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.8 1999/10/14 06:49:24 ngorham * * Remove @all_includes@ from Drivers/MiniSQL/Makefile.am * * Revision 1.7 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.6 1999/08/17 06:20:00 ngorham * * Remove posibility of returning without clearing the connection mutex. * * Revision 1.5 1999/08/03 21:47:39 shandyb * Moving to automake: changed files in DriverManager * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.4 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDriverConnect.c,v $ $Revision: 1.28 $"; /* * connection pooling stuff */ extern int pooling_enabled; void __generate_connection_string( struct con_struct *con_str, char *str, int str_len ) { struct con_pair *cp; char *tmp; str[ 0 ] = '\0'; if ( con_str -> count == 0 ) { return; } cp = con_str -> list; while( cp ) { size_t attrlen = strlen( cp -> attribute ); int use_esc = isspace( *(cp -> attribute ) ) || ( attrlen && isspace( cp->attribute[attrlen - 1] )); for ( tmp = cp -> attribute; *tmp; tmp++ ) { use_esc |= (*tmp == '{') || (*tmp == '}'); attrlen += (*tmp == '}'); } tmp = malloc( strlen( cp -> keyword ) + attrlen + 10 ); if( use_esc ) { char *tmp2 = tmp + sprintf( tmp, "%s={", cp -> keyword ); char *tmp3; for( tmp3 = cp -> attribute; *tmp3 ; tmp3++ ) { *tmp2++ = *tmp3; if ( '}' == *tmp3++ ) { *tmp2++ = '}'; } } *tmp2++ = '}'; *tmp2++ = 0; } else { sprintf( tmp, "%s=%s;", cp -> keyword, cp -> attribute ); } if ( strlen( str ) + strlen( tmp ) > str_len ) { break; } else { strcat( str, tmp ); } free( tmp ); cp = cp -> next; } } void __get_attr( char ** cp, char ** keyword, char ** value ) { char * ptr; int len; *keyword = *value = NULL; while ( isspace( **cp ) || **cp == ';' ) { (*cp)++; } if ( !**cp ) return; ptr = *cp; /* * To handle the case attribute in which the attribute is of the form * "ATTR;" instead of "ATTR=VALUE;" */ while ( **cp && **cp != '=' ) { (*cp)++; } if ( !**cp ) return; len = *cp - ptr; *keyword = malloc( len + 1 ); memcpy( *keyword, ptr, len ); (*keyword)[ len ] = '\0'; (*cp)++; if ( **cp == '{' ) { /* escaped with '{' - all characters until next '}' not followed by '}', or end of string, are part of the value */ int i = 0; ptr = ++*cp; while ( **cp && (**cp != '}' || (*cp)[1] == '}') ) { if ( **cp == '}' ) (*cp)++; (*cp)++; } len = *cp - ptr; *value = malloc( len + 1 ); while( ptr < *cp ) { if ( ((*value)[i++] = *ptr++) == '}') { ptr++; } } (*value)[i] = 0; if ( **cp == '}' ) { (*cp)++; } } else { /* non-escaped: all characters until ';' or end of string are value */ ptr = *cp; while ( **cp && **cp != ';' ) { (*cp)++; } len = *cp - ptr; *value = malloc( len + 1 ); memcpy( *value, ptr, len ); (*value)[ len ] = 0; } } struct con_pair * __get_pair( char ** cp ) { char *keyword, *value; struct con_pair * con_p; __get_attr( cp, &keyword, &value ); if ( keyword ) { con_p = malloc( sizeof( *con_p )); con_p -> keyword = keyword; con_p -> attribute = value; return con_p; } else { return NULL; } } int __append_pair( struct con_struct *con_str, char *kword, char *value ) { struct con_pair *ptr, *end; /* check that the keyword is not already in the list */ end = NULL; if ( con_str -> count > 0 ) { ptr = con_str -> list; while( ptr ) { if( strcasecmp( kword, ptr -> keyword ) == 0 ) { free( ptr -> attribute ); ptr -> attribute = malloc( strlen( value ) + 1 ); strcpy( ptr -> attribute, value ); return 0; } end = ptr; ptr = ptr -> next; } } ptr = malloc( sizeof( *ptr )); ptr -> keyword = malloc( strlen( kword ) + 1 ); strcpy( ptr -> keyword, kword ); ptr -> attribute = malloc( strlen( value ) + 1 ); strcpy( ptr -> attribute, value ); con_str -> count ++; if ( con_str -> list ) { end -> next = ptr; ptr -> next = NULL; } else { ptr -> next = NULL; con_str -> list = ptr; } return 0; } int __parse_connection_string_ex( struct con_struct *con_str, char *str, int str_len, int exclude ) { struct con_pair *cp; char *local_str, *ptr; int got_dsn = 0; /* if we have a DSN then ignore any DRIVER or FILEDSN */ int got_driver = 0; /* if we have a DRIVER or FILEDSN then ignore any DSN */ con_str -> count = 0; con_str -> list = NULL; if ( str_len != SQL_NTS ) { local_str = malloc( str_len + 1 ); memcpy( local_str, str, str_len ); local_str[ str_len ] = '\0'; } else { local_str = str; } if ( !local_str || strlen( local_str ) == 0 || ( strlen( local_str ) == 1 && *local_str == ';' )) { /* connection-string ::= empty-string [;] */ if ( str_len != SQL_NTS ) free( local_str ); return 0; } ptr = local_str; while(( cp = __get_pair( &ptr )) != NULL ) { if ( strcasecmp( cp -> keyword, "DSN" ) == 0 ) { if ( got_driver && exclude ) { /* 11-29-2010 JM Modify to free the allocated memory before continuing. */ free( cp -> keyword ); free( cp -> attribute ); free( cp ); continue; } got_dsn = 1; } else if ( strcasecmp( cp -> keyword, "DRIVER" ) == 0 || strcasecmp( cp -> keyword, "FILEDSN" ) == 0 ) { if ( got_dsn && exclude ) { /* 11-29-2010 JM Modify to free the allocated memory before continuing. */ free( cp -> keyword ); free( cp -> attribute ); free( cp ); continue; } got_driver = 1; } __append_pair( con_str, cp -> keyword, cp -> attribute ); free( cp -> keyword ); free( cp -> attribute ); free( cp ); } if ( str_len != SQL_NTS ) free( local_str ); return 0; } int __parse_connection_string( struct con_struct *con_str, char *str, int str_len ) { return __parse_connection_string_ex( con_str, str, str_len, 1 ); } char * __get_attribute_value( struct con_struct * con_str, char * keyword ) { struct con_pair *cp; if ( con_str -> count == 0 ) return NULL; cp = con_str -> list; while( cp ) { if( strcasecmp( keyword, cp -> keyword ) == 0 ) { if ( cp -> attribute ) return cp -> attribute; else return ""; } cp = cp -> next; } return NULL; } void __release_conn( struct con_struct *con_str ) { struct con_pair *cp = con_str -> list; struct con_pair *save; while( cp ) { free( cp -> attribute ); free( cp -> keyword ); save = cp; cp = cp -> next; free( save ); } con_str -> count = 0; } void __handle_attr_extensions_cs( DMHDBC connection, struct con_struct *con_str ) { char *ptr; if (( ptr = __get_attribute_value( con_str, "DMEnvAttr" )) != NULL ) { __parse_attribute_string( &connection -> env_attribute, ptr, SQL_NTS ); } if (( ptr = __get_attribute_value( con_str, "DMConnAttr" )) != NULL ) { __parse_attribute_string( &connection -> dbc_attribute, ptr, SQL_NTS ); } if (( ptr = __get_attribute_value( con_str, "DMStmtAttr" )) != NULL ) { __parse_attribute_string( &connection -> stmt_attribute, ptr, SQL_NTS ); } } SQLRETURN SQLDriverConnectA( SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *conn_str_in, SQLSMALLINT len_conn_str_in, SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion ) { return SQLDriverConnect( hdbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out, conn_str_out_max, ptr_conn_str_out, driver_completion ); } SQLRETURN SQLDriverConnect( SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *conn_str_in, SQLSMALLINT len_conn_str_in, SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion ) { DMHDBC connection = (DMHDBC)hdbc; struct con_struct con_struct; char *driver, *dsn = NULL, *filedsn, *tsavefile, savefile[ INI_MAX_PROPERTY_VALUE + 1 ]; char lib_name[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver_name[ INI_MAX_PROPERTY_VALUE + 1 ]; SQLRETURN ret_from_connect; SQLCHAR s1[ 2048 ]; SQLCHAR local_conn_str_in[ 2048 ]; SQLCHAR local_out_conection[ 2048 ]; char *save_filedsn; int warnings = 0; /* * check connection */ strcpy( driver_name, "" ); if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); /* * replace this if not set for use by SAVEFILE */ if ( !conn_str_out ) { conn_str_out = local_out_conection; conn_str_out_max = sizeof( local_out_conection ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tWindow Hdl = %p\ \n\t\t\tStr In = %s\ \n\t\t\tStr Out = %p\ \n\t\t\tStr Out Max = %d\ \n\t\t\tStr Out Ptr = %p\ \n\t\t\tCompletion = %d", connection, hwnd, __string_with_length_hide_pwd( s1, conn_str_in, len_conn_str_in ), conn_str_out, conn_str_out_max, ptr_conn_str_out, driver_completion ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( len_conn_str_in < 0 && len_conn_str_in != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( driver_completion == SQL_DRIVER_PROMPT && hwnd == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( driver_completion != SQL_DRIVER_PROMPT && driver_completion != SQL_DRIVER_COMPLETE && driver_completion != SQL_DRIVER_COMPLETE_REQUIRED && driver_completion != SQL_DRIVER_NOPROMPT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY110" ); __post_internal_error( &connection -> error, ERROR_HY110, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } /* * check the state of the connection */ if ( connection -> state != STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } /* * parse the connection string, and call the GUI if needed */ if ( driver_completion == SQL_DRIVER_NOPROMPT ) { if ( !conn_str_in ) { conn_str_in = (SQLCHAR*)"DSN=DEFAULT;"; len_conn_str_in = strlen((char*) conn_str_in ); } __parse_connection_string( &con_struct, (char*)conn_str_in, len_conn_str_in ); } else { if ( !conn_str_in ) { conn_str_in = (SQLCHAR*)""; len_conn_str_in = strlen((char*) conn_str_in ); } __parse_connection_string( &con_struct, (char*)conn_str_in, len_conn_str_in ); if ( !__get_attribute_value( &con_struct, "DSN" ) && !__get_attribute_value( &con_struct, "DRIVER" ) && !__get_attribute_value( &con_struct, "FILEDSN" )) { int ret; SQLCHAR returned_dsn[ 1025 ], *prefix, *target; /* * try and call GUI to obtain a DSN */ ret = _SQLDriverConnectPrompt( hwnd, returned_dsn, sizeof( returned_dsn )); if ( !ret || returned_dsn[ 0 ] == '\0' ) { __append_pair( &con_struct, "DSN", "DEFAULT" ); } else { prefix = returned_dsn; target = (SQLCHAR*)strchr( (char*)returned_dsn, '=' ); if ( target ) { *target = '\0'; target ++; __append_pair( &con_struct, (char*)prefix, (char*)target ); } else { __append_pair( &con_struct, "DSN", (char*)returned_dsn ); } } /* * regenerate to pass to driver */ __generate_connection_string( &con_struct, (char*)local_conn_str_in, sizeof( local_conn_str_in )); conn_str_in = local_conn_str_in; len_conn_str_in = strlen((char*) conn_str_in ); } } /* * can we find a pooled connection to use here ? */ connection -> pooled_connection = NULL; if ( pooling_enabled && search_for_pool( connection, NULL, 0, NULL, 0, NULL, 0, conn_str_in, len_conn_str_in )) { /* * copy the in string to the out string */ ret_from_connect = SQL_SUCCESS; if ( conn_str_out ) { if ( len_conn_str_in < 0 ) { len_conn_str_in = strlen((char*) conn_str_in ); } if ( len_conn_str_in >= conn_str_out_max ) { memcpy( conn_str_out, conn_str_in, conn_str_out_max - 1 ); conn_str_out[ conn_str_out_max - 1 ] = '\0'; if ( ptr_conn_str_out ) { *ptr_conn_str_out = len_conn_str_in; } __post_internal_error( &connection -> error, ERROR_01004, NULL, connection -> environment -> requested_version ); ret_from_connect = SQL_SUCCESS_WITH_INFO; } else { memcpy( conn_str_out, conn_str_in, len_conn_str_in ); conn_str_out[ len_conn_str_in ] = '\0'; if ( ptr_conn_str_out ) { *ptr_conn_str_out = len_conn_str_in; } } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } connection -> state = STATE_C4; __release_conn( &con_struct ); return function_return( SQL_HANDLE_DBC, connection, ret_from_connect, DEFER_R0 ); } /* * else safe the info for later */ if ( pooling_enabled ) { connection -> dsn_length = 0; strcpy( connection -> server, "" ); connection -> server_length = 0; strcpy( connection -> user, "" ); connection -> user_length = 0; strcpy( connection -> password, "" ); connection -> password_length = 0; if ( len_conn_str_in == SQL_NTS ) { strcpy( connection -> driver_connect_string, (char*)conn_str_in ); } else { memcpy( connection -> driver_connect_string, conn_str_in, len_conn_str_in ); } connection -> dsn_length = len_conn_str_in; } /* * get for later */ tsavefile = __get_attribute_value( &con_struct, "SAVEFILE" ); if ( tsavefile ) { if ( strlen( tsavefile ) > INI_MAX_PROPERTY_VALUE ) { memcpy( savefile, tsavefile, INI_MAX_PROPERTY_VALUE ); savefile[ INI_MAX_PROPERTY_VALUE ] = '\0'; } else { strcpy( savefile, tsavefile ); } } else { savefile[ 0 ] = '\0'; } /* * open the file dsn, get each entry from it, if it's not in the connection * struct, add it */ filedsn = __get_attribute_value( &con_struct, "FILEDSN" ); if ( filedsn ) { char str[ 1024 * 16 ]; if ( SQLReadFileDSN( filedsn, "ODBC", NULL, str, sizeof( str ), NULL )) { struct con_struct con_struct1; save_filedsn = strdup( filedsn ); if ( strlen( str )) { strcpy((char*)local_conn_str_in, (char*)conn_str_in ); conn_str_in = local_conn_str_in; __parse_connection_string( &con_struct1, str, strlen( str )); /* * Get the attributes from the original string */ conn_str_in[ 0 ] = '\0'; if ( con_struct.count ) { struct con_pair *cp; cp = con_struct.list; while( cp ) { char *str1; /* * Don't pass FILEDSN down */ if ( strcasecmp( cp -> keyword, "FILEDSN" ) && strcasecmp( cp -> keyword, "FILEDSN" ) ) { str1 = malloc( strlen( cp -> keyword ) + strlen( cp -> attribute ) + 10 ); if ( !str1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY001" ); __post_internal_error( &connection -> error, ERROR_HY001, NULL, connection -> environment -> requested_version ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( strlen((char*) conn_str_in ) > 0 ) { sprintf( str1, ";%s=%s", cp -> keyword, cp -> attribute ); } else { sprintf( str1, "%s=%s", cp -> keyword, cp -> attribute ); } if ( strlen( (char*)conn_str_in ) + strlen( str1 ) < conn_str_out_max ) { strcat((char*) conn_str_in, str1 ); } else { warnings = 1; __post_internal_error( &connection -> error, ERROR_01004, NULL, connection -> environment -> requested_version ); } free( str1 ); } cp = cp -> next; } } if ( con_struct1.count ) { struct con_pair *cp; cp = con_struct1.list; while( cp ) { if ( !__get_attribute_value( &con_struct, cp -> keyword )) { char *str1; str1 = malloc( strlen( cp -> keyword ) + strlen( cp -> attribute ) + 10 ); if ( !str1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY001" ); __post_internal_error( &connection -> error, ERROR_HY001, NULL, connection -> environment -> requested_version ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( strlen((char*) conn_str_in ) > 0 ) { sprintf( str1, ";%s=%s", cp -> keyword, cp -> attribute ); } else { sprintf( str1, "%s=%s", cp -> keyword, cp -> attribute ); } if ( strlen( (char*)conn_str_in ) + strlen( str1 ) < conn_str_out_max ) { strcat((char*) conn_str_in, str1 ); } else { warnings = 1; __post_internal_error( &connection -> error, ERROR_01004, NULL, connection -> environment -> requested_version ); } free( str1 ); } cp = cp -> next; } } len_conn_str_in = strlen((char*) conn_str_in ); __release_conn( &con_struct1 ); } /* * reparse the string */ __release_conn( &con_struct ); __parse_connection_string( &con_struct, (char*)conn_str_in, len_conn_str_in ); } else { save_filedsn = NULL; } } else { save_filedsn = NULL; } /* * look for some keywords * * have we got a DRIVER= attribute */ driver = __get_attribute_value( &con_struct, "DRIVER" ); if ( driver ) { /* * look up the driver in the ini file */ if ( strlen( driver ) >= sizeof( driver_name )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM011" ); __post_internal_error( &connection -> error, ERROR_IM011, NULL, connection -> environment -> requested_version ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } strcpy( driver_name, driver ); #ifdef PLATFORM64 SQLGetPrivateProfileString( driver, "Driver64", "", lib_name, sizeof( lib_name ), "ODBCINST.INI" ); if ( lib_name[ 0 ] == '\0' ) { SQLGetPrivateProfileString( driver, "Driver", "", lib_name, sizeof( lib_name ), "ODBCINST.INI" ); } #else SQLGetPrivateProfileString( driver, "Driver", "", lib_name, sizeof( lib_name ), "ODBCINST.INI" ); #endif /* * Assume if it's not in a odbcinst.ini then it's a direct reference */ if ( lib_name[ 0 ] == '\0' ) { strcpy( lib_name, driver ); } strcpy( connection -> dsn, "" ); __handle_attr_extensions( connection, NULL, driver_name ); } else { dsn = __get_attribute_value( &con_struct, "DSN" ); if ( !dsn ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( strlen( dsn ) > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM012" ); __post_internal_error( &connection -> error, ERROR_IM012, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } /* * look up the dsn in the ini file */ if ( !__find_lib_name( dsn, lib_name, driver_name )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } strcpy( connection -> dsn, dsn ); __handle_attr_extensions( connection, dsn, driver_name ); } if ( dsn ) { /* * do we have any Environment, Connection, or Statement attributes set in the ini ? */ __handle_attr_extensions( connection, dsn, driver_name ); } else { /* * the attributes may be in the connection string */ __handle_attr_extensions_cs( connection, &con_struct ); } __release_conn( &con_struct ); /* * we have now got the name of a lib to load */ if ( !__connect_part_one( connection, lib_name, driver_name, &warnings )) { if ( save_filedsn ) { free( save_filedsn ); } __disconnect_part_four( connection ); /* release unicode handles */ return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( !CHECK_SQLDRIVERCONNECT( connection ) && !CHECK_SQLDRIVERCONNECTW( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( CHECK_SQLDRIVERCONNECT( connection )) { /* if ( CHECK_SQLSETCONNECTATTR( connection )) { int lret; lret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, SQL_ATTR_ANSI_APP, SQL_AA_TRUE, 0 ); } */ ret_from_connect = SQLDRIVERCONNECT( connection, connection -> driver_dbc, hwnd, conn_str_in, len_conn_str_in, conn_str_out, conn_str_out_max, ptr_conn_str_out, driver_completion ); if ( ret_from_connect != SQL_SUCCESS ) { SQLCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; /* * get the errors from the driver before * loseing the connection */ if ( CHECK_SQLERROR( connection )) { do { ret = SQLERROR( connection, SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex_noprefix( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, message_text ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGREC( connection )) { int rec = 1; do { ret = SQLGETDIAGREC( connection, SQL_HANDLE_DBC, connection -> driver_dbc, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { __post_internal_error_ex_noprefix( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, message_text ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } } /* * if it was a error then return now */ if ( !SQL_SUCCEEDED( ret_from_connect )) { __disconnect_part_one( connection ); __disconnect_part_four( connection ); sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, ret_from_connect, DEFER_R0 ); } connection -> unicode_driver = 0; } else { SQLWCHAR *uc_conn_str_in, *s1 = NULL; SQLCHAR s2[ 128 ]; int wlen; uc_conn_str_in = ansi_to_unicode_alloc( conn_str_in, len_conn_str_in, connection, &wlen ); len_conn_str_in = wlen; if ( CHECK_SQLSETCONNECTATTR( connection )) { SQLSETCONNECTATTR( connection, connection -> driver_dbc, SQL_ATTR_ANSI_APP, SQL_AA_FALSE, 0 ); } if ( conn_str_out && conn_str_out_max > 0 ) { s1 = malloc( sizeof( SQLWCHAR ) * ( conn_str_out_max + 1 )); } ret_from_connect = SQLDRIVERCONNECTW( connection, connection -> driver_dbc, hwnd, uc_conn_str_in, len_conn_str_in, s1 ? s1 : (SQLWCHAR*)conn_str_out, conn_str_out_max, ptr_conn_str_out, driver_completion ); if ( uc_conn_str_in ) free( uc_conn_str_in ); if ( ret_from_connect != SQL_SUCCESS ) { SQLWCHAR sqlstate[ 6 ]; SQLINTEGER native_error; SQLSMALLINT ind; SQLWCHAR message_text[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLRETURN ret; /* * get the errors from the driver before * loseing the connection */ if ( CHECK_SQLERRORW( connection )) { do { ret = SQLERRORW( connection, SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { SQLCHAR *as1, *as2; __post_internal_error_ex_w_noprefix( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); as1 = (SQLCHAR*) unicode_to_ansi_alloc( sqlstate, SQL_NTS, connection, NULL ); as2 = (SQLCHAR*) unicode_to_ansi_alloc( message_text, SQL_NTS, connection, NULL ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", as1, as2 ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } else if ( CHECK_SQLGETDIAGRECW( connection )) { int rec = 1; do { ret = SQLGETDIAGRECW( connection, SQL_HANDLE_DBC, connection -> driver_dbc, rec ++, sqlstate, &native_error, message_text, sizeof( message_text ), &ind ); if ( SQL_SUCCEEDED( ret )) { SQLCHAR *as1, *as2; __post_internal_error_ex_w_noprefix( &connection -> error, sqlstate, native_error, message_text, SUBCLASS_ODBC, SUBCLASS_ODBC ); as1 = (SQLCHAR*) unicode_to_ansi_alloc( sqlstate, SQL_NTS, connection, NULL ); as2 = (SQLCHAR*) unicode_to_ansi_alloc( message_text, SQL_NTS, connection, NULL ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", as1, as2 ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); dm_log_write_diag( connection -> msg ); } } while( SQL_SUCCEEDED( ret )); } } /* * if it was a error then return now */ if ( !SQL_SUCCEEDED( ret_from_connect )) { __disconnect_part_one( connection ); __disconnect_part_four( connection ); sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret_from_connect, s2 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); if ( save_filedsn ) { free( save_filedsn ); } if ( s1 ) { free( s1 ); } return function_return( SQL_HANDLE_DBC, connection, ret_from_connect, DEFER_R0 ); } else { if ( conn_str_out && s1 ) { unicode_to_ansi_copy((char*) conn_str_out, conn_str_out_max, s1, SQL_NTS, connection, NULL ); } } if ( s1 ) { free( s1 ); } connection -> unicode_driver = 1; } /* * we should be connected now */ connection -> state = STATE_C4; /* * did we get the type we wanted */ if ( connection -> driver_version != connection -> environment -> requested_version ) { connection -> driver_version = connection -> environment -> requested_version; __post_internal_error( &connection -> error, ERROR_01000, "Driver does not support the requested version", connection -> environment -> requested_version ); ret_from_connect = SQL_SUCCESS_WITH_INFO; } if ( !__connect_part_two( connection )) { __disconnect_part_two( connection ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); if ( save_filedsn ) { free( save_filedsn ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } if ( log_info.log_flag ) { if ( conn_str_out && strlen((char*) conn_str_out ) > 64 ) { sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tConnection Out [%.64s...]", __get_return_status( ret_from_connect, s1 ), conn_str_out ); } else { sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tConnection Out [%s]", __get_return_status( ret_from_connect, s1 ), __string_with_length_hide_pwd( s1, conn_str_out ? conn_str_out : (SQLCHAR*)"NULL", SQL_NTS )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } /* * If we specified FILEDSN or SAVEFILE these need adding to the * output string */ if ( strlen( savefile )) { char *str = strdup((char*) conn_str_out ); strcpy((char*) conn_str_out, "SAVEFILE=" ); strcat((char*) conn_str_out, savefile ); strcat((char*) conn_str_out, ";" ); strcat((char*) conn_str_out, str ); free( str ); if ( ptr_conn_str_out ) { *ptr_conn_str_out = strlen((char*) conn_str_out ); } } if ( save_filedsn && strlen( save_filedsn )) { char *str = strdup((char*) conn_str_out ); strcpy((char*) conn_str_out, "FILEDSN=" ); strcat((char*) conn_str_out, save_filedsn ); strcat((char*) conn_str_out, ";" ); strcat((char*) conn_str_out, str ); free( str ); if ( ptr_conn_str_out ) { *ptr_conn_str_out = strlen((char*) conn_str_out ); } } if ( save_filedsn ) { free( save_filedsn ); } /* * write the connection string out to a file */ if ( tsavefile ) { if ( SQL_SUCCEEDED( ret_from_connect )) { __parse_connection_string_ex( &con_struct, (char*)conn_str_out, conn_str_out_max, 0 ); /* * remove them */ SQLWriteFileDSN( savefile, "ODBC", NULL, NULL ); if ( con_struct.count ) { int has_driver = 0; struct con_pair *cp; cp = con_struct.list; while( cp ) { if ( strcasecmp( cp -> keyword, "PWD" ) == 0 ) { /* * don't save this */ cp = cp -> next; continue; } else if ( strcasecmp( cp -> keyword, "SAVEFILE" ) == 0 ) { /* * or this */ cp = cp -> next; continue; } else if ( strcasecmp( cp -> keyword, "DSN" ) == 0 ) { /* * don't save this either, there should be enough with the added DRIVER= * to make it work */ cp = cp -> next; continue; } else if ( strcasecmp( cp -> keyword, "DRIVER" ) == 0 ) { has_driver = 1; } SQLWriteFileDSN( savefile, "ODBC", cp -> keyword, cp -> attribute ); cp = cp -> next; } if ( !has_driver ) { SQLWriteFileDSN( savefile, "ODBC", "Driver", driver_name ); } } __release_conn( &con_struct ); } } if ( warnings && ret_from_connect == SQL_SUCCESS ) { ret_from_connect = SQL_SUCCESS_WITH_INFO; } return function_return_nodrv( SQL_HANDLE_DBC, connection, ret_from_connect ); } unixODBC-2.3.9/DriverManager/SQLDataSourcesW.c0000644000175000017500000002224613441433161015705 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDataSourcesW.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDataSourcesW.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/04 13:16:25 nick * * Add support for GNU portable threads and tidy up some UNICODE compile * warnings * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDataSourcesW.c,v $"; #define BUFFERSIZE 1024 * 4 SQLRETURN SQLDataSourcesW( SQLHENV environment_handle, SQLUSMALLINT direction, SQLWCHAR *server_name, SQLSMALLINT buffer_length1, SQLSMALLINT *name_length1, SQLWCHAR *description, SQLSMALLINT buffer_length2, SQLSMALLINT *name_length2 ) { DMHENV environment = (DMHENV) environment_handle; SQLRETURN ret; char buffer[ BUFFERSIZE + 1 ]; char object[ INI_MAX_OBJECT_NAME + 1 ]; char property[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver[ INI_MAX_PROPERTY_VALUE + 1 ]; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p", environment ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); /* * check that a version has been requested */ if ( environment -> requested_version == 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &environment -> error, ERROR_HY010, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( buffer_length1 < 0 || buffer_length2 < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &environment -> error, ERROR_HY090, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( direction != SQL_FETCH_FIRST && direction != SQL_FETCH_FIRST_USER && direction != SQL_FETCH_FIRST_SYSTEM && direction != SQL_FETCH_NEXT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY103" ); __post_internal_error( &environment -> error, ERROR_HY103, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } /* * for this function USER = "~/.odbc.ini" and * SYSTEM = "/usr/odbc.ini */ if ( direction == SQL_FETCH_FIRST ) { environment -> fetch_mode = ODBC_BOTH_DSN; environment -> entry = 0; } else if ( direction == SQL_FETCH_FIRST_USER ) { environment -> fetch_mode = ODBC_USER_DSN; environment -> entry = 0; } else if ( direction == SQL_FETCH_FIRST_SYSTEM ) { environment -> fetch_mode = ODBC_SYSTEM_DSN; environment -> entry = 0; } /* * this is lifted from Peters code */ memset( buffer, 0, sizeof( buffer )); memset( object, 0, sizeof( object )); SQLSetConfigMode( environment -> fetch_mode ); SQLGetPrivateProfileString( NULL, NULL, NULL, buffer, sizeof( buffer ), "odbc.ini" ); if ( iniElement( buffer, '\0', '\0', environment -> entry, object, sizeof( object )) != INI_SUCCESS ) { environment -> entry = 0; ret = SQL_NO_DATA; } else { memset( buffer, 0, sizeof( buffer )); memset( property, 0, sizeof( property )); memset( driver, 0, sizeof( driver )); SQLGetPrivateProfileString( object, "Driver", "", driver, sizeof( driver ), "odbc.ini" ); if ( strlen( driver ) > 0 ) { /* SQLGetPrivateProfileString( driver, "Description", "", property, sizeof( property ), "odbcinst.ini" ); */ strcpy( property, driver ); } else { strcpy( property, "" ); } environment -> entry++; if (( server_name && buffer_length1 <= strlen( object )) || ( description && buffer_length2 <= strlen( property ))) { __post_internal_error( &environment -> error, ERROR_01004, NULL, environment -> requested_version ); ret = SQL_SUCCESS_WITH_INFO; } else { ret = SQL_SUCCESS; } if ( server_name ) { SQLWCHAR *s1; s1 = ansi_to_unicode_alloc((SQLCHAR*) object, SQL_NTS, NULL, NULL ); if ( s1 ) { if ( buffer_length1 <= strlen( object )) { memcpy( server_name, s1, buffer_length1 * 2 ); server_name[ buffer_length1 - 1 ] = 0; } else { wide_strcpy( server_name, s1 ); } free( s1 ); } } if ( description ) { SQLWCHAR *s1; s1 = ansi_to_unicode_alloc((SQLCHAR*) property, SQL_NTS, NULL, NULL ); if ( s1 ) { if ( buffer_length2 <= strlen( property )) { memcpy( description, s1, buffer_length2 * 2 ); description[ buffer_length2 - 1 ] = 0; } else { wide_strcpy( description, s1 ); } free( s1 ); } } if ( name_length1 ) { *name_length1 = strlen( object ); } if ( name_length2 ) { *name_length2 = strlen( property ); } } /* NEVER FORGET TO RESET THIS TO ODBC_BOTH_DSN */ SQLSetConfigMode( ODBC_BOTH_DSN ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } return function_return_nodrv( SQL_HANDLE_ENV, environment, ret ); } unixODBC-2.3.9/DriverManager/SQLProcedureColumns.c0000644000175000017500000003005413303466667016644 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLProcedureColumns.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLProcedureColumns.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLProcedureColumns.c,v $ $Revision: 1.7 $"; SQLRETURN SQLProcedureColumnsA( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_proc_name, SQLSMALLINT cb_proc_name, SQLCHAR *sz_column_name, SQLSMALLINT cb_column_name ) { return SQLProcedureColumns( statement_handle, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name, sz_column_name, cb_column_name ); } SQLRETURN SQLProcedureColumns( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_proc_name, SQLSMALLINT cb_proc_name, SQLCHAR *sz_column_name, SQLSMALLINT cb_column_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tProc Name = %s\ \n\t\t\tColumn Type = %s", statement, __string_with_length( s1, sz_catalog_name, cb_catalog_name ), __string_with_length( s2, sz_schema_name, cb_schema_name ), __string_with_length( s3, sz_proc_name, cb_proc_name ), __string_with_length( s4, sz_column_name, cb_column_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( sz_catalog_name && cb_catalog_name < 0 && cb_catalog_name != SQL_NTS ) || ( sz_schema_name && cb_schema_name < 0 && cb_schema_name != SQL_NTS ) || ( sz_proc_name && cb_proc_name < 0 && cb_proc_name != SQL_NTS ) || ( sz_column_name && cb_column_name < 0 && cb_column_name != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPROCEDURECOLUMNS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3, *s4; int wlen; if ( !CHECK_SQLPROCEDURECOLUMNSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( sz_catalog_name, cb_catalog_name, statement -> connection, &wlen ); cb_catalog_name = wlen; s2 = ansi_to_unicode_alloc( sz_schema_name, cb_schema_name, statement -> connection, &wlen ); cb_schema_name = wlen; s3 = ansi_to_unicode_alloc( sz_proc_name, cb_proc_name, statement -> connection, &wlen ); cb_proc_name = wlen; s4 = ansi_to_unicode_alloc( sz_column_name, cb_column_name, statement -> connection, &wlen ); cb_column_name = wlen; ret = SQLPROCEDURECOLUMNSW( statement -> connection , statement -> driver_stmt, s1, cb_catalog_name, s2, cb_schema_name, s3, cb_proc_name, s4, cb_column_name ); if ( s1 ) free( s1 ); if ( s2 ) free( s2 ); if ( s3 ) free( s3 ); if ( s4 ) free( s4 ); } else { if ( !CHECK_SQLPROCEDURECOLUMNS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPROCEDURECOLUMNS( statement -> connection , statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name, sz_column_name, cb_column_name ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPROCEDURECOLUMNS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLCloseCursor.c0000644000175000017500000001541613303466667015623 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLCloseCursor.c,v 1.5 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLCloseCursor.c,v $ * Revision 1.5 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/08/15 08:10:33 lurcher * * Couple of small fixes from John L Miller * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLCloseCursor.c,v $ $Revision: 1.5 $"; SQLRETURN SQLCloseCursor( SQLHSTMT statement_handle ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p", statement ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 || statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( !CHECK_SQLCLOSECURSOR( statement -> connection )) { if ( !CHECK_SQLFREESTMT( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else { ret = SQLFREESTMT( statement -> connection, statement -> driver_stmt, SQL_CLOSE ); } } else { ret = SQLCLOSECURSOR( statement -> connection, statement -> driver_stmt ); } if ( SQL_SUCCEEDED( ret )) { if ( statement -> prepared ) statement -> state = STATE_S3; else statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLForeignKeys.c0000644000175000017500000003543513303466667015610 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLForeignKeys.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLForeignKeys.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 2000/06/20 12:44:00 ngorham * * Fix bug that caused a success with info message from SQLExecute or * SQLExecDirect to be lost if used with a ODBC 3 driver and the application * called SQLGetDiagRec * * Revision 1.8 2000/06/16 16:52:18 ngorham * * Stop info messages being lost when calling SQLExecute etc on ODBC 3 * drivers, the SQLNumResultCols were clearing the error before * function return had a chance to get to them * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLForeignKeys.c,v $ $Revision: 1.7 $"; SQLRETURN SQLForeignKeysA( SQLHSTMT statement_handle, SQLCHAR *szpk_catalog_name, SQLSMALLINT cbpk_catalog_name, SQLCHAR *szpk_schema_name, SQLSMALLINT cbpk_schema_name, SQLCHAR *szpk_table_name, SQLSMALLINT cbpk_table_name, SQLCHAR *szfk_catalog_name, SQLSMALLINT cbfk_catalog_name, SQLCHAR *szfk_schema_name, SQLSMALLINT cbfk_schema_name, SQLCHAR *szfk_table_name, SQLSMALLINT cbfk_table_name ) { return SQLForeignKeys( statement_handle, szpk_catalog_name, cbpk_catalog_name, szpk_schema_name, cbpk_schema_name, szpk_table_name, cbpk_table_name, szfk_catalog_name, cbfk_catalog_name, szfk_schema_name, cbfk_schema_name, szfk_table_name, cbfk_table_name ); } SQLRETURN SQLForeignKeys( SQLHSTMT statement_handle, SQLCHAR *szpk_catalog_name, SQLSMALLINT cbpk_catalog_name, SQLCHAR *szpk_schema_name, SQLSMALLINT cbpk_schema_name, SQLCHAR *szpk_table_name, SQLSMALLINT cbpk_table_name, SQLCHAR *szfk_catalog_name, SQLSMALLINT cbfk_catalog_name, SQLCHAR *szfk_schema_name, SQLSMALLINT cbfk_schema_name, SQLCHAR *szfk_table_name, SQLSMALLINT cbfk_table_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s5[ 100 + LOG_MESSAGE_LEN ], s6[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tPK Catalog Name = %s\ \n\t\t\tPK Schema Name = %s\ \n\t\t\tPK Table Name = %s\ \n\t\t\tFK Catalog Name = %s\ \n\t\t\tFK Schema Name = %s\ \n\t\t\tFK Table Name = %s", statement, __string_with_length( s1, szpk_catalog_name, cbpk_catalog_name ), __string_with_length( s2, szpk_schema_name, cbpk_schema_name ), __string_with_length( s3, szpk_table_name, cbpk_table_name ), __string_with_length( s4, szfk_catalog_name, cbfk_catalog_name ), __string_with_length( s5, szfk_schema_name, cbfk_schema_name ), __string_with_length( s6, szfk_table_name, cbfk_table_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( !szpk_table_name && !szfk_table_name ) { __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (( cbpk_catalog_name < 0 && cbpk_catalog_name != SQL_NTS ) || ( cbpk_schema_name < 0 && cbpk_schema_name != SQL_NTS ) || ( cbpk_table_name < 0 && cbpk_table_name != SQL_NTS ) || ( cbfk_catalog_name < 0 && cbfk_catalog_name != SQL_NTS ) || ( cbfk_schema_name < 0 && cbfk_schema_name != SQL_NTS ) || ( cbfk_table_name < 0 && cbfk_table_name != SQL_NTS )) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLFOREIGNKEYS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3, *s4, *s5, *s6; int wlen; if ( !CHECK_SQLFOREIGNKEYSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( szpk_catalog_name, cbpk_catalog_name, statement -> connection, &wlen ); cbpk_catalog_name = wlen; s2 = ansi_to_unicode_alloc( szpk_schema_name, cbpk_schema_name, statement -> connection, &wlen ); cbpk_schema_name = wlen; s3 = ansi_to_unicode_alloc( szpk_table_name, cbpk_table_name, statement -> connection, &wlen ); cbpk_table_name = wlen; s4 = ansi_to_unicode_alloc( szfk_catalog_name, cbfk_catalog_name, statement -> connection, &wlen ); cbfk_catalog_name = wlen; s5 = ansi_to_unicode_alloc( szfk_schema_name, cbfk_schema_name, statement -> connection, &wlen ); cbfk_schema_name = wlen; s6 = ansi_to_unicode_alloc( szfk_table_name, cbfk_table_name, statement -> connection, &wlen ); cbfk_table_name = wlen; ret = SQLFOREIGNKEYSW( statement -> connection , statement -> driver_stmt, s1, cbpk_catalog_name, s2, cbpk_schema_name, s3, cbpk_table_name, s4, cbfk_catalog_name, s5, cbfk_schema_name, s6, cbfk_table_name ); if ( s1 ) free( s1 ); if ( s2 ) free( s2 ); if ( s3 ) free( s3 ); if ( s4 ) free( s4 ); if ( s5 ) free( s5 ); if ( s6 ) free( s6 ); } else { if ( !CHECK_SQLFOREIGNKEYS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLFOREIGNKEYS( statement -> connection , statement -> driver_stmt, szpk_catalog_name, cbpk_catalog_name, szpk_schema_name, cbpk_schema_name, szpk_table_name, cbpk_table_name, szfk_catalog_name, cbfk_catalog_name, szfk_schema_name, cbfk_schema_name, szfk_table_name, cbfk_table_name ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLFOREIGNKEYS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLGetDescRecW.c0000644000175000017500000002613213303466667015454 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDescRecW.c,v 1.11 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetDescRecW.c,v $ * Revision 1.11 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.10 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.9 2007/04/02 10:50:19 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.8 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.7 2004/11/22 17:02:49 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/04 13:16:25 nick * * Add support for GNU portable threads and tidy up some UNICODE compile * warnings * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetDescRecW.c,v $"; SQLRETURN SQLGetDescRecW( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLWCHAR *name, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLSMALLINT *type, SQLSMALLINT *sub_type, SQLLEN *length, SQLSMALLINT *precision, SQLSMALLINT *scale, SQLSMALLINT *nullable ) { /* * not quite sure how the descriptor can be * allocated to a statement, all the documentation talks * about state transitions on statement states, but the * descriptor may be allocated with more than one statement * at one time. Which one should I check ? */ DMHDESC descriptor = (DMHDESC) descriptor_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s5[ 100 + LOG_MESSAGE_LEN ], s6[ 100 + LOG_MESSAGE_LEN ], s7[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s8[ 100 + LOG_MESSAGE_LEN ]; /* * check descriptor */ if ( !__validate_desc( descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDESC parent_desc; parent_desc = find_parent_handle( descriptor, SQL_HANDLE_DESC ); if ( parent_desc ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETDESCRECW( parent_desc -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETDESCRECW( parent_desc -> connection, descriptor, rec_number, name, buffer_length, string_length, type, sub_type, length, precision, scale, nullable ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( descriptor ); if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tEntry:\ \n\t\t\tDescriptor = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tName = %p\ \n\t\t\tBuffer length = %d\ \n\t\t\tString Length = %p\ \n\t\t\tType = %p\ \n\t\t\tSub Type = %p\ \n\t\t\tLength = %p\ \n\t\t\tPrecision = %p\ \n\t\t\tScale = %p\ \n\t\t\tNullable = %p", descriptor, rec_number, name, buffer_length, string_length, type, sub_type, length, precision, scale, nullable ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } thread_protect( SQL_HANDLE_DESC, descriptor ); /* * check status of statements associated with this descriptor */ if( __check_stmt_from_desc( descriptor, STATE_S8 ) || __check_stmt_from_desc( descriptor, STATE_S9 ) || __check_stmt_from_desc( descriptor, STATE_S10 ) || __check_stmt_from_desc( descriptor, STATE_S11 ) || __check_stmt_from_desc( descriptor, STATE_S12 ) || __check_stmt_from_desc( descriptor, STATE_S13 ) || __check_stmt_from_desc( descriptor, STATE_S14 ) || __check_stmt_from_desc( descriptor, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if( __check_stmt_from_desc_ird( descriptor, STATE_S1 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY007" ); __post_internal_error( &descriptor -> error, ERROR_HY007, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( descriptor -> connection -> unicode_driver || CHECK_SQLGETDESCRECW( descriptor -> connection )) { if ( !CHECK_SQLGETDESCRECW( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } ret = SQLGETDESCRECW( descriptor -> connection, descriptor -> driver_desc, rec_number, name, buffer_length, string_length, type, sub_type, length, precision, scale, nullable ); } else { SQLCHAR *as1 = NULL; if ( !CHECK_SQLGETDESCREC( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( name && buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } ret = SQLGETDESCREC( descriptor -> connection, descriptor -> driver_desc, rec_number, as1 ? as1 : (SQLCHAR*) name, buffer_length, string_length, type, sub_type, length, precision, scale, nullable ); if ( SQL_SUCCEEDED( ret ) && name && as1 ) { ansi_to_unicode_copy( name, (char*) as1, SQL_NTS, descriptor -> connection, NULL ); } if ( as1 ) { free( as1 ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length *= sizeof( SQLWCHAR ); } } if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tExit:[%s]\ \n\t\t\tName = %s\ \n\t\t\tType = %s\ \n\t\t\tSub Type = %s\ \n\t\t\tLength = %s\ \n\t\t\tPrecision = %s\ \n\t\t\tScale = %s\ \n\t\t\tNullable = %s", __get_return_status( ret, s8 ), __sdata_as_string( s1, SQL_WCHAR, string_length, name ), __sptr_as_string( s2, type ), __sptr_as_string( s3, sub_type ), __ptr_as_string( s4, length ), __sptr_as_string( s5, precision ), __sptr_as_string( s6, scale ), __sptr_as_string( s7, nullable )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } return function_return( SQL_HANDLE_DESC, descriptor, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetStmtOption.c0000644000175000017500000002275313364072343016131 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetStmtOption.c,v 1.4 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetStmtOption.c,v $ * Revision 1.4 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.4 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetStmtOption.c,v $ $Revision: 1.4 $"; SQLRETURN SQLGetStmtOption( SQLHSTMT statement_handle, SQLUSMALLINT option, SQLPOINTER value ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tOption = %s\ \n\t\t\tValue = %p", statement, __stmt_attr_as_string( s1, option ), value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( option == SQL_ROW_NUMBER || option == SQL_GET_BOOKMARK ) { if (( statement -> state >= STATE_S1 && statement -> state <= STATE_S5 ) || (( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) && statement -> eod )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * states S5 - S7 are handled by the driver */ if ( CHECK_SQLGETSTMTOPTION( statement -> connection )) { ret = SQLGETSTMTOPTION( statement -> connection, statement -> driver_stmt, option, value ); } else if ( CHECK_SQLGETSTMTATTR( statement -> connection )) { switch ( option ) { case SQL_ATTR_APP_PARAM_DESC: if ( value ) memcpy( value, &statement -> apd, sizeof( statement -> apd )); ret = SQL_SUCCESS; break; case SQL_ATTR_APP_ROW_DESC: if ( value ) memcpy( value, &statement -> ard, sizeof( statement -> ard )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_PARAM_DESC: if ( value ) memcpy( value, &statement -> ipd, sizeof( statement -> ipd )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_ROW_DESC: if ( value ) memcpy( value, &statement -> ird, sizeof( statement -> ird )); ret = SQL_SUCCESS; break; default: ret = SQLGETSTMTATTR( statement -> connection, statement -> driver_stmt, option, value, SQL_MAX_OPTION_STRING_LENGTH, NULL ); break; } } else if ( CHECK_SQLGETSTMTATTRW( statement -> connection )) { switch ( option ) { case SQL_ATTR_APP_PARAM_DESC: if ( value ) memcpy( value, &statement -> apd, sizeof( statement -> apd )); ret = SQL_SUCCESS; break; case SQL_ATTR_APP_ROW_DESC: if ( value ) memcpy( value, &statement -> ard, sizeof( statement -> ard )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_PARAM_DESC: if ( value ) memcpy( value, &statement -> ipd, sizeof( statement -> ipd )); ret = SQL_SUCCESS; break; case SQL_ATTR_IMP_ROW_DESC: if ( value ) memcpy( value, &statement -> ird, sizeof( statement -> ird )); ret = SQL_SUCCESS; break; default: ret = SQLGETSTMTATTRW( statement -> connection, statement -> driver_stmt, option, value, SQL_MAX_OPTION_STRING_LENGTH, NULL ); break; } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLExecDirectW.c0000644000175000017500000003266713364070732015524 00000000000000/********************************************************************* * * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLExecDirectW.c,v 1.10 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLExecDirectW.c,v $ * Revision 1.10 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.9 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.8 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.7 2006/04/11 10:22:56 lurcher * Fix a data type check * * Revision 1.6 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2002/01/15 14:47:44 lurcher * * Reset stmt->prepared flag after entering a SQLParamData state from * SQLExecDirect * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/04 13:16:25 nick * * Add support for GNU portable threads and tidy up some UNICODE compile * warnings * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLExecDirectW.c,v $"; SQLRETURN SQLExecDirectW( SQLHSTMT statement_handle, SQLWCHAR *statement_text, SQLINTEGER text_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR *s1; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLEXECDIRECTW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLEXECDIRECTW( parent_statement -> connection, statement, statement_text, text_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { /* * allocate some space for the buffer */ if ( statement_text && text_length == SQL_NTS ) { s1 = malloc( wide_strlen( statement_text ) * 2 + LOG_MESSAGE_LEN * 2 ); } else if ( statement_text ) { s1 = malloc( text_length + LOG_MESSAGE_LEN * 2 ); } else { s1 = malloc( LOG_MESSAGE_LEN * 2 ); } sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tSQL = %s", statement, __wstring_with_length( s1, statement_text, text_length )); free( s1 ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( !statement_text ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( text_length <= 0 && text_length != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLEXECDIRECT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver || CHECK_SQLEXECDIRECTW( statement -> connection )) { #ifdef NR_PROBE if ( !CHECK_SQLEXECDIRECTW( statement -> connection ) || !CHECK_SQLNUMRESULTCOLS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } #else if ( !CHECK_SQLEXECDIRECTW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } #endif ret = SQLEXECDIRECTW( statement -> connection, statement -> driver_stmt, statement_text, text_length ); } else { SQLCHAR *as1 = NULL; int clen; #ifdef NR_PROBE if ( !CHECK_SQLEXECDIRECT( statement -> connection ) || !CHECK_SQLNUMRESULTCOLS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } #else if ( !CHECK_SQLEXECDIRECT( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } #endif as1 = (SQLCHAR*) unicode_to_ansi_alloc( statement_text, text_length, statement -> connection, &clen ); text_length = clen; ret = SQLEXECDIRECT( statement -> connection, statement -> driver_stmt, as1, text_length ); if ( as1 ) free( as1 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE SQLRETURN local_ret; /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } local_ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); if ( statement -> numcols > 0 ) { statement -> state = STATE_S5; } else { statement -> state = STATE_S4; } #else /* * We don't know for sure */ statement -> hascols = 1; statement -> state = STATE_S5; #endif statement -> prepared = 0; /* * there is a issue here with transactions, but for the * moment * statement -> connection -> state = STATE_C6; */ } else if ( ret == SQL_NO_DATA ) { statement -> state = STATE_S4; statement -> prepared = 0; } else if ( ret == SQL_NEED_DATA ) { statement -> interupted_func = SQL_API_SQLEXECDIRECT; statement -> interupted_state = statement -> state; statement -> state = STATE_S8; statement -> prepared = 0; } else if ( ret == SQL_PARAM_DATA_AVAILABLE ) { statement -> interupted_func = SQL_API_SQLEXECDIRECT; statement -> interupted_state = statement -> state; statement -> state = STATE_S13; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLEXECDIRECT; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; statement -> prepared = 0; } else if (( statement -> state >= STATE_S2 && statement -> state <= STATE_S4 ) || ( statement -> state >= STATE_S11 && statement -> state <= STATE_S12 && statement -> interupted_state >= STATE_S2 && statement -> interupted_state <= STATE_S4 )) { statement -> state = STATE_S1; } else if ( statement -> state >= STATE_S11 && statement -> state <= STATE_S12 ) { statement -> state = statement -> interupted_state; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s2 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLBrowseConnect.c0000644000175000017500000005054113364067331016121 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBrowseConnect.c,v 1.15 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLBrowseConnect.c,v $ * Revision 1.15 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.14 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.13 2007/10/19 10:14:05 lurcher * Pull errors from SQLBrowseConnect when it returns SQL_NEED_DATA * * Revision 1.12 2005/11/21 17:25:43 lurcher * A few DM fixes for Oracle's ODBC driver * * Revision 1.11 2005/10/06 08:50:58 lurcher * Fix problem with SQLDrivers not returning first entry * * Revision 1.10 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.9 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.8 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.7 2002/08/15 08:10:33 lurcher * * Couple of small fixes from John L Miller * * Revision 1.6 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.5 2002/02/08 17:59:40 lurcher * * Fix threading problem in SQLBrowseConnect * * Revision 1.4 2002/02/07 20:50:04 lurcher * * Fix small bug in SQLBrowseConnect * * Revision 1.3 2002/01/21 18:00:50 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:31 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.9 2001/07/20 12:35:09 nick * * Fix SQLBrowseConnect operation * * Revision 1.8 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.7 2001/05/15 10:57:44 nick * * Add initial support for VMS * * Revision 1.6 2001/04/16 22:35:10 nick * * More tweeks to the AutoTest code * * Revision 1.5 2001/04/16 15:41:24 nick * * Fix some problems calling non existing error funcs * * Revision 1.4 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.2 2000/10/13 15:18:49 nick * * Change string length parameter from SQLINTEGER to SQLSMALLINT * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 2000/05/21 21:49:19 ngorham * * Assorted fixes * * Revision 1.7 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/08/03 21:47:39 shandyb * Moving to automake: changed files in DriverManager * * Revision 1.3 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.2 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLBrowseConnect.c,v $ $Revision: 1.15 $"; #define BUFFER_LEN 4095 SQLRETURN SQLBrowseConnectA( SQLHDBC hdbc, SQLCHAR *conn_str_in, SQLSMALLINT len_conn_str_in, SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, SQLSMALLINT *ptr_conn_str_out ) { return SQLBrowseConnect( hdbc, conn_str_in, len_conn_str_in, conn_str_out, conn_str_out_max, ptr_conn_str_out ); } SQLRETURN SQLBrowseConnect( SQLHDBC hdbc, SQLCHAR *conn_str_in, SQLSMALLINT len_conn_str_in, SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, SQLSMALLINT *ptr_conn_str_out ) { DMHDBC connection = (DMHDBC) hdbc; struct con_struct con_struct; char *driver, *dsn; char lib_name[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver_name[ INI_MAX_PROPERTY_VALUE + 1 ]; char in_str_buf[ BUFFER_LEN ]; char *in_str; SQLSMALLINT in_str_len; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN]; int warnings = 0; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tStr In = %s\ \n\t\t\tStr Out = %p\ \n\t\t\tStr Out Max = %d\ \n\t\t\tPtr Conn Str Out = %p", connection, __string_with_length( s1, conn_str_in, len_conn_str_in ), conn_str_out, conn_str_out_max, ptr_conn_str_out ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } /* * check the state of the connection */ if ( connection -> state == STATE_C4 || connection -> state == STATE_C5 || connection -> state == STATE_C6 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( IGNORE_THREAD, connection, SQL_ERROR ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( len_conn_str_in < 0 && len_conn_str_in != SQL_NTS) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * are we at the start of a connection */ if ( connection -> state == STATE_C2 ) { /* * parse the connection string */ __parse_connection_string( &con_struct, (char*)conn_str_in, len_conn_str_in ); /* * look for some keywords * have we got a DRIVER= attribute */ driver = __get_attribute_value( &con_struct, "DRIVER" ); if ( driver ) { /* * look up the driver in the ini file */ SQLGetPrivateProfileString( driver, "Driver", "", lib_name, sizeof( lib_name ), "ODBCINST.INI" ); if ( lib_name[ 0 ] == '\0' ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } strcpy( connection -> dsn, "" ); } else { dsn = __get_attribute_value( &con_struct, "DSN" ); if ( !dsn ) { dsn = "DEFAULT"; __append_pair( &con_struct, "DSN", "DEFAULT" ); } if ( strlen( dsn ) > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM012" ); __post_internal_error( &connection -> error, ERROR_IM012, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * look up the dsn in the ini file */ if ( !__find_lib_name( dsn, lib_name, driver_name )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } strcpy( connection -> dsn, dsn ); } __generate_connection_string( &con_struct, in_str_buf, sizeof( in_str_buf )); __release_conn( &con_struct ); /* * we now have a driver to connect to */ if ( !__connect_part_one( connection, lib_name, driver_name, &warnings )) { __disconnect_part_four( connection ); /* release unicode handles */ dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: connect_part_one fails" ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( !CHECK_SQLBROWSECONNECTW( connection ) && !CHECK_SQLBROWSECONNECT( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } in_str = in_str_buf; in_str_len = strlen(in_str); } else { in_str = (char*)conn_str_in; in_str_len = len_conn_str_in == SQL_NTS ? strlen(in_str) : len_conn_str_in; } if (CHECK_SQLBROWSECONNECT( connection )) { ret = SQLBROWSECONNECT( connection, connection -> driver_dbc, in_str, in_str_len, conn_str_out, conn_str_out_max, ptr_conn_str_out ); connection->unicode_driver = 0; } else if (CHECK_SQLBROWSECONNECTW( connection )) { int wlen; SQLWCHAR *uc_in_str = ansi_to_unicode_alloc((SQLCHAR*)in_str,SQL_NTS,connection, &wlen); SQLWCHAR *uc_out_str = conn_str_out ? malloc( (conn_str_out_max + 1) * sizeof(SQLWCHAR) ) : 0; ret = SQLBROWSECONNECTW( connection, connection -> driver_dbc, uc_in_str, wlen, uc_out_str, conn_str_out_max, ptr_conn_str_out ); if(uc_in_str) free(uc_in_str); if(uc_out_str) { unicode_to_ansi_copy((char*) conn_str_out, conn_str_out_max, uc_out_str, SQL_NTS, connection, NULL ); if (*ptr_conn_str_out < conn_str_out_max) *ptr_conn_str_out = strlen((char*)conn_str_out); free(uc_out_str); } connection->unicode_driver = 1; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( !SQL_SUCCEEDED( ret ) || ret == SQL_NEED_DATA ) { /* * get the error from the driver before * losing the connection */ if ( connection -> unicode_driver ) { if ( CHECK_SQLGETDIAGFIELDW( connection ) && CHECK_SQLGETDIAGRECW( connection )) { extract_diag_error_w( SQL_HANDLE_DBC, connection -> driver_dbc, connection, &connection -> error, ret, 1 ); } else if ( CHECK_SQLERRORW( connection )) { extract_sql_error_w( SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, connection, &connection -> error, ret ); } else if ( CHECK_SQLGETDIAGFIELD( connection ) && CHECK_SQLGETDIAGREC( connection )) { extract_diag_error( SQL_HANDLE_DBC, connection -> driver_dbc, connection, &connection -> error, ret, 1 ); } else if ( CHECK_SQLERROR( connection )) { extract_sql_error( SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, connection, &connection -> error, ret ); } else { __post_internal_error( &connection -> error, ERROR_HY000, "Driver returned SQL_ERROR or SQL_SUCCESS_WITH_INFO but no error reporting API found", connection -> environment -> requested_version ); } } else { if ( CHECK_SQLGETDIAGFIELD( connection ) && CHECK_SQLGETDIAGREC( connection )) { extract_diag_error( SQL_HANDLE_DBC, connection -> driver_dbc, connection, &connection -> error, ret, 1 ); } else if ( CHECK_SQLERROR( connection )) { extract_sql_error( SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, connection, &connection -> error, ret ); } else if ( CHECK_SQLGETDIAGFIELDW( connection ) && CHECK_SQLGETDIAGRECW( connection )) { extract_diag_error_w( SQL_HANDLE_DBC, connection -> driver_dbc, connection, &connection -> error, ret, 1 ); } else if ( CHECK_SQLERRORW( connection )) { extract_sql_error_w( SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, connection, &connection -> error, ret ); } else { __post_internal_error( &connection -> error, ERROR_HY000, "Driver returned SQL_ERROR or SQL_SUCCESS_WITH_INFO but no error reporting API found", connection -> environment -> requested_version ); } } if ( ret != SQL_NEED_DATA ) { /* If an error occurred during SQLBrowseConnect, we need to keep the connection in the same state (C2 or C3). This allows the application to either try the SQLBrowseConnect again, or disconnect an active browse session with SQLDisconnect. Otherwise the driver may continue to have an active connection while the DM thinks it does not, causing more errors later on. */ if ( connection -> state == STATE_C2 ) { /* only disconnect and unload if we never started browsing */ __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles - also sets state to C2 */ } } else { connection -> state = STATE_C3; } } else { /* * we should be connected now */ connection -> state = STATE_C4; if( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, connection, ret, TRUE, DEFER_R0 ); } if ( !__connect_part_two( connection )) { __disconnect_part_two( connection ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tconnect_part_two fails", __get_return_status( SQL_ERROR, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tPtr Conn Str Out = %s", __get_return_status( ret, s2 ), __sptr_as_string( s1, ptr_conn_str_out )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } if ( warnings && ret == SQL_SUCCESS ) { ret = SQL_SUCCESS_WITH_INFO; } return function_return_nodrv( SQL_HANDLE_DBC, connection, ret ); } unixODBC-2.3.9/DriverManager/SQLProceduresW.c0000644000175000017500000002566413303466667015630 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLProceduresW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLProceduresW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLProceduresW.c,v $ $Revision: 1.9 $"; SQLRETURN SQLProceduresW( SQLHSTMT statement_handle, SQLWCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLWCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLWCHAR *sz_proc_name, SQLSMALLINT cb_proc_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLPROCEDURESW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLPROCEDURESW( parent_statement -> connection, statement_handle, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tProc Name = %s", statement, __wstring_with_length( s1, sz_catalog_name, cb_catalog_name ), __wstring_with_length( s2, sz_schema_name, cb_schema_name ), __wstring_with_length( s3, sz_proc_name, cb_proc_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( cb_catalog_name < 0 && cb_catalog_name != SQL_NTS ) || ( cb_schema_name < 0 && cb_schema_name != SQL_NTS ) || ( cb_proc_name < 0 && cb_proc_name != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPROCEDURES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLPROCEDURESW( statement -> connection )) { if ( !CHECK_SQLPROCEDURESW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPROCEDURESW( statement -> connection , statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name ); } else { SQLCHAR *as1, *as2, *as3; int clen; if ( !CHECK_SQLPROCEDURES( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( sz_catalog_name, cb_catalog_name, statement -> connection, &clen ); cb_catalog_name = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( sz_schema_name, cb_schema_name, statement -> connection, &clen ); cb_schema_name = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( sz_proc_name, cb_proc_name, statement -> connection, &clen ); cb_proc_name = clen; ret = SQLPROCEDURES( statement -> connection , statement -> driver_stmt, as1, cb_catalog_name, as2, cb_schema_name, as3, cb_proc_name ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPROCEDURES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLMoreResults.c0000644000175000017500000002253313303466667015642 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLMoreResults.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLMoreResults.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2006/03/08 09:18:41 lurcher * fix silly typo that was using sizeof( SQL_WCHAR ) instead of SQLWCHAR * * Revision 1.6 2003/12/19 16:25:38 lurcher * * Fix incorrect state in SQLMoreResults.c * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/01/27 15:01:01 lurcher * * On error from SQLMoreResults DONT change to S1 * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/08/15 08:10:33 lurcher * * Couple of small fixes from John L Miller * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 2000/06/20 12:44:00 ngorham * * Fix bug that caused a success with info message from SQLExecute or * SQLExecDirect to be lost if used with a ODBC 3 driver and the application * called SQLGetDiagRec * * Revision 1.8 2000/06/16 16:52:18 ngorham * * Stop info messages being lost when calling SQLExecute etc on ODBC 3 * drivers, the SQLNumResultCols were clearing the error before * function return had a chance to get to them * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLMoreResults.c,v $ $Revision: 1.8 $"; SQLRETURN SQLMoreResults( SQLHSTMT statement_handle ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p", statement ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S1 || /* statement -> state == STATE_S2 || */ statement -> state == STATE_S3 ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_NO_DATA, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_NO_DATA ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLMORERESULTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } #ifdef NR_PROBE if ( !CHECK_SQLMORERESULTS( statement -> connection ) || !CHECK_SQLNUMRESULTCOLS( statement -> connection )) #else if ( !CHECK_SQLMORERESULTS( statement -> connection )) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLMORERESULTS( statement -> connection , statement -> driver_stmt ); if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R3 ); } SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); if ( statement -> numcols == 0 ) { statement -> state = STATE_S4; } else { statement -> state = STATE_S5; } #else /* * We don't know for sure */ statement -> hascols = 0; statement -> state = STATE_S5; #endif } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLEXECUTE; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( ret == SQL_NO_DATA ) { if ( statement -> prepared ) { if ( statement -> state == STATE_S4 ) { statement -> state = STATE_S2; } else { statement -> state = STATE_S3; } } else { statement -> state = STATE_S1; } } else if ( ret == SQL_NEED_DATA ) { statement -> interupted_func = SQL_API_SQLMORERESULTS; statement -> interupted_state = statement -> state; statement -> state = STATE_S8; } else if ( ret == SQL_PARAM_DATA_AVAILABLE ) { statement -> interupted_func = SQL_API_SQLMORERESULTS; statement -> interupted_state = statement -> state; statement -> state = STATE_S13; } else { /* * Leave the state where it is */ } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetCursorNameW.c0000644000175000017500000002141213303466667016216 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetCursorNameW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetCursorNameW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/04 13:16:25 nick * * Add support for GNU portable threads and tidy up some UNICODE compile * warnings * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetCursorNameW.c,v $"; SQLRETURN SQLGetCursorNameW( SQLHSTMT statement_handle, SQLWCHAR *cursor_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETCURSORNAMEW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETCURSORNAMEW( parent_statement -> connection, statement_handle, cursor_name, buffer_length, name_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCursor Name = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tName Length= %p", statement, cursor_name, buffer_length, name_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( buffer_length < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> connection -> unicode_driver || CHECK_SQLGETCURSORNAMEW( statement -> connection )) { if ( !CHECK_SQLGETCURSORNAMEW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLGETCURSORNAMEW( statement -> connection, statement -> driver_stmt, cursor_name, buffer_length, name_length ); } else { SQLCHAR *as1 = NULL; if ( !CHECK_SQLGETCURSORNAME( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( cursor_name && buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } ret = SQLGETCURSORNAME( statement -> connection, statement -> driver_stmt, as1 ? as1 : (SQLCHAR*) cursor_name, buffer_length, name_length ); if ( SQL_SUCCEEDED( ret ) && cursor_name && as1 ) { ansi_to_unicode_copy( cursor_name, (char*) as1, SQL_NTS, statement -> connection, NULL ); } if ( as1 ) { free( as1 ); } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tCursor Name = %s", __get_return_status( ret, s1 ), __sdata_as_string( s1, SQL_WCHAR, name_length, cursor_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetDescFieldW.c0000644000175000017500000003012613303466667015764 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDescFieldW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetDescFieldW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/11/22 17:02:49 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/17 16:29:39 nick * * More checks and autotest fixes * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetDescFieldW.c,v $"; SQLRETURN SQLGetDescFieldW( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { /* * not quite sure how the descriptor can be * allocated to a statement, all the documentation talks * about state transitions on statement states, but the * descriptor may be allocated with more than one statement * at one time. Which one should I check ? */ DMHDESC descriptor = (DMHDESC) descriptor_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; int isStrField = 0; /* * check descriptor */ if ( !__validate_desc( descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDESC parent_desc; parent_desc = find_parent_handle( descriptor, SQL_HANDLE_DESC ); if ( parent_desc ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETDESCFIELDW( parent_desc -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETDESCFIELDW( parent_desc -> connection, descriptor, rec_number, field_identifier, value, buffer_length, string_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( descriptor ); if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tEntry:\ \n\t\t\tDescriptor = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tField Attr = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen = %p", descriptor, rec_number, __desc_attr_as_string( s1, field_identifier ), value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } thread_protect( SQL_HANDLE_DESC, descriptor ); if ( descriptor -> connection -> state < STATE_C4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } /* * check status of statements associated with this descriptor */ if( __check_stmt_from_desc( descriptor, STATE_S8 ) || __check_stmt_from_desc( descriptor, STATE_S9 ) || __check_stmt_from_desc( descriptor, STATE_S10 ) || __check_stmt_from_desc( descriptor, STATE_S11 ) || __check_stmt_from_desc( descriptor, STATE_S12 ) || __check_stmt_from_desc( descriptor, STATE_S13 ) || __check_stmt_from_desc( descriptor, STATE_S14 ) || __check_stmt_from_desc( descriptor, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if( __check_stmt_from_desc_ird( descriptor, STATE_S1 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY007" ); __post_internal_error( &descriptor -> error, ERROR_HY007, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( rec_number < 0 ) { __post_internal_error( &descriptor -> error, ERROR_07009, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } switch ( field_identifier ) { /* Fixed-length fields: buffer_length is ignored */ case SQL_DESC_ALLOC_TYPE: case SQL_DESC_ARRAY_SIZE: case SQL_DESC_ARRAY_STATUS_PTR: case SQL_DESC_BIND_OFFSET_PTR: case SQL_DESC_BIND_TYPE: case SQL_DESC_COUNT: case SQL_DESC_ROWS_PROCESSED_PTR: case SQL_DESC_AUTO_UNIQUE_VALUE: case SQL_DESC_CASE_SENSITIVE: case SQL_DESC_CONCISE_TYPE: case SQL_DESC_DATA_PTR: case SQL_DESC_DATETIME_INTERVAL_CODE: case SQL_DESC_DATETIME_INTERVAL_PRECISION: case SQL_DESC_DISPLAY_SIZE: case SQL_DESC_FIXED_PREC_SCALE: case SQL_DESC_INDICATOR_PTR: case SQL_DESC_LENGTH: case SQL_DESC_NULLABLE: case SQL_DESC_NUM_PREC_RADIX: case SQL_DESC_OCTET_LENGTH: case SQL_DESC_OCTET_LENGTH_PTR: case SQL_DESC_PARAMETER_TYPE: case SQL_DESC_PRECISION: case SQL_DESC_ROWVER: case SQL_DESC_SCALE: case SQL_DESC_SEARCHABLE: case SQL_DESC_TYPE: case SQL_DESC_UNNAMED: case SQL_DESC_UNSIGNED: case SQL_DESC_UPDATABLE: isStrField = 0; break; /* Pointer to data: buffer_length must be valid */ case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: isStrField = 1; break; default: isStrField = buffer_length != SQL_IS_POINTER && buffer_length != SQL_IS_INTEGER && buffer_length != SQL_IS_UINTEGER && buffer_length != SQL_IS_SMALLINT && buffer_length != SQL_IS_USMALLINT; } if ( isStrField && buffer_length < 0 ) { __post_internal_error( &descriptor -> error, ERROR_HY090, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( descriptor -> connection -> unicode_driver || CHECK_SQLGETDESCFIELDW( descriptor -> connection )) { if ( !CHECK_SQLGETDESCFIELDW( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } ret = SQLGETDESCFIELDW( descriptor -> connection, descriptor -> driver_desc, rec_number, field_identifier, value, buffer_length, string_length ); } else { SQLCHAR *as1 = NULL; if ( !CHECK_SQLGETDESCFIELD( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( isStrField && buffer_length > 0 && value ) { as1 = malloc( buffer_length + 1 ); } ret = SQLGETDESCFIELD( descriptor -> connection, descriptor -> driver_desc, rec_number, field_identifier, as1 ? as1 : value, buffer_length, string_length ); if ( isStrField && SQL_SUCCEEDED( ret ) && value ) { if ( as1 && buffer_length > 0) { ansi_to_unicode_copy( value, (char*) as1, SQL_NTS, descriptor -> connection, NULL ); } } if ( as1 ) { free( as1 ); } } if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } return function_return( SQL_HANDLE_DESC, descriptor, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLFreeEnv.c0000755000175000017500000000416113303466667014710 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFreeEnv.c,v 1.2 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLFreeEnv.c,v $ * Revision 1.2 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLFreeEnv.c,v $ $Revision: 1.2 $"; SQLRETURN SQLFreeEnv( SQLHENV environment_handle ) { return __SQLFreeHandle( SQL_HANDLE_ENV, environment_handle ); } unixODBC-2.3.9/DriverManager/SQLExecDirect.c0000644000175000017500000003604613364071107015365 00000000000000/********************************************************************* * * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLExecDirect.c,v 1.11 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLExecDirect.c,v $ * Revision 1.11 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.10 2006/04/11 10:22:56 lurcher * Fix a data type check * * Revision 1.9 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.8 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.7 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.5 2002/07/18 15:21:56 lurcher * * Fix problem with SQLExecute/SQLExecDirect returning SQL_NO_DATA * * Revision 1.4 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.3 2002/01/15 14:47:44 lurcher * * Reset stmt->prepared flag after entering a SQLParamData state from * SQLExecDirect * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/08/17 11:03:35 nick * * Fix final state from SQLExecute if error happens * * Revision 1.4 2001/04/18 15:03:37 nick * * Fix problem when going to DB2 unicode driver * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.11 2000/06/20 12:43:58 ngorham * * Fix bug that caused a success with info message from SQLExecute or * SQLExecDirect to be lost if used with a ODBC 3 driver and the application * called SQLGetDiagRec * * Revision 1.10 2000/06/16 16:52:16 ngorham * * Stop info messages being lost when calling SQLExecute etc on ODBC 3 * drivers, the SQLNumResultCols were clearing the error before * function return had a chance to get to them * * Revision 1.9 1999/11/18 22:42:09 ngorham * * Fix missing function_entry in SQLExecDirect() * * Revision 1.8 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:06 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.5 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 21:40:58 nick * End of another night :-) * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLExecDirect.c,v $ $Revision: 1.11 $"; SQLRETURN SQLExecDirectA( SQLHSTMT statement_handle, SQLCHAR *statement_text, SQLINTEGER text_length ) { return SQLExecDirect( statement_handle, statement_text, text_length ); } SQLRETURN SQLExecDirect( SQLHSTMT statement_handle, SQLCHAR *statement_text, SQLINTEGER text_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR *s1; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { /* * allocate some space for the buffer */ if ( statement_text && text_length == SQL_NTS ) { s1 = malloc( strlen((char*) statement_text ) + LOG_MESSAGE_LEN ); } else if ( statement_text ) { s1 = malloc( text_length + LOG_MESSAGE_LEN ); } else { s1 = malloc( LOG_MESSAGE_LEN ); } sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tSQL = %s", statement, __string_with_length( s1, statement_text, text_length )); free( s1 ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( !statement_text ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( text_length <= 0 && text_length != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLEXECDIRECT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1; int wlen; #ifdef NR_PROBE if ( !CHECK_SQLEXECDIRECTW( statement -> connection ) || !CHECK_SQLNUMRESULTCOLS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } #else if ( !CHECK_SQLEXECDIRECTW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } #endif s1 = ansi_to_unicode_alloc( statement_text, text_length, statement -> connection, &wlen ); text_length = wlen; ret = SQLEXECDIRECTW( statement -> connection, statement -> driver_stmt, s1, text_length ); if ( s1 ) free( s1 ); } else { #ifdef NR_PROBE if ( !CHECK_SQLEXECDIRECT( statement -> connection ) || !CHECK_SQLNUMRESULTCOLS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } #else if ( !CHECK_SQLEXECDIRECT( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } #endif ret = SQLEXECDIRECT( statement -> connection, statement -> driver_stmt, statement_text, text_length ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE SQLRETURN local_ret; /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } local_ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); if ( statement -> numcols > 0 ) { statement -> state = STATE_S5; } else { statement -> state = STATE_S4; } #else /* * We don't know for sure */ statement -> hascols = 1; statement -> state = STATE_S5; #endif statement -> prepared = 0; /* * there is a issue here with transactions, but for the * moment * statement -> connection -> state = STATE_C6; */ } else if ( ret == SQL_NO_DATA ) { statement -> state = STATE_S4; statement -> prepared = 0; } else if ( ret == SQL_NEED_DATA ) { statement -> interupted_func = SQL_API_SQLEXECDIRECT; statement -> interupted_state = statement -> state; statement -> state = STATE_S8; statement -> prepared = 0; } else if ( ret == SQL_PARAM_DATA_AVAILABLE ) { statement -> interupted_func = SQL_API_SQLEXECDIRECT; statement -> interupted_state = statement -> state; statement -> state = STATE_S13; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLEXECDIRECT; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; statement -> prepared = 0; } else if (( statement -> state >= STATE_S2 && statement -> state <= STATE_S4 ) || ( statement -> state >= STATE_S11 && statement -> state <= STATE_S12 && statement -> interupted_state >= STATE_S2 && statement -> interupted_state <= STATE_S4 )) { statement -> state = STATE_S1; } else if ( statement -> state >= STATE_S11 && statement -> state <= STATE_S12 ) { statement -> state = statement -> interupted_state; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s2 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLGetDescField.c0000644000175000017500000003142113303466667015634 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDescField.c,v 1.10 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetDescField.c,v $ * Revision 1.10 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.9 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.8 2006/03/08 09:18:41 lurcher * fix silly typo that was using sizeof( SQL_WCHAR ) instead of SQLWCHAR * * Revision 1.7 2004/11/22 17:02:49 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.4 2001/04/17 16:29:39 nick * * More checks and autotest fixes * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetDescField.c,v $ $Revision: 1.10 $"; SQLRETURN SQLGetDescFieldA( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { return SQLGetDescField( descriptor_handle, rec_number, field_identifier, value, buffer_length, string_length ); } SQLRETURN SQLGetDescField( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { /* * not quite sure how the descriptor can be * allocated to a statement, all the documentation talks * about state transitions on statement states, but the * descriptor may be allocated with more than one statement * at one time. Which one should I check ? */ DMHDESC descriptor = (DMHDESC) descriptor_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; int isStrField = 0; /* * check descriptor */ if ( !__validate_desc( descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( descriptor ); if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tEntry:\ \n\t\t\tDescriptor = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tField Attr = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen = %p", descriptor, rec_number, __desc_attr_as_string( s1, field_identifier ), value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } thread_protect( SQL_HANDLE_DESC, descriptor ); if ( descriptor -> connection -> state < STATE_C4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } /* * check status of statements associated with this descriptor */ if( __check_stmt_from_desc( descriptor, STATE_S8 ) || __check_stmt_from_desc( descriptor, STATE_S9 ) || __check_stmt_from_desc( descriptor, STATE_S10 ) || __check_stmt_from_desc( descriptor, STATE_S11 ) || __check_stmt_from_desc( descriptor, STATE_S12 ) || __check_stmt_from_desc( descriptor, STATE_S13 ) || __check_stmt_from_desc( descriptor, STATE_S14 ) || __check_stmt_from_desc( descriptor, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if( __check_stmt_from_desc_ird( descriptor, STATE_S1 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY007" ); __post_internal_error( &descriptor -> error, ERROR_HY007, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( rec_number < 0 ) { __post_internal_error( &descriptor -> error, ERROR_07009, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } switch ( field_identifier ) { /* Fixed-length fields: buffer_length is ignored */ case SQL_DESC_ALLOC_TYPE: case SQL_DESC_ARRAY_SIZE: case SQL_DESC_ARRAY_STATUS_PTR: case SQL_DESC_BIND_OFFSET_PTR: case SQL_DESC_BIND_TYPE: case SQL_DESC_COUNT: case SQL_DESC_ROWS_PROCESSED_PTR: case SQL_DESC_AUTO_UNIQUE_VALUE: case SQL_DESC_CASE_SENSITIVE: case SQL_DESC_CONCISE_TYPE: case SQL_DESC_DATA_PTR: case SQL_DESC_DATETIME_INTERVAL_CODE: case SQL_DESC_DATETIME_INTERVAL_PRECISION: case SQL_DESC_DISPLAY_SIZE: case SQL_DESC_FIXED_PREC_SCALE: case SQL_DESC_INDICATOR_PTR: case SQL_DESC_LENGTH: case SQL_DESC_NULLABLE: case SQL_DESC_NUM_PREC_RADIX: case SQL_DESC_OCTET_LENGTH: case SQL_DESC_OCTET_LENGTH_PTR: case SQL_DESC_PARAMETER_TYPE: case SQL_DESC_PRECISION: case SQL_DESC_ROWVER: case SQL_DESC_SCALE: case SQL_DESC_SEARCHABLE: case SQL_DESC_TYPE: case SQL_DESC_UNNAMED: case SQL_DESC_UNSIGNED: case SQL_DESC_UPDATABLE: isStrField = 0; break; /* Pointer to data: buffer_length must be valid */ case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: isStrField = 1; break; default: isStrField = buffer_length != SQL_IS_POINTER && buffer_length != SQL_IS_INTEGER && buffer_length != SQL_IS_UINTEGER && buffer_length != SQL_IS_SMALLINT && buffer_length != SQL_IS_USMALLINT; } if ( isStrField && buffer_length < 0 ) { __post_internal_error( &descriptor -> error, ERROR_HY090, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( descriptor -> connection -> unicode_driver ) { SQLWCHAR *s1 = NULL; if ( !CHECK_SQLGETDESCFIELDW( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( isStrField && buffer_length > 0 && value ) { s1 = malloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 )); } ret = SQLGETDESCFIELDW( descriptor -> connection, descriptor -> driver_desc, rec_number, field_identifier, s1 ? s1 : value, s1 ? (sizeof ( SQLWCHAR ) * (buffer_length + 1)) : buffer_length, string_length ); if ( isStrField && SQL_SUCCEEDED( ret ) ) { if ( value && s1 ) { unicode_to_ansi_copy( value, buffer_length, s1, SQL_NTS, descriptor -> connection, NULL ); } } if ( s1 ) { free( s1 ); } } else { if ( !CHECK_SQLGETDESCFIELD( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } ret = SQLGETDESCFIELD( descriptor -> connection, descriptor -> driver_desc, rec_number, field_identifier, value, buffer_length, string_length ); } if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } return function_return( SQL_HANDLE_DESC, descriptor, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/ChangeLog0000755000175000017500000000135412262474474014403 000000000000001999-05-19 Peter Harvey * ALL: Added logging for Top and Bottom of funcs... errors still need to go to log * ALL: numcols now calced for catalog funcs 1999-05-10 Peter Harvey * SQLPrepare: Code, here and elsewhere, dependent upon num result cols being known before execute has been commented out. * SQLConnect: Used to try to search-a-path for DSN but now lets odbcinst do this. 1999-05-09 Nick Gorham * ALL: Total rewrite by Nick. Has much more functionality and compliance. 1999-04-14 Peter Harvey * sqltypes.h: Changed ODBCINT64 to long long 1999-03-30 Peter Harvey * SQLDrivers.c: added unixODBC-2.3.9/DriverManager/SQLColumnPrivileges.c0000644000175000017500000003077413303466667016653 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColumnPrivileges.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLColumnPrivileges.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2005/11/21 17:25:43 lurcher * A few DM fixes for Oracle's ODBC driver * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLColumnPrivileges.c,v $ $Revision: 1.8 $"; SQLRETURN SQLColumnPrivilegesA( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *column_name, SQLSMALLINT name_length4 ) { return SQLColumnPrivileges( statement_handle, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); } SQLRETURN SQLColumnPrivileges( SQLHSTMT statement_handle, SQLCHAR *catalog_name, SQLSMALLINT name_length1, SQLCHAR *schema_name, SQLSMALLINT name_length2, SQLCHAR *table_name, SQLSMALLINT name_length3, SQLCHAR *column_name, SQLSMALLINT name_length4 ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tColumn Name = %s", statement, __string_with_length( s1, catalog_name, name_length1 ), __string_with_length( s2, schema_name, name_length2 ), __string_with_length( s3, table_name, name_length3 ), __string_with_length( s4, column_name, name_length4 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( table_name == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS ) || ( name_length3 < 0 && name_length3 != SQL_NTS ) || ( name_length4 < 0 && name_length4 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLCOLUMNPRIVILEGES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3, *s4; int wlen; if ( !CHECK_SQLCOLUMNPRIVILEGESW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( catalog_name, name_length1, statement -> connection, &wlen ); name_length1 = wlen; s2 = ansi_to_unicode_alloc( schema_name, name_length2, statement -> connection, &wlen ); name_length2 = wlen; s3 = ansi_to_unicode_alloc( table_name, name_length3, statement -> connection, &wlen ); name_length3 = wlen; s4 = ansi_to_unicode_alloc( column_name, name_length4, statement -> connection, &wlen ); name_length4 = wlen; ret = SQLCOLUMNPRIVILEGESW( statement -> connection , statement -> driver_stmt, s1, name_length1, s2, name_length2, s3, name_length3, s4, name_length4 ); if( s1 ) free( s1 ); if( s2 ) free( s2 ); if( s3 ) free( s3 ); if( s4 ) free( s4 ); } else { if ( !CHECK_SQLCOLUMNPRIVILEGES( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLCOLUMNPRIVILEGES( statement -> connection , statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLCOLUMNPRIVILEGES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLSetDescRec.c0000644000175000017500000001424413303466667015342 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetDescRec.c,v 1.4 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetDescRec.c,v $ * Revision 1.4 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.3 2001/04/17 16:29:39 nick * * More checks and autotest fixes * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.5 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetDescRec.c,v $ $Revision: 1.4 $"; SQLRETURN SQLSetDescRec( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT type, SQLSMALLINT subtype, SQLLEN length, SQLSMALLINT precision, SQLSMALLINT scale, SQLPOINTER data, SQLLEN *string_length, SQLLEN *indicator ) { /* * not quite sure how the descriptor can be * allocated to a statement, all the documentation talks * about state transitions on statement states, but the * descriptor may be allocated with more than one statement * at one time. Which one should I check ? */ DMHDESC descriptor = (DMHDESC) descriptor_handle; SQLRETURN ret; /* * check descriptor */ if ( !__validate_desc( descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( descriptor ); thread_protect( SQL_HANDLE_DESC, descriptor ); if ( descriptor -> connection -> state < STATE_C4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } /* * check status of statements associated with this descriptor */ if( __check_stmt_from_desc( descriptor, STATE_S8 ) || __check_stmt_from_desc( descriptor, STATE_S9 ) || __check_stmt_from_desc( descriptor, STATE_S10 ) || __check_stmt_from_desc( descriptor, STATE_S11 ) || __check_stmt_from_desc( descriptor, STATE_S12 ) || __check_stmt_from_desc( descriptor, STATE_S13 ) || __check_stmt_from_desc( descriptor, STATE_S14 ) || __check_stmt_from_desc( descriptor, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( !CHECK_SQLSETDESCREC( descriptor -> connection )) { __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } ret = SQLSETDESCREC( descriptor -> connection, descriptor -> driver_desc, rec_number, type, subtype, length, precision, scale, data, string_length, indicator ); return function_return( SQL_HANDLE_DESC, descriptor, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLError.c0000644000175000017500000003077713364066145014452 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLError.c,v 1.11 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLError.c,v $ * Revision 1.11 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.10 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.9 2008/05/20 13:43:47 lurcher * Vms fixes * * Revision 1.8 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.7 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/11/11 17:10:08 lurcher * * VMS changes * * Revision 1.5 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.4 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/02/27 11:27:14 lurcher * * Fix bug in error reporting * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.4 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2001/01/06 15:00:12 nick * * Fix bug in SQLError introduced with UNICODE * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.14 2000/06/23 16:11:35 ngorham * * Map ODBC 2 SQLSTATE values to ODBC 3 * * Revision 1.13 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.12 1999/11/10 22:15:48 ngorham * * Fix some bugs with the DM and error reporting. * * Revision 1.11 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.10 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.9 1999/10/14 06:49:24 ngorham * * Remove @all_includes@ from Drivers/MiniSQL/Makefile.am * * Revision 1.8 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.7 1999/08/03 21:47:39 shandyb * Moving to automake: changed files in DriverManager * * Revision 1.6 1999/07/15 06:22:33 ngorham * * Fixed spelling mistake * * Revision 1.5 1999/07/14 19:46:04 ngorham * * Fix the error logging when SQLError or SQLGetDiagRec returns SQL_NO_DATA * * Revision 1.4 1999/07/12 19:42:05 ngorham * * Finished off SQLGetDiagField.c and fixed a but that caused SQLError to * fail with Perl and PHP, connect errors were not being returned because * I was checking to the environment being set, they were setting the * statement and the environment. The order of checking has been changed. * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:06 sShandyb * first go at it * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 21:40:58 nick * End of another night :-) * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLError.c,v $ $Revision: 1.11 $"; static SQLRETURN local_extract_sql_error( EHEAD *head, SQLCHAR *sqlstate, SQLINTEGER *native_error, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length, DMHDBC connection ) { ERROR *err; SQLRETURN ret; char *str; if ( sqlstate ) strcpy((char*) sqlstate, "00000" ); if ( head -> sql_error_head.error_count < 1 ) { return SQL_NO_DATA; } err = head -> sql_error_head.error_list_head; head -> sql_error_head.error_list_head = err -> next; /* * is it the last */ if ( head -> sql_error_head.error_list_tail == err ) head -> sql_error_head.error_list_tail = NULL; /* * not empty yet */ if ( head -> sql_error_head.error_list_head ) { head -> sql_error_head.error_list_head -> prev = NULL; } head -> sql_error_head.error_count --; if ( sqlstate ) { unicode_to_ansi_copy((char*) sqlstate, 6, err -> sqlstate, SQL_NTS, connection, NULL ); } str = unicode_to_ansi_alloc( err -> msg, SQL_NTS, connection, NULL ); if ( message_text && buffer_length < strlen( str ) + 1 ) { ret = SQL_SUCCESS_WITH_INFO; } else { ret = SQL_SUCCESS; } if ( message_text ) { if ( ret == SQL_SUCCESS ) { strcpy((char*) message_text, str ); } else { memcpy( message_text, str, buffer_length ); message_text[ buffer_length - 1 ] = '\0'; } } if ( text_length ) { *text_length = strlen( str ); } if ( native_error ) { *native_error = err -> native_error; } /* * clean up */ free( err -> msg ); free( err ); if ( str ) free( str ); /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) __map_error_state( (char *)sqlstate, __get_version( head )); return ret; } SQLRETURN SQLErrorA( SQLHENV environment_handle, SQLHDBC connection_handle, SQLHSTMT statement_handle, SQLCHAR *sqlstate, SQLINTEGER *native_error, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ) { return SQLError( environment_handle, connection_handle, statement_handle, sqlstate, native_error, message_text, buffer_length, text_length ); } SQLRETURN SQLError( SQLHENV environment_handle, SQLHDBC connection_handle, SQLHSTMT statement_handle, SQLCHAR *sqlstate, SQLINTEGER *native_error, SQLCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ) { SQLRETURN ret; SQLCHAR s0[ 32 ], s1[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; DMHENV environment = NULL; DMHDBC connection = NULL; DMHSTMT statement = NULL; void *active_handle = NULL; EHEAD *herror; char *handle_msg; int handle_type; const char *handle_type_ptr; if ( statement_handle ) { statement = ( DMHSTMT ) statement_handle; if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } connection = statement->connection; active_handle = statement; handle_type = SQL_HANDLE_STMT; herror = &statement->error; handle_msg = statement->msg; handle_type_ptr = "Statement"; } else if (connection_handle) { connection = ( DMHDBC ) connection_handle; if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } active_handle = connection; handle_type = SQL_HANDLE_DBC; herror = &connection->error; handle_msg = connection->msg; handle_type_ptr = "Connection"; } else if ( environment_handle ) { environment = ( DMHENV ) environment_handle; if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } active_handle = environment; handle_type = SQL_HANDLE_ENV; herror = &environment->error; handle_msg = environment->msg; handle_type_ptr = "Environment"; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } thread_protect( handle_type, active_handle ); if ( log_info.log_flag ) { sprintf( handle_msg, "\n\t\tEntry:\ \n\t\t\t%s = %p\ \n\t\t\tSQLState = %p\ \n\t\t\tNative = %p\ \n\t\t\tMessage Text = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tText Len Ptr = %p", handle_type_ptr, active_handle, sqlstate, native_error, message_text, buffer_length, text_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } /* * Do diag extraction here if defer flag is set. * Clean the flag after extraction. * The defer flag will not be set for DMHENV in function_return_ex. */ if ( connection && herror->defer_extract ) { extract_error_from_driver( herror, connection, herror->ret_code_deferred, 0 ); herror->defer_extract = 0; herror->ret_code_deferred = 0; } ret = local_extract_sql_error( herror, sqlstate, native_error, message_text, buffer_length, text_length, connection ); if ( log_info.log_flag ) { if ( SQL_SUCCEEDED( ret )) { sprintf( handle_msg, "\n\t\tExit:[%s]\ \n\t\t\tSQLState = %s\ \n\t\t\tNative = %s\ \n\t\t\tMessage Text = %s", __get_return_status( ret, s2 ), sqlstate, __iptr_as_string( s0, native_error ), __sdata_as_string( s1, SQL_CHAR, text_length, message_text )); } else { sprintf( handle_msg, "\n\t\tExit:[%s]", __get_return_status( ret, s2 )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } thread_release( handle_type, active_handle ); return ret; } unixODBC-2.3.9/DriverManager/SQLGetConnectAttrW.c0000644000175000017500000005734413364066323016371 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetConnectAttrW.c,v 1.14 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetConnectAttrW.c,v $ * Revision 1.14 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.13 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.12 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.11 2004/11/22 17:02:48 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.10 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.9 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.8 2002/11/11 17:10:10 lurcher * * VMS changes * * Revision 1.7 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.6 2002/08/12 13:17:52 lurcher * * Replicate the way the MS DM handles loading of driver libs, and allocating * handles in the driver. usage counting in the driver means that dlopen is * only called for the first use, and dlclose for the last. AllocHandle for * the driver environment is only called for the first time per driver * per application environment. * * Revision 1.5 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.4 2002/07/16 13:08:18 lurcher * * Filter attribute values from SQLSetStmtAttr to SQLSetStmtOption to fit * within ODBC 2 * Make DSN's double clickable in ODBCConfig * * Revision 1.3 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.2 2001/12/04 16:46:19 lurcher * * Allow the Unix Domain Socket to be set from the ini file (DSN) * Make the DataManager browser work with drivers that don't support * SQLRowCount * Make the directory selection from odbctest work simplier * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/08/03 15:19:00 nick * * Add changes to set values before connect * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetConnectAttrW.c,v $"; SQLRETURN SQLGetConnectAttrW( SQLHDBC connection_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { DMHDBC connection = (DMHDBC)connection_handle; int type = 0; char *ptr; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * doesn't require a handle */ if ( attribute == SQL_ATTR_TRACE ) { if ( value ) { if ( log_info.log_flag ) { *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON; } else { *((SQLINTEGER*)value) = SQL_OPT_TRACE_OFF; } } return SQL_SUCCESS; } else if ( attribute == SQL_ATTR_TRACEFILE ) { SQLRETURN ret = SQL_SUCCESS; ptr = log_info.log_file_name; if ( ptr ) { int len = strlen( ptr ) * sizeof( SQLWCHAR ); if ( string_length ) { *string_length = len; } if ( value ) { if ( buffer_length > len + sizeof( SQLWCHAR )) { ansi_to_unicode_copy( value, ptr, SQL_NTS, connection, NULL ); } else { ansi_to_unicode_copy( value, ptr, buffer_length - 1, connection, NULL ); ((SQLWCHAR*)value)[( buffer_length - 1 ) / sizeof( SQLWCHAR )] = 0; ret = SQL_SUCCESS_WITH_INFO; } } } else { if ( string_length ) { *string_length = 0; } if ( value ) { if ( buffer_length > 0 ) { ((SQLWCHAR*)value)[ 0 ] = 0; } else { ret = SQL_SUCCESS_WITH_INFO; } } } return ret; } /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen = %p", connection, __con_attr_as_string( s1, attribute ), value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( connection -> state == STATE_C2 ) { switch ( attribute ) { case SQL_ATTR_ACCESS_MODE: case SQL_ATTR_AUTOCOMMIT: case SQL_ATTR_LOGIN_TIMEOUT: case SQL_ATTR_ODBC_CURSORS: case SQL_ATTR_TRACE: case SQL_ATTR_TRACEFILE: case SQL_ATTR_ASYNC_ENABLE: break; case SQL_ATTR_PACKET_SIZE: if ( connection -> packet_size_set ) break; case SQL_ATTR_QUIET_MODE: if ( connection -> quite_mode_set ) break; default: { struct save_attr *sa = connection -> save_attr; while (sa) { if (sa -> attr_type == attribute) { SQLRETURN rc = SQL_SUCCESS; if (sa -> str_len == SQL_NTS || sa -> str_len > 0) { SQLLEN realLen = sa->str_attr ? strlen(sa->str_attr) : 0; if(value && sa->str_attr && buffer_length) { ansi_to_unicode_copy( value, sa->str_attr, buffer_length/sizeof(SQLWCHAR), connection, NULL ); ((SQLCHAR*)value)[buffer_length - 1] = 0; } if(string_length) { *string_length = realLen * sizeof(SQLWCHAR); } if(realLen * sizeof(SQLWCHAR) > buffer_length - 1) { __post_internal_error( &connection -> error, ERROR_01004, NULL, connection -> environment -> requested_version ); rc = SQL_SUCCESS_WITH_INFO; } } else if(buffer_length >= sizeof(SQLLEN)) { *(SQLLEN*)value = sa -> intptr_attr; if(string_length) { *string_length = sizeof(SQLLEN); } } else if(sa -> str_len >= SQL_IS_SMALLINT && sa -> str_len <= SQL_IS_POINTER) { SQLLEN length = 0; switch (sa -> str_len) { case SQL_IS_SMALLINT: *(SQLSMALLINT*)value = sa->intptr_attr; length = sizeof(SQLSMALLINT); break; case SQL_IS_USMALLINT: *(SQLUSMALLINT*)value = sa->intptr_attr; length = sizeof(SQLUSMALLINT); break; case SQL_IS_INTEGER: *(SQLINTEGER*)value = sa->intptr_attr; length = sizeof(SQLINTEGER); break; case SQL_IS_UINTEGER: *(SQLUINTEGER*)value = sa->intptr_attr; length = sizeof(SQLUINTEGER); break; case SQL_IS_POINTER: *(SQLPOINTER**)value = (SQLPOINTER) sa->intptr_attr; length = sizeof(SQLPOINTER); break; } if(string_length) { *string_length = length; } } else { memcpy(value, &sa->intptr_attr, buffer_length); } return function_return_nodrv( SQL_HANDLE_DBC, connection, rc ); } sa = sa -> next; } } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } switch ( attribute ) { case SQL_ATTR_ACCESS_MODE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> access_mode; type = 1; } break; case SQL_ATTR_AUTOCOMMIT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> auto_commit; type = 1; } break; case SQL_ATTR_LOGIN_TIMEOUT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> login_timeout; type = 1; } break; case SQL_ATTR_ODBC_CURSORS: *((SQLULEN*)value) = connection -> cursors; type = 1; break; case SQL_ATTR_TRACE: *((SQLINTEGER*)value) = connection -> trace; type = 1; break; case SQL_ATTR_TRACEFILE: ptr = connection -> tracefile; type = 2; break; case SQL_ATTR_ASYNC_ENABLE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLULEN*)value) = connection -> async_enable; type = 1; } break; case SQL_ATTR_AUTO_IPD: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> auto_ipd; type = 1; } break; case SQL_ATTR_CONNECTION_TIMEOUT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> connection_timeout; type = 1; } break; case SQL_ATTR_METADATA_ID: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> metadata_id; type = 1; } break; case SQL_ATTR_PACKET_SIZE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> packet_size; type = 1; } break; case SQL_ATTR_QUIET_MODE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> quite_mode; type = 1; } break; case SQL_ATTR_TXN_ISOLATION: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> txn_isolation; type = 1; } break; default: break; } /* * if type has been set we have already set the value, * so just return */ if ( type ) { SQLRETURN ret = SQL_SUCCESS; if ( type == 1 ) { if ( string_length ) { *string_length = sizeof( SQLUINTEGER ); } } else { if ( string_length ) { *string_length = strlen( ptr ); } if ( value ) { if ( buffer_length > strlen( ptr ) + 1 ) { strcpy( value, ptr ); } else { memcpy( value, ptr, buffer_length - 1 ); ((char*)value)[ buffer_length - 1 ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } } } sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return_nodrv( SQL_HANDLE_DBC, connection, ret ); } else { SQLRETURN ret = 0; /* * call the driver */ if ( connection -> unicode_driver || CHECK_SQLGETCONNECTATTRW( connection ) || CHECK_SQLGETCONNECTOPTIONW( connection )) { if ( !CHECK_SQLGETCONNECTATTRW( connection )) { if ( CHECK_SQLGETCONNECTOPTIONW( connection )) { /* * Is it in the legal range of values */ if ( attribute < SQL_CONN_DRIVER_MIN && ( attribute > SQL_PACKET_SIZE || attribute < SQL_ACCESS_MODE )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } ret = SQLGETCONNECTOPTIONW( connection, connection -> driver_dbc, attribute, value ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { ret = SQLGETCONNECTATTRW( connection, connection -> driver_dbc, attribute, value, buffer_length, string_length ); } } else { if ( !CHECK_SQLGETCONNECTATTR( connection )) { if (( ret = CHECK_SQLGETCONNECTOPTION( connection ))) { SQLCHAR *as1 = NULL; /* * Is it in the legal range of values */ if ( attribute < SQL_CONN_DRIVER_MIN && ( attribute > SQL_PACKET_SIZE || attribute < SQL_ACCESS_MODE )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &connection -> error, ERROR_HY092, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value && buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } break; } ret = SQLGETCONNECTOPTION( connection, connection -> driver_dbc, attribute, as1 ? as1 : value ); switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value && buffer_length > 0 && as1 ) { ansi_to_unicode_copy( value, (char*) as1, SQL_NTS, connection, NULL ); } if ( as1 ) { free( as1 ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length *= sizeof( SQLWCHAR ); } break; } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { SQLCHAR *as1 = NULL; switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: buffer_length = buffer_length / 2; if ( buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } break; } ret = SQLGETCONNECTATTR( connection, connection -> driver_dbc, attribute, as1 ? as1 : value, buffer_length, string_length ); switch( attribute ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value && buffer_length > 0 && as1 ) { ansi_to_unicode_copy( value, (char*)as1, SQL_NTS, connection, NULL ); } if ( as1 ) { free( as1 ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length *= sizeof( SQLWCHAR ); } break; } } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } } unixODBC-2.3.9/DriverManager/SQLCopyDesc.c0000644000175000017500000004450513303466667015072 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLCopyDesc.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLCopyDesc.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.6 2004/03/30 13:20:11 lurcher * * * Fix problem with SQLCopyDesc * Add additional target for iconv * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/09/18 14:49:32 lurcher * * DataManagerII additions and some more threading fixes * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 2001/05/26 19:11:37 ngorham * * Add SQLCopyDesc functionality and fix bug that was stopping messages * coming out of SQLConnect * * Revision 1.7 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLCopyDesc.c,v $ $Revision: 1.8 $"; struct cdesc { int field_identifier; int field_type; }; /* * note that SQL_VARCHAR indicates a pointer type, not a string */ static struct cdesc header_fields[] = { { SQL_DESC_ARRAY_SIZE, SQL_INTEGER }, { SQL_DESC_ARRAY_STATUS_PTR, SQL_VARCHAR }, { SQL_DESC_BIND_OFFSET_PTR, SQL_VARCHAR }, { SQL_DESC_BIND_TYPE, SQL_VARCHAR }, { SQL_DESC_COUNT, SQL_SMALLINT }, { SQL_DESC_ROWS_PROCESSED_PTR, SQL_VARCHAR } }; static struct cdesc rec_fields[] = { { SQL_DESC_CONCISE_TYPE, SQL_SMALLINT }, { SQL_DESC_LENGTH, SQL_INTEGER }, { SQL_DESC_OCTET_LENGTH, SQL_INTEGER }, { SQL_DESC_PARAMETER_TYPE, SQL_SMALLINT }, { SQL_DESC_NUM_PREC_RADIX, SQL_INTEGER }, { SQL_DESC_PRECISION, SQL_SMALLINT }, { SQL_DESC_SCALE, SQL_SMALLINT }, { SQL_DESC_DATETIME_INTERVAL_CODE, SQL_SMALLINT }, { SQL_DESC_DATETIME_INTERVAL_PRECISION, SQL_SMALLINT }, { SQL_DESC_DATA_PTR, SQL_VARCHAR }, { SQL_DESC_INDICATOR_PTR, SQL_VARCHAR }, { SQL_DESC_OCTET_LENGTH_PTR, SQL_VARCHAR } }; SQLRETURN SQLCopyDesc( SQLHDESC source_desc_handle, SQLHDESC target_desc_handle ) { DMHDESC src_descriptor = (DMHDESC)source_desc_handle; DMHDESC target_descriptor = (DMHDESC)target_desc_handle; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check descriptor */ if ( !__validate_desc( src_descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } if ( !__validate_desc( target_descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( src_descriptor ); function_entry( target_descriptor ); if ( log_info.log_flag ) { sprintf( src_descriptor -> msg, "\n\t\tEntry:\ \n\t\t\tSource Descriptor = %p\ \n\t\t\tTarget Descriptor = %p", src_descriptor, target_descriptor ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, src_descriptor -> msg ); } if ( src_descriptor -> associated_with ) { DMHSTMT statement = (DMHSTMT) src_descriptor -> associated_with; if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &src_descriptor -> error, ERROR_HY010, NULL, src_descriptor -> connection -> environment -> requested_version ); function_return_nodrv( SQL_HANDLE_DESC, target_descriptor, SQL_SUCCESS ); return function_return_nodrv( SQL_HANDLE_DESC, src_descriptor, SQL_ERROR ); } } if ( target_descriptor -> associated_with ) { DMHSTMT statement = (DMHSTMT) target_descriptor -> associated_with; if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &target_descriptor -> error, ERROR_HY010, NULL, target_descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( IGNORE_THREAD, src_descriptor, SQL_ERROR ); } } /* * if both descriptors are from the same driver then we can just * pass it on */ if ( (src_descriptor -> connection == target_descriptor -> connection || !strcmp(src_descriptor -> connection -> dl_name, target_descriptor -> connection -> dl_name) ) && CHECK_SQLCOPYDESC( src_descriptor -> connection )) { SQLRETURN ret; /* * protect the common connection */ thread_protect( SQL_HANDLE_DBC, src_descriptor -> connection ); ret = SQLCOPYDESC( src_descriptor -> connection, src_descriptor -> driver_desc, target_descriptor -> driver_desc ); if ( log_info.log_flag ) { sprintf( target_descriptor -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, target_descriptor -> msg ); } return function_return( IGNORE_THREAD, target_descriptor, ret, DEFER_R3 ); } else { /* * TODO copy from one to the other * protect the common environment */ SQLRETURN ret = SQL_SUCCESS; SQLSMALLINT count; SQLSMALLINT sval; SQLINTEGER ival; SQLPOINTER pval; if ( src_descriptor -> connection == target_descriptor -> connection ) thread_protect( SQL_HANDLE_DBC, src_descriptor -> connection ); else thread_protect( SQL_HANDLE_ENV, src_descriptor -> connection -> environment ); if ( !CHECK_SQLGETDESCFIELD( src_descriptor -> connection ) || !CHECK_SQLSETDESCFIELD( src_descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &target_descriptor -> error, ERROR_IM001, NULL, target_descriptor -> connection -> environment -> requested_version ); if ( src_descriptor -> connection == target_descriptor -> connection ) thread_release( SQL_HANDLE_DBC, src_descriptor -> connection ); else thread_release( SQL_HANDLE_ENV, src_descriptor -> connection -> environment ); return function_return_nodrv( IGNORE_THREAD, target_descriptor, SQL_ERROR ); } /* * get the count from the source field */ ret = SQLGETDESCFIELD( src_descriptor -> connection, src_descriptor -> driver_desc, 0, SQL_DESC_COUNT, &count, sizeof( count ), NULL ); if ( SQL_SUCCEEDED( ret )) { /* * copy the header fields */ int i; for ( i = 0; i < sizeof( header_fields ) / sizeof( header_fields[ 0 ] ); i ++ ) { if ( header_fields[ i ].field_type == SQL_INTEGER ) { ret = SQLGETDESCFIELD( src_descriptor -> connection, src_descriptor -> driver_desc, 0, header_fields[ i ].field_identifier, &ival, sizeof( ival ), NULL ); } else if ( header_fields[ i ].field_type == SQL_SMALLINT ) { ret = SQLGETDESCFIELD( src_descriptor -> connection, src_descriptor -> driver_desc, 0, header_fields[ i ].field_identifier, &sval, sizeof( sval ), NULL ); } if ( header_fields[ i ].field_type == SQL_VARCHAR ) { ret = SQLGETDESCFIELD( src_descriptor -> connection, src_descriptor -> driver_desc, 0, header_fields[ i ].field_identifier, &pval, sizeof( pval ), NULL ); } if ( SQL_SUCCEEDED( ret )) { if ( header_fields[ i ].field_type == SQL_INTEGER ) { ret = SQLSETDESCFIELD( target_descriptor -> connection, target_descriptor -> driver_desc, 0, header_fields[ i ].field_identifier, ival, sizeof( ival )); } else if ( header_fields[ i ].field_type == SQL_SMALLINT ) { ret = SQLSETDESCFIELD( target_descriptor -> connection, target_descriptor -> driver_desc, 0, header_fields[ i ].field_identifier, sval, sizeof( sval )); } else if ( header_fields[ i ].field_type == SQL_VARCHAR ) { ret = SQLSETDESCFIELD( target_descriptor -> connection, target_descriptor -> driver_desc, 0, header_fields[ i ].field_identifier, pval, sizeof( pval )); } } if ( !SQL_SUCCEEDED( ret )) break; } } if ( SQL_SUCCEEDED( ret )) { /* * copy the records */ int i, rec; for ( rec = 0; rec <= count; rec ++ ) { for ( i = 0; i < sizeof( rec_fields ) / sizeof( rec_fields[ 0 ] ); i ++ ) { if ( rec_fields[ i ].field_type == SQL_INTEGER ) { ret = SQLGETDESCFIELD( src_descriptor -> connection, src_descriptor -> driver_desc, rec, rec_fields[ i ].field_identifier, &ival, sizeof( ival ), NULL ); } else if ( rec_fields[ i ].field_type == SQL_SMALLINT ) { ret = SQLGETDESCFIELD( src_descriptor -> connection, src_descriptor -> driver_desc, rec, rec_fields[ i ].field_identifier, &sval, sizeof( sval ), NULL ); } if ( rec_fields[ i ].field_type == SQL_VARCHAR ) { ret = SQLGETDESCFIELD( src_descriptor -> connection, src_descriptor -> driver_desc, rec, rec_fields[ i ].field_identifier, &pval, sizeof( pval ), NULL ); } if ( SQL_SUCCEEDED( ret )) { if ( rec_fields[ i ].field_type == SQL_INTEGER ) { ret = SQLSETDESCFIELD( target_descriptor -> connection, target_descriptor -> driver_desc, rec, rec_fields[ i ].field_identifier, ival, sizeof( ival )); } else if ( rec_fields[ i ].field_type == SQL_SMALLINT ) { ret = SQLSETDESCFIELD( target_descriptor -> connection, target_descriptor -> driver_desc, rec, rec_fields[ i ].field_identifier, sval, sizeof( sval )); } else if ( rec_fields[ i ].field_type == SQL_VARCHAR ) { ret = SQLSETDESCFIELD( target_descriptor -> connection, target_descriptor -> driver_desc, rec, rec_fields[ i ].field_identifier, pval, sizeof( pval )); } } if ( !SQL_SUCCEEDED( ret )) break; } if ( !SQL_SUCCEEDED( ret )) break; } } if ( log_info.log_flag ) { sprintf( src_descriptor -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, src_descriptor -> msg ); } if ( src_descriptor -> connection == target_descriptor -> connection ) thread_release( SQL_HANDLE_DBC, src_descriptor -> connection ); else thread_release( SQL_HANDLE_ENV, src_descriptor -> connection -> environment ); return function_return( IGNORE_THREAD, target_descriptor, ret, DEFER_R3 ); } } unixODBC-2.3.9/DriverManager/SQLTablePrivilegesW.c0000644000175000017500000002615613303466667016573 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLTablePrivilegesW.c,v 1.10 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLTablePrivilegesW.c,v $ * Revision 1.10 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.9 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.8 2007/02/28 15:37:49 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.7 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/11/11 17:10:18 lurcher * * VMS changes * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLTablePrivilegesW.c,v $"; SQLRETURN SQLTablePrivilegesW( SQLHSTMT statement_handle, SQLWCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLWCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLWCHAR *sz_table_name, SQLSMALLINT cb_table_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLTABLEPRIVILEGESW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLTABLEPRIVILEGESW( parent_statement -> connection, statement_handle, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s", statement, __wstring_with_length( s1, sz_catalog_name, cb_catalog_name ), __wstring_with_length( s2, sz_schema_name, cb_schema_name ), __wstring_with_length( s3, sz_table_name, cb_table_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( sz_catalog_name && cb_catalog_name < 0 && cb_catalog_name != SQL_NTS ) || ( sz_schema_name && cb_schema_name < 0 && cb_schema_name != SQL_NTS ) || ( sz_table_name && cb_table_name < 0 && cb_table_name != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLTABLEPRIVILEGES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLTABLEPRIVILEGESW( statement -> connection )) { if ( !CHECK_SQLTABLEPRIVILEGESW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLTABLEPRIVILEGESW( statement -> connection , statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); } else { SQLCHAR *as1, *as2, *as3; int clen; if ( !CHECK_SQLTABLEPRIVILEGES( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( sz_catalog_name, cb_catalog_name, statement -> connection, &clen ); cb_catalog_name = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( sz_schema_name, cb_schema_name, statement -> connection, &clen ); cb_schema_name = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( sz_table_name, cb_table_name, statement -> connection, &clen ); cb_table_name = clen; ret = SQLTABLEPRIVILEGES( statement -> connection , statement -> driver_stmt, as1, cb_catalog_name, as2, cb_schema_name, as3, cb_table_name ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLTABLEPRIVILEGES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLGetFunctions.c0000644000175000017500000001472613364070567015770 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetFunctions.c,v 1.5 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetFunctions.c,v $ * Revision 1.5 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetFunctions.c,v $ $Revision: 1.5 $"; SQLRETURN SQLGetFunctions( SQLHDBC connection_handle, SQLUSMALLINT function_id, SQLUSMALLINT *supported ) { DMHDBC connection = (DMHDBC)connection_handle; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tId = %s\ \n\t\t\tSupported = %p", connection, __fid_as_string( s1, function_id ), supported ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( function_id == SQL_API_SQLGETFUNCTIONS || function_id == SQL_API_SQLDATASOURCES || function_id == SQL_API_SQLDRIVERS || function_id == SQL_API_SQLGETENVATTR || function_id == SQL_API_SQLSETENVATTR ) { *supported = SQL_TRUE; return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } if ( connection -> state == STATE_C3 || connection -> state == STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if (( function_id > SQL_API_SQLBULKOPERATIONS && function_id < SQL_API_SQLCOLUMNS ) || ( function_id > SQL_API_SQLALLOCHANDLESTD && function_id < SQL_API_LOADBYORDINAL ) || ( function_id > SQL_API_LOADBYORDINAL && function_id < SQL_API_ODBC3_ALL_FUNCTIONS ) || ( function_id > SQL_API_ODBC3_ALL_FUNCTIONS && function_id < SQL_API_SQLALLOCHANDLE ) || function_id > SQL_API_SQLFETCHSCROLL ) { __post_internal_error( &connection -> error, ERROR_HY095, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } __check_for_function( connection, function_id, supported ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tSupported = %s", __get_return_status( SQL_SUCCESS, s1 ), __sptr_as_string( s1, (short*)supported )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } unixODBC-2.3.9/DriverManager/SQLStatisticsW.c0000644000175000017500000003252513303466667015641 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLStatisticsW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLStatisticsW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:49 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLStatisticsW.c,v $"; SQLRETURN SQLStatisticsW( SQLHSTMT statement_handle, SQLWCHAR *catalog_name, SQLSMALLINT name_length1, SQLWCHAR *schema_name, SQLSMALLINT name_length2, SQLWCHAR *table_name, SQLSMALLINT name_length3, SQLUSMALLINT unique, SQLUSMALLINT reserved ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLSTATISTICSW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLSTATISTICSW( parent_statement -> connection, statement_handle, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, unique, reserved ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tUnique = %d\ \n\t\t\tReserved = %d", statement, __wstring_with_length( s1, catalog_name, name_length1 ), __wstring_with_length( s2, schema_name, name_length2 ), __wstring_with_length( s3, table_name, name_length3 ), unique, reserved ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS ) || ( name_length3 < 0 && name_length3 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( reserved != SQL_ENSURE && reserved != SQL_QUICK ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY101" ); __post_internal_error( &statement -> error, ERROR_HY101, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( unique != SQL_INDEX_UNIQUE && unique != SQL_INDEX_ALL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY100" ); __post_internal_error( &statement -> error, ERROR_HY100, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLSTATISTICS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( table_name == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> metadata_id == SQL_TRUE ) { if ( schema_name == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver || CHECK_SQLSTATISTICSW( statement -> connection )) { if ( !CHECK_SQLSTATISTICSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLSTATISTICSW( statement -> connection, statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, unique, reserved ); } else { SQLCHAR *as1, *as2, *as3; int clen; if ( !CHECK_SQLSTATISTICS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( catalog_name, name_length1, statement -> connection, &clen ); name_length1 = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( schema_name, name_length2, statement -> connection, &clen ); name_length2 = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( table_name, name_length3, statement -> connection, &clen ); name_length3 = clen; ret = SQLSTATISTICS( statement -> connection, statement -> driver_stmt, as1, name_length1, as2, name_length2, as3, name_length3, unique, reserved ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); */ statement -> numcols = 1; /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLSTATISTICS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLGetDescRec.c0000644000175000017500000003116213303466667015324 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDescRec.c,v 1.13 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetDescRec.c,v $ * Revision 1.13 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.12 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.11 2007/04/02 10:50:19 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.10 2007/03/05 09:49:23 lurcher * Get it to build on VMS again * * Revision 1.9 2006/01/06 18:44:35 lurcher * Couple of unicode fixes * * Revision 1.8 2004/11/22 17:02:49 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.7 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.6 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.5 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.4 2001/04/17 16:29:39 nick * * More checks and autotest fixes * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 2001/04/27 01:29:35 ngorham * * Added a couple of fixes from Tim Roepken * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetDescRec.c,v $ $Revision: 1.13 $"; SQLRETURN SQLGetDescRecA( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLCHAR *name, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLSMALLINT *type, SQLSMALLINT *sub_type, SQLLEN *length, SQLSMALLINT *precision, SQLSMALLINT *scale, SQLSMALLINT *nullable ) { return SQLGetDescRec( descriptor_handle, rec_number, name, buffer_length, string_length, type, sub_type, length, precision, scale, nullable ); } SQLRETURN SQLGetDescRec( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLCHAR *name, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLSMALLINT *type, SQLSMALLINT *sub_type, SQLLEN *length, SQLSMALLINT *precision, SQLSMALLINT *scale, SQLSMALLINT *nullable ) { /* * not quite sure how the descriptor can be * allocated to a statement, all the documentation talks * about state transitions on statement states, but the * descriptor may be allocated with more than one statement * at one time. Which one should I check ? */ DMHDESC descriptor = (DMHDESC) descriptor_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s5[ 100 + LOG_MESSAGE_LEN ], s6[ 100 + LOG_MESSAGE_LEN ], s7[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s8[ 100 + LOG_MESSAGE_LEN ]; /* * check descriptor */ if ( !__validate_desc( descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( descriptor ); if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tEntry:\ \n\t\t\tDescriptor = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tName = %p\ \n\t\t\tBuffer length = %d\ \n\t\t\tString Length = %p\ \n\t\t\tType = %p\ \n\t\t\tSub Type = %p\ \n\t\t\tLength = %p\ \n\t\t\tPrecision = %p\ \n\t\t\tScale = %p\ \n\t\t\tNullable = %p", descriptor, rec_number, name, buffer_length, string_length, type, sub_type, length, precision, scale, nullable ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } thread_protect( SQL_HANDLE_DESC, descriptor ); if ( descriptor -> connection -> state < STATE_C4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } /* * check status of statements associated with this descriptor */ if( __check_stmt_from_desc( descriptor, STATE_S8 ) || __check_stmt_from_desc( descriptor, STATE_S9 ) || __check_stmt_from_desc( descriptor, STATE_S10 ) || __check_stmt_from_desc( descriptor, STATE_S11 ) || __check_stmt_from_desc( descriptor, STATE_S12 ) || __check_stmt_from_desc( descriptor, STATE_S13 ) || __check_stmt_from_desc( descriptor, STATE_S14 ) || __check_stmt_from_desc( descriptor, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if( __check_stmt_from_desc_ird( descriptor, STATE_S1 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY007" ); __post_internal_error( &descriptor -> error, ERROR_HY007, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( descriptor -> connection -> unicode_driver ) { SQLWCHAR *s1 = NULL; if ( !CHECK_SQLGETDESCRECW( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( name && buffer_length > 0 ) { s1 = malloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 )); } ret = SQLGETDESCRECW( descriptor -> connection, descriptor -> driver_desc, rec_number, s1 ? s1 : (SQLWCHAR*) name, buffer_length, string_length, type, sub_type, length, precision, scale, nullable ); if ( SQL_SUCCEEDED( ret ) && name && s1 ) { unicode_to_ansi_copy((char*) name, buffer_length, s1, SQL_NTS, descriptor -> connection, NULL ); } if ( s1 ) { free( s1 ); } if ( SQL_SUCCEEDED( ret ) && string_length && name ) { *string_length = strlen((char*)name); } } else { if ( !CHECK_SQLGETDESCREC( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } ret = SQLGETDESCREC( descriptor -> connection, descriptor -> driver_desc, rec_number, name, buffer_length, string_length, type, sub_type, length, precision, scale, nullable ); } if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tExit:[%s]\ \n\t\t\tName = %s\ \n\t\t\tType = %s\ \n\t\t\tSub Type = %s\ \n\t\t\tLength = %s\ \n\t\t\tPrecision = %s\ \n\t\t\tScale = %s\ \n\t\t\tNullable = %s", __get_return_status( ret, s8 ), __sdata_as_string( s1, SQL_CHAR, string_length, name ), __sptr_as_string( s2, type ), __sptr_as_string( s3, sub_type ), __ptr_as_string( s4, length ), __sptr_as_string( s5, precision ), __sptr_as_string( s6, scale ), __sptr_as_string( s7, nullable )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } return function_return( SQL_HANDLE_DESC, descriptor, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLCancelHandle.c0000644000175000017500000002520613676600652015654 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLCancel.c,v $ $Revision: 1.4 $"; SQLRETURN SQLCancelHandle( SQLSMALLINT HandleType, SQLHANDLE Handle ) { SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; switch ( HandleType ) { case SQL_HANDLE_STMT: { DMHSTMT statement = (DMHSTMT) Handle; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\n\t\t\tStatement = %p", statement ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } #if defined( HAVE_LIBPTH ) || defined( HAVE_LIBPTHREAD ) || defined( HAVE_LIBTHREAD ) /* * Allow this past the thread checks if the driver is at all thread safe, as SQLCancel can * be called across threads */ if ( statement -> connection -> protection_level == 3 ) { thread_protect( SQL_HANDLE_STMT, statement ); } #endif /* * check states */ if ( !CHECK_SQLCANCEL( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); #if defined( HAVE_LIBPTH ) || defined( HAVE_LIBPTHREAD ) || defined( HAVE_LIBTHREAD ) if ( statement -> connection -> protection_level == 3 ) { return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else { return function_return_nodrv( IGNORE_THREAD, statement, SQL_ERROR ); } #else return function_return_nodrv( IGNORE_THREAD, statement, SQL_ERROR ); #endif } ret = SQLCANCEL( statement -> connection, statement -> driver_stmt ); if ( SQL_SUCCEEDED( ret )) { if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S10 ) { if ( statement -> interupted_func == SQL_API_SQLEXECDIRECT ) { statement -> state = STATE_S1; } else if ( statement -> interupted_func == SQL_API_SQLEXECUTE ) { if ( statement -> hascols ) { statement -> state = STATE_S3; } else { statement -> state = STATE_S2; } } else if ( statement -> interupted_func == SQL_API_SQLBULKOPERATIONS ) { statement -> state = STATE_S6; statement -> eod = 0; } else if ( statement -> interupted_func == SQL_API_SQLSETPOS ) { if ( statement -> interupted_state == STATE_S5 || statement -> interupted_state == STATE_S6 ) { statement -> state = STATE_S6; statement -> eod = 0; } else if ( statement -> interupted_state == STATE_S7 ) { statement -> state = STATE_S7; } } } else if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { statement -> state = STATE_S12; } else { /* Same action as SQLFreeStmt( SQL_CLOSE ) */ if ( statement -> state == STATE_S4 ) { if ( statement -> prepared ) statement -> state = STATE_S2; else statement -> state = STATE_S1; } else { if ( statement -> prepared ) statement -> state = STATE_S3; else statement -> state = STATE_S1; } statement -> hascols = 0; } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } #if defined( HAVE_LIBPTH ) || defined( HAVE_LIBPTHREAD ) || defined( HAVE_LIBTHREAD ) if ( statement -> connection -> protection_level == 3 ) { return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R0 ); } else { return function_return( IGNORE_THREAD, statement, ret, DEFER_R0 ); } #else return function_return( IGNORE_THREAD, statement, ret, DEFER_R0 ); #endif } break; case SQL_HANDLE_DBC: { DMHDBC connection = (DMHDBC) Handle; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\n\t\t\tConnection = %p", connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } /* * check states */ if ( !CHECK_SQLCANCELHANDLE( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( IGNORE_THREAD, connection, SQL_ERROR ); } ret = SQLCANCELHANDLE( connection, SQL_HANDLE_DBC, connection -> driver_dbc ); /* * The effect this has on connection states is not defined AFAIKS */ if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( IGNORE_THREAD, connection, ret, DEFER_R0 ); } break; default: return SQL_INVALID_HANDLE; break; } } unixODBC-2.3.9/DriverManager/SQLColAttributeW.c0000644000175000017500000004306613303466667016112 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColAttributeW.c,v 1.14 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLColAttributeW.c,v $ * Revision 1.14 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.13 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.12 2007/04/02 10:50:18 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.11 2004/11/22 17:02:48 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.10 2004/10/30 20:19:21 peteralexharvey * ODBC spec says last arg for SQLColAttribute() is SQLPOINTER not (SQLEN*). * So switched back to SQLPOINTER. * * Revision 1.9 2004/10/29 10:00:36 lurcher * Fix SQLColAttribute protype * * Revision 1.8 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.7 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.5 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.4 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/04/25 15:16:46 lurcher * * Fix bug with SQLCOlAttribute(s)(W) where a column of zero could not be * used to get the count value * * Revision 1.2 2001/11/16 11:39:17 lurcher * * Add mapping between ODBC 2 and ODBC 3 types for SQLColAttribute(s)(W) * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLColAttributeW.c,v $"; SQLRETURN SQLColAttributeW ( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Number = %d\ \n\t\t\tField Identifier = %s\ \n\t\t\tCharacter Attr = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tString Length = %p\ \n\t\t\tNumeric Attribute = %p", statement, column_number, __col_attr_as_string( s1, field_identifier ), character_attribute, buffer_length, string_length, numeric_attribute ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( column_number == 0 && statement -> bookmarks_on == SQL_UB_OFF && statement -> connection -> bookmarks_on == SQL_UB_OFF && field_identifier != SQL_DESC_COUNT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLCOLATTRIBUTE ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * Commented out for now because most drivers can not calc num cols * before Execute (they have no parse). - PAH * if ( field_identifier != SQL_DESC_COUNT && statement -> numcols < column_number ) { __post_internal_error( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version ); return function_return( statement, SQL_ERROR ); } */ /* * check states */ if ( statement -> state == STATE_S1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* else if ( statement -> state == STATE_S2 && field_identifier != SQL_DESC_COUNT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07005" ); __post_internal_error( &statement -> error, ERROR_07005, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ else if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLCOLATTRIBUTE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } switch ( field_identifier ) { case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_NAME: case SQL_COLUMN_LABEL: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: if ( buffer_length < 0 && buffer_length != SQL_NTS ) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver || CHECK_SQLCOLATTRIBUTEW( statement -> connection ) || CHECK_SQLCOLATTRIBUTESW( statement -> connection )) { if ( !CHECK_SQLCOLATTRIBUTEW( statement -> connection )) { if ( CHECK_SQLCOLATTRIBUTESW( statement -> connection )) { /* * map to the ODBC2 function */ field_identifier = map_ca_odbc3_to_2( field_identifier ); ret = SQLCOLATTRIBUTESW( statement -> connection, statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { ret = SQLCOLATTRIBUTEW( statement -> connection, statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } } else { if ( !CHECK_SQLCOLATTRIBUTE( statement -> connection )) { if ( CHECK_SQLCOLATTRIBUTES( statement -> connection )) { SQLCHAR *as1 = NULL; /* * map to the ODBC2 function */ field_identifier = map_ca_odbc3_to_2( field_identifier ); switch( field_identifier ) { case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_NAME: case SQL_COLUMN_LABEL: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: buffer_length = buffer_length / 2; if ( buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } break; } ret = SQLCOLATTRIBUTES( statement -> connection, statement -> driver_stmt, column_number, field_identifier, as1 ? as1 : character_attribute, buffer_length, string_length, numeric_attribute ); switch( field_identifier ) { case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_NAME: case SQL_COLUMN_LABEL: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: if ( SQL_SUCCEEDED( ret ) && character_attribute && as1 ) { ansi_to_unicode_copy( character_attribute, (char*) as1, SQL_NTS, statement -> connection, NULL ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length *= sizeof( SQLWCHAR ); } if ( as1 ) { free( as1 ); } break; } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { SQLCHAR *as1 = NULL; switch( field_identifier ) { case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: case SQL_COLUMN_NAME: buffer_length = buffer_length / 2; if ( buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } break; } ret = SQLCOLATTRIBUTE( statement -> connection, statement -> driver_stmt, column_number, field_identifier, as1 ? as1 : character_attribute, buffer_length, string_length, numeric_attribute ); switch( field_identifier ) { case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: case SQL_COLUMN_NAME: if ( SQL_SUCCEEDED( ret ) && character_attribute && as1 ) { ansi_to_unicode_copy( character_attribute, (char*) as1, SQL_NTS, statement -> connection, NULL ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length *= sizeof( SQLWCHAR ); } if ( as1 ) { free( as1 ); } break; default: break; } } } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLCOLATTRIBUTE; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( SQL_SUCCEEDED( ret )) { /* * map ODBC 3 datetime fields to ODBC2 */ if ( field_identifier == SQL_COLUMN_TYPE && numeric_attribute ) { *(SQLINTEGER*)numeric_attribute= __map_type(MAP_SQL_D2DM, statement->connection, *(SQLINTEGER*)numeric_attribute); } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLFetch.c0000644000175000017500000002423113303466667014404 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFetch.c,v 1.4 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLFetch.c,v $ * Revision 1.4 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2001/01/14 10:09:39 nick * * Add sqi/test to build * * Revision 1.2 2001/01/09 22:33:13 nick * * Stop passing NULL into SQLExtendedFetch * Further fixes to unicode to ansi conversions * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 2000/02/11 00:41:46 ngorham * * Added a couple of fixes for drivers without SQLExtendedFetch * * Revision 1.8 2000/02/02 07:55:21 ngorham * * Add flag to disable SQLFetch -> SQLExtendedFetch mapping * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:06 sShandyb * first go at it * * Revision 1.2 1999/06/02 23:48:45 ngorham * * Added more 3-2 mapping * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLFetch.c,v $ $Revision: 1.4 $"; SQLRETURN SQLFetch( SQLHSTMT statement_handle ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p", statement ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } /* * check states */ thread_protect( SQL_HANDLE_STMT, statement ); if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S7 || statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLFETCH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( CHECK_SQLFETCH( statement -> connection )) { /* * this is odd, but its in the book */ if ( statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection ) && statement -> connection -> ex_fetch_mapping ) { /* * the row_st_arr can't be null */ if ( statement -> row_st_arr ) { ret = SQLEXTENDEDFETCH( statement -> connection, statement -> driver_stmt, SQL_FETCH_NEXT, NULL, statement -> row_ct_ptr, statement -> row_st_arr ); } else { SQLUSMALLINT *row_st_arr; int row_count; SQLUSMALLINT row_status; if ( statement -> row_array_size <= 1 ) { row_count = 1; row_st_arr = &row_status; } else { row_count = statement -> row_array_size; row_st_arr = malloc( sizeof( SQLUSMALLINT ) * row_count ); } ret = SQLEXTENDEDFETCH( statement -> connection, statement -> driver_stmt, SQL_FETCH_NEXT, NULL, statement -> row_ct_ptr, row_st_arr ); if ( row_count > 1 ) { free( row_st_arr ); } } } else { ret = SQLFETCH( statement -> connection, statement -> driver_stmt ); if( statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && statement -> row_ct_ptr ) { if( ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO ) { *statement -> row_ct_ptr = 1; } else { *statement -> row_ct_ptr = 0; } } } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLFETCH; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S6; statement -> eod = 0; } else if ( ret == SQL_NO_DATA ) { statement -> eod = 1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLColAttribute.c0000644000175000017500000005361713303466667015766 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColAttribute.c,v 1.19 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLColAttribute.c,v $ * Revision 1.19 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.18 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.17 2008/09/29 14:02:43 lurcher * Fix missing dlfcn group option * * Revision 1.16 2007/04/02 10:50:17 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.15 2006/03/08 09:18:41 lurcher * fix silly typo that was using sizeof( SQL_WCHAR ) instead of SQLWCHAR * * Revision 1.14 2004/11/22 17:02:48 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.13 2004/10/30 20:19:21 peteralexharvey * ODBC spec says last arg for SQLColAttribute() is SQLPOINTER not (SQLEN*). * So switched back to SQLPOINTER. * * Revision 1.12 2004/10/29 10:00:35 lurcher * Fix SQLColAttribute protype * * Revision 1.11 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.10 2003/04/10 13:45:51 lurcher * * Alter the way that SQLDataSources returns the description field (again) * * Revision 1.9 2003/04/09 08:42:18 lurcher * * Allow setting of odbcinstQ lib from odbcinst.ini and Environment * * Revision 1.8 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.7 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/11/11 17:10:06 lurcher * * VMS changes * * Revision 1.5 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.4 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/04/25 15:16:46 lurcher * * Fix bug with SQLCOlAttribute(s)(W) where a column of zero could not be * used to get the count value * * Revision 1.2 2001/11/16 11:39:17 lurcher * * Add mapping between ODBC 2 and ODBC 3 types for SQLColAttribute(s)(W) * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.6 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.5 2001/07/02 17:09:37 nick * * Add some portability changes * * Revision 1.4 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2001/04/03 16:34:12 nick * * Add support for strangly broken unicode drivers * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 2000/06/20 13:30:07 ngorham * * Fix problems when using bookmarks * * Revision 1.7 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/10/09 00:56:16 ngorham * * Added Manush's patch to map ODBC 3-2 datetime values * * Revision 1.4 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.3 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.2 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.2 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLColAttribute.c,v $ $Revision: 1.19 $"; SQLINTEGER map_ca_odbc3_to_2( SQLINTEGER field_identifier ) { switch( field_identifier ) { case SQL_DESC_COUNT: field_identifier = SQL_COLUMN_COUNT; break; case SQL_DESC_TYPE: field_identifier = SQL_COLUMN_TYPE; break; case SQL_DESC_LENGTH: field_identifier = SQL_COLUMN_LENGTH; break; case SQL_DESC_PRECISION: field_identifier = SQL_COLUMN_PRECISION; break; case SQL_DESC_SCALE: field_identifier = SQL_COLUMN_SCALE; break; case SQL_DESC_NULLABLE: field_identifier = SQL_COLUMN_NULLABLE; break; case SQL_DESC_NAME: field_identifier = SQL_COLUMN_NAME; break; default: break; } return field_identifier; } SQLRETURN SQLColAttributeA( SQLHSTMT statement_handle, SQLSMALLINT column_number, SQLSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ) { return SQLColAttribute( statement_handle, (SQLUSMALLINT) column_number, (SQLUSMALLINT) field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } SQLRETURN SQLColAttribute ( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLUSMALLINT field_identifier, SQLPOINTER character_attribute, SQLSMALLINT buffer_length, SQLSMALLINT *string_length, SQLLEN *numeric_attribute ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret = 0; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; int isStringAttr; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Number = %d\ \n\t\t\tField Identifier = %s\ \n\t\t\tCharacter Attr = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tString Length = %p\ \n\t\t\tNumeric Attribute = %p", statement, column_number, __col_attr_as_string( s1, field_identifier ), character_attribute, buffer_length, string_length, numeric_attribute ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( column_number == 0 && statement -> bookmarks_on == SQL_UB_OFF && statement -> connection -> bookmarks_on == SQL_UB_OFF && field_identifier != SQL_DESC_COUNT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLCOLATTRIBUTE ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * Commented out for now because most drivers can not calc num cols * before Execute (they have no parse). - PAH * if ( field_identifier != SQL_DESC_COUNT && statement -> numcols < column_number ) { __post_internal_error( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version ); return function_return( statement, SQL_ERROR ); } */ /* * check states */ if ( statement -> state == STATE_S1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* MS Driver manager passes this to driver else if ( statement -> state == STATE_S2 && field_identifier != SQL_DESC_COUNT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07005" ); __post_internal_error( &statement -> error, ERROR_07005, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ else if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLCOLATTRIBUTE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } switch( field_identifier ) { case SQL_DESC_AUTO_UNIQUE_VALUE: case SQL_DESC_CASE_SENSITIVE: case SQL_DESC_CONCISE_TYPE: case SQL_DESC_COUNT: case SQL_DESC_DISPLAY_SIZE: case SQL_DESC_FIXED_PREC_SCALE: case SQL_DESC_LENGTH: case SQL_DESC_NULLABLE: case SQL_DESC_NUM_PREC_RADIX: case SQL_DESC_OCTET_LENGTH: case SQL_DESC_PRECISION: case SQL_DESC_SCALE: case SQL_DESC_SEARCHABLE: case SQL_DESC_TYPE: case SQL_DESC_UNNAMED: case SQL_DESC_UNSIGNED: case SQL_DESC_UPDATABLE: isStringAttr = 0; break; case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_NAME: case SQL_COLUMN_LABEL: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: if ( buffer_length < 0 && buffer_length != SQL_NTS ) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } default: isStringAttr = buffer_length >= 0; break; } if ( statement -> connection -> unicode_driver ) { if ( !CHECK_SQLCOLATTRIBUTEW( statement -> connection )) { if ( CHECK_SQLCOLATTRIBUTESW( statement -> connection )) { SQLWCHAR *s1 = NULL; /* * map to the ODBC2 function */ field_identifier = map_ca_odbc3_to_2( field_identifier ); switch( field_identifier ) { case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_NAME: case SQL_COLUMN_LABEL: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: if ( SQL_SUCCEEDED( ret ) && character_attribute && buffer_length > 0 ) { s1 = calloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 ), 1); } break; default: break; } ret = SQLCOLATTRIBUTESW( statement -> connection, statement -> driver_stmt, column_number, field_identifier, s1 ? s1 : character_attribute, buffer_length, string_length, numeric_attribute ); switch( field_identifier ) { case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_NAME: case SQL_COLUMN_LABEL: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: if ( SQL_SUCCEEDED( ret ) && character_attribute && s1 ) { unicode_to_ansi_copy( character_attribute, buffer_length, s1, SQL_NTS, statement -> connection, NULL ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length /= sizeof( SQLWCHAR ); } break; default: break; } if ( s1 ) { free( s1 ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { SQLWCHAR *s1 = NULL; SQLSMALLINT unibuf_len; if ( isStringAttr && character_attribute && buffer_length > 0 ) { s1 = calloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 ), 1); /* Do not overflow, since SQLSMALLINT can only hold -32768 <= x <= 32767 */ unibuf_len = buffer_length > 16383 ? buffer_length : sizeof( SQLWCHAR ) * buffer_length; } ret = SQLCOLATTRIBUTEW( statement -> connection, statement -> driver_stmt, column_number, field_identifier, s1 ? s1 : character_attribute, s1 ? unibuf_len : buffer_length, string_length, numeric_attribute ); if ( SQL_SUCCEEDED( ret ) && isStringAttr && buffer_length > 0 ) { if ( character_attribute && s1 ) { unicode_to_ansi_copy( character_attribute, buffer_length, s1, SQL_NTS, statement -> connection, NULL ); } /* BUGBUG: Windows DM returns the number of bytes for the Unicode string but only for certain ODBC-defined string fields, and when truncating */ switch ( field_identifier ) { case SQL_COLUMN_QUALIFIER_NAME: case SQL_COLUMN_NAME: case SQL_COLUMN_LABEL: case SQL_COLUMN_OWNER_NAME: case SQL_COLUMN_TABLE_NAME: case SQL_COLUMN_TYPE_NAME: case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: if ( ret == SQL_SUCCESS && string_length ) { *string_length /= sizeof( SQLWCHAR ); } break; default: if ( string_length ) { *string_length /= sizeof( SQLWCHAR ); } } } if ( s1 ) { free( s1 ); } } } else { if ( !CHECK_SQLCOLATTRIBUTE( statement -> connection )) { /* * map ODBC 3 types to ODBC 2 */ if ( CHECK_SQLCOLATTRIBUTES( statement -> connection )) { /* * map to the ODBC2 function */ field_identifier = map_ca_odbc3_to_2( field_identifier ); ret = SQLCOLATTRIBUTES( statement -> connection, statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { ret = SQLCOLATTRIBUTE( statement -> connection, statement -> driver_stmt, column_number, field_identifier, character_attribute, buffer_length, string_length, numeric_attribute ); } } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLCOLATTRIBUTE; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( SQL_SUCCEEDED( ret )) { /* * map ODBC 3 datetime fields to ODBC2 */ if ( field_identifier == SQL_COLUMN_TYPE && numeric_attribute ) { *(SQLINTEGER*)numeric_attribute= __map_type(MAP_SQL_D2DM, statement->connection, *(SQLINTEGER*)numeric_attribute); } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLProcedures.c0000644000175000017500000002631513303466667015473 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLProcedures.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLProcedures.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLProcedures.c,v $ $Revision: 1.7 $"; SQLRETURN SQLProceduresA( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_proc_name, SQLSMALLINT cb_proc_name ) { return SQLProcedures( statement_handle, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name ); } SQLRETURN SQLProcedures( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_proc_name, SQLSMALLINT cb_proc_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tProc Name = %s", statement, __string_with_length( s1, sz_catalog_name, cb_catalog_name ), __string_with_length( s2, sz_schema_name, cb_schema_name ), __string_with_length( s3, sz_proc_name, cb_proc_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( cb_catalog_name < 0 && cb_catalog_name != SQL_NTS ) || ( cb_schema_name < 0 && cb_schema_name != SQL_NTS ) || ( cb_proc_name < 0 && cb_proc_name != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPROCEDURES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3; int wlen; if ( !CHECK_SQLPROCEDURESW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( sz_catalog_name, cb_catalog_name, statement -> connection, &wlen ); cb_catalog_name = wlen; s2 = ansi_to_unicode_alloc( sz_schema_name, cb_schema_name, statement -> connection, &wlen ); cb_schema_name = wlen; s3 = ansi_to_unicode_alloc( sz_proc_name, cb_proc_name, statement -> connection, &wlen ); cb_proc_name = wlen; ret = SQLPROCEDURESW( statement -> connection , statement -> driver_stmt, s1, cb_catalog_name, s2, cb_schema_name, s3, cb_proc_name ); if ( s1 ) free( s1 ); if ( s2 ) free( s2 ); if ( s3 ) free( s3 ); } else { if ( !CHECK_SQLPROCEDURES( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPROCEDURES( statement -> connection , statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_proc_name, cb_proc_name ); } if ( SQL_SUCCEEDED( ret )) { statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPROCEDURES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLGetStmtAttrW.c0000644000175000017500000002454513470564410015722 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetStmtAttrW.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetStmtAttrW.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.5 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.4 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetStmtAttrW.c,v $"; SQLRETURN SQLGetStmtAttrW( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETSTMTATTRW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETSTMTATTRW( parent_statement -> connection, statement_handle, attribute, value, buffer_length, string_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen = %p", statement, __stmt_attr_as_string( s1, attribute ), value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( attribute == SQL_ATTR_ROW_NUMBER || attribute == SQL_GET_BOOKMARK ) { if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 || statement -> state == STATE_S4 || statement -> state == STATE_S5 || (( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) && statement -> eod )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * states S5 - S7 are handled by the driver */ if ( statement -> connection -> unicode_driver || CHECK_SQLGETSTMTATTRW( statement -> connection )) { if ( !CHECK_SQLGETSTMTATTRW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { if ( !CHECK_SQLGETSTMTATTR( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * map descriptors to our copies */ if ( attribute == SQL_ATTR_APP_ROW_DESC ) { if ( value ) memcpy( value, &statement -> ard, sizeof( statement -> ard )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_APP_PARAM_DESC ) { if ( value ) memcpy( value, &statement -> apd, sizeof( SQLHANDLE )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_IMP_ROW_DESC ) { if ( value ) memcpy( value, &statement -> ird, sizeof( SQLHANDLE )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_IMP_PARAM_DESC ) { if ( value ) memcpy( value, &statement -> ipd, sizeof( SQLHANDLE )); ret = SQL_SUCCESS; } /* * does the call need mapping from 3 to 2 */ else if ( attribute == SQL_ATTR_FETCH_BOOKMARK_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection )) { if ( value ) memcpy( value, &statement -> fetch_bm_ptr, sizeof( SQLLEN * )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROW_STATUS_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection )) { if ( value ) memcpy( value, &statement -> row_st_arr, sizeof( SQLLEN * )); ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROWS_FETCHED_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection )) { if ( value ) memcpy( value, &statement -> row_ct_ptr, sizeof( SQLULEN * )); ret = SQL_SUCCESS; } else { if ( statement -> connection -> unicode_driver ) { ret = SQLGETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, value, buffer_length, string_length ); } else { /* * don't know if any string attributes to convert... */ ret = SQLGETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, value, buffer_length, string_length ); } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLNativeSql.c0000644000175000017500000002534513303466667015270 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLNativeSql.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLNativeSql.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.7 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.6 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.5 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.4 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2001/01/02 09:55:04 nick * * More unicode bits * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 21:40:58 nick * End of another night :-) * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLNativeSql.c,v $ $Revision: 1.9 $"; SQLRETURN SQLNativeSqlA( SQLHDBC hdbc, SQLCHAR *sz_sql_str_in, SQLINTEGER cb_sql_str_in, SQLCHAR *sz_sql_str, SQLINTEGER cb_sql_str_max, SQLINTEGER *pcb_sql_str ) { return SQLNativeSql( hdbc, sz_sql_str_in, cb_sql_str_in, sz_sql_str, cb_sql_str_max, pcb_sql_str ); } SQLRETURN SQLNativeSql( SQLHDBC hdbc, SQLCHAR *sz_sql_str_in, SQLINTEGER cb_sql_str_in, SQLCHAR *sz_sql_str, SQLINTEGER cb_sql_str_max, SQLINTEGER *pcb_sql_str ) { DMHDBC connection = (DMHDBC)hdbc; SQLRETURN ret; SQLCHAR *s1; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { /* * allocate some space for the buffer */ if ( sz_sql_str_in && cb_sql_str_in == SQL_NTS ) { s1 = malloc( strlen((char*) sz_sql_str_in ) + 100 ); } else if ( sz_sql_str_in ) { s1 = malloc( cb_sql_str_in + 100 ); } else { s1 = malloc( 101 ); } sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tSQL In = %s\ \n\t\t\tSQL Out = %p\ \n\t\t\tSQL Out Len = %d\ \n\t\t\tSQL Len Ptr = %p", connection, __string_with_length( s1, sz_sql_str_in, cb_sql_str_in ), sz_sql_str, (int)cb_sql_str_max, pcb_sql_str ); free( s1 ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( !sz_sql_str_in ) { __post_internal_error( &connection -> error, ERROR_HY009, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( cb_sql_str_in < 0 && cb_sql_str_in != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( sz_sql_str && cb_sql_str_max < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( connection -> state == STATE_C2 || connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( connection -> unicode_driver ) { SQLWCHAR *s1, *s2 = NULL; if ( !CHECK_SQLNATIVESQLW( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( sz_sql_str_in, cb_sql_str_in, connection, NULL ); if ( sz_sql_str && cb_sql_str_max > 0 ) { s2 = malloc( sizeof( SQLWCHAR ) * ( cb_sql_str_max + 1 )); } ret = SQLNATIVESQLW( connection, connection -> driver_dbc, s1, cb_sql_str_in, s2, cb_sql_str_max, pcb_sql_str ); if ( SQL_SUCCEEDED( ret ) && s2 && sz_sql_str ) { unicode_to_ansi_copy((char*) sz_sql_str, cb_sql_str_max, s2, SQL_NTS, connection, NULL ); } if ( s1 ) free( s1 ); if ( s2 ) free( s2 ); } else { if ( !CHECK_SQLNATIVESQL( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } ret = SQLNATIVESQL( connection, connection -> driver_dbc, sz_sql_str_in, cb_sql_str_in, sz_sql_str, cb_sql_str_max, pcb_sql_str ); } if ( log_info.log_flag ) { /* * allocate some space for the buffer */ if ( sz_sql_str && pcb_sql_str && *pcb_sql_str == SQL_NTS ) { s1 = malloc( strlen((char*) sz_sql_str ) + 100 ); } else if ( sz_sql_str && pcb_sql_str ) { s1 = malloc( *pcb_sql_str + 100 ); } else if ( sz_sql_str ) { s1 = malloc( strlen((char*) sz_sql_str ) + 100 ); } else { s1 = malloc( 101 ); } sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tSQL Out = %s", __get_return_status( ret, s2 ), __idata_as_string( s1, SQL_CHAR, pcb_sql_str, sz_sql_str )); free( s1 ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLPrimaryKeys.c0000644000175000017500000003063413303466667015636 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLPrimaryKeys.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLPrimaryKeys.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 2000/06/20 12:44:01 ngorham * * Fix bug that caused a success with info message from SQLExecute or * SQLExecDirect to be lost if used with a ODBC 3 driver and the application * called SQLGetDiagRec * * Revision 1.8 2000/06/16 16:52:18 ngorham * * Stop info messages being lost when calling SQLExecute etc on ODBC 3 * drivers, the SQLNumResultCols were clearing the error before * function return had a chance to get to them * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLPrimaryKeys.c,v $ $Revision: 1.7 $"; SQLRETURN SQLPrimaryKeysA( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_table_name, SQLSMALLINT cb_table_name ) { return SQLPrimaryKeys( statement_handle, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); } SQLRETURN SQLPrimaryKeys( SQLHSTMT statement_handle, SQLCHAR *sz_catalog_name, SQLSMALLINT cb_catalog_name, SQLCHAR *sz_schema_name, SQLSMALLINT cb_schema_name, SQLCHAR *sz_table_name, SQLSMALLINT cb_table_name ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Type = %s", statement, __string_with_length( s1, sz_catalog_name, cb_catalog_name ), __string_with_length( s2, sz_schema_name, cb_schema_name ), __string_with_length( s3, sz_table_name, cb_table_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( cb_catalog_name < 0 && cb_catalog_name != SQL_NTS ) || ( cb_schema_name < 0 && cb_schema_name != SQL_NTS ) || ( cb_table_name < 0 && cb_table_name != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if ( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPRIMARYKEYS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( sz_table_name == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1, *s2, *s3; int wlen; if ( !CHECK_SQLPRIMARYKEYSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( sz_catalog_name, cb_catalog_name, statement -> connection, &wlen ); s2 = ansi_to_unicode_alloc( sz_schema_name, cb_schema_name, statement -> connection, &wlen ); s3 = ansi_to_unicode_alloc( sz_table_name, cb_table_name, statement -> connection, &wlen ); ret = SQLPRIMARYKEYSW( statement -> connection , statement -> driver_stmt, s1, cb_catalog_name, s2, cb_schema_name, s3, cb_table_name ); if ( s1 ) free( s1 ); if ( s2 ) free( s2 ); if ( s3 ) free( s3 ); } else { if ( !CHECK_SQLPRIMARYKEYS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPRIMARYKEYS( statement -> connection , statement -> driver_stmt, sz_catalog_name, cb_catalog_name, sz_schema_name, cb_schema_name, sz_table_name, cb_table_name ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPRIMARYKEYS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLErrorW.c0000644000175000017500000003006513364066212014562 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLErrorW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLErrorW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/05/20 13:43:47 lurcher * Vms fixes * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.5 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.4 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/05/21 14:19:44 lurcher * * * Update libtool to escape from AIX build problem * * Add fix to avoid file handle limitations * * Add more UNICODE changes, it looks like it is native 16 representation * the old way can be reproduced by defining UCS16BE * * Add iusql, its just the same as isql but uses the wide functions * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLErrorW.c,v $"; SQLRETURN extract_parent_handle_err( int handle_type, SQLHENV environment_handle, SQLHDBC connection_handle, SQLHSTMT statement_handle, SQLWCHAR *sqlstate, SQLINTEGER *native_error, SQLWCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); if ( handle_type != SQL_HANDLE_ENV ) { #ifdef WITH_HANDLE_REDIRECT { DMHDBC *parent_handle_dbc; DMHSTMT *parent_handle_stmt; switch ( handle_type ) { case SQL_HANDLE_DBC: { parent_handle_dbc = find_parent_handle( connection_handle, handle_type ); } break; case SQL_HANDLE_STMT: { parent_handle_stmt = find_parent_handle( statement_handle, handle_type ); parent_handle_dbc = parent_handle_stmt->connection; } break; default: { return SQL_INVALID_HANDLE; } } if ( parent_handle_dbc ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLERRORW( parent_handle_dbc )) { dm_log_write(__FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLERRORW( parent_handle_dbc, environment_handle, connection_handle, statement_handle, sqlstate, native_error, message_text, buffer_length, text_length ); } } } #endif } return SQL_INVALID_HANDLE; } /* * unicode mapping function */ static SQLRETURN local_extract_sql_error_w( EHEAD *head, SQLWCHAR *sqlstate, SQLINTEGER *native_error, SQLWCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ) { ERROR *err; SQLRETURN ret; if ( sqlstate ) { SQLWCHAR *tmp; tmp = ansi_to_unicode_alloc((SQLCHAR*) "00000", SQL_NTS, __get_connection( head ), NULL ); wide_strcpy( sqlstate, tmp ); free( tmp ); } if ( head -> sql_error_head.error_count < 1 ) { return SQL_NO_DATA; } err = head -> sql_error_head.error_list_head; head -> sql_error_head.error_list_head = err -> next; /* * is it the last */ if ( head -> sql_error_head.error_list_tail == err ) head -> sql_error_head.error_list_tail = NULL; /* * not empty yet */ if ( head -> sql_error_head.error_list_head ) { head -> sql_error_head.error_list_head -> prev = NULL; } head -> sql_error_head.error_count --; if ( sqlstate ) { wide_strcpy( sqlstate, err -> sqlstate ); } if ( message_text && buffer_length < wide_strlen( err -> msg ) + 1 ) { ret = SQL_SUCCESS_WITH_INFO; } else { ret = SQL_SUCCESS; } if ( message_text ) { if ( ret == SQL_SUCCESS ) { wide_strcpy( message_text, err -> msg ); } else { memcpy( message_text, err -> msg, buffer_length * 2 ); message_text[ buffer_length - 1 ] = 0; } } if ( text_length ) { *text_length = wide_strlen( err -> msg ); } if ( native_error ) { *native_error = err -> native_error; } /* * clean up */ free( err -> msg ); free( err ); /* * map 3 to 2 if required */ if ( SQL_SUCCEEDED( ret ) && sqlstate ) __map_error_state_w( sqlstate, __get_version( head )); return ret; } SQLRETURN SQLErrorW( SQLHENV environment_handle, SQLHDBC connection_handle, SQLHSTMT statement_handle, SQLWCHAR *sqlstate, SQLINTEGER *native_error, SQLWCHAR *message_text, SQLSMALLINT buffer_length, SQLSMALLINT *text_length ) { SQLRETURN ret; SQLCHAR s0[ 32 ], s1[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s3[ 100 + LOG_MESSAGE_LEN ]; DMHENV environment = NULL; DMHDBC connection = NULL; DMHSTMT statement = NULL; void *active_handle = NULL; EHEAD *herror; char *handle_msg; int handle_type; const char *handle_type_ptr; if ( statement_handle ) { statement = ( DMHSTMT ) statement_handle; handle_type = SQL_HANDLE_STMT; if ( !__validate_stmt( statement )) { return extract_parent_handle_err( handle_type, environment_handle, connection_handle, statement_handle, sqlstate, native_error, message_text, buffer_length, text_length ); } connection = statement->connection; active_handle = statement; herror = &statement->error; handle_msg = statement->msg; handle_type_ptr = "Statement"; } else if ( connection_handle ) { connection = ( DMHDBC ) connection_handle; handle_type = SQL_HANDLE_DBC; if ( !__validate_dbc( connection )) { return extract_parent_handle_err( handle_type, environment_handle, connection_handle, statement_handle, sqlstate, native_error, message_text, buffer_length, text_length ); } active_handle = connection; herror = &connection->error; handle_msg = connection->msg; handle_type_ptr = "Connection"; } else if ( environment_handle ) { environment = ( DMHENV ) environment_handle; handle_type = SQL_HANDLE_ENV; if ( !__validate_env( environment )) { return extract_parent_handle_err( handle_type, environment_handle, connection_handle, statement_handle, sqlstate, native_error, message_text, buffer_length, text_length ); } active_handle = environment; herror = &environment->error; handle_msg = environment->msg; handle_type_ptr = "Environment"; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } thread_protect( handle_type, active_handle ); if ( log_info.log_flag ) { sprintf( handle_msg, "\n\t\tEntry:\ \n\t\t\t%s = %p\ \n\t\t\tSQLState = %p\ \n\t\t\tNative = %p\ \n\t\t\tMessage Text = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tText Len Ptr = %p", handle_type_ptr, active_handle, sqlstate, native_error, message_text, buffer_length, text_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } /* * Do diag extraction here if defer flag is set. * Clean the flag after extraction. * The defer flag will not be set for DMHENV in function_return_ex. */ if ( connection && herror->defer_extract ) { extract_error_from_driver( herror, connection, herror->ret_code_deferred, 0 ); herror->defer_extract = 0; herror->ret_code_deferred = 0; } ret = local_extract_sql_error_w( herror, sqlstate, native_error, message_text, buffer_length, text_length ); if ( log_info.log_flag ) { if ( SQL_SUCCEEDED( ret )) { char *ts1, *ts2; sprintf( handle_msg, "\n\t\tExit:[%s]\ \n\t\t\tSQLState = %s\ \n\t\t\tNative = %s\ \n\t\t\tMessage Text = %s", __get_return_status( ret, s2 ), __sdata_as_string( s3, SQL_CHAR, NULL, ts1 = unicode_to_ansi_alloc( sqlstate, SQL_NTS, connection, NULL )), __iptr_as_string( s0, native_error ), __sdata_as_string( s1, SQL_CHAR, text_length, ( ts2 = unicode_to_ansi_alloc( message_text, SQL_NTS, connection, NULL )))); free( ts1 ); free( ts2 ); } else { sprintf( handle_msg, "\n\t\tExit:[%s]", __get_return_status( ret, s2 )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } thread_release( handle_type, active_handle ); return ret; } unixODBC-2.3.9/DriverManager/SQLAllocHandleStd.c0000644000175000017500000000550113303466667016173 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLAllocHandleStd.c,v 1.2 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLAllocHandleStd.c,v $ * Revision 1.2 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.4 1999/07/07 18:51:54 ngorham * * Add missing '*' * * Revision 1.3 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/21 19:59:04 ngorham * * Fix bug in SQLAllocHandleStd.c, the wrong handle was being used to * return the allocated env handle * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLAllocHandleStd.c,v $ $Revision: 1.2 $"; SQLRETURN SQLAllocHandleStd( SQLSMALLINT handle_type, SQLHANDLE input_handle, SQLHANDLE *output_handle ) { SQLRETURN ret; ret = __SQLAllocHandle( handle_type, input_handle, output_handle, 0 ); if ( handle_type == SQL_HANDLE_ENV && SQL_SUCCEEDED( ret )) { DMHENV environment = (DMHENV) *output_handle; environment -> requested_version = SQL_OV_ODBC3; environment -> version_set = 1; } return ret; } unixODBC-2.3.9/DriverManager/SQLPrepare.c0000644000175000017500000002526413303466667014760 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLPrepare.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLPrepare.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2005/03/04 14:38:08 lurcher * Bump version number * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.4 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.2 2000/10/25 09:23:53 nick * * Fixed incorrect error return when NULL string passed * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLPrepare.c,v $ $Revision: 1.7 $"; SQLRETURN SQLPrepareA( SQLHSTMT statement_handle, SQLCHAR *statement_text, SQLINTEGER text_length ) { return SQLPrepare( statement_handle, statement_text, text_length ); } SQLRETURN SQLPrepare( SQLHSTMT statement_handle, SQLCHAR *statement_text, SQLINTEGER text_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR *s1; SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { /* * allocate some space for the buffer */ if ( statement_text && text_length == SQL_NTS ) { s1 = malloc( strlen((char*) statement_text ) + 100 ); } else if ( statement_text ) { s1 = malloc( text_length + 100 ); } else { s1 = malloc( 101 ); } sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tSQL = %s", statement, __string_with_length( s1, statement_text, text_length )); free( s1 ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( !statement_text ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( text_length <= 0 && text_length != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if ( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPREPARE ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver ) { int wlen; SQLWCHAR *s1; if ( !CHECK_SQLPREPAREW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( statement_text, text_length, statement -> connection, &wlen ); text_length = wlen; ret = SQLPREPAREW( statement -> connection , statement -> driver_stmt, s1, text_length ); if ( s1 ) free( s1 ); } else { if ( !CHECK_SQLPREPARE( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPREPARE( statement -> connection , statement -> driver_stmt, statement_text, text_length ); } if ( SQL_SUCCEEDED( ret )) { statement -> hascols = 0; statement -> state = STATE_S3; statement -> prepared = 1; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPREPARE; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s2 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLDescribeCol.c0000644000175000017500000003620413303466667015534 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDescribeCol.c,v 1.13 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDescribeCol.c,v $ * Revision 1.13 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.12 2008/09/29 14:02:44 lurcher * Fix missing dlfcn group option * * Revision 1.11 2008/05/20 13:43:46 lurcher * Vms fixes * * Revision 1.10 2007/04/02 10:50:18 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.9 2007/01/02 10:27:50 lurcher * Fix descriptor leak with unicode only driver * * Revision 1.8 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.7 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.6 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.5 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.4 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.3 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.4 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2001/01/02 09:55:04 nick * * More unicode bits * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.10 2000/06/20 13:30:09 ngorham * * Fix problems when using bookmarks * * Revision 1.9 1999/11/28 18:35:50 ngorham * * Add extra ODBC3/2 Date/Time mapping * * Revision 1.8 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/10/09 00:56:16 ngorham * * Added Manush's patch to map ODBC 3-2 datetime values * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 21:40:58 nick * End of another night :-) * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDescribeCol.c,v $ $Revision: 1.13 $"; SQLRETURN SQLDescribeColA( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLCHAR *column_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length, SQLSMALLINT *data_type, SQLULEN *column_size, SQLSMALLINT *decimal_digits, SQLSMALLINT *nullable ) { return SQLDescribeCol( statement_handle, column_number, column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); } SQLRETURN SQLDescribeCol( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLCHAR *column_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length, SQLSMALLINT *data_type, SQLULEN *column_size, SQLSMALLINT *decimal_digits, SQLSMALLINT *nullable ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s5[ 100 + LOG_MESSAGE_LEN ], s6[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Number = %d\ \n\t\t\tColumn Name = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tName Length = %p\ \n\t\t\tData Type = %p\ \n\t\t\tColumn Size = %p\ \n\t\t\tDecimal Digits = %p\ \n\t\t\tNullable = %p", statement, column_number, column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( column_number == 0 && statement -> bookmarks_on == SQL_UB_OFF && statement -> connection -> bookmarks_on == SQL_UB_OFF ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLDESCRIBECOL ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * sadly we can't truct the numcols value * if ( statement -> numcols < column_number ) { __post_internal_error( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ if ( buffer_length < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * This seems to be down to the driver in the MS DM * else if ( statement -> state == STATE_S2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07005" ); __post_internal_error( &statement -> error, ERROR_07005, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ else if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLDESCRIBECOL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1 = NULL; if ( !CHECK_SQLDESCRIBECOLW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( column_name && buffer_length > 0 ) { s1 = malloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 )); } ret = SQLDESCRIBECOLW( statement -> connection, statement -> driver_stmt, column_number, s1 ? s1 : (SQLWCHAR*)column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); if ( SQL_SUCCEEDED( ret ) && column_name && s1 ) { unicode_to_ansi_copy((char*) column_name, buffer_length, s1, SQL_NTS, statement -> connection, NULL ); } if ( s1 ) { free( s1 ); } } else { if ( !CHECK_SQLDESCRIBECOL( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLDESCRIBECOL( statement -> connection, statement -> driver_stmt, column_number, column_name, buffer_length, name_length, data_type, column_size, decimal_digits, nullable ); } if ( (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) && data_type ) { *data_type=__map_type(MAP_SQL_D2DM,statement->connection, *data_type); } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLDESCRIBECOL; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } if ( log_info.log_flag ) { if ( !SQL_SUCCEEDED( ret )) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s6 )); } else { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tColumn Name = %s\ \n\t\t\tData Type = %s\ \n\t\t\tColumn Size = %s\ \n\t\t\tDecimal Digits = %s\ \n\t\t\tNullable = %s", __get_return_status( ret, s6 ), __sdata_as_string( s1, SQL_CHAR, name_length, column_name ), __sptr_as_string( s2, data_type ), __ptr_as_string( s3, (SQLLEN*)column_size ), __sptr_as_string( s4, decimal_digits ), __sptr_as_string( s5, nullable )); } dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLFetchScroll.c0000644000175000017500000002523413364070505015554 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFetchScroll.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLFetchScroll.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2007/11/29 12:00:31 lurcher * Add 64 bit type changes to SQLExtendedFetch etc * * Revision 1.4 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 2000/05/22 17:10:34 ngorham * * Fix problems with the FetchScroll -> ExtendedFetch Mapping * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.2 1999/06/02 23:48:45 ngorham * * Added more 3-2 mapping * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLFetchScroll.c,v $ $Revision: 1.6 $"; SQLRETURN SQLFetchScroll( SQLHSTMT statement_handle, SQLSMALLINT fetch_orientation, SQLLEN fetch_offset ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tFetch Orentation = %d\ \n\t\t\tFetch Offset = %d", statement, fetch_orientation, (int)fetch_offset ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( fetch_orientation != SQL_FETCH_NEXT && fetch_orientation != SQL_FETCH_PRIOR && fetch_orientation != SQL_FETCH_FIRST && fetch_orientation != SQL_FETCH_LAST && fetch_orientation != SQL_FETCH_ABSOLUTE && fetch_orientation != SQL_FETCH_RELATIVE && fetch_orientation != SQL_FETCH_BOOKMARK ) || (fetch_orientation == SQL_FETCH_BOOKMARK && statement -> bookmarks_on == SQL_UB_OFF) ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY106" ); __post_internal_error( &statement -> error, ERROR_HY106, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S7 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLFETCHSCROLL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( CHECK_SQLFETCHSCROLL( statement -> connection )) { ret = SQLFETCHSCROLL( statement -> connection, statement -> driver_stmt, fetch_orientation, fetch_offset ); } else if ( statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection )) { /* * map to ODBC 2 call */ SQLINTEGER bm_ptr = 0; if ( fetch_orientation == SQL_FETCH_BOOKMARK ) { if ( statement -> fetch_bm_ptr ) bm_ptr = *statement -> fetch_bm_ptr; ret = SQLEXTENDEDFETCH( statement -> connection, statement -> driver_stmt, fetch_orientation, bm_ptr, statement -> row_ct_ptr, statement -> row_st_arr ); } else { ret = SQLEXTENDEDFETCH( statement -> connection, statement -> driver_stmt, fetch_orientation, fetch_offset, statement -> row_ct_ptr, statement -> row_st_arr ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLFETCHSCROLL; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( SQL_SUCCEEDED( ret )) { statement -> eod = 0; statement -> state = STATE_S6; } else if ( ret == SQL_NO_DATA ) { statement -> eod = 1; statement -> state = STATE_S6; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLTablesW.c0000644000175000017500000003014613303466667014716 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLTablesW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLTablesW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:49 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLTablesW.c,v $"; SQLRETURN SQLTablesW( SQLHSTMT statement_handle, SQLWCHAR *catalog_name, SQLSMALLINT name_length1, SQLWCHAR *schema_name, SQLSMALLINT name_length2, SQLWCHAR *table_name, SQLSMALLINT name_length3, SQLWCHAR *table_type, SQLSMALLINT name_length4 ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLTABLESW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLTABLESW( parent_statement -> connection, statement_handle, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, table_type, name_length4 ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tTable Type = %s", statement, __wstring_with_length( s1, catalog_name, name_length1 ), __wstring_with_length( s2, schema_name, name_length2 ), __wstring_with_length( s3, table_name, name_length3 ), __wstring_with_length( s4, table_type, name_length4 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * this is a fix for old version of EXCEL */ if ( !catalog_name ) name_length1 = 0; if ( !schema_name ) name_length2 = 0; if ( !table_name ) name_length3 = 0; if ( !table_type ) name_length4 = 0; if (( name_length1 < 0 && name_length1 != SQL_NTS ) || ( name_length2 < 0 && name_length2 != SQL_NTS ) || ( name_length3 < 0 && name_length3 != SQL_NTS ) || ( name_length4 < 0 && name_length4 != SQL_NTS )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLTABLES ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLTABLESW( statement -> connection )) { if ( !CHECK_SQLTABLESW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLTABLESW( statement -> connection , statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, table_type, name_length4 ); } else { SQLCHAR *as1, *as2, *as3, *as4; int clen; if ( !CHECK_SQLTABLES( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( catalog_name, name_length1, statement -> connection, &clen ); name_length1 = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( schema_name, name_length2, statement -> connection, &clen ); name_length2 = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( table_name, name_length3, statement -> connection, &clen ); name_length3 = clen; as4 = (SQLCHAR*) unicode_to_ansi_alloc( table_type, name_length4, statement -> connection, &clen ); name_length4 = clen; ret = SQLTABLES( statement -> connection , statement -> driver_stmt, as1, name_length1, as2, name_length2, as3, name_length3, as4, name_length4 ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); if ( as4 ) free( as4 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* * There is no point in doing this as we can't trust the value * from SQLPrepare, so we can't perform checks on the column number * ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); */ statement -> numcols = 1; /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLTABLES; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/Makefile.in0000664000175000017500000010722313725127174014674 00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = DriverManager ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltargz.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/unixodbc_conf.h CONFIG_CLEAN_FILES = odbc.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = am_libodbc_la_OBJECTS = SQLAllocConnect.lo SQLAllocEnv.lo \ SQLAllocHandle.lo SQLAllocHandleStd.lo SQLAllocStmt.lo \ SQLBindCol.lo SQLBindParam.lo SQLBindParameter.lo \ SQLBrowseConnect.lo SQLBulkOperations.lo SQLCancel.lo \ SQLCancelHandle.lo SQLCloseCursor.lo SQLColAttribute.lo \ SQLColAttributes.lo SQLColumnPrivileges.lo SQLColumns.lo \ SQLConnect.lo SQLCopyDesc.lo SQLDataSources.lo \ SQLDescribeCol.lo SQLDescribeParam.lo SQLDisconnect.lo \ SQLDriverConnect.lo SQLDrivers.lo SQLEndTran.lo SQLError.lo \ SQLExecDirect.lo SQLExecute.lo SQLExtendedFetch.lo SQLFetch.lo \ SQLFetchScroll.lo SQLForeignKeys.lo SQLFreeConnect.lo \ SQLFreeEnv.lo SQLFreeHandle.lo SQLFreeStmt.lo \ SQLGetConnectAttr.lo SQLGetConnectOption.lo \ SQLGetCursorName.lo SQLGetData.lo SQLGetDescField.lo \ SQLGetDescRec.lo SQLGetDiagField.lo SQLGetDiagRec.lo \ SQLGetEnvAttr.lo SQLGetFunctions.lo SQLGetInfo.lo \ SQLGetStmtAttr.lo SQLGetStmtOption.lo SQLGetTypeInfo.lo \ SQLMoreResults.lo SQLNativeSql.lo SQLNumParams.lo \ SQLNumResultCols.lo SQLParamData.lo SQLParamOptions.lo \ SQLPrepare.lo SQLPrimaryKeys.lo SQLProcedureColumns.lo \ SQLProcedures.lo SQLPutData.lo SQLRowCount.lo \ SQLSetConnectAttr.lo SQLSetConnectOption.lo \ SQLSetCursorName.lo SQLSetDescField.lo SQLSetDescRec.lo \ SQLSetEnvAttr.lo SQLSetParam.lo SQLSetPos.lo \ SQLSetScrollOptions.lo SQLSetStmtAttr.lo SQLSetStmtOption.lo \ SQLSpecialColumns.lo SQLStatistics.lo SQLTablePrivileges.lo \ SQLTables.lo SQLTransact.lo SQLBrowseConnectW.lo \ SQLColAttributeW.lo SQLColAttributesW.lo \ SQLColumnPrivilegesW.lo SQLColumnsW.lo SQLConnectW.lo \ SQLDataSourcesW.lo SQLDescribeColW.lo SQLDriverConnectW.lo \ SQLDriversW.lo SQLErrorW.lo SQLExecDirectW.lo \ SQLForeignKeysW.lo SQLGetConnectAttrW.lo \ SQLGetConnectOptionW.lo SQLGetCursorNameW.lo \ SQLGetDescFieldW.lo SQLGetDescRecW.lo SQLGetDiagFieldW.lo \ SQLGetDiagRecW.lo SQLGetInfoW.lo SQLGetStmtAttrW.lo \ SQLGetTypeInfoW.lo SQLNativeSqlW.lo SQLPrepareW.lo \ SQLPrimaryKeysW.lo SQLProcedureColumnsW.lo SQLProceduresW.lo \ SQLSetConnectAttrW.lo SQLSetConnectOptionW.lo \ SQLSetCursorNameW.lo SQLSetDescFieldW.lo SQLSetStmtAttrW.lo \ SQLSetStmtOptionW.lo SQLSpecialColumnsW.lo SQLStatisticsW.lo \ SQLTablePrivilegesW.lo SQLTablesW.lo __connection.lo \ __handles.lo __info.lo __stats.lo __attribute.lo libodbc_la_OBJECTS = $(am_libodbc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libodbc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libodbc_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libodbc_la_SOURCES) DIST_SOURCES = $(libodbc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/odbc.pc.in \ $(top_srcdir)/depcomp $(top_srcdir)/mkinstalldirs ChangeLog \ TODO DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BIN_PREFIX = @BIN_PREFIX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFLIB_PATH = @DEFLIB_PATH@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEC_PREFIX = @EXEC_PREFIX@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ ICONV_CHAR_ENCODING = @ICONV_CHAR_ENCODING@ ICONV_UNICODE_ENCODING = @ICONV_UNICODE_ENCODING@ INCLTDL = @INCLTDL@ INCLUDE_PREFIX = @INCLUDE_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LFLAGS = @LFLAGS@ LIBADD_CRYPT = @LIBADD_CRYPT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_POW = @LIBADD_POW@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBICONV = @LIBICONV@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_PREFIX = @LIB_PREFIX@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PREFIX = @PREFIX@ PTH_CFLAGS = @PTH_CFLAGS@ PTH_CPPFLAGS = @PTH_CPPFLAGS@ PTH_LDFLAGS = @PTH_LDFLAGS@ PTH_LIBS = @PTH_LIBS@ RANLIB = @RANLIB@ READLINE = @READLINE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHLIBEXT = @SHLIBEXT@ STATS_FTOK_NAME = @STATS_FTOK_NAME@ STRIP = @STRIP@ SYSTEM_FILE_PATH = @SYSTEM_FILE_PATH@ SYSTEM_LIB_PATH = @SYSTEM_LIB_PATH@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ msql_headers = @msql_headers@ msql_libraries = @msql_libraries@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libodbc.la AM_CPPFLAGS = -I@top_srcdir@/include \ $(LTDLINCL) EXTRA_DIST = \ drivermanager.h \ DriverManager.exp \ __stats.h \ drivermanager_axp.opt libodbc_la_LIBADD = \ ../lst/liblstlc.la \ ../log/libloglc.la \ ../ini/libinilc.la \ ../odbcinst/libodbcinstlc.la \ $(LIBLTDL) \ $(LIBICONV) libodbc_la_LDFLAGS = \ -version-info @LIB_VERSION@ \ -no-undefined \ -export-dynamic \ -export-symbols @srcdir@/DriverManager.exp libodbc_la_DEPENDENCIES = $(LTDLDEPS) \ ../lst/liblstlc.la \ ../log/libloglc.la \ ../ini/libinilc.la \ ../odbcinst/libodbcinstlc.la libodbc_la_SOURCES = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocHandle.c \ SQLAllocHandleStd.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParam.c \ SQLBindParameter.c \ SQLBrowseConnect.c \ SQLBulkOperations.c \ SQLCancel.c \ SQLCancelHandle.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDataSources.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLDrivers.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagField.c \ SQLGetDiagRec.c \ SQLGetEnvAttr.c \ SQLGetFunctions.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectAttr.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescField.c \ SQLSetDescRec.c \ SQLSetEnvAttr.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c \ SQLBrowseConnectW.c \ SQLColAttributeW.c \ SQLColAttributesW.c \ SQLColumnPrivilegesW.c \ SQLColumnsW.c \ SQLConnectW.c \ SQLDataSourcesW.c \ SQLDescribeColW.c \ SQLDriverConnectW.c \ SQLDriversW.c \ SQLErrorW.c \ SQLExecDirectW.c \ SQLForeignKeysW.c \ SQLGetConnectAttrW.c \ SQLGetConnectOptionW.c \ SQLGetCursorNameW.c \ SQLGetDescFieldW.c \ SQLGetDescRecW.c \ SQLGetDiagFieldW.c \ SQLGetDiagRecW.c \ SQLGetInfoW.c \ SQLGetStmtAttrW.c \ SQLGetTypeInfoW.c \ SQLNativeSqlW.c \ SQLPrepareW.c \ SQLPrimaryKeysW.c \ SQLProcedureColumnsW.c \ SQLProceduresW.c \ SQLSetConnectAttrW.c \ SQLSetConnectOptionW.c \ SQLSetCursorNameW.c \ SQLSetDescFieldW.c \ SQLSetStmtAttrW.c \ SQLSetStmtOptionW.c \ SQLSpecialColumnsW.c \ SQLStatisticsW.c \ SQLTablePrivilegesW.c \ SQLTablesW.c \ __connection.c \ __handles.c \ __info.c \ __stats.c \ __attribute.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu DriverManager/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu DriverManager/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): odbc.pc: $(top_builddir)/config.status $(srcdir)/odbc.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libodbc.la: $(libodbc_la_OBJECTS) $(libodbc_la_DEPENDENCIES) $(EXTRA_libodbc_la_DEPENDENCIES) $(AM_V_CCLD)$(libodbc_la_LINK) -rpath $(libdir) $(libodbc_la_OBJECTS) $(libodbc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocHandleStd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLAllocStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBindParameter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBrowseConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBrowseConnectW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLBulkOperations.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCancel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCancelHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCloseCursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttributeW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttributes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColAttributesW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumnPrivileges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumnPrivilegesW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLColumnsW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLConnectW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLCopyDesc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDataSources.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDataSourcesW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeCol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeColW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDescribeParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDisconnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDriverConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDriverConnectW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDrivers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLDriversW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLEndTran.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLError.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLErrorW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecDirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecDirectW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExecute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLExtendedFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFetchScroll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLForeignKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLForeignKeysW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeConnect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeEnv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeHandle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLFreeStmt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectAttrW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetConnectOptionW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetCursorName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetCursorNameW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescFieldW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDescRecW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagFieldW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetDiagRecW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetEnvAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetFunctions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetInfoW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtAttrW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetStmtOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetTypeInfo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLGetTypeInfoW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLMoreResults.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNativeSql.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNativeSqlW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumParams.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLNumResultCols.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLParamOptions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrepare.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrepareW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrimaryKeys.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPrimaryKeysW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedureColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedureColumnsW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProcedures.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLProceduresW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLPutData.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLRowCount.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectAttrW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetConnectOptionW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetCursorName.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetCursorNameW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescField.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescFieldW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetDescRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetEnvAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetPos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetScrollOptions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtAttr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtAttrW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtOption.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSetStmtOptionW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSpecialColumns.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLSpecialColumnsW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLStatistics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLStatisticsW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTablePrivileges.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTablePrivilegesW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTables.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTablesW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SQLTransact.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/__attribute.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/__connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/__handles.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/__info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/__stats.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: unixODBC-2.3.9/DriverManager/SQLBulkOperations.c0000644000175000017500000002161413303466667016316 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBulkOperations.c,v 1.4 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLBulkOperations.c,v $ * Revision 1.4 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.2 1999/06/02 23:48:45 ngorham * * Added more 3-2 mapping * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLBulkOperations.c,v $ $Revision: 1.4 $"; SQLRETURN SQLBulkOperations( SQLHSTMT statement_handle, SQLSMALLINT operation ) { DMHSTMT statement = (DMHSTMT)statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tOption = %d", statement, operation ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S7 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLBULKOPERATIONS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) { statement -> interupted_state = statement -> state; } /* * there are a lot of conditions that should be tested here */ if ( CHECK_SQLBULKOPERATIONS( statement -> connection )) { ret = SQLBULKOPERATIONS( statement -> connection, statement -> driver_stmt, operation ); } else if ( CHECK_SQLSETPOS( statement -> connection ) && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && operation == SQL_ADD ) { ret = SQLSETPOS( statement -> connection, statement -> driver_stmt, 0, SQL_ADD, SQL_LOCK_NO_CHANGE ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLBULKOPERATIONS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( ret == SQL_NEED_DATA ) { statement -> interupted_func = SQL_API_SQLBULKOPERATIONS; statement -> interupted_state = statement -> state; statement -> state = STATE_S8; } else { statement -> state = statement -> interupted_state; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLAllocStmt.c0000755000175000017500000000447713303466667015272 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLAllocStmt.c,v 1.2 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLAllocStmt.c,v $ * Revision 1.2 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.3 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.2 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLAllocStmt.c,v $ $Revision: 1.2 $"; SQLRETURN SQLAllocStmt( SQLHDBC connection_handle, SQLHSTMT *statement_handle ) { return __SQLAllocHandle( SQL_HANDLE_STMT, connection_handle, statement_handle, SQL_OV_ODBC2 ); } unixODBC-2.3.9/DriverManager/SQLSetDescFieldW.c0000644000175000017500000003042413303466667016001 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetDescFieldW.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetDescFieldW.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.6 2007/03/05 09:49:24 lurcher * Get it to build on VMS again * * Revision 1.5 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.4 2006/04/18 10:24:47 lurcher * Add a couple of changes from Mark Vanderwiel * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/17 16:29:39 nick * * More checks and autotest fixes * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetDescFieldW.c,v $"; SQLRETURN SQLSetDescFieldW( SQLHDESC descriptor_handle, SQLSMALLINT rec_number, SQLSMALLINT field_identifier, SQLPOINTER value, SQLINTEGER buffer_length ) { /* * not quite sure how the descriptor can be * allocated to a statement, all the documentation talks * about state transitions on statement states, but the * descriptor may be allocated with more than one statement * at one time. Which one should I check ? */ DMHDESC descriptor = (DMHDESC) descriptor_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; int isStrField = 0; /* * check descriptor */ if ( !__validate_desc( descriptor )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDESC parent_desc; parent_desc = find_parent_handle( descriptor, SQL_HANDLE_DESC ); if ( parent_desc ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLSETDESCFIELDW( parent_desc -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLSETDESCFIELDW( parent_desc -> connection, descriptor, rec_number, field_identifier, value, buffer_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( descriptor ); if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tEntry:\ \n\t\t\tDescriptor = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tField Ident = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Length = %d", descriptor, rec_number, __desc_attr_as_string( s1, field_identifier ), value, (int)buffer_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } thread_protect( SQL_HANDLE_DESC, descriptor ); if ( descriptor -> connection -> state < STATE_C4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } /* * check status of statements associated with this descriptor */ if( __check_stmt_from_desc( descriptor, STATE_S8 ) || __check_stmt_from_desc( descriptor, STATE_S9 ) || __check_stmt_from_desc( descriptor, STATE_S10 ) || __check_stmt_from_desc( descriptor, STATE_S11 ) || __check_stmt_from_desc( descriptor, STATE_S12 ) || __check_stmt_from_desc( descriptor, STATE_S13 ) || __check_stmt_from_desc( descriptor, STATE_S14 ) || __check_stmt_from_desc( descriptor, STATE_S15 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &descriptor -> error, ERROR_HY010, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( rec_number < 0 ) { __post_internal_error( &descriptor -> error, ERROR_07009, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } switch ( field_identifier ) { /* Fixed-length fields: buffer_length is ignored */ case SQL_DESC_ALLOC_TYPE: case SQL_DESC_ARRAY_SIZE: case SQL_DESC_ARRAY_STATUS_PTR: case SQL_DESC_BIND_OFFSET_PTR: case SQL_DESC_BIND_TYPE: case SQL_DESC_COUNT: case SQL_DESC_ROWS_PROCESSED_PTR: case SQL_DESC_AUTO_UNIQUE_VALUE: case SQL_DESC_CASE_SENSITIVE: case SQL_DESC_CONCISE_TYPE: case SQL_DESC_DATA_PTR: case SQL_DESC_DATETIME_INTERVAL_CODE: case SQL_DESC_DATETIME_INTERVAL_PRECISION: case SQL_DESC_DISPLAY_SIZE: case SQL_DESC_FIXED_PREC_SCALE: case SQL_DESC_INDICATOR_PTR: case SQL_DESC_LENGTH: case SQL_DESC_NULLABLE: case SQL_DESC_NUM_PREC_RADIX: case SQL_DESC_OCTET_LENGTH: case SQL_DESC_OCTET_LENGTH_PTR: case SQL_DESC_PARAMETER_TYPE: case SQL_DESC_PRECISION: case SQL_DESC_ROWVER: case SQL_DESC_SCALE: case SQL_DESC_SEARCHABLE: case SQL_DESC_TYPE: case SQL_DESC_UNNAMED: case SQL_DESC_UNSIGNED: case SQL_DESC_UPDATABLE: isStrField = 0; break; /* Pointer to data: buffer_length must be valid */ case SQL_DESC_BASE_COLUMN_NAME: case SQL_DESC_BASE_TABLE_NAME: case SQL_DESC_CATALOG_NAME: case SQL_DESC_LABEL: case SQL_DESC_LITERAL_PREFIX: case SQL_DESC_LITERAL_SUFFIX: case SQL_DESC_LOCAL_TYPE_NAME: case SQL_DESC_NAME: case SQL_DESC_SCHEMA_NAME: case SQL_DESC_TABLE_NAME: case SQL_DESC_TYPE_NAME: isStrField = 1; break; default: isStrField = buffer_length != SQL_IS_POINTER && buffer_length != SQL_IS_INTEGER && buffer_length != SQL_IS_UINTEGER && buffer_length != SQL_IS_SMALLINT && buffer_length != SQL_IS_USMALLINT; } if ( isStrField && buffer_length < 0 && buffer_length != SQL_NTS) { __post_internal_error( &descriptor -> error, ERROR_HY090, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( field_identifier == SQL_DESC_COUNT && (intptr_t)value < 0 ) { __post_internal_error( &descriptor -> error, ERROR_07009, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( field_identifier == SQL_DESC_PARAMETER_TYPE && (intptr_t)value != SQL_PARAM_INPUT && (intptr_t)value != SQL_PARAM_OUTPUT && (intptr_t)value != SQL_PARAM_INPUT_OUTPUT && (intptr_t)value != SQL_PARAM_INPUT_OUTPUT_STREAM && (intptr_t)value != SQL_PARAM_OUTPUT_STREAM ) { __post_internal_error( &descriptor -> error, ERROR_HY105, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } if ( descriptor -> connection -> unicode_driver || CHECK_SQLSETDESCFIELDW( descriptor -> connection )) { if ( !CHECK_SQLSETDESCFIELDW( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } ret = SQLSETDESCFIELDW( descriptor -> connection, descriptor -> driver_desc, rec_number, field_identifier, value, buffer_length ); if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } } else { SQLCHAR *ascii_str = NULL; if ( !CHECK_SQLSETDESCFIELD( descriptor -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &descriptor -> error, ERROR_IM001, NULL, descriptor -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DESC, descriptor, SQL_ERROR ); } /* * is it a char arg... */ switch ( field_identifier ) { case SQL_DESC_NAME: /* This is the only R/W SQLCHAR* type */ ascii_str = (SQLCHAR*) unicode_to_ansi_alloc( value, buffer_length, descriptor -> connection, NULL ); value = ascii_str; buffer_length = strlen((char*) ascii_str ); break; default: break; } ret = SQLSETDESCFIELD( descriptor -> connection, descriptor -> driver_desc, rec_number, field_identifier, value, buffer_length ); if ( log_info.log_flag ) { sprintf( descriptor -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, descriptor -> msg ); } if ( ascii_str ) { free( ascii_str ); } } return function_return( SQL_HANDLE_DESC, descriptor, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLSetCursorName.c0000644000175000017500000002100013303466667016074 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetCursorName.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetCursorName.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/02/27 12:19:40 lurcher * * Add the A functions as well as the W * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetCursorName.c,v $ $Revision: 1.6 $"; SQLRETURN SQLSetCursorNameA( SQLHSTMT statement_handle, SQLCHAR *cursor_name, SQLSMALLINT name_length ) { return SQLSetCursorName( statement_handle, cursor_name, name_length ); } SQLRETURN SQLSetCursorName( SQLHSTMT statement_handle, SQLCHAR *cursor_name, SQLSMALLINT name_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCursor name = %s", statement, __string_with_length( s1, cursor_name, name_length )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( !cursor_name || (name_length < 0 && name_length != SQL_NTS ) ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1; int wlen; if ( !CHECK_SQLSETCURSORNAMEW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } s1 = ansi_to_unicode_alloc( cursor_name, name_length, statement -> connection, &wlen ); name_length = wlen; ret = SQLSETCURSORNAMEW( statement -> connection, statement -> driver_stmt, s1, name_length ); if ( s1 ) free( s1 ); } else { if ( !CHECK_SQLSETCURSORNAME( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLSETCURSORNAME( statement -> connection, statement -> driver_stmt, cursor_name, name_length ); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLDrivers.c0000644000175000017500000003601213303466667014771 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDrivers.c,v 1.13 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDrivers.c,v $ * Revision 1.13 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.12 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.11 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.10 2005/10/06 08:58:19 lurcher * Fix problem with SQLDrivers not returning first entry * * Revision 1.9 2005/07/17 09:11:23 lurcher * Fix bug in SQLDrivers that was stopping the return of the attribute length * * Revision 1.8 2004/07/25 00:42:02 peteralexharvey * for OS2 port * * Revision 1.7 2003/11/13 15:12:53 lurcher * * small change to ODBCConfig to have the password field in the driver * properties hide the password * Make both # and ; comments in ini files * * Revision 1.6 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/05/21 14:19:44 lurcher * * * Update libtool to escape from AIX build problem * * Add fix to avoid file handle limitations * * Add more UNICODE changes, it looks like it is native 16 representation * the old way can be reproduced by defining UCS16BE * * Add iusql, its just the same as isql but uses the wide functions * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/05/15 10:57:44 nick * * Add initial support for VMS * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.12 2000/08/16 13:06:21 ngorham * * Fix invalid return code * * Revision 1.11 2000/07/13 13:27:24 ngorham * * remove _ from odbcinst_system_file_path() * * Revision 1.10 2001/04/04 23:10:34 ngorham * * Fix a SQLDrivers problem * * Revision 1.9 2000/02/20 10:18:47 ngorham * * Add support for ODBCINI environment override for Applix. * * Revision 1.8 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/09/19 22:24:33 ngorham * * Added support for the cursor library * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:06 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.4 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDrivers.c,v $ $Revision: 1.13 $"; #define BUFFERSIZE 1024 SQLRETURN SQLDriversA( SQLHENV henv, SQLUSMALLINT fdirection, SQLCHAR *sz_driver_desc, SQLSMALLINT cb_driver_desc_max, SQLSMALLINT *pcb_driver_desc, SQLCHAR *sz_driver_attributes, SQLSMALLINT cb_drvr_attr_max, SQLSMALLINT *pcb_drvr_attr ) { return SQLDrivers( henv, fdirection, sz_driver_desc, cb_driver_desc_max, pcb_driver_desc, sz_driver_attributes, cb_drvr_attr_max, pcb_drvr_attr ); } SQLRETURN SQLDrivers( SQLHENV henv, SQLUSMALLINT fdirection, SQLCHAR *sz_driver_desc, SQLSMALLINT cb_driver_desc_max, SQLSMALLINT *pcb_driver_desc, SQLCHAR *sz_driver_attributes, SQLSMALLINT cb_drvr_attr_max, SQLSMALLINT *pcb_drvr_attr ) { DMHENV environment = (DMHENV) henv; char buffer[ BUFFERSIZE + 1 ]; char object[ INI_MAX_OBJECT_NAME + 1 ]; SQLRETURN ret = SQL_SUCCESS; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p\ \n\t\t\tDirection = %d", environment, (int)fdirection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); /* * check that a version has been requested */ if ( ! environment -> version_set ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &environment -> error, ERROR_HY010, NULL, SQL_OV_ODBC3 ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( cb_driver_desc_max < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &environment -> error, ERROR_HY090, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( cb_drvr_attr_max < 0 || cb_drvr_attr_max == 1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &environment -> error, ERROR_HY090, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( fdirection != SQL_FETCH_FIRST && fdirection != SQL_FETCH_NEXT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY103" ); __post_internal_error( &environment -> error, ERROR_HY103, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( fdirection == SQL_FETCH_FIRST ) environment -> sql_driver_count = 0; else environment -> sql_driver_count ++; try_again: memset( buffer, '\0', sizeof( buffer )); memset( object, '\0', sizeof( object )); SQLGetPrivateProfileString( NULL, NULL, NULL, buffer, sizeof( buffer ), "ODBCINST.INI" ); if ( iniElement( buffer, '\0', '\0', environment -> sql_driver_count, object, sizeof( object )) != INI_SUCCESS ) { /* * Set up for the next time */ environment -> sql_driver_count = -1; ret = SQL_NO_DATA; } else { ret = SQL_SUCCESS; /* * this section is used for internal info */ if ( strcmp( object, "ODBC" ) == 0 ) { environment -> sql_driver_count ++; goto try_again; } if ( pcb_driver_desc ) *pcb_driver_desc = strlen( object ); if ( sz_driver_desc ) { if ( strlen( object ) >= cb_driver_desc_max ) { memcpy( sz_driver_desc, object, cb_driver_desc_max - 1 ); sz_driver_desc[ cb_driver_desc_max - 1 ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } else { strcpy((char*) sz_driver_desc, object ); } } else { ret = SQL_SUCCESS; } if ( sz_driver_attributes || pcb_drvr_attr ) { HINI hIni; char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char szValue[INI_MAX_PROPERTY_NAME+1]; char szIniName[ INI_MAX_OBJECT_NAME + 1 ]; char buffer[ 1024 ]; int total_len = 0; char b1[ 256 ], b2[ 256 ]; int found = 0; /* * enumerate the driver attributes, first in system odbcinst.ini and if not found in user odbcinst.ini */ sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); memset( buffer, '\0', sizeof( buffer )); #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE, 1L ) == INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE ) == INI_SUCCESS ) #endif { iniObjectSeek( hIni, (char *)object ); iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) != TRUE ) { iniProperty( hIni, szPropertyName ); iniValue( hIni, szValue ); sprintf( buffer, "%s=%s", szPropertyName, szValue ); found = 1; if ( sz_driver_attributes ) { if ( total_len + strlen( buffer ) + 1 > cb_drvr_attr_max ) { ret = SQL_SUCCESS_WITH_INFO; } else { strcpy((char*) sz_driver_attributes, buffer ); sz_driver_attributes += strlen( buffer ) + 1; } } total_len += strlen( buffer ) + 1; iniPropertyNext( hIni ); } /* * add extra null */ if ( sz_driver_attributes ) *sz_driver_attributes = '\0'; if ( pcb_drvr_attr ) { *pcb_drvr_attr = total_len; } iniClose( hIni ); } if ( !found ) { sprintf( szIniName, "%s/%s", odbcinst_user_file_path( b1 ), odbcinst_user_file_name( b2 )); memset( buffer, '\0', sizeof( buffer )); #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE, 1L ) == INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE ) == INI_SUCCESS ) #endif { iniObjectSeek( hIni, (char *)object ); iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) != TRUE ) { iniProperty( hIni, szPropertyName ); iniValue( hIni, szValue ); sprintf( buffer, "%s=%s", szPropertyName, szValue ); if ( sz_driver_attributes ) { if ( total_len + strlen( buffer ) + 1 > cb_drvr_attr_max ) { ret = SQL_SUCCESS_WITH_INFO; } else { strcpy((char*) sz_driver_attributes, buffer ); sz_driver_attributes += strlen( buffer ) + 1; } } total_len += strlen( buffer ) + 1; iniPropertyNext( hIni ); } /* * add extra null */ if ( sz_driver_attributes ) *sz_driver_attributes = '\0'; if ( pcb_drvr_attr ) { *pcb_drvr_attr = total_len; } iniClose( hIni ); } } } } if ( ret == SQL_SUCCESS_WITH_INFO ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 01004" ); __post_internal_error( &environment -> error, ERROR_01004, NULL, environment -> requested_version ); } if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } return function_return_nodrv( SQL_HANDLE_ENV, environment, ret ); } unixODBC-2.3.9/DriverManager/SQLGetConnectOption.c0000644000175000017500000003376213676601210016572 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetConnectOption.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetConnectOption.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.7 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/11/11 17:10:10 lurcher * * VMS changes * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/08/03 15:19:00 nick * * Add changes to set values before connect * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.8 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.7 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/09/19 22:24:34 ngorham * * Added support for the cursor library * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetConnectOption.c,v $ $Revision: 1.9 $"; SQLRETURN SQLGetConnectOptionA( SQLHDBC connection_handle, SQLUSMALLINT option, SQLPOINTER value ) { return SQLGetConnectOption( connection_handle, option, value ); } SQLRETURN SQLGetConnectOption( SQLHDBC connection_handle, SQLUSMALLINT option, SQLPOINTER value ) { DMHDBC connection = (DMHDBC)connection_handle; int type = 0; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * doesn't require a handle */ if ( option == SQL_ATTR_TRACE ) { if ( value ) { *((SQLINTEGER*)value) = SQL_OPT_TRACE_ON; } return SQL_SUCCESS; } else if ( option == SQL_ATTR_TRACEFILE ) { SQLRETURN ret = SQL_SUCCESS; if ( log_info.log_file_name ) { strcpy( value, log_info.log_file_name ); } else { strcpy( value, "" ); } return ret; } /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tOption = %s\ \n\t\t\tValue = %p", connection, __con_attr_as_string( s1, option ), value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( connection -> state == STATE_C2 ) { switch ( option ) { case SQL_ACCESS_MODE: case SQL_AUTOCOMMIT: case SQL_LOGIN_TIMEOUT: case SQL_ODBC_CURSORS: break; default: dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } switch ( option ) { case SQL_ACCESS_MODE: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> access_mode; type = 1; } break; case SQL_AUTOCOMMIT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> auto_commit; type = 1; } break; case SQL_ODBC_CURSORS: *((SQLINTEGER*)value) = connection -> cursors; type = 1; break; case SQL_ATTR_LOGIN_TIMEOUT: /* * if connected, call the driver */ if ( connection -> state != STATE_C2 ) { type = 0; } else { *((SQLINTEGER*)value) = connection -> login_timeout; type = 1; } break; default: break; } /* * if type has been set we have already set the value, * so just return */ if ( type ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } else { SQLRETURN ret = 0; /* * call the driver */ if ( connection -> unicode_driver ) { SQLWCHAR *s1 = NULL; if (( ret = CHECK_SQLGETCONNECTOPTIONW( connection ))) { switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value ) { /* * guess a length */ if ( value ) { s1 = malloc( sizeof( SQLWCHAR ) * 1024 ); } } break; } ret = SQLGETCONNECTOPTIONW( connection, connection -> driver_dbc, option, s1 ? s1 : value ); switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: if ( SQL_SUCCEEDED( ret ) && value && s1 ) { unicode_to_ansi_copy( value, 1024, s1, SQL_NTS, connection, NULL ); } break; } if ( s1 ) { free( s1 ); } } else if ( CHECK_SQLGETCONNECTATTRW( connection )) { SQLINTEGER length, len; void * ptr; SQLWCHAR txt[ 1024 ]; switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: length = sizeof( txt ); ptr = txt; break; default: length = sizeof( SQLINTEGER ); ptr = value; break; } ret = SQLGETCONNECTATTRW( connection, connection -> driver_dbc, option, ptr, length, &len ); /* * not much else we can do here, lets assume that * there is enough space */ if ( ptr != value && SQL_SUCCEEDED( ret )) { unicode_to_ansi_copy( value, 1024, ptr, SQL_NTS, connection, NULL ); /* * are we still here ? good */ } } else { __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { if ( CHECK_SQLGETCONNECTOPTION( connection )) { ret = SQLGETCONNECTOPTION( connection, connection -> driver_dbc, option, value ); } else if ( CHECK_SQLGETCONNECTATTR( connection )) { SQLINTEGER length, len; void * ptr; char txt[ 1024 ]; switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: length = sizeof( txt ); ptr = txt; break; default: length = sizeof( SQLINTEGER ); ptr = value; break; } ret = SQLGETCONNECTATTR( connection, connection -> driver_dbc, option, ptr, length, &len ); /* * not much else we can do here, lets assume that * there is enough space */ if ( ptr != value ) { strcpy( value, ptr ); /* * are we still here ? good */ } } else { __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } } unixODBC-2.3.9/DriverManager/SQLFreeStmt.c0000644000175000017500000001714013303466667015105 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLFreeStmt.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLFreeStmt.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/07/04 17:27:56 lurcher * * Small bug fixes * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLFreeStmt.c,v $ $Revision: 1.6 $"; SQLRETURN SQLFreeStmt( SQLHSTMT statement_handle, SQLUSMALLINT option ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tOption = %d", statement, option ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); switch ( option ) { case SQL_CLOSE: case SQL_DROP: case SQL_RESET_PARAMS: case SQL_UNBIND: break; default: dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &statement -> error, ERROR_HY092, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( !CHECK_SQLFREESTMT( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * option has already been checked and found valid */ switch ( option ) { case SQL_CLOSE: ret = SQLFREESTMT( statement -> connection, statement -> driver_stmt, option ); if ( SQL_SUCCEEDED( ret )) { if ( statement -> state == STATE_S4 ) { if ( statement -> prepared ) statement -> state = STATE_S2; else statement -> state = STATE_S1; } else if ( statement -> state >= STATE_S5 && statement -> state <= STATE_S7 ) { if ( statement -> prepared ) statement -> state = STATE_S3; else statement -> state = STATE_S1; } statement -> hascols = 0; } break; case SQL_DROP: /* * call SQLFreeHandle(); */ thread_release( SQL_HANDLE_STMT, statement ); return function_return( IGNORE_THREAD, statement, __SQLFreeHandle( SQL_HANDLE_STMT, statement_handle), DEFER_R3); case SQL_RESET_PARAMS: case SQL_UNBIND: ret = SQLFREESTMT( statement -> connection, statement -> driver_stmt, option ); /* * TO_DO reset any information about parameters or bound columns */ break; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLDisconnect.c0000644000175000017500000002447613303466667015457 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDisconnect.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDisconnect.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2004/02/18 15:47:44 lurcher * * Fix a leak in the iconv code * * Revision 1.7 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.6 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.5 2002/08/12 13:17:52 lurcher * * Replicate the way the MS DM handles loading of driver libs, and allocating * handles in the driver. usage counting in the driver means that dlopen is * only called for the first use, and dlclose for the last. AllocHandle for * the driver environment is only called for the first time per driver * per application environment. * * Revision 1.4 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/07/04 17:27:56 lurcher * * Small bug fixes * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.8 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.7 2001/03/21 16:12:29 nick * * Alter cleaning of stmt and desc handles if a SQLDisconnect fails * * Revision 1.6 2001/03/02 14:24:23 nick * * Fix thread detection for Solaris * * Revision 1.5 2001/02/12 11:20:22 nick * * Add supoort for calling SQLDriverLoad and SQLDriverUnload * * Revision 1.4 2000/12/18 12:53:29 nick * * More pooling tweeks * * Revision 1.3 2000/12/18 12:32:16 nick * * Fix missing return codes * * Revision 1.2 2000/12/14 18:10:19 nick * * Add connection pooling * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.13 2000/04/27 20:49:03 ngorham * * Fixes to work with Star Office 5.2 * * Revision 1.12 2001/04/27 01:33:40 ngorham * * Fix a problem where handles were not being free'd * * Revision 1.11 2001/04/05 21:15:01 ngorham * * Fix small memory leak in SQLDisconnect and the Postgres driver * * Revision 1.10 2000/02/25 00:02:00 ngorham * * Add a patch to support IBM DB2, and Solaris threads * * Revision 1.9 2000/02/22 22:14:45 ngorham * * Added support for solaris threads * Added check to overcome bug in PHP4 * Fixed bug in descriptors and ODBC 3 drivers * * Revision 1.8 1999/12/28 15:05:01 ngorham * * Fix bug that caused StarOffice to fail. A SQLConnect, SQLDisconnect, * followed by another SQLConnect on the same DBC would fail. * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDisconnect.c,v $ $Revision: 1.9 $"; extern int pooling_enabled; SQLRETURN SQLDisconnect( SQLHDBC connection_handle ) { DMHDBC connection = (DMHDBC)connection_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p", connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); /* * check states */ if ( connection -> state == STATE_C6 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 25000" ); __post_internal_error( &connection -> error, ERROR_25000, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( connection -> state == STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * any statements that are in SQL_NEED_DATA */ if( __check_stmt_from_dbc( connection, STATE_S8 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if( __check_stmt_from_dbc( connection, STATE_S13 )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * is it a pooled connection, or can it go back */ if ( connection -> pooled_connection ) { __clean_stmt_from_dbc( connection ); __clean_desc_from_dbc( connection ); return_to_pool( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } else if ( pooling_enabled && connection -> pooling_timeout > 0 ) { __clean_stmt_from_dbc( connection ); __clean_desc_from_dbc( connection ); return_to_pool( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } /* * disconnect from the driver */ if ( !CHECK_SQLDISCONNECT( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } ret = SQLDISCONNECT( connection, connection -> driver_dbc ); if ( SQL_SUCCEEDED( ret )) { /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, connection, ret, TRUE, DEFER_R0 ); } /* * complete disconnection from driver */ __disconnect_part_three( connection ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R0 ); } unixODBC-2.3.9/DriverManager/SQLSetStmtAttrW.c0000644000175000017500000005170613470516636015744 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetStmtAttrW.c,v 1.10 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetStmtAttrW.c,v $ * Revision 1.10 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.9 2009/02/04 09:30:02 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.8 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2006/04/18 10:24:47 lurcher * Add a couple of changes from Mark Vanderwiel * * Revision 1.5 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2002/05/28 13:30:34 lurcher * * Tidy up for AIX * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetStmtAttrW.c,v $"; SQLRETURN SQLSetStmtAttrW( SQLHSTMT statement_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER string_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; SQLWCHAR buffer[ 512 ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLSETSTMTATTRW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLSETSTMTATTRW( parent_statement -> connection, statement_handle, attribute, value, string_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tStrLen = %d", statement, __stmt_attr_as_string( s1, attribute ), value, (int)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( attribute == SQL_ATTR_CONCURRENCY || attribute == SQL_ATTR_CURSOR_TYPE || attribute == SQL_ATTR_SIMULATE_CURSOR || attribute == SQL_ATTR_USE_BOOKMARKS || attribute == SQL_ATTR_CURSOR_SCROLLABLE || attribute == SQL_ATTR_CURSOR_SENSITIVITY ) { if ( statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &statement -> error, ERROR_HY011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { if ( statement -> prepared ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &statement -> error, ERROR_HY011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } } else { if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( statement -> connection -> unicode_driver || CHECK_SQLSETSTMTATTRW( statement -> connection )) { if ( !CHECK_SQLSETSTMTATTRW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { if ( !CHECK_SQLSETSTMTATTR( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * map descriptors to our copies */ if ( attribute == SQL_ATTR_APP_ROW_DESC ) { DMHDESC desc = ( DMHDESC ) value; /* * needs to reset to implicit descriptor, this is safe * without a validate, as the value is either null, or the * same as a descriptor we know is valid */ if ( desc == NULL || desc == statement -> implicit_ard ) { DRV_SQLHDESC drv_desc = NULL; ret = SQL_SUCCESS; if ( desc == statement -> implicit_ard ) { drv_desc = statement -> implicit_ard -> driver_desc; } if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, statement -> implicit_ard -> driver_desc, 0 ); } else if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, drv_desc, 0 ); } else { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, statement -> implicit_ard -> driver_desc ); } if ( ret != SQL_SUCCESS ) { if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } /* * copy DM descriptor */ statement -> apd = statement -> implicit_apd; if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } if ( !__validate_desc( desc )) { thread_release( SQL_HANDLE_STMT, statement ); return SQL_INVALID_HANDLE; } if ( desc -> implicit && desc != statement -> implicit_ard ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &statement -> error, ERROR_HY017, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( desc -> connection != statement -> connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &statement -> error, ERROR_HY024, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * set the value to the driver descriptor handle */ value = ( SQLPOINTER ) desc -> driver_desc; statement -> ard = desc; desc -> associated_with = statement; } if ( attribute == SQL_ATTR_APP_PARAM_DESC ) { DMHDESC desc = ( DMHDESC ) value; /* * needs to reset to implicit descriptor, this is safe * without a validate, as the value is either null, or the * same as a descriptor we know is valid */ if ( desc == NULL || desc == statement -> implicit_apd ) { DRV_SQLHDESC drv_desc = NULL; ret = SQL_SUCCESS; if ( desc == statement -> implicit_apd ) { drv_desc = statement -> implicit_apd -> driver_desc; } if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, statement -> implicit_apd -> driver_desc, 0 ); } else if ( CHECK_SQLSETSTMTATTR( statement -> connection )) { ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, statement -> implicit_apd -> driver_desc, 0 ); } else { ret = SQLSETSTMTOPTION( statement -> connection, statement -> driver_stmt, attribute, drv_desc ); } if ( ret != SQL_SUCCESS ) { if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } /* * copy DM descriptor */ statement -> apd = statement -> implicit_apd; if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } if ( !__validate_desc( desc )) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_INVALID_HANDLE, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); thread_release( SQL_HANDLE_STMT, statement ); return SQL_INVALID_HANDLE; } if ( desc -> implicit && desc != statement -> implicit_apd ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &statement -> error, ERROR_HY017, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( desc -> connection != statement -> connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &statement -> error, ERROR_HY024, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * set the value to the driver descriptor handle */ value = ( SQLPOINTER ) desc -> driver_desc; statement -> apd = desc; desc -> associated_with = statement; } /* * save for internal use */ if ( attribute == SQL_ATTR_METADATA_ID ) { #ifdef HAVE_PTRDIFF_T statement -> metadata_id = (ptrdiff_t) value; #else statement -> metadata_id = (SQLINTEGER) value; #endif } if ( attribute == SQL_ATTR_IMP_ROW_DESC || attribute == SQL_ATTR_IMP_PARAM_DESC ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY017" ); __post_internal_error( &statement -> error, ERROR_HY017, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * is it a legitimate value */ ret = dm_check_statement_attrs( statement, attribute, value ); if ( ret != SQL_SUCCESS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &statement -> error, ERROR_HY024, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * is it something overridden */ value = __attr_override_wide( statement, SQL_HANDLE_STMT, attribute, value, &string_length, buffer ); /* * does the call need mapping from 3 to 2 */ if ( attribute == SQL_ATTR_FETCH_BOOKMARK_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 && CHECK_SQLEXTENDEDFETCH( statement -> connection ) && !CHECK_SQLFETCHSCROLL( statement -> connection )) { statement -> fetch_bm_ptr = (SQLULEN*) value; ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROW_STATUS_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 ) { statement -> row_st_arr = (SQLUSMALLINT*) value; ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROWS_FETCHED_PTR && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 ) { statement -> row_ct_ptr = (SQLULEN*) value; ret = SQL_SUCCESS; } else if ( attribute == SQL_ATTR_ROW_ARRAY_SIZE && statement -> connection -> driver_act_ver == SQL_OV_ODBC2 ) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, SQL_ROWSET_SIZE, value, string_length ); } else { if ( CHECK_SQLSETSTMTATTRW( statement -> connection )) { ret = SQLSETSTMTATTRW( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } else { /* * I can't find any string values, so we don't need to translate */ ret = SQLSETSTMTATTR( statement -> connection, statement -> driver_stmt, attribute, value, string_length ); } } /* * take notice of this */ if ( attribute == SQL_ATTR_USE_BOOKMARKS && SQL_SUCCEEDED( ret )) { statement -> bookmarks_on = (SQLULEN) value; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetInfoW.c0000644000175000017500000004267413303466667015050 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetInfoW.c,v 1.14 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetInfoW.c,v $ * Revision 1.14 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.13 2008/08/29 08:01:39 lurcher * Alter the way W functions are passed to the driver * * Revision 1.12 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.11 2005/10/06 08:50:58 lurcher * Fix problem with SQLDrivers not returning first entry * * Revision 1.10 2004/11/22 17:02:49 lurcher * Fix unicode/ansi conversion in the SQLGet functions * * Revision 1.9 2004/11/20 13:21:38 lurcher * Fix unicode bug in SQLGetInfoW * * Revision 1.8 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.7 2003/03/05 09:48:44 lurcher * * Add some 64 bit fixes * * Revision 1.6 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.5 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.4 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/05/21 14:19:44 lurcher * * * Update libtool to escape from AIX build problem * * Add fix to avoid file handle limitations * * Add more UNICODE changes, it looks like it is native 16 representation * the old way can be reproduced by defining UCS16BE * * Add iusql, its just the same as isql but uses the wide functions * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetInfoW.c,v $"; SQLRETURN SQLGetInfoW( SQLHDBC connection_handle, SQLUSMALLINT info_type, SQLPOINTER info_value, SQLSMALLINT buffer_length, SQLSMALLINT *string_length ) { DMHDBC connection = (DMHDBC)connection_handle; SQLRETURN ret = SQL_SUCCESS; int type; char txt[ 30 ], *cptr; SQLPOINTER *ptr; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; SQLUSMALLINT sval; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDBC parent_connection; parent_connection = find_parent_handle( connection, SQL_HANDLE_DBC ); if ( parent_connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLGETINFOW( parent_connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLGETINFOW( parent_connection, connection_handle, info_type, info_value, buffer_length, string_length ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tInfo Type = %s\ \n\t\t\tInfo Value = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen = %p", connection, __info_as_string( s1, info_type ), info_value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( info_type != SQL_ODBC_VER && info_type != SQL_DM_VER && connection -> state == STATE_C2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( buffer_length < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } switch ( info_type ) { case SQL_DATA_SOURCE_NAME: type = 1; cptr = connection -> dsn; break; case SQL_DM_VER: type = 1; sprintf( txt, "%02d.%02d.%04d.%04d", SQL_SPEC_MAJOR, SQL_SPEC_MINOR, atoi( VERSION ), atoi( VERSION + 2 )); cptr = txt; break; case SQL_ODBC_VER: type = 1; sprintf( txt, "%02d.%02d", SQL_SPEC_MAJOR, SQL_SPEC_MINOR ); cptr = txt; break; case SQL_DRIVER_HDBC: type = 2; ptr = (SQLPOINTER) connection -> driver_dbc; break; case SQL_DRIVER_HENV: type = 2; ptr = (SQLPOINTER) connection -> driver_env; break; case SQL_DRIVER_HDESC: { DMHDESC hdesc; if ( info_value && __validate_desc ( hdesc = *(DMHDESC*) info_value ) ) { type = 2; ptr = (SQLPOINTER) hdesc -> driver_desc; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } break; case SQL_DRIVER_HLIB: type = 2; ptr = connection -> dl_handle; break; case SQL_DRIVER_HSTMT: { DMHSTMT hstmt; if ( info_value && __validate_stmt( hstmt = *(DMHSTMT*)info_value ) ) { type = 2; ptr = (SQLPOINTER) hstmt -> driver_stmt; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } break; case SQL_XOPEN_CLI_YEAR: type = 1; cptr = "1994"; break; case SQL_ATTR_DRIVER_THREADING: type = 3; sval = connection -> threading_level; break; default: /* * pass all the others on */ if ( connection -> unicode_driver || CHECK_SQLGETINFOW( connection )) { if ( !CHECK_SQLGETINFOW( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } ret = SQLGETINFOW( connection, connection -> driver_dbc, info_type, info_value, buffer_length, string_length ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } } else { SQLCHAR *as1 = NULL; if ( !CHECK_SQLGETINFO( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } switch( info_type ) { case SQL_ACCESSIBLE_PROCEDURES: case SQL_ACCESSIBLE_TABLES: case SQL_CATALOG_NAME: case SQL_CATALOG_NAME_SEPARATOR: case SQL_CATALOG_TERM: case SQL_COLLATION_SEQ: case SQL_COLUMN_ALIAS: case SQL_DATA_SOURCE_NAME: case SQL_DATA_SOURCE_READ_ONLY: case SQL_DATABASE_NAME: case SQL_DBMS_NAME: case SQL_DBMS_VER: case SQL_DESCRIBE_PARAMETER: case SQL_DRIVER_NAME: case SQL_DRIVER_ODBC_VER: case SQL_DRIVER_VER: case SQL_ODBC_VER: case SQL_EXPRESSIONS_IN_ORDERBY: case SQL_IDENTIFIER_QUOTE_CHAR: case SQL_INTEGRITY: case SQL_KEYWORDS: case SQL_LIKE_ESCAPE_CLAUSE: case SQL_MAX_ROW_SIZE_INCLUDES_LONG: case SQL_MULT_RESULT_SETS: case SQL_MULTIPLE_ACTIVE_TXN: case SQL_NEED_LONG_DATA_LEN: case SQL_ORDER_BY_COLUMNS_IN_SELECT: case SQL_PROCEDURE_TERM: case SQL_PROCEDURES: case SQL_ROW_UPDATES: case SQL_SCHEMA_TERM: case SQL_SEARCH_PATTERN_ESCAPE: case SQL_SERVER_NAME: case SQL_SPECIAL_CHARACTERS: case SQL_TABLE_TERM: case SQL_USER_NAME: case SQL_XOPEN_CLI_YEAR: case SQL_OUTER_JOINS: if ( SQL_SUCCEEDED( ret ) && info_value && buffer_length > 0 ) { as1 = malloc( buffer_length + 1 ); } break; } ret = SQLGETINFO( connection, connection -> driver_dbc, info_type, as1 ? as1 : info_value, buffer_length, string_length ); switch( info_type ) { case SQL_ACCESSIBLE_PROCEDURES: case SQL_ACCESSIBLE_TABLES: case SQL_CATALOG_NAME: case SQL_CATALOG_NAME_SEPARATOR: case SQL_CATALOG_TERM: case SQL_COLLATION_SEQ: case SQL_COLUMN_ALIAS: case SQL_DATA_SOURCE_NAME: case SQL_DATA_SOURCE_READ_ONLY: case SQL_DATABASE_NAME: case SQL_DBMS_NAME: case SQL_DBMS_VER: case SQL_DESCRIBE_PARAMETER: case SQL_DRIVER_NAME: case SQL_DRIVER_ODBC_VER: case SQL_DRIVER_VER: case SQL_ODBC_VER: case SQL_EXPRESSIONS_IN_ORDERBY: case SQL_IDENTIFIER_QUOTE_CHAR: case SQL_INTEGRITY: case SQL_KEYWORDS: case SQL_LIKE_ESCAPE_CLAUSE: case SQL_MAX_ROW_SIZE_INCLUDES_LONG: case SQL_MULT_RESULT_SETS: case SQL_MULTIPLE_ACTIVE_TXN: case SQL_NEED_LONG_DATA_LEN: case SQL_ORDER_BY_COLUMNS_IN_SELECT: case SQL_PROCEDURE_TERM: case SQL_PROCEDURES: case SQL_ROW_UPDATES: case SQL_SCHEMA_TERM: case SQL_SEARCH_PATTERN_ESCAPE: case SQL_SERVER_NAME: case SQL_SPECIAL_CHARACTERS: case SQL_TABLE_TERM: case SQL_USER_NAME: case SQL_XOPEN_CLI_YEAR: case SQL_OUTER_JOINS: if ( SQL_SUCCEEDED( ret ) && info_value && as1 ) { ansi_to_unicode_copy( info_value, (char*) as1, SQL_NTS, connection, NULL ); } if ( SQL_SUCCEEDED( ret ) && string_length ) { *string_length *= sizeof( SQLWCHAR ); } break; } if ( as1 ) free( as1 ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } if ( type == 1 ) { SQLWCHAR *s1; int len; s1 = ansi_to_unicode_alloc((SQLCHAR*) cptr, SQL_NTS, connection, NULL ); len = strlen( cptr ) * sizeof( SQLWCHAR ); if ( string_length ) *string_length = len; if ( info_value ) { if ( buffer_length > len + 1 ) { wide_strcpy( info_value, s1 ); } else { memcpy( info_value, s1, ( buffer_length - 1 * sizeof( SQLWCHAR ))); ((SQLWCHAR*)info_value)[ buffer_length - 1 ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } } if ( s1 ) free( s1 ); } else if ( type == 2 ) { if ( info_value ) *((void **)info_value) = ptr; if ( string_length ) *string_length = sizeof( SQLPOINTER ); } else if ( type == 3 ) { if ( info_value ) *((SQLUSMALLINT *)info_value) = sval; if ( string_length ) *string_length = sizeof( SQLUSMALLINT ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return_nodrv( SQL_HANDLE_DBC, connection, ret ); } unixODBC-2.3.9/DriverManager/SQLGetCursorName.c0000644000175000017500000002166713303466667016103 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetCursorName.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetCursorName.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.6 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.4 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2001/01/04 13:16:25 nick * * Add support for GNU portable threads and tidy up some UNICODE compile * warnings * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetCursorName.c,v $ $Revision: 1.8 $"; SQLRETURN SQLGetCursorNameA( SQLHSTMT statement_handle, SQLCHAR *cursor_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length ) { return SQLGetCursorName( statement_handle, cursor_name, buffer_length, name_length ); } SQLRETURN SQLGetCursorName( SQLHSTMT statement_handle, SQLCHAR *cursor_name, SQLSMALLINT buffer_length, SQLSMALLINT *name_length ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCursor Name = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tName Length= %p", statement, cursor_name, buffer_length, name_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( buffer_length < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> connection -> unicode_driver ) { SQLWCHAR *s1 = NULL; if ( !CHECK_SQLGETCURSORNAMEW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( cursor_name && buffer_length > 0 ) { s1 = malloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 )); } ret = SQLGETCURSORNAMEW( statement -> connection, statement -> driver_stmt, s1 ? s1 : (SQLWCHAR*) cursor_name, buffer_length, name_length ); if ( SQL_SUCCEEDED( ret ) && cursor_name && s1 ) { unicode_to_ansi_copy((char*) cursor_name, buffer_length, s1, SQL_NTS, statement -> connection, NULL ); } if ( s1 ) { free( s1 ); } } else { if ( !CHECK_SQLGETCURSORNAME( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLGETCURSORNAME( statement -> connection, statement -> driver_stmt, cursor_name, buffer_length, name_length ); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tCursor Name = %s", __get_return_status( ret, s1 ), __sdata_as_string( s1, SQL_CHAR, name_length, cursor_name )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLParamData.c0000644000175000017500000002466513303466667015220 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLParamData.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLParamData.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2007/05/25 16:42:32 lurcher * Sync up * * Revision 1.5 2005/11/21 17:25:43 lurcher * A few DM fixes for Oracle's ODBC driver * * Revision 1.4 2004/05/07 09:53:13 lurcher * * * Fix potential problrm in stats if creating a semaphore fails * Alter state after SQLParamData from S4 to S5 * * Revision 1.3 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.10 2000/06/20 12:44:00 ngorham * * Fix bug that caused a success with info message from SQLExecute or * SQLExecDirect to be lost if used with a ODBC 3 driver and the application * called SQLGetDiagRec * * Revision 1.9 2000/06/16 16:52:18 ngorham * * Stop info messages being lost when calling SQLExecute etc on ODBC 3 * drivers, the SQLNumResultCols were clearing the error before * function return had a chance to get to them * * Revision 1.8 2000/05/21 21:49:19 ngorham * * Assorted fixes * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLParamData.c,v $ $Revision: 1.7 $"; SQLRETURN SQLParamData( SQLHSTMT statement_handle, SQLPOINTER *value ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tValue = %p", statement, value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 || statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 || statement -> state == STATE_S9 || statement -> state == STATE_S14 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPARAMDATA ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( !CHECK_SQLPARAMDATA( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * When a NULL is passed, driver tries to access this memory and dumps core, * so pass a vaild pointer to the driver. This mirrors what the MS DM does */ if (!value) { statement -> valueptr = NULL; value = &statement -> valueptr; } ret = SQLPARAMDATA( statement -> connection, statement -> driver_stmt, value ); if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPARAMDATA; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( SQL_SUCCEEDED( ret )) { if ( statement -> interupted_func == SQL_API_SQLEXECDIRECT || statement -> interupted_func == SQL_API_SQLEXECUTE || statement -> interupted_func == SQL_API_SQLMORERESULTS ) { #ifdef NR_PROBE SQLRETURN local_ret; /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R0 ); } local_ret = SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> hascols ); if ( statement -> hascols > 0 ) statement -> state = STATE_S5; else statement -> state = STATE_S4; #else statement -> hascols = 1; statement -> state = STATE_S5; #endif } else if ( statement -> interupted_func == SQL_API_SQLSETPOS && statement -> interupted_state == STATE_S7 ) { statement -> state = STATE_S7; } else if ( statement -> interupted_func == SQL_API_SQLBULKOPERATIONS && statement -> interupted_state == STATE_S5 ) { statement -> state = STATE_S5; } else { statement -> state = STATE_S6; statement -> eod = 0; } } else if ( ret == SQL_NEED_DATA ) { statement -> state = STATE_S9; } else if ( ret == SQL_PARAM_DATA_AVAILABLE ) { statement -> state = STATE_S14; } else if ( ret == SQL_NO_DATA ) { statement -> interupted_func = 0; statement -> state = STATE_S4; } else { if ( statement -> interupted_func == SQL_API_SQLEXECDIRECT ) { statement -> state = STATE_S1; } else if ( statement -> interupted_func == SQL_API_SQLEXECUTE && statement -> hascols ) { statement -> state = STATE_S3; } else if ( statement -> interupted_func == SQL_API_SQLEXECUTE ) { statement -> state = STATE_S2; } else if ( statement -> interupted_func == SQL_API_SQLBULKOPERATIONS && statement -> interupted_state == STATE_S5 ) { statement -> state = STATE_S5; } else if ( statement -> interupted_func == SQL_API_SQLSETPOS && statement -> interupted_state == STATE_S7 ) { statement -> state = STATE_S7; } else { statement -> state = STATE_S6; statement -> eod = 0; } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tValue = %p", __get_return_status( ret, s1 ), *value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R0 ); } unixODBC-2.3.9/DriverManager/SQLSetConnectOption.c0000644000175000017500000004543713364064764016623 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetConnectOption.c,v 1.12 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetConnectOption.c,v $ * Revision 1.12 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.11 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.10 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.9 2003/02/27 12:19:40 lurcher * * Add the A functions as well as the W * * Revision 1.8 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.7 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.6 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.5 2002/07/04 17:27:56 lurcher * * Small bug fixes * * Revision 1.3 2002/01/30 12:20:02 lurcher * * Add MyODBC 3 driver source * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.8 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.7 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.6 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.5 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.4 2001/02/07 11:20:23 nick * * Remove some compile warnings * * Revision 1.3 2001/02/06 18:46:55 nick * * More UNICODE ommissions * * Revision 1.2 2000/11/14 10:15:27 nick * * Add test for localtime_r * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.11 2000/06/20 13:30:10 ngorham * * Fix problems when using bookmarks * * Revision 1.10 2000/05/21 21:49:19 ngorham * * Assorted fixes * * Revision 1.9 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/11/10 03:51:34 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.7 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.5 1999/09/19 22:24:34 ngorham * * Added support for the cursor library * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.4 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:21 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetConnectOption.c,v $ $Revision: 1.12 $"; SQLRETURN SQLSetConnectOptionA( SQLHDBC connection_handle, SQLUSMALLINT option, SQLULEN value ) { return SQLSetConnectOption( connection_handle, option, value ); } SQLRETURN SQLSetConnectOption( SQLHDBC connection_handle, SQLUSMALLINT option, SQLULEN value ) { DMHDBC connection = (DMHDBC)connection_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * doesn't require a handle */ if ( option == SQL_ATTR_TRACE ) { if ((SQLLEN) value != SQL_OPT_TRACE_OFF && (SQLLEN) value != SQL_OPT_TRACE_ON ) { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); function_entry( connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } if ( value == SQL_OPT_TRACE_OFF ) { log_info.log_flag = 0; } else { log_info.log_flag = 1; } return SQL_SUCCESS; } else if ( option == SQL_ATTR_TRACEFILE ) { if ( value ) { if (((SQLCHAR*)value)[ 0 ] == '\0' ) { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); function_entry( connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } else { if ( log_info.log_file_name ) { free( log_info.log_file_name ); } log_info.log_file_name = strdup((char*) value ); } } else { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); function_entry( connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } return SQL_SUCCESS; } /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tOption = %s\ \n\t\t\tValue = %d", connection, __con_attr_as_string( s1, option ), (int)value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C2 ) { if ( option == SQL_TRANSLATE_OPTION || option == SQL_TRANSLATE_DLL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( connection -> state == STATE_C4 || connection -> state == STATE_C5 ) { if ( option == SQL_ODBC_CURSORS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else if ( connection -> state == STATE_C6 ) { if ( option == SQL_ODBC_CURSORS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( option == SQL_TXN_ISOLATION ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1011" ); __post_internal_error( &connection -> error, ERROR_S1011, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } /* * is it a legitimate value */ ret = dm_check_connection_attrs( connection, option, (SQLPOINTER)value ); if ( ret != SQL_SUCCESS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * is it something overridden */ value = (SQLULEN) __attr_override( connection, SQL_HANDLE_DBC, option, (void*) value, NULL ); /* * we need to save this even if connected so we can use it for the next connect */ if ( option == SQL_LOGIN_TIMEOUT ) { connection -> login_timeout_set = 1; connection -> login_timeout = value; } else if ( option == SQL_ATTR_ACCESS_MODE ) { connection -> access_mode = ( SQLLEN ) value; connection -> access_mode_set = 1; } else if ( option == SQL_AUTOCOMMIT ) { connection -> auto_commit = ( SQLINTEGER ) value; connection -> auto_commit_set = 1; } if ( option == SQL_ODBC_CURSORS ) { connection -> cursors = value; ret = SQL_SUCCESS; } else if ( connection -> state == STATE_C2 ) { if ( option == SQL_AUTOCOMMIT ) { connection -> auto_commit = ( SQLINTEGER ) value; connection -> auto_commit_set = 1; } else if ( option == SQL_ATTR_QUIET_MODE ) { connection -> quite_mode = ( SQLLEN ) value; connection -> quite_mode_set = 1; } else if ( option == SQL_ATTR_ACCESS_MODE ) { connection -> access_mode = ( SQLLEN ) value; connection -> access_mode_set = 1; } else { /* * save any unknown attributes untill connect */ struct save_attr *sa = calloc( 1, sizeof( struct save_attr )); sa -> attr_type = option; sa -> intptr_attr = value; sa -> next = connection -> save_attr; connection -> save_attr = sa; } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } else { /* * call the driver */ if ( connection -> unicode_driver ) { if ( CHECK_SQLSETCONNECTOPTIONW( connection )) { ret = SQLSETCONNECTOPTIONW( connection, connection -> driver_dbc, option, value ); } else if ( CHECK_SQLSETCONNECTATTRW( connection )) { SQLINTEGER string_length; void *ptr = (void *) value; switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: string_length = SQL_NTS; ptr = (void *) ansi_to_unicode_alloc(( SQLCHAR * ) value, SQL_NTS, connection, NULL ); break; default: string_length = 0; break; } ret = SQLSETCONNECTATTRW( connection, connection -> driver_dbc, option, ptr, string_length ); if ( ptr != (void*) value ) { free( ptr ); } } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else { if ( CHECK_SQLSETCONNECTOPTION( connection )) { ret = SQLSETCONNECTOPTION( connection, connection -> driver_dbc, option, value ); } else if ( CHECK_SQLSETCONNECTATTR( connection )) { SQLINTEGER string_length; switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: string_length = SQL_NTS; break; default: string_length = 0; break; } ret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, option, value, string_length ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } } /* * catch this */ if ( option == SQL_ATTR_USE_BOOKMARKS && SQL_SUCCEEDED( ret )) { connection -> bookmarks_on = (SQLUINTEGER) value; } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetDiagField.c0000644000175000017500000007120413364072106015611 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetDiagField.c,v 1.17 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetDiagField.c,v $ * Revision 1.17 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.16 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.15 2009/02/04 09:30:01 lurcher * Fix some SQLINTEGER/SQLLEN conflicts * * Revision 1.14 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.13 2007/03/05 09:49:24 lurcher * Get it to build on VMS again * * Revision 1.12 2006/11/27 14:08:33 lurcher * Sync up dirs * * Revision 1.11 2006/05/31 17:35:34 lurcher * Add unicode ODBCINST entry points * * Revision 1.10 2006/03/08 09:18:41 lurcher * fix silly typo that was using sizeof( SQL_WCHAR ) instead of SQLWCHAR * * Revision 1.9 2005/12/19 18:43:26 lurcher * Add new parts to contrib and alter how the errors are returned from the driver * * Revision 1.8 2003/02/27 12:19:39 lurcher * * Add the A functions as well as the W * * Revision 1.7 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.6 2002/11/11 17:10:12 lurcher * * VMS changes * * Revision 1.5 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.4 2002/01/30 12:20:02 lurcher * * Add MyODBC 3 driver source * * Revision 1.3 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.15 2000/08/22 22:56:27 ngorham * * Add fix to SQLGetDiagField to return the server name on statements and * descriptors * * Revision 1.14 2000/08/21 10:31:58 ngorham * * Add missing line continuation char * * Revision 1.13 2000/08/09 08:48:18 ngorham * * Fix for SQLGetDiagField(SQL_DIAG_SUBCLASS_ORIGIN) returning a null string * * Revision 1.12 2000/08/03 10:49:34 ngorham * * Fix buffer overrun problem in GetDiagField * * Revision 1.11 2000/07/31 20:48:01 ngorham * * Fix bugs in SQLGetDiagField and with SQLColAttributes * * Revision 1.10 2000/06/23 16:11:35 ngorham * * Map ODBC 2 SQLSTATE values to ODBC 3 * * Revision 1.9 2000/05/21 21:49:19 ngorham * * Assorted fixes * * Revision 1.8 1999/11/17 21:08:58 ngorham * * Fix Bug with the ODBC 3 error handling * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/12 19:42:06 ngorham * * Finished off SQLGetDiagField.c and fixed a but that caused SQLError to * fail with Perl and PHP, connect errors were not being returned because * I was checking to the environment being set, they were setting the * statement and the environment. The order of checking has been changed. * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.5 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.4 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetDiagField.c,v $ $Revision: 1.17 $"; #define ODBC30_SUBCLASS "01S00,01S01,01S02,01S06,01S07,07S01,08S01,21S01,\ 21S02,25S01,25S02,25S03,42S01,42S02,42S11,42S12,42S21,42S22,HY095,HY097,HY098,\ HY099,HY100,HY101,HY105,HY107,HY109,HY110,HY111,HYT00,HYT01,IM001,IM002,IM003,\ IM004,IM005,IM006,IM007,IM008,IM010,IM011,IM012" extern int __is_env( EHEAD * head ); /* * is it a diag identifier that we have to convert from unicode to ansi */ static int is_char_diag( int diag_identifier ) { switch( diag_identifier ) { case SQL_DIAG_CLASS_ORIGIN: case SQL_DIAG_CONNECTION_NAME: case SQL_DIAG_DYNAMIC_FUNCTION: case SQL_DIAG_MESSAGE_TEXT: case SQL_DIAG_SERVER_NAME: case SQL_DIAG_SQLSTATE: case SQL_DIAG_SUBCLASS_ORIGIN: return 1; default: return 0; } } static SQLRETURN extract_sql_error_field( EHEAD *head, SQLSMALLINT rec_number, SQLSMALLINT diag_identifier, SQLPOINTER diag_info_ptr, SQLSMALLINT buffer_length, SQLSMALLINT *string_length_ptr ) { ERROR *ptr; if ( is_char_diag( diag_identifier ) && buffer_length < 0 ) { return SQL_ERROR; } /* * check the header fields first */ switch( diag_identifier ) { case SQL_DIAG_CURSOR_ROW_COUNT: case SQL_DIAG_ROW_COUNT: { SQLLEN val; SQLRETURN ret; if ( rec_number > 0 || head -> handle_type != SQL_HANDLE_STMT ) { return SQL_ERROR; } else if ( head -> header_set ) { switch( diag_identifier ) { case SQL_DIAG_CURSOR_ROW_COUNT: if ( SQL_SUCCEEDED( head -> diag_cursor_row_count_ret ) && diag_info_ptr ) { *((SQLLEN*)diag_info_ptr) = head -> diag_cursor_row_count; } return head -> diag_cursor_row_count_ret; case SQL_DIAG_ROW_COUNT: if ( SQL_SUCCEEDED( head -> diag_row_count_ret ) && diag_info_ptr ) { *((SQLLEN*)diag_info_ptr) = head -> diag_row_count; } return head -> diag_row_count_ret; } } else if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELDW( __get_connection( head ))) { ret = SQLGETDIAGFIELDW( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELD( __get_connection( head ))) { ret = SQLGETDIAGFIELD( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else if ( CHECK_SQLROWCOUNT( __get_connection( head ))) { ret = DEF_SQLROWCOUNT( __get_connection( head ), __get_driver_handle( head ), &val ); if ( !SQL_SUCCEEDED( ret )) { return ret; } } else { val = 0; } if ( diag_info_ptr ) { memcpy( diag_info_ptr, &val, sizeof( val )); } } return SQL_SUCCESS; case SQL_DIAG_DYNAMIC_FUNCTION: { SQLRETURN ret; if ( rec_number > 0 ) { return SQL_ERROR; } else if ( head -> handle_type != SQL_HANDLE_STMT ) { if ( diag_info_ptr ) { strcpy( diag_info_ptr, "" ); } if ( string_length_ptr ) { *string_length_ptr = 0; } return SQL_SUCCESS; } else if ( head -> header_set ) { if ( SQL_SUCCEEDED( head -> diag_dynamic_function_ret ) && diag_info_ptr ) { unicode_to_ansi_copy( diag_info_ptr, buffer_length, head -> diag_dynamic_function, SQL_NTS, __get_connection( head ), NULL ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( head -> diag_dynamic_function ); } } return head -> diag_dynamic_function_ret; } else if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELDW( __get_connection( head ))) { SQLWCHAR *s1 = NULL; if ( buffer_length > 0 ) { s1 = malloc( sizeof( SQLWCHAR ) * ( buffer_length + 1 )); } ret = SQLGETDIAGFIELDW( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, s1 ? s1 : diag_info_ptr, buffer_length * sizeof ( SQLWCHAR ), string_length_ptr ); if ( SQL_SUCCEEDED( ret ) && diag_info_ptr && s1 ) { unicode_to_ansi_copy( diag_info_ptr, buffer_length, s1, buffer_length, __get_connection( head ), NULL ); } if ( string_length_ptr && *string_length_ptr > 0 ) { *string_length_ptr /= sizeof ( SQLWCHAR ); } if ( s1 ) { free( s1 ); } return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELD( __get_connection( head ))) { ret = SQLGETDIAGFIELD( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } if ( diag_info_ptr ) { strcpy( diag_info_ptr, "" ); } } return SQL_SUCCESS; case SQL_DIAG_DYNAMIC_FUNCTION_CODE: { SQLINTEGER val; SQLRETURN ret; if ( rec_number > 0 ) { return SQL_ERROR; } else if ( head -> handle_type != SQL_HANDLE_STMT ) { *((SQLINTEGER*)diag_info_ptr) = 0; return SQL_SUCCESS; } else if ( head -> header_set ) { if ( SQL_SUCCEEDED( head -> diag_dynamic_function_code_ret ) && diag_info_ptr ) { *((SQLINTEGER*)diag_info_ptr) = head -> diag_dynamic_function_code; } return head -> diag_dynamic_function_code_ret; } else if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELDW( __get_connection( head ))) { ret = SQLGETDIAGFIELDW( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELD( __get_connection( head ))) { ret = SQLGETDIAGFIELD( __get_connection( head ), SQL_HANDLE_STMT, __get_driver_handle( head ), 0, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); return ret; } else { val = SQL_DIAG_UNKNOWN_STATEMENT; } if ( diag_info_ptr ) { memcpy( diag_info_ptr, &val, sizeof( val )); } } return SQL_SUCCESS; case SQL_DIAG_NUMBER: { SQLINTEGER val; if ( rec_number > 0 ) { return SQL_ERROR; } val = head -> sql_diag_head.internal_count + head -> sql_diag_head.error_count; if ( diag_info_ptr ) { memcpy( diag_info_ptr, &val, sizeof( val )); } } return SQL_SUCCESS; case SQL_DIAG_RETURNCODE: { if ( diag_info_ptr ) { memcpy( diag_info_ptr, &head -> return_code, sizeof( head -> return_code )); } } return SQL_SUCCESS; } /* * else check the records */ if ( rec_number < 1 || (( diag_identifier == SQL_DIAG_COLUMN_NUMBER || diag_identifier == SQL_DIAG_ROW_NUMBER ) && head -> handle_type != SQL_HANDLE_STMT )) { return SQL_ERROR; } if ( rec_number <= head -> sql_diag_head.internal_count ) { /* * local errors */ ptr = head -> sql_diag_head.internal_list_head; while( rec_number > 1 ) { ptr = ptr -> next; rec_number --; } if ( !ptr ) { return SQL_NO_DATA; } } else if ( !__is_env( head ) && __get_connection( head ) -> state != STATE_C2 ) { rec_number -= head -> sql_diag_head.internal_count; if ( __get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELDW( __get_connection( head ))) { SQLRETURN ret; SQLWCHAR *s1 = NULL; if ( diag_info_ptr && buffer_length > 0 ) { s1 = malloc( ( buffer_length + 1 ) * sizeof( SQLWCHAR )); } ret = SQLGETDIAGFIELDW( __get_connection( head ), head -> handle_type, __get_driver_handle( head ), rec_number, diag_identifier, s1 ? s1 : diag_info_ptr, s1 ? ( buffer_length + 1 ) * sizeof( SQLWCHAR ) : buffer_length, string_length_ptr ); if ( SQL_SUCCEEDED( ret ) && s1 && diag_info_ptr ) { unicode_to_ansi_copy( diag_info_ptr, buffer_length, s1, SQL_NTS, __get_connection( head ), NULL ); if ( string_length_ptr && *string_length_ptr > 0 ) { *string_length_ptr /= sizeof( SQLWCHAR ); } } if ( s1 ) { free( s1 ); } if ( SQL_SUCCEEDED( ret ) && diag_identifier == SQL_DIAG_SQLSTATE ) { /* * map 3 to 2 if required */ if ( diag_info_ptr ) { if ( diag_info_ptr ) __map_error_state( diag_info_ptr, __get_version( head )); } } return ret; } else if ( !__get_connection( head ) -> unicode_driver && CHECK_SQLGETDIAGFIELD( __get_connection( head ))) { SQLRETURN ret; ret = SQLGETDIAGFIELD( __get_connection( head ), head -> handle_type, __get_driver_handle( head ), rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); if ( SQL_SUCCEEDED( ret ) && diag_identifier == SQL_DIAG_SQLSTATE ) { /* * map 3 to 2 if required */ if ( diag_info_ptr ) { if ( diag_info_ptr ) __map_error_state( diag_info_ptr, __get_version( head )); } } return ret; } else { ptr = head -> sql_diag_head.error_list_head; while( rec_number > 1 ) { ptr = ptr -> next; rec_number --; } if ( !ptr ) { return SQL_NO_DATA; } } } else { return SQL_NO_DATA; } /* * if we are here ptr should point to the local error * record */ switch( diag_identifier ) { case SQL_DIAG_CLASS_ORIGIN: { if ( SQL_SUCCEEDED( ptr -> diag_class_origin_ret )) { unicode_to_ansi_copy( diag_info_ptr, buffer_length, ptr -> diag_class_origin, SQL_NTS, __get_connection( head ), NULL ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( ptr -> diag_class_origin ); } return ptr -> diag_class_origin_ret; } else { return ptr -> diag_class_origin_ret; } } break; case SQL_DIAG_COLUMN_NUMBER: { if ( diag_info_ptr ) { memcpy( diag_info_ptr, &ptr -> diag_column_number, sizeof( SQLINTEGER )); } return SQL_SUCCESS; } break; case SQL_DIAG_CONNECTION_NAME: { if ( SQL_SUCCEEDED( ptr -> diag_connection_name_ret )) { unicode_to_ansi_copy( diag_info_ptr, buffer_length, ptr -> diag_connection_name, SQL_NTS, __get_connection( head ), NULL ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( ptr -> diag_connection_name ); } return ptr -> diag_connection_name_ret; } else { return ptr -> diag_connection_name_ret; } } break; case SQL_DIAG_MESSAGE_TEXT: { char *str; int ret = SQL_SUCCESS; str = unicode_to_ansi_alloc( ptr -> msg, SQL_NTS, __get_connection( head ), NULL ); if ( diag_info_ptr ) { if ( buffer_length >= strlen( str ) + 1 ) { strcpy( diag_info_ptr, str ); } else { ret = SQL_SUCCESS_WITH_INFO; memcpy( diag_info_ptr, str, buffer_length - 1 ); (( char * ) diag_info_ptr )[ buffer_length - 1 ] = '\0'; } } if ( string_length_ptr ) { *string_length_ptr = strlen( str ); } if ( str ) { free( str ); } return ret; } break; case SQL_DIAG_NATIVE: { if ( diag_info_ptr ) { memcpy( diag_info_ptr, &ptr -> native_error, sizeof( SQLINTEGER )); } return SQL_SUCCESS; } break; case SQL_DIAG_ROW_NUMBER: { if ( diag_info_ptr ) { memcpy( diag_info_ptr, &ptr -> diag_row_number, sizeof( SQLLEN )); } return SQL_SUCCESS; } break; case SQL_DIAG_SERVER_NAME: { if ( SQL_SUCCEEDED( ptr -> diag_server_name_ret )) { unicode_to_ansi_copy( diag_info_ptr, buffer_length, ptr -> diag_server_name, SQL_NTS, __get_connection( head ), NULL ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( ptr -> diag_server_name ); } return ptr -> diag_server_name_ret; } else { return ptr -> diag_server_name_ret; } } break; case SQL_DIAG_SQLSTATE: { char *str; int ret = SQL_SUCCESS; str = unicode_to_ansi_alloc( ptr -> sqlstate, SQL_NTS, __get_connection( head ), NULL ); if ( diag_info_ptr ) { if ( buffer_length >= strlen( str ) + 1 ) { strcpy( diag_info_ptr, str ); } else { ret = SQL_SUCCESS_WITH_INFO; memcpy( diag_info_ptr, str, buffer_length - 1 ); (( char * ) diag_info_ptr )[ buffer_length - 1 ] = '\0'; } /* * map 3 to 2 if required */ if ( diag_info_ptr ) __map_error_state( diag_info_ptr, __get_version( head )); } if ( string_length_ptr ) { *string_length_ptr = strlen( str ); } if ( str ) { free( str ); } return ret; } break; case SQL_DIAG_SUBCLASS_ORIGIN: { if ( SQL_SUCCEEDED( ptr -> diag_subclass_origin_ret )) { unicode_to_ansi_copy( diag_info_ptr, buffer_length, ptr -> diag_subclass_origin, SQL_NTS, __get_connection( head ), NULL ); if ( string_length_ptr ) { *string_length_ptr = wide_strlen( ptr -> diag_subclass_origin ); } return ptr -> diag_subclass_origin_ret; } else { return ptr -> diag_subclass_origin_ret; } } break; } return SQL_SUCCESS; } SQLRETURN SQLGetDiagFieldA( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLSMALLINT diag_identifier, SQLPOINTER diag_info_ptr, SQLSMALLINT buffer_length, SQLSMALLINT *string_length_ptr ) { return SQLGetDiagField( handle_type, handle, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); } SQLRETURN SQLGetDiagField( SQLSMALLINT handle_type, SQLHANDLE handle, SQLSMALLINT rec_number, SQLSMALLINT diag_identifier, SQLPOINTER diag_info_ptr, SQLSMALLINT buffer_length, SQLSMALLINT *string_length_ptr ) { SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; DMHENV environment = ( DMHENV ) handle; DMHDBC connection = NULL; DMHSTMT statement = NULL; DMHDESC descriptor = NULL; EHEAD *herror; char *handle_msg; const char *handle_type_ptr; switch ( handle_type ) { case SQL_HANDLE_ENV: { if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } herror = &environment->error; handle_msg = environment->msg; handle_type_ptr = "Environment"; } break; case SQL_HANDLE_DBC: { connection = ( DMHDBC ) handle; if ( !__validate_dbc( connection )) { return SQL_INVALID_HANDLE; } herror = &connection->error; handle_msg = connection->msg; handle_type_ptr = "Connection"; } break; case SQL_HANDLE_STMT: { statement = ( DMHSTMT ) handle; if ( !__validate_stmt( statement )) { return SQL_INVALID_HANDLE; } connection = statement->connection; herror = &statement->error; handle_msg = statement->msg; handle_type_ptr = "Statement"; } break; case SQL_HANDLE_DESC: { descriptor = ( DMHDESC ) handle; if ( !__validate_desc( descriptor )) { return SQL_INVALID_HANDLE; } connection = descriptor->connection; herror = &descriptor->error; handle_msg = descriptor->msg; handle_type_ptr = "Descriptor"; } break; default: { return SQL_NO_DATA; } } thread_protect( handle_type, handle ); if ( log_info.log_flag ) { sprintf( handle_msg, "\n\t\tEntry:\ \n\t\t\t%s = %p\ \n\t\t\tRec Number = %d\ \n\t\t\tDiag Ident = %d\ \n\t\t\tDiag Info Ptr = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tString Len Ptr = %p", handle_type_ptr, handle, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } /* * Do diag extraction here if defer flag is set. * Clean the flag after extraction. */ if ( connection && herror->defer_extract ) { extract_error_from_driver( herror, connection, herror->ret_code_deferred, 0 ); herror->defer_extract = 0; herror->ret_code_deferred = 0; } ret = extract_sql_error_field( herror, rec_number, diag_identifier, diag_info_ptr, buffer_length, string_length_ptr ); if ( log_info.log_flag ) { sprintf( handle_msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, handle_msg ); } thread_release( handle_type, handle ); return ret; } unixODBC-2.3.9/DriverManager/SQLGetData.c0000644000175000017500000003762413364071156014666 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetData.c,v 1.15 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetData.c,v $ * Revision 1.15 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.14 2007/04/02 10:50:19 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.13 2006/04/11 10:22:56 lurcher * Fix a data type check * * Revision 1.12 2006/03/08 11:22:13 lurcher * Add check for valid C_TYPE * * Revision 1.11 2004/02/02 10:10:45 lurcher * * Fix some connection pooling problems * Include sqlucode in sqlext * * Revision 1.10 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.9 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.8 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.7 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.6 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.5 2002/07/10 15:05:57 lurcher * * Alter the return code in the Postgres driver, for a warning, it should be * 01000 it was 00000 * Fix a problem in DriverManagerII with the postgres driver as the driver * doesn't return a propper list of schemas * Allow the delimiter to be set in isql to a hex/octal char not just a * printable one * * Revision 1.4 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.3 2001/12/04 10:16:59 lurcher * * Fix SQLSetScrollOption problem * * Revision 1.2 2001/11/22 14:27:02 lurcher * * Add UNICODE conversion fix * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.5 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.4 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/01 11:04:13 nick * * Add UNICODE conversion to SQLGetData * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.10 2000/06/20 13:30:09 ngorham * * Fix problems when using bookmarks * * Revision 1.9 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.7 1999/10/09 00:56:16 ngorham * * Added Manush's patch to map ODBC 3-2 datetime values * * Revision 1.6 1999/10/09 00:15:58 ngorham * * Add mapping from SQL_TYPE_X to SQL_X and SQL_C_TYPE_X to SQL_C_X * when the driver is a ODBC 2 one * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.4 1999/05/03 19:50:43 nick * Another check point * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetData.c,v $ $Revision: 1.15 $"; SQLRETURN SQLGetData( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLSMALLINT target_type, SQLPOINTER target_value, SQLLEN buffer_length, SQLLEN *strlen_or_ind ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ]; int unicode_switch = 0; SQLLEN ind_value; SQLCHAR *as1 = NULL; SQLCHAR s3[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Number = %d\ \n\t\t\tTarget Type = %d %s\ \n\t\t\tBuffer Length = %d\ \n\t\t\tTarget Value = %p\ \n\t\t\tStrLen Or Ind = %p", statement, column_number, target_type, __sql_as_text( target_type ), (int)buffer_length, target_value, (void*)strlen_or_ind ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( column_number == 0 && statement -> bookmarks_on == SQL_UB_OFF && statement -> connection -> bookmarks_on == SQL_UB_OFF ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLGETDATA ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * can't trust the numcols value * if ( statement -> numcols < column_number ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version ); return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR ); } */ /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S4 || statement -> state == STATE_S5 || (( statement -> state == STATE_S6 || statement -> state == STATE_S7 ) && statement -> eod )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLGETDATA ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( target_value == NULL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( buffer_length < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * TO_DO assorted checks need adding here, relating to bound columns * and what sort of SQLGetData extensions the driver supports */ /* * check valid C_TYPE */ if ( !check_target_type( target_type, statement -> connection -> environment -> requested_version )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY003" ); __post_internal_error( &statement -> error, ERROR_HY003, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( !CHECK_SQLGETDATA( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if (statement -> connection -> driver_act_ver==SQL_OV_ODBC2) { switch( target_type ) { case SQL_WCHAR: target_type = SQL_CHAR; unicode_switch = 1; buffer_length = buffer_length / sizeof( SQLWCHAR ); break; case SQL_WVARCHAR: target_type = SQL_VARCHAR; unicode_switch = 1; buffer_length = buffer_length / sizeof( SQLWCHAR ); break; case SQL_WLONGVARCHAR: target_type = SQL_LONGVARCHAR; unicode_switch = 1; buffer_length = buffer_length / sizeof( SQLWCHAR ); break; } } if ( unicode_switch ) { if ( buffer_length > 0 && target_value ) { as1 = malloc( buffer_length + 1 ); ret = SQLGETDATA( statement -> connection, statement -> driver_stmt, column_number, __map_type(MAP_C_DM2D,statement->connection,target_type), as1, buffer_length, &ind_value ); } else { ret = SQLGETDATA( statement -> connection, statement -> driver_stmt, column_number, __map_type(MAP_C_DM2D,statement->connection,target_type), target_value, buffer_length, &ind_value ); } } else { ret = SQLGETDATA( statement -> connection, statement -> driver_stmt, column_number, __map_type(MAP_C_DM2D,statement->connection,target_type), target_value, buffer_length, strlen_or_ind ); } if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLGETDATA; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) { statement -> interupted_state = statement -> state; statement -> state = STATE_S11; } } else if ( SQL_SUCCEEDED( ret ) && unicode_switch ) { if ( target_value && ind_value >= 0 && as1 ) { if ( ind_value > buffer_length ) { ansi_to_unicode_copy( target_value, (char*) as1, buffer_length, statement -> connection, NULL ); } else { ansi_to_unicode_copy( target_value, (char*) as1, ind_value + 1, statement -> connection, NULL ); } } if ( as1 ) { free( as1 ); } if ( ind_value > 0 ) { ind_value *= sizeof( SQLWCHAR ); } if ( strlen_or_ind ) { *strlen_or_ind = ind_value; } } if ( ret != SQL_STILL_EXECUTING && (statement -> state == STATE_S11 || statement -> state == STATE_S12) ) { statement -> state = statement -> interupted_state; } if ( statement -> state == STATE_S14 ) { statement -> state = STATE_S15; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tBuffer = %s\ \n\t\t\tStrlen Or Ind = %s", __get_return_status( ret, s3 ), __data_as_string( s1, target_type, strlen_or_ind, target_value ), __ptr_as_string( s2, strlen_or_ind )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/drivermanager_axp.opt0000644000175000017500000000447713303466702017051 00000000000000CASE_SENSITIVE=YES SYMBOL_VECTOR = (SQLAllocConnect=PROCEDURE,- SQLAllocEnv=PROCEDURE,- SQLAllocHandle=PROCEDURE,- SQLAllocHandleStd=PROCEDURE,- SQLAllocStmt=PROCEDURE,- SQLBindCol=PROCEDURE,- SQLBindParam=PROCEDURE,- SQLBindParameter=PROCEDURE,- SQLBrowseConnect=PROCEDURE,- SQLBulkOperations=PROCEDURE,- SQLCancel=PROCEDURE,- SQLCancelHandle=PROCEDURE,- SQLCloseCursor=PROCEDURE,- SQLColAttribute=PROCEDURE,- SQLColAttributes=PROCEDURE,- SQLColumnPrivileges=PROCEDURE,- SQLColumns=PROCEDURE,- SQLConnect=PROCEDURE,- SQLCopyDesc=PROCEDURE,- SQLDataSources=PROCEDURE,- SQLDescribeCol=PROCEDURE,- SQLDescribeParam=PROCEDURE,- SQLDisconnect=PROCEDURE,- SQLDriverConnect=PROCEDURE,- SQLDrivers=PROCEDURE,- SQLEndTran=PROCEDURE,- SQLError=PROCEDURE,- SQLExecDirect=PROCEDURE,- SQLExecute=PROCEDURE,- SQLExtendedFetch=PROCEDURE,- SQLFetch=PROCEDURE,- SQLFetchScroll=PROCEDURE,- SQLForeignKeys=PROCEDURE,- SQLFreeConnect=PROCEDURE,- SQLFreeEnv=PROCEDURE,- SQLFreeHandle=PROCEDURE,- SQLFreeStmt=PROCEDURE,- SQLGetConnectAttr=PROCEDURE,- SQLGetConnectOption=PROCEDURE,- SQLGetCursorName=PROCEDURE,- SQLGetData=PROCEDURE,- SQLGetDescField=PROCEDURE,- SQLGetDescRec=PROCEDURE,- SQLGetDiagField=PROCEDURE,- SQLGetDiagRec=PROCEDURE,- SQLGetEnvAttr=PROCEDURE,- SQLGetFunctions=PROCEDURE,- SQLGetInfo=PROCEDURE,- SQLGetStmtAttr=PROCEDURE,- SQLGetStmtOption=PROCEDURE,- SQLGetTypeInfo=PROCEDURE,- SQLMoreResults=PROCEDURE,- SQLNativeSql=PROCEDURE,- SQLNumParams=PROCEDURE,- SQLNumResultCols=PROCEDURE,- SQLParamData=PROCEDURE,- SQLParamOptions=PROCEDURE,- SQLPrepare=PROCEDURE,- SQLPrimaryKeys=PROCEDURE,- SQLProcedureColumns=PROCEDURE,- SQLProcedures=PROCEDURE,- SQLPutData=PROCEDURE,- SQLRowCount=PROCEDURE,- SQLSetConnectAttr=PROCEDURE,- SQLSetConnectOption=PROCEDURE,- SQLSetCursorName=PROCEDURE,- SQLSetDescField=PROCEDURE,- SQLSetDescRec=PROCEDURE,- SQLSetEnvAttr=PROCEDURE,- SQLSetParam=PROCEDURE,- SQLSetPos=PROCEDURE,- SQLSetScrollOptions=PROCEDURE,- SQLSetStmtAttr=PROCEDURE,- SQLSetStmtOption=PROCEDURE,- SQLSpecialColumns=PROCEDURE,- SQLStatistics=PROCEDURE,- SQLTablePrivileges=PROCEDURE,- SQLTables=PROCEDURE,- SQLTransact=PROCEDURE) unixODBC-2.3.9/DriverManager/SQLDriversW.c0000644000175000017500000003317613433744462015124 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDriversW.c,v 1.12 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDriversW.c,v $ * Revision 1.12 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.11 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.10 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.9 2005/07/17 09:11:23 lurcher * Fix bug in SQLDrivers that was stopping the return of the attribute length * * Revision 1.8 2004/07/25 00:42:02 peteralexharvey * for OS2 port * * Revision 1.7 2003/11/13 15:12:53 lurcher * * small change to ODBCConfig to have the password field in the driver * properties hide the password * Make both # and ; comments in ini files * * Revision 1.6 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.5 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/05/21 14:19:44 lurcher * * * Update libtool to escape from AIX build problem * * Add fix to avoid file handle limitations * * Add more UNICODE changes, it looks like it is native 16 representation * the old way can be reproduced by defining UCS16BE * * Add iusql, its just the same as isql but uses the wide functions * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/05/15 10:57:44 nick * * Add initial support for VMS * * Revision 1.3 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/02 09:55:04 nick * * More unicode bits * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDriversW.c,v $"; #define BUFFERSIZE 1024 SQLRETURN SQLDriversW( SQLHENV henv, SQLUSMALLINT fdirection, SQLWCHAR *sz_driver_desc, SQLSMALLINT cb_driver_desc_max, SQLSMALLINT *pcb_driver_desc, SQLWCHAR *sz_driver_attributes, SQLSMALLINT cb_drvr_attr_max, SQLSMALLINT *pcb_drvr_attr ) { DMHENV environment = (DMHENV) henv; char buffer[ BUFFERSIZE + 1 ]; char object[ INI_MAX_OBJECT_NAME + 1 ]; SQLRETURN ret = SQL_SUCCESS; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p\ \n\t\t\tDirection = %d", environment, (int)fdirection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); /* * check that a version has been requested */ if ( ! environment -> version_set ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &environment -> error, ERROR_HY010, NULL, SQL_OV_ODBC3 ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( cb_driver_desc_max < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &environment -> error, ERROR_HY090, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( cb_drvr_attr_max < 0 || cb_drvr_attr_max == 1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &environment -> error, ERROR_HY090, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( fdirection != SQL_FETCH_FIRST && fdirection != SQL_FETCH_NEXT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY103" ); __post_internal_error( &environment -> error, ERROR_HY103, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( fdirection == SQL_FETCH_FIRST ) environment -> sql_driver_count = 0; else environment -> sql_driver_count ++; try_again: memset( buffer, '\0', sizeof( buffer )); memset( object, '\0', sizeof( object )); SQLGetPrivateProfileString( NULL, NULL, NULL, buffer, sizeof( buffer ), "ODBCINST.INI" ); if ( iniElement( buffer, '\0', '\0', environment -> sql_driver_count, object, sizeof( object )) != INI_SUCCESS ) { /* * Set up for the next time */ environment -> sql_driver_count = -1; ret = SQL_NO_DATA; } else { ret = SQL_SUCCESS; /* * this section is used for internal info */ if ( strcmp( object, "ODBC" ) == 0 ) { environment -> sql_driver_count ++; goto try_again; } if ( pcb_driver_desc ) *pcb_driver_desc = strlen( object ); if ( sz_driver_desc ) { if ( strlen( object ) >= cb_driver_desc_max ) { memcpy( sz_driver_desc, object, cb_driver_desc_max - 1 ); sz_driver_desc[ cb_driver_desc_max - 1 ] = '\0'; ret = SQL_SUCCESS_WITH_INFO; } else { SQLWCHAR *s1; s1 = ansi_to_unicode_alloc((SQLCHAR*) object, SQL_NTS, NULL, NULL ); if ( s1 ) { wide_strcpy( sz_driver_desc, s1 ); free( s1 ); } } } else { ret = SQL_SUCCESS; } if ( sz_driver_attributes || pcb_drvr_attr ) { HINI hIni; char szPropertyName[INI_MAX_PROPERTY_NAME+1]; char szValue[INI_MAX_PROPERTY_NAME+1]; char szIniName[ INI_MAX_OBJECT_NAME + 1 ]; char buffer[ 1024 ]; int total_len = 0; char b1[ 512 ], b2[ 512 ]; int found = 0; /* * enumerate the driver attributes, first in system odbcinst.ini and if not found in user odbcinst.ini */ sprintf( szIniName, "%s/%s", odbcinst_system_file_path( b1 ), odbcinst_system_file_name( b2 )); memset( buffer, '\0', sizeof( buffer )); #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE, 1L ) == INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE ) == INI_SUCCESS ) #endif { iniObjectSeek( hIni, (char *)object ); iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) != TRUE ) { iniProperty( hIni, szPropertyName ); iniValue( hIni, szValue ); sprintf( buffer, "%s=%s", szPropertyName, szValue ); found = 1; if ( sz_driver_attributes ) { if ( total_len + strlen( buffer ) + 1 > cb_drvr_attr_max ) { ret = SQL_SUCCESS_WITH_INFO; } else { SQLWCHAR *s1; s1 = ansi_to_unicode_alloc((SQLCHAR*) buffer, SQL_NTS, NULL, NULL ); if ( s1 ) { wide_strcpy( sz_driver_attributes, s1 ); free( s1 ); } sz_driver_attributes += strlen( buffer ) + 1; } } total_len += strlen( buffer ) + 1; iniPropertyNext( hIni ); } /* * add extra null */ if ( sz_driver_attributes ) *sz_driver_attributes = '\0'; if ( pcb_drvr_attr ) { *pcb_drvr_attr = total_len; } iniClose( hIni ); } if ( !found ) { sprintf( szIniName, "%s/%s", odbcinst_user_file_path( b1 ), odbcinst_user_file_name( b2 )); memset( buffer, '\0', sizeof( buffer )); #ifdef __OS2__ if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE, 1L ) == INI_SUCCESS ) #else if ( iniOpen( &hIni, szIniName, "#;", '[', ']', '=', FALSE ) == INI_SUCCESS ) #endif { iniObjectSeek( hIni, (char *)object ); iniPropertyFirst( hIni ); while ( iniPropertyEOL( hIni ) != TRUE ) { iniProperty( hIni, szPropertyName ); iniValue( hIni, szValue ); sprintf( buffer, "%s=%s", szPropertyName, szValue ); if ( sz_driver_attributes ) { if ( total_len + strlen( buffer ) + 1 > cb_drvr_attr_max ) { ret = SQL_SUCCESS_WITH_INFO; } else { SQLWCHAR *s1; s1 = ansi_to_unicode_alloc((SQLCHAR*) buffer, SQL_NTS, NULL, NULL ); if ( s1 ) { wide_strcpy( sz_driver_attributes, s1 ); free( s1 ); } sz_driver_attributes += strlen( buffer ) + 1; } } total_len += strlen( buffer ) + 1; iniPropertyNext( hIni ); } /* * add extra null */ if ( sz_driver_attributes ) *sz_driver_attributes = '\0'; if ( pcb_drvr_attr ) { *pcb_drvr_attr = total_len; } iniClose( hIni ); } } } } if ( ret == SQL_SUCCESS_WITH_INFO ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 01004" ); __post_internal_error( &environment -> error, ERROR_01004, NULL, environment -> requested_version ); } if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } return function_return_nodrv( SQL_HANDLE_ENV, environment, ret ); } unixODBC-2.3.9/DriverManager/drivermanager.h0000664000175000017500000016515113724126772015634 00000000000000#ifndef _DRIVERMANAGER_H #define _DRIVERMANAGER_H #define ODBCVER 0x0380 #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_PWD_H #include #endif #include #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_TIME_H #include #endif #ifdef HAVE_SYNCH_H #include #endif #ifdef HAVE_LIBPTH #include #elif HAVE_LIBPTHREAD #include #elif HAVE_LIBTHREAD #include #endif #define SQL_NOUNICODEMAP #define UNICODE #include #include #include #include /* THIS WILL BRING IN sql.h and sqltypes.h AS WELL AS PROVIDE MS EXTENSIONS */ #include #include "__stats.h" /* * iconv support */ #ifdef HAVE_ICONV #include #include #endif #ifdef UNICODE_ENCODING #define DEFAULT_ICONV_ENCODING UNICODE_ENCODING #else #define DEFAULT_ICONV_ENCODING "auto-search" #endif #define ERROR_PREFIX "[unixODBC]" #define DM_ERROR_PREFIX "[Driver Manager]" #define LOG_MESSAGE_LEN 128 /* length of string to display in log */ /* * SQLSetStmt/ConnectionAttr limits */ #define SQL_CONN_DRIVER_MIN 20000 #define SQL_STMT_DRIVER_MIN 20000 /* * its possible that the driver has a different definition of a handle to the driver * manager, DB2 64bit is a example of this */ #define DRV_SQLHANDLE SQLHANDLE #define DRV_SQLHDESC SQLHDESC /* * DEFAULT FILE NAMES * */ /* * magic numbers */ #define HENV_MAGIC 19289 #define HDBC_MAGIC 19290 #define HSTMT_MAGIC 19291 #define HDESC_MAGIC 19292 /* * states */ #define STATE_E0 0 #define STATE_E1 1 #define STATE_E2 2 #define STATE_C0 0 #define STATE_C1 1 #define STATE_C2 2 #define STATE_C3 3 #define STATE_C4 4 #define STATE_C5 5 #define STATE_C6 6 #define STATE_S0 0 #define STATE_S1 1 #define STATE_S2 2 #define STATE_S3 3 #define STATE_S4 4 #define STATE_S5 5 #define STATE_S6 6 #define STATE_S7 7 #define STATE_S8 8 #define STATE_S9 9 #define STATE_S10 10 #define STATE_S11 11 #define STATE_S12 12 #define STATE_S13 13 /* SQLExecute/SQLExecDirect/SQLMoreResult returned SQL_PARAM_DATA_AVAILABLE */ #define STATE_S14 14 /* SQL_PARAM_DATA_AVAILABLE version of S9, Must Get */ #define STATE_S15 15 /* SQL_PARAM_DATA_AVAILABLE version of S10, Can Get */ #define STATE_D0 0 #define STATE_D1i 1 #define STATE_D1e 2 /* * rules to extract diag/error record from driver */ #define DEFER_R0 0 /* Not defer extracting diag/err record from driver. Use this as default */ #define DEFER_R1 1 /* defer extracting diag/err record from driver when SQL_SUCCESS_WITH_INFO is returned */ #define DEFER_R2 2 /* defer extracting diag/err record from driver when SQL_ERROR is returned */ #define DEFER_R3 3 /* defer extracting diag/err record from driver when SQL_SUCCESS_WITH_INFO or SQL_ERROR is returned */ /* * structure to contain the loaded lib entry points */ struct driver_func { int ordinal; char *name; void *dm_func; /* this is to fix what seems a bug in */ /* some dlopen implemnations where dlsym */ /* will return the driver manager func */ /* not the driver one */ void *dm_funcW; SQLRETURN (*func)(); SQLRETURN (*funcW)(); /* function with a unicode W */ SQLRETURN (*funcA)(); /* function with a unicode A */ int can_supply; /* this is used to indicate that */ /* the DM can execute the function */ /* even if the driver does not */ /* supply it */ }; typedef struct error { SQLWCHAR sqlstate[ 6 ]; SQLWCHAR *msg; SQLINTEGER native_error; int return_val; SQLRETURN diag_column_number_ret; SQLRETURN diag_row_number_ret; SQLRETURN diag_class_origin_ret; SQLRETURN diag_subclass_origin_ret; SQLRETURN diag_connection_name_ret; SQLRETURN diag_server_name_ret; SQLINTEGER diag_column_number; SQLLEN diag_row_number; SQLWCHAR diag_class_origin[ 128 ]; SQLWCHAR diag_subclass_origin[ 128 ]; SQLWCHAR diag_connection_name[ 128 ]; SQLWCHAR diag_server_name[ 128 ]; struct error *next; struct error *prev; } ERROR; typedef struct error_header { int error_count; ERROR *error_list_head; ERROR *error_list_tail; int internal_count; ERROR *internal_list_head; ERROR *internal_list_tail; } EHEADER; typedef struct error_head { EHEADER sql_error_head; EHEADER sql_diag_head; void *owning_handle; int handle_type; SQLRETURN return_code; SQLINTEGER header_set; SQLRETURN diag_cursor_row_count_ret; SQLRETURN diag_dynamic_function_ret; SQLRETURN diag_dynamic_function_code_ret; SQLRETURN diag_number_ret; SQLRETURN diag_row_count_ret; SQLLEN diag_cursor_row_count; SQLWCHAR diag_dynamic_function[ 128 ]; SQLINTEGER diag_dynamic_function_code; SQLLEN diag_number; SQLLEN diag_row_count; int defer_extract; /* determine the extraction of driver's message for SQLGetDiagRec or SQLGetDiagField. 0 by default is not deferred */ SQLRETURN ret_code_deferred; /* used for deferring extraction */ } EHEAD; struct log_structure { char *program_name; char *log_file_name; int log_flag; int pid_logging; /* the log path specifies a directory, and a */ /* log file per pid is created */ int ref_count; /* number of times dm_log_open()'d without dm_log_close() */ }; extern struct log_structure log_info; /* * save connection attr untill after the connect, and then pass on */ struct save_attr { int attr_type; char *str_attr; int str_len; intptr_t intptr_attr; struct save_attr *next; }; /* * attribute extension support */ struct attr_set { char *keyword; char *value; int override; int attribute; int is_int_type; int int_value; struct attr_set *next; }; struct attr_struct { int count; struct attr_set *list; }; int __parse_attribute_string( struct attr_struct *attr_str, char *str, int str_len ); void __release_attr_str( struct attr_struct *attr_str ); void __set_attributes( void *handle, int type ); void __set_local_attributes( void *handle, int type ); void *__attr_override( void *handle, int type, int attribute, void * value, SQLINTEGER *string_length ); void *__attr_override_wide( void *handle, int type, int attribute, void * value, SQLINTEGER *string_length, SQLWCHAR *buffer ); /* * use this to maintain a list of the drivers that are loaded under this env, * and to decide if we want to call SQLAllocHandle( SQL_ENV ) om them */ struct env_lib_struct { char *lib_name; DRV_SQLHANDLE env_handle; int count; struct env_lib_struct *next; }; typedef struct environment { int type; /* magic number */ struct environment *next_class_list;/* static list of all env handles */ char msg[ LOG_MSG_MAX ]; /* buff to format msgs */ int state; /* state of environment */ int version_set; /* whether ODBC version has been set */ SQLINTEGER requested_version; /* SQL_OV_ODBC2 or SQL_OV_ODBC3 */ int connection_count; /* number of hdbc of this env */ int sql_driver_count; /* used for SQLDrivers */ EHEAD error; /* keep track of errors */ SQLINTEGER connection_pooling; /* does connection pooling operate */ SQLINTEGER cp_match; int fetch_mode; /* for SQLDataSources */ int entry; void *sh; /* statistics handle */ int driver_act_ver; /* real version of the driver */ struct env_lib_struct *env_lib_list;/* use this to avoid multiple AllocEnv in the driver */ } *DMHENV; #ifdef FAST_HANDLE_VALIDATE struct statement; #endif /* * connection pooling attributes */ typedef struct connection { int type; /* magic number */ struct connection *next_class_list; /* static list of all dbc handles */ char msg[ LOG_MSG_MAX ]; /* buff to format msgs */ int state; /* state of connection */ DMHENV environment; /* environment that own's the connection */ #ifdef FAST_HANDLE_VALIDATE struct statement *statements; /* List of statements owned by this connection */ #endif void *dl_handle; /* handle of the loaded lib */ char dl_name[ 256 ]; /* name of loaded lib */ struct driver_func *functions; /* entry points */ struct driver_func ini_func; /* optinal start end functions */ struct driver_func fini_func; int unicode_driver; /* do we use the W functions in the */ /* driver ? */ DRV_SQLHANDLE driver_env; /* environment handle in client */ DRV_SQLHANDLE driver_dbc; /* connection handle in client */ int driver_version; /* required version of the connected */ /* driver */ int driver_act_ver; /* real version of the driver */ int statement_count; /* number of statements on this dbc */ EHEAD error; /* keep track of errors */ char dsn[ SQL_MAX_DSN_LENGTH + 1 ]; /* where we are connected */ int access_mode; /* variables set via SQLSetConnectAttr */ int access_mode_set; int login_timeout; int login_timeout_set; int auto_commit; int auto_commit_set; int async_enable; int async_enable_set; int auto_ipd; int auto_ipd_set; int connection_timeout; int connection_timeout_set; int metadata_id; int metadata_id_set; int packet_size; int packet_size_set; SQLLEN quite_mode; int quite_mode_set; int txn_isolation; int txn_isolation_set; SQLINTEGER cursors; void *cl_handle; /* handle to the cursor lib */ int trace; char tracefile[ INI_MAX_PROPERTY_VALUE + 1 ]; #ifdef HAVE_LIBPTH pth_mutex_t mutex; /* protect the object */ int protection_level; #elif HAVE_LIBPTHREAD pthread_mutex_t mutex; /* protect the object */ int protection_level; #elif HAVE_LIBTHREAD mutex_t mutex; /* protect the object */ int protection_level; #endif int ex_fetch_mapping; /* disable SQLFetch -> SQLExtendedFetch */ int disable_gf; /* dont call SQLGetFunctions in the driver */ int dont_dlclose; /* disable dlclosing of the handle */ int bookmarks_on; /* bookmarks are set on */ void *pooled_connection; /* points to t connection pool structure */ int pooling_timeout; int ttl; char driver_connect_string[ 1024 ]; int dsn_length; char server[ 128 ]; int server_length; char user[ 128 ]; int user_length; char password[ 128 ]; int password_length; char cli_year[ 5 ]; struct attr_struct env_attribute; /* Extended attribute set info */ struct attr_struct dbc_attribute; struct attr_struct stmt_attribute; struct save_attr *save_attr; /* SQLConnectAttr before connect */ #ifdef HAVE_ICONV iconv_t iconv_cd_uc_to_ascii; /* in and out conversion descriptor */ iconv_t iconv_cd_ascii_to_uc; char unicode_string[ 64 ]; /* name of unicode conversion */ #endif struct env_lib_struct *env_list_ent; /* pointer to reference in the env list */ char probe_sql[ 512 ]; /* SQL to use to check a pool is valid */ int threading_level; /* level of thread protection the DM proves */ int cbs_found; /* Have we queried the driver for the effect of a */ SQLSMALLINT ccb_value; /* COMMIT or a ROLLBACK */ SQLSMALLINT crb_value; } *DMHDBC; typedef struct connection_pool { char driver_connect_string[ 1024 ]; int dsn_length; char server[ 128 ]; int server_length; char user[ 128 ]; int user_length; char password[ 128 ]; int password_length; time_t expiry_time; int ttl; int timeout; int in_use; struct connection_pool *next; struct connection connection; int cursors; } CPOOL; typedef struct descriptor { int type; /* magic number */ struct descriptor *next_class_list; /* static list of all desc handles */ char msg[ LOG_MSG_MAX ]; /* buff to format msgs */ int state; /* state of descriptor */ #ifdef FAST_HANDLE_VALIDATE struct descriptor *prev_class_list;/* static list of all desc handles */ #endif EHEAD error; /* keep track of errors */ DRV_SQLHDESC driver_desc; /* driver descriptor */ DMHDBC connection; /* DM connection that owns this */ int implicit; /* created by a AllocStmt */ void *associated_with; /* statement that this is a descriptor of */ #ifdef HAVE_LIBPTH pth_mutex_t mutex; /* protect the object */ #elif HAVE_LIBPTHREAD pthread_mutex_t mutex; /* protect the object */ #elif HAVE_LIBTHREAD mutex_t mutex; /* protect the object */ #endif } *DMHDESC; typedef struct statement { int type; /* magic number */ struct statement *next_class_list; /* static list of all stmt handles */ char msg[ LOG_MSG_MAX ]; /* buff to format msgs */ int state; /* state of statement */ #ifdef FAST_HANDLE_VALIDATE struct statement *prev_class_list; /* static list of all stmt handles */ struct statement *next_conn_list; /* Single linked list storing statements owned by "connection" connection */ #endif DMHDBC connection; /* DM connection that owns this */ DRV_SQLHANDLE driver_stmt; /* statement in the driver */ SQLSMALLINT hascols; /* is there a result set */ int prepared; /* the statement has been prepared */ int interupted_func; /* current function running async */ /* or NEED_DATA */ int interupted_state; /* state we went into need data or */ /* still executing from */ int bookmarks_on; /* bookmarks are set on */ EHEAD error; /* keep track of errors */ SQLINTEGER metadata_id; DMHDESC ipd; /* current descriptors */ DMHDESC apd; DMHDESC ird; DMHDESC ard; DMHDESC implicit_ipd; /* implicit descriptors */ DMHDESC implicit_apd; DMHDESC implicit_ird; DMHDESC implicit_ard; SQLULEN *fetch_bm_ptr; /* Saved for ODBC3 to ODBC2 mapping */ SQLULEN *row_ct_ptr; /* row count ptr */ SQLUSMALLINT *row_st_arr; /* row status array */ SQLULEN row_array_size; SQLPOINTER valueptr; /* Default buffer for SQLParamData() */ #ifdef HAVE_LIBPTH pth_mutex_t mutex; /* protect the object */ #elif HAVE_LIBPTHREAD pthread_mutex_t mutex; /* protect the object */ #elif HAVE_LIBTHREAD mutex_t mutex; /* protect the object */ #endif int eod; /* when in S6 has EOD been returned */ } *DMHSTMT; #if defined ( HAVE_LIBPTHREAD ) || defined ( HAVE_LIBTHREAD ) || defined ( HAVE_LIBPTH ) #define TS_LEVEL0 0 /* no implicit protection, only for */ /* dm internal structures */ #define TS_LEVEL1 1 /* protection on a statement level */ #define TS_LEVEL2 2 /* protection on a connection level */ #define TS_LEVEL3 3 /* protection on a environment level */ #endif void mutex_lib_entry( void ); void mutex_lib_exit( void ); void mutex_pool_entry( void ); void mutex_pool_exit( void ); void mutex_iconv_entry( void ); void mutex_iconv_exit( void ); typedef struct connection_pair { char *name; char *value; struct connection_pair *next; } *connection_attribute; /* * defined down here to get the DMHDBC definition */ void __handle_attr_extensions( DMHDBC connection, char *dsn, char *driver_name ); /* * handle allocation functions */ DMHENV __alloc_env( void ); int __validate_env( DMHENV ); void __release_env( DMHENV environment ); DMHDBC __alloc_dbc( void ); int __validate_dbc( DMHDBC ); void __release_dbc( DMHDBC connection ); DMHSTMT __alloc_stmt( void ); void __register_stmt ( DMHDBC connection, DMHSTMT statement ); void __set_stmt_state ( DMHDBC connection, SQLSMALLINT cb_value ); int __validate_stmt( DMHSTMT ); void __release_stmt( DMHSTMT ); DMHDESC __alloc_desc( void ); int __validate_desc( DMHDESC ); void __release_desc( DMHDESC ); /* * generic functions */ SQLRETURN __SQLAllocHandle( SQLSMALLINT handle_type, SQLHANDLE input_handle, SQLHANDLE *output_handle, SQLINTEGER requested_version ); SQLRETURN __SQLFreeHandle( SQLSMALLINT handle_type, SQLHANDLE handle ); SQLRETURN __SQLGetInfo( SQLHDBC connection_handle, SQLUSMALLINT info_type, SQLPOINTER info_value, SQLSMALLINT buffer_length, SQLSMALLINT *string_length ); int __connect_part_one( DMHDBC connection, char *driver_lib, char *driver_name, int *warnings ); void __disconnect_part_one( DMHDBC connection ); int __connect_part_two( DMHDBC connection ); void __disconnect_part_two( DMHDBC connection ); void __disconnect_part_three( DMHDBC connection ); void __disconnect_part_four( DMHDBC connection ); DMHDBC __get_dbc_root( void ); void __check_for_function( DMHDBC connection, SQLUSMALLINT function_id, SQLUSMALLINT *supported ); int __clean_stmt_from_dbc( DMHDBC connection ); int __clean_desc_from_dbc( DMHDBC connection ); void __map_error_state( char * state, int requested_version ); void __map_error_state_w( SQLWCHAR * wstate, int requested_version ); /* * mapping from ODBC 2 <-> 3 datetime types */ #define MAP_SQL_DM2D 0 #define MAP_SQL_D2DM 1 #define MAP_C_DM2D 2 #define MAP_C_D2DM 3 SQLSMALLINT __map_type( int map, DMHDBC connection, SQLSMALLINT type); /* * error functions */ typedef enum error_id { ERROR_01000, ERROR_01004, ERROR_01S02, ERROR_01S06, ERROR_07005, ERROR_07009, ERROR_08002, ERROR_08003, ERROR_24000, ERROR_25000, ERROR_25S01, ERROR_S1000, ERROR_S1003, ERROR_S1010, ERROR_S1011, ERROR_S1107, ERROR_S1108, ERROR_S1C00, ERROR_HY001, ERROR_HY003, ERROR_HY004, ERROR_HY007, ERROR_HY009, ERROR_HY010, ERROR_HY011, ERROR_HY012, ERROR_HY013, ERROR_HY017, ERROR_HY024, ERROR_HY090, ERROR_HY092, ERROR_HY095, ERROR_HY097, ERROR_HY098, ERROR_HY099, ERROR_HY100, ERROR_HY101, ERROR_HY103, ERROR_HY105, ERROR_HY106, ERROR_HY110, ERROR_HY111, ERROR_HYC00, ERROR_IM001, ERROR_IM002, ERROR_IM003, ERROR_IM004, ERROR_IM005, ERROR_IM010, ERROR_IM012, ERROR_SL004, ERROR_SL009, ERROR_SL010, ERROR_SL008, ERROR_HY000, ERROR_IM011 } error_id; #define IGNORE_THREAD (-1) #define function_return(l,h,r,d) function_return_ex(l,h,r,FALSE,d) #define SUBCLASS_ODBC 0 #define SUBCLASS_ISO 1 void __post_internal_error( EHEAD *error_handle, error_id, char *txt, int connection_mode ); void __post_internal_error_api( EHEAD *error_handle, error_id, char *txt, int connection_mode, int calling_api ); void __post_internal_error_ex( EHEAD *error_handle, SQLCHAR *sqlstate, SQLINTEGER native_error, SQLCHAR *message_text, int class_origin, int subclass_origin ); void __post_internal_error_ex_noprefix( EHEAD *error_handle, SQLCHAR *sqlstate, SQLINTEGER native_error, SQLCHAR *message_text, int class_origin, int subclass_origin ); void __post_internal_error_ex_w( EHEAD *error_handle, SQLWCHAR *sqlstate, SQLINTEGER native_error, SQLWCHAR *message_text, int class_origin, int subclass_origin ); void __post_internal_error_ex_w_noprefix( EHEAD *error_handle, SQLWCHAR *sqlstate, SQLINTEGER native_error, SQLWCHAR *message_text, int class_origin, int subclass_origin ); void extract_error_from_driver( EHEAD * error_handle, DMHDBC hdbc, int ret_code, int save_to_diag ); int function_return_nodrv( int level, void *handle, int ret_code ); int function_return_ex( int level, void * handle, int ret_code, int save_to_diag, int defer_type ); void function_entry( void *handle ); void setup_error_head( EHEAD *error_header, void *handle, int handle_type ); void clear_error_head( EHEAD *error_header ); SQLWCHAR *ansi_to_unicode_copy( SQLWCHAR * dest, char *src, SQLINTEGER buffer_len, DMHDBC connection, int *wlen ); SQLWCHAR *ansi_to_unicode_alloc( SQLCHAR *str, SQLINTEGER len, DMHDBC connection, int *wlen ); char *unicode_to_ansi_copy( char* dest, int dest_len, SQLWCHAR *src, SQLINTEGER len, DMHDBC connection, int *clen ); char *unicode_to_ansi_alloc( SQLWCHAR *str, SQLINTEGER len, DMHDBC connection, int *clen ); int unicode_setup( DMHDBC connection ); void unicode_shutdown( DMHDBC connection ); char * __get_return_status( SQLRETURN ret, SQLCHAR *buffer ); char * __sql_as_text( SQLINTEGER type ); char * __c_as_text( SQLINTEGER type ); char * __string_with_length( SQLCHAR *out, SQLCHAR *str, SQLINTEGER len ); char * __string_with_length_pass( SQLCHAR *out, SQLCHAR *str, SQLINTEGER len ); char * __string_with_length_hide_pwd( SQLCHAR *out, SQLCHAR *str, SQLINTEGER len ); char * __wstring_with_length( SQLCHAR *out, SQLWCHAR *str, SQLINTEGER len ); char * __wstring_with_length_pass( SQLCHAR *out, SQLWCHAR *str, SQLINTEGER len ); char * __wstring_with_length_hide_pwd( SQLCHAR *out, SQLWCHAR *str, SQLINTEGER len ); SQLWCHAR *wide_strcpy( SQLWCHAR *str1, SQLWCHAR *str2 ); SQLWCHAR *wide_strncpy( SQLWCHAR *str1, SQLWCHAR *str2, int buffer_length ); SQLWCHAR *wide_strcat( SQLWCHAR *str1, SQLWCHAR *str2 ); SQLWCHAR *wide_strdup( SQLWCHAR *str1 ); int wide_strlen( SQLWCHAR *str1 ); int wide_ansi_strncmp( SQLWCHAR *str1, char *str2, int len ); char * __get_pid( SQLCHAR *str ); char * __iptr_as_string( SQLCHAR *s, SQLINTEGER *ptr ); char * __ptr_as_string( SQLCHAR *s, SQLLEN *ptr ); char * __sptr_as_string( SQLCHAR *s, SQLSMALLINT *ptr ); char * __info_as_string( SQLCHAR *s, SQLINTEGER typ ); void __clear_internal_error( struct error *error_handle ); char * __data_as_string( SQLCHAR *s, SQLINTEGER type, SQLLEN *ptr, SQLPOINTER buf ); char * __sdata_as_string( SQLCHAR *s, SQLINTEGER type, SQLSMALLINT *ptr, SQLPOINTER buf ); char * __idata_as_string( SQLCHAR *s, SQLINTEGER type, SQLINTEGER *ptr, SQLPOINTER buf ); char * __col_attr_as_string( SQLCHAR *s, SQLINTEGER type ); char * __fid_as_string( SQLCHAR *s, SQLINTEGER fid ); char * __con_attr_as_string( SQLCHAR *s, SQLINTEGER type ); char * __env_attr_as_string( SQLCHAR *s, SQLINTEGER type ); char * __stmt_attr_as_string( SQLCHAR *s, SQLINTEGER type ); char * __desc_attr_as_string( SQLCHAR *s, SQLINTEGER type ); char * __diag_attr_as_string( SQLCHAR *s, SQLINTEGER type ); char * __type_as_string( SQLCHAR *s, SQLSMALLINT type ); DMHDBC __get_connection( EHEAD * head ); DRV_SQLHANDLE __get_driver_handle( EHEAD * head ); int __get_version( EHEAD * head ); int dm_check_connection_attrs( DMHDBC connection, SQLINTEGER attribute, SQLPOINTER value ); int dm_check_statement_attrs( DMHSTMT statement, SQLINTEGER attribute, SQLPOINTER value ); int __check_stmt_from_dbc( DMHDBC connection, int state ); #define MAX_STATE_ARGS 8 int __check_stmt_from_dbc_v( DMHDBC connection, int statecount, ... ); int __check_stmt_from_desc( DMHDESC desc, int state ); int __check_stmt_from_desc_ird( DMHDESC desc, int state ); /* * These are passed to the cursor lib as helper functions */ struct driver_helper_funcs { void (*__post_internal_error_ex)( EHEAD *error_header, SQLCHAR *sqlstate, SQLINTEGER native_error, SQLCHAR *message_text, int class_origin, int subclass_origin ); void (*__post_internal_error)( EHEAD *error_handle, error_id id, char *txt, int connection_mode ); void (*dm_log_write)( char *function_name, int line, int type, int severity, char *message ); }; /* * thread protection funcs */ #if defined ( HAVE_LIBPTHREAD ) || defined ( HAVE_LIBTHREAD ) || defined ( HAVE_LIBPTH ) void thread_protect( int type, void *handle ); void thread_release( int type, void *handle ); #else #define thread_protect(a,b) #define thread_release(a,b) #endif void dbc_change_thread_support( DMHDBC connection, int level ); #ifdef WITH_HANDLE_REDIRECT void *find_parent_handle( DRV_SQLHANDLE hand, int type ); #endif /* * lookup functions */ char *__find_lib_name( char *dsn, char *lib_name, char *driver_name ); /* * setup the cursor library */ SQLRETURN SQL_API CLConnect( DMHDBC connection, struct driver_helper_funcs * ); /* * connection string functions */ struct con_pair { char *keyword; char *attribute; char *identifier; struct con_pair *next; }; struct con_struct { int count; struct con_pair *list; }; void __generate_connection_string( struct con_struct *con_str, char *str, int str_len ); int __parse_connection_string( struct con_struct *con_str, char *str, int str_len ); int __parse_connection_string_w( struct con_struct *con_str, SQLWCHAR *str, int str_len ); char * __get_attribute_value( struct con_struct * con_str, char * keyword ); void __release_conn( struct con_struct *con_str ); void __get_attr( char ** cp, char ** keyword, char ** value ); struct con_pair * __get_pair( char ** cp ); int __append_pair( struct con_struct *con_str, char *kword, char *value ); void __handle_attr_extensions_cs( DMHDBC connection, struct con_struct *con_str ); void __strip_from_pool( DMHENV env ); void extract_diag_error_w( int htype, DRV_SQLHANDLE handle, DMHDBC connection, EHEAD *head, int return_code, int save_to_diag ); void extract_diag_error( int htype, DRV_SQLHANDLE handle, DMHDBC connection, EHEAD *head, int return_code, int save_to_diag ); void extract_sql_error_w( DRV_SQLHANDLE henv, DRV_SQLHANDLE hdbc, DRV_SQLHANDLE hstmt, DMHDBC connection, EHEAD *head, int return_code ); void extract_sql_error( DRV_SQLHANDLE henv, DRV_SQLHANDLE hdbc, DRV_SQLHANDLE hstmt, DMHDBC connection, EHEAD *head, int return_code ); /* * the following two are part of a effort to get a particular unicode driver working */ SQLINTEGER map_ca_odbc3_to_2( SQLINTEGER field_identifier ); SQLINTEGER map_ca_odbc2_to_3( SQLINTEGER field_identifier ); /* * check the type passed to SQLBindCol is a valid C_TYPE */ int check_target_type( int c_type, int connection_mode); /* * entry exit functions in drivers */ #define ODBC_INI_FUNCTION "SQLDriverLoad" #define ODBC_FINI_FUNCTION "SQLDriverUnload" /* * driver manager logging functions */ void dm_log_open( char *program_name, char *log_file, int pid_logging ); void dm_log_write( char *function_name, int line, int type, int severity, char *message ); void dm_log_write_diag( char *message ); void dm_log_close( void ); /* * connection pooling functions */ int search_for_pool( DMHDBC connection, SQLCHAR *server_name, SQLSMALLINT name_length1, SQLCHAR *user_name, SQLSMALLINT name_length2, SQLCHAR *authentication, SQLSMALLINT name_length3, SQLCHAR *connect_string, SQLSMALLINT connect_string_length ); void return_to_pool( DMHDBC connection ); /* * Macros to check and call functions in the driver */ #define DM_SQLALLOCCONNECT 0 #define CHECK_SQLALLOCCONNECT(con) (con->functions[0].func!=NULL) #define SQLALLOCCONNECT(con,env,oh)\ (con->functions[0].func)(env,oh) #define DM_SQLALLOCENV 1 #define CHECK_SQLALLOCENV(con) (con->functions[1].func!=NULL) #define SQLALLOCENV(con,oh)\ (con->functions[1].func)(oh) #define DM_SQLALLOCHANDLE 2 #define CHECK_SQLALLOCHANDLE(con) (con->functions[2].func!=NULL) /* * if the function is in the cursor lib, pass a additional * arg that allows the cursor lib to get the dm handle */ #define SQLALLOCHANDLE(con,ht,ih,oh,dmh)\ (con->cl_handle?\ (con->functions[2].func)(ht,ih,oh,dmh):\ (con->functions[2].func)(ht,ih,oh)) #define DM_SQLALLOCSTMT 3 #define CHECK_SQLALLOCSTMT(con) (con->functions[3].func!=NULL) #define SQLALLOCSTMT(con,dbc,oh,dmh)\ (con->cl_handle?\ (con->functions[3].func)(dbc,oh,dmh):\ (con->functions[3].func)(dbc,oh)) #define DM_SQLALLOCHANDLESTD 4 #define DM_SQLBINDCOL 5 #define CHECK_SQLBINDCOL(con) (con->functions[5].func!=NULL) #define SQLBINDCOL(con,stmt,cn,tt,tvp,bl,sli)\ (con->functions[5].func)\ (stmt,cn,tt,tvp,bl,sli) #define DM_SQLBINDPARAM 6 #define CHECK_SQLBINDPARAM(con) (con->functions[6].func!=NULL) #define SQLBINDPARAM(con,stmt,pn,vt,pt,cs,dd,pvp,ind)\ (con->functions[6].func)\ (stmt,pn,vt,pt,cs,dd,pvp,ind) #define DM_SQLBINDPARAMETER 7 #define CHECK_SQLBINDPARAMETER(con) (con->functions[7].func!=NULL) #define SQLBINDPARAMETER(con,stmt,pn,typ,vt,pt,cs,dd,pvp,bl,ind)\ (con->functions[7].func)\ (stmt,pn,typ,vt,pt,cs,dd,pvp,bl,ind) #define DM_SQLBROWSECONNECT 8 #define CHECK_SQLBROWSECONNECT(con) (con->functions[8].func!=NULL) #define SQLBROWSECONNECT(con,dbc,ics,sl1,ocs,bl,sl2)\ (con->functions[8].func)\ (dbc,ics,sl1,ocs,bl,sl2) #define CHECK_SQLBROWSECONNECTW(con) (con->functions[8].funcW!=NULL) #define SQLBROWSECONNECTW(con,dbc,ics,sl1,ocs,bl,sl2)\ (con->functions[8].funcW)\ (dbc,ics,sl1,ocs,bl,sl2) #define DM_SQLBULKOPERATIONS 9 #define CHECK_SQLBULKOPERATIONS(con) (con->functions[9].func!=NULL) #define SQLBULKOPERATIONS(con,stmt,op)\ (con->functions[9].func)(stmt,op) #define DM_SQLCANCEL 10 #define CHECK_SQLCANCEL(con) (con->functions[10].func!=NULL) #define SQLCANCEL(con,stmt)\ (con->functions[10].func)(stmt) #define DM_SQLCLOSECURSOR 11 #define CHECK_SQLCLOSECURSOR(con) (con->functions[11].func!=NULL) #define SQLCLOSECURSOR(con,stmt)\ (con->functions[11].func)(stmt) #define DM_SQLCOLATTRIBUTE 12 #define CHECK_SQLCOLATTRIBUTE(con) (con->functions[12].func!=NULL) #define SQLCOLATTRIBUTE(con,stmt,cn,fi,cap,bl,slp,nap)\ (con->functions[12].func)\ (stmt,cn,fi,cap,bl,slp,nap) #define CHECK_SQLCOLATTRIBUTEW(con) (con->functions[12].funcW!=NULL) #define SQLCOLATTRIBUTEW(con,stmt,cn,fi,cap,bl,slp,nap)\ (con->functions[12].funcW)\ (stmt,cn,fi,cap,bl,slp,nap) #define DM_SQLCOLATTRIBUTES 13 #define CHECK_SQLCOLATTRIBUTES(con) (con->functions[13].func!=NULL) #define SQLCOLATTRIBUTES(con,stmt,cn,fi,cap,bl,slp,nap)\ (con->functions[13].func)\ (stmt,cn,fi,cap,bl,slp,nap) #define CHECK_SQLCOLATTRIBUTESW(con) (con->functions[13].funcW!=NULL) #define SQLCOLATTRIBUTESW(con,stmt,cn,fi,cap,bl,slp,nap)\ (con->functions[13].funcW)\ (stmt,cn,fi,cap,bl,slp,nap) #define DM_SQLCOLUMNPRIVILEGES 14 #define CHECK_SQLCOLUMNPRIVILEGES(con) (con->functions[14].func!=NULL) #define SQLCOLUMNPRIVILEGES(con,stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4)\ (con->functions[14].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4) #define CHECK_SQLCOLUMNPRIVILEGESW(con) (con->functions[14].funcW!=NULL) #define SQLCOLUMNPRIVILEGESW(con,stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4)\ (con->functions[14].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4) #define DM_SQLCOLUMNS 15 #define CHECK_SQLCOLUMNS(con) (con->functions[15].func!=NULL) #define SQLCOLUMNS(con,stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4)\ (con->functions[15].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4) #define CHECK_SQLCOLUMNSW(con) (con->functions[15].funcW!=NULL) #define SQLCOLUMNSW(con,stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4)\ (con->functions[15].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4) #define DM_SQLCONNECT 16 #define CHECK_SQLCONNECT(con) (con->functions[16].func!=NULL) #define SQLCONNECT(con,dbc,dsn,l1,uid,l2,at,l3)\ (con->functions[16].func)\ (dbc,dsn,l1,uid,l2,at,l3) #define CHECK_SQLCONNECTW(con) (con->functions[16].funcW!=NULL) #define SQLCONNECTW(con,dbc,dsn,l1,uid,l2,at,l3)\ (con->functions[16].funcW)\ (dbc,dsn,l1,uid,l2,at,l3) #define DM_SQLCOPYDESC 17 #define CHECK_SQLCOPYDESC(con) (con->functions[17].func!=NULL) #define SQLCOPYDESC(con,sd,td)\ (con->functions[17].func)(sd,td) #define DM_SQLDATASOURCES 18 #define DM_SQLDESCRIBECOL 19 #define CHECK_SQLDESCRIBECOL(con) (con->functions[19].func!=NULL) #define SQLDESCRIBECOL(con,stmt,cnum,cn,bli,nl,dt,cs,dd,n)\ (con->functions[19].func)\ (stmt,cnum,cn,bli,nl,dt,cs,dd,n) #define CHECK_SQLDESCRIBECOLW(con) (con->functions[19].funcW!=NULL) #define SQLDESCRIBECOLW(con,stmt,cnum,cn,bli,nl,dt,cs,dd,n)\ (con->functions[19].funcW)\ (stmt,cnum,cn,bli,nl,dt,cs,dd,n) #define DM_SQLDESCRIBEPARAM 20 #define CHECK_SQLDESCRIBEPARAM(con) (con->functions[20].func!=NULL) #define SQLDESCRIBEPARAM(con,stmt,pn,dtp,psp,ddp,np)\ (con->functions[20].func)\ (stmt,pn,dtp,psp,ddp,np) #define DM_SQLDISCONNECT 21 #define CHECK_SQLDISCONNECT(con) (con->functions[21].func!=NULL) #define SQLDISCONNECT(con,dbc)\ (con->functions[21].func)(dbc) #define DM_SQLDRIVERCONNECT 22 #define CHECK_SQLDRIVERCONNECT(con) (con->functions[22].func!=NULL) #define SQLDRIVERCONNECT(con,dbc,wh,ics,sl1,ocs,bl,sl2p,dc)\ (con->functions[22].func)\ (dbc,wh,ics,sl1,ocs,bl,sl2p,dc) #define CHECK_SQLDRIVERCONNECTW(con) (con->functions[22].funcW!=NULL) #define SQLDRIVERCONNECTW(con,dbc,wh,ics,sl1,ocs,bl,sl2p,dc)\ (con->functions[22].funcW)\ (dbc,wh,ics,sl1,ocs,bl,sl2p,dc) #define DM_SQLDRIVERS 23 #define DM_SQLENDTRAN 24 #define CHECK_SQLENDTRAN(con) (con->functions[24].func!=NULL) #define SQLENDTRAN(con,ht,h,op)\ (con->functions[24].func)(ht,h,op) #define DM_SQLERROR 25 #define CHECK_SQLERROR(con) (con->functions[25].func!=NULL) #define SQLERROR(con,env,dbc,stmt,st,nat,msg,mm,pcb)\ (con->functions[25].func)\ (env,dbc,stmt,st,nat,msg,mm,pcb) #define CHECK_SQLERRORW(con) (con->functions[25].funcW!=NULL) #define SQLERRORW(con,env,dbc,stmt,st,nat,msg,mm,pcb)\ (con->functions[25].funcW)\ (env,dbc,stmt,st,nat,msg,mm,pcb) #define DM_SQLEXECDIRECT 26 #define CHECK_SQLEXECDIRECT(con) (con->functions[26].func!=NULL) #define SQLEXECDIRECT(con,stmt,sql,len)\ (con->functions[26].func)(stmt,sql,len) #define CHECK_SQLEXECDIRECTW(con) (con->functions[26].funcW!=NULL) #define SQLEXECDIRECTW(con,stmt,sql,len)\ (con->functions[26].funcW)(stmt,sql,len) #define DM_SQLEXECUTE 27 #define CHECK_SQLEXECUTE(con) (con->functions[27].func!=NULL) #define SQLEXECUTE(con,stmt)\ (con->functions[27].func)(stmt) #define DM_SQLEXTENDEDFETCH 28 #define CHECK_SQLEXTENDEDFETCH(con) (con->functions[28].func!=NULL) #define SQLEXTENDEDFETCH(con,stmt,fo,of,rcp,ssa)\ (con->functions[28].func)\ (stmt,fo,of,rcp,ssa) #define DM_FETCH 29 #define CHECK_SQLFETCH(con) (con->functions[29].func!=NULL) #define SQLFETCH(con,stmt)\ (con->functions[29].func)(stmt) #define DM_SQLFETCHSCROLL 30 #define CHECK_SQLFETCHSCROLL(con) (con->functions[30].func!=NULL) #define SQLFETCHSCROLL(con,stmt,or,of)\ (con->functions[30].func)\ (stmt,or,of) #define DM_SQLFOREIGNKEYS 31 #define CHECK_SQLFOREIGNKEYS(con) (con->functions[31].func!=NULL) #define SQLFOREIGNKEYS(con,stmt,cn,nl1,sn,nl2,tn,nl3,fcn,nl4,fsn,nl5,ftn,nl6)\ (con->functions[31].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3,fcn,nl4,fsn,nl5,ftn,nl6) #define CHECK_SQLFOREIGNKEYSW(con) (con->functions[31].funcW!=NULL) #define SQLFOREIGNKEYSW(con,stmt,cn,nl1,sn,nl2,tn,nl3,fcn,nl4,fsn,nl5,ftn,nl6)\ (con->functions[31].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3,fcn,nl4,fsn,nl5,ftn,nl6) #define DM_SQLFREEENV 32 #define CHECK_SQLFREEENV(con) (con->functions[32].func!=NULL) #define SQLFREEENV(con,env)\ (con->functions[32].func)(env) #define DM_SQLFREEHANDLE 33 #define CHECK_SQLFREEHANDLE(con) (con->functions[33].func!=NULL) #define SQLFREEHANDLE(con,typ,env)\ (con->functions[33].func)(typ,env) #define DM_SQLFREESTMT 34 #define CHECK_SQLFREESTMT(con) (con->functions[34].func!=NULL) #define SQLFREESTMT(con,stmt,opt)\ (con->functions[34].func)(stmt,opt) #define DM_SQLFREECONNECT 35 #define CHECK_SQLFREECONNECT(con) (con->functions[35].func!=NULL) #define SQLFREECONNECT(con,dbc)\ (con->functions[35].func)(dbc) #define DM_SQLGETCONNECTATTR 36 #define CHECK_SQLGETCONNECTATTR(con) (con->functions[36].func!=NULL) #define SQLGETCONNECTATTR(con,dbc,at,vp,bl,slp)\ (con->functions[36].func)\ (dbc,at,vp,bl,slp) #define CHECK_SQLGETCONNECTATTRW(con) (con->functions[36].funcW!=NULL) #define SQLGETCONNECTATTRW(con,dbc,at,vp,bl,slp)\ (con->functions[36].funcW)\ (dbc,at,vp,bl,slp) #define DM_SQLGETCONNECTOPTION 37 #define CHECK_SQLGETCONNECTOPTION(con) (con->functions[37].func!=NULL) #define SQLGETCONNECTOPTION(con,dbc,at,val)\ (con->functions[37].func)\ (dbc,at,val) #define CHECK_SQLGETCONNECTOPTIONW(con) (con->functions[37].funcW!=NULL) #define SQLGETCONNECTOPTIONW(con,dbc,at,val)\ (con->functions[37].funcW)\ (dbc,at,val) #define DM_SQLGETCURSORNAME 38 #define CHECK_SQLGETCURSORNAME(con) (con->functions[38].func!=NULL) #define SQLGETCURSORNAME(con,stmt,cn,bl,nlp)\ (con->functions[38].func)\ (stmt,cn,bl,nlp) #define CHECK_SQLGETCURSORNAMEW(con) (con->functions[38].funcW!=NULL) #define SQLGETCURSORNAMEW(con,stmt,cn,bl,nlp)\ (con->functions[38].funcW)\ (stmt,cn,bl,nlp) #define DM_SQLGETDATA 39 #define CHECK_SQLGETDATA(con) (con->functions[39].func!=NULL) #define SQLGETDATA(con,stmt,cn,tt,tvp,bl,sli)\ (con->functions[39].func)\ (stmt,cn,tt,tvp,bl,sli) #define DM_SQLGETDESCFIELD 40 #define CHECK_SQLGETDESCFIELD(con) (con->functions[40].func!=NULL) #define SQLGETDESCFIELD(con,des,rn,fi,vp,bl,slp)\ (con->functions[40].func)\ (des,rn,fi,vp,bl,slp) #define CHECK_SQLGETDESCFIELDW(con) (con->functions[40].funcW!=NULL) #define SQLGETDESCFIELDW(con,des,rn,fi,vp,bl,slp)\ (con->functions[40].funcW)\ (des,rn,fi,vp,bl,slp) #define DM_SQLGETDESCREC 41 #define CHECK_SQLGETDESCREC(con) (con->functions[41].func!=NULL) #define SQLGETDESCREC(con,des,rn,n,bl,slp,tp,stp,lp,pp,sp,np)\ (con->functions[41].func)\ (des,rn,n,bl,slp,tp,stp,lp,pp,sp,np) #define CHECK_SQLGETDESCRECW(con) (con->functions[41].funcW!=NULL) #define SQLGETDESCRECW(con,des,rn,n,bl,slp,tp,stp,lp,pp,sp,np)\ (con->functions[41].funcW)\ (des,rn,n,bl,slp,tp,stp,lp,pp,sp,np) #define DM_SQLGETDIAGFIELD 42 #define CHECK_SQLGETDIAGFIELD(con) (con->functions[42].func!=NULL) #define SQLGETDIAGFIELD(con,typ,han,rn,di,dip,bl,slp)\ (con->functions[42].func)\ (typ,han,rn,di,dip,bl,slp) #define CHECK_SQLGETDIAGFIELDW(con) (con->functions[42].funcW!=NULL) #define SQLGETDIAGFIELDW(con,typ,han,rn,di,dip,bl,slp)\ (con->functions[42].funcW)\ (typ,han,rn,di,dip,bl,slp) #define DM_SQLGETENVATTR 43 #define CHECK_SQLGETENVATTR(con) (con->functions[43].func!=NULL) #define SQLGETENVATTR(con,env,attr,val,len,ol)\ (con->functions[43].func)\ (env,attr,val,len,ol) #define DM_SQLGETFUNCTIONS 44 #define CHECK_SQLGETFUNCTIONS(con) (con->functions[44].func!=NULL) #define SQLGETFUNCTIONS(con,dbc,id,ptr)\ (con->functions[44].func)\ (dbc,id,ptr) #define DM_SQLGETINFO 45 #define CHECK_SQLGETINFO(con) (con->functions[45].func!=NULL) #define SQLGETINFO(con,dbc,it,ivo,bl,slp)\ (con->functions[45].func)\ (dbc,it,ivo,bl,slp) #define CHECK_SQLGETINFOW(con) (con->functions[45].funcW!=NULL) #define SQLGETINFOW(con,dbc,it,ivo,bl,slp)\ (con->functions[45].funcW)\ (dbc,it,ivo,bl,slp) #define DM_SQLGETSTMTATTR 46 #define CHECK_SQLGETSTMTATTR(con) (con->functions[46].func!=NULL) #define SQLGETSTMTATTR(con,stmt,at,vp,bl,slp)\ (con->functions[46].func)\ (stmt,at,vp,bl,slp) #define CHECK_SQLGETSTMTATTRW(con) (con->functions[46].funcW!=NULL) #define SQLGETSTMTATTRW(con,stmt,at,vp,bl,slp)\ (con->functions[46].funcW)\ (stmt,at,vp,bl,slp) #define DM_SQLGETSTMTOPTION 47 #define CHECK_SQLGETSTMTOPTION(con) (con->functions[47].func!=NULL) #define SQLGETSTMTOPTION(con,stmt,op,val)\ (con->functions[47].func)\ (stmt,op,val) #define CHECK_SQLGETSTMTOPTIONW(con) (con->functions[47].funcW!=NULL) #define SQLGETSTMTOPTIONW(con,stmt,op,val)\ (con->functions[47].funcW)\ (stmt,op,val) #define DM_SQLGETTYPEINFO 48 #define CHECK_SQLGETTYPEINFO(con) (con->functions[48].func!=NULL) #define SQLGETTYPEINFO(con,stmt,typ)\ (con->functions[48].func)(stmt,typ) #define CHECK_SQLGETTYPEINFOW(con) (con->functions[48].funcW!=NULL) #define SQLGETTYPEINFOW(con,stmt,typ)\ (con->functions[48].funcW)(stmt,typ) #define DM_SQLMORERESULTS 49 #define CHECK_SQLMORERESULTS(con) (con->functions[49].func!=NULL) #define SQLMORERESULTS(con,stmt)\ (con->functions[49].func)(stmt) #define DM_SQLNATIVESQL 50 #define CHECK_SQLNATIVESQL(con) (con->functions[50].func!=NULL) #define SQLNATIVESQL(con,dbc,ist,tl,ost,bl,tlp)\ (con->functions[50].func)\ (dbc,ist,tl,ost,bl,tlp) #define CHECK_SQLNATIVESQLW(con) (con->functions[50].funcW!=NULL) #define SQLNATIVESQLW(con,dbc,ist,tl,ost,bl,tlp)\ (con->functions[50].funcW)\ (dbc,ist,tl,ost,bl,tlp) #define DM_SQLNUMPARAMS 51 #define CHECK_SQLNUMPARAMS(con) (con->functions[51].func!=NULL) #define SQLNUMPARAMS(con,stmt,cnt)\ (con->functions[51].func)(stmt,cnt) #define DM_SQLNUMRESULTCOLS 52 #define CHECK_SQLNUMRESULTCOLS(con) (con->functions[52].func!=NULL) #define SQLNUMRESULTCOLS(con,stmt,cnt)\ (con->functions[52].func)(stmt,cnt) #define DM_SQLPARAMDATA 53 #define CHECK_SQLPARAMDATA(con) (con->functions[53].func!=NULL) #define SQLPARAMDATA(con,stmt,val)\ (con->functions[53].func)(stmt,val) #define DM_SQLPARAMOPTIONS 54 #define CHECK_SQLPARAMOPTIONS(con) (con->functions[54].func!=NULL) #define SQLPARAMOPTIONS(con,stmt,cr,pi)\ (con->functions[54].func)(stmt,cr,pi) #define DM_SQLPREPARE 55 #define CHECK_SQLPREPARE(con) (con->functions[55].func!=NULL) #define SQLPREPARE(con,stmt,sql,len)\ (con->functions[55].func)(stmt,sql,len) #define CHECK_SQLPREPAREW(con) (con->functions[55].funcW!=NULL) #define SQLPREPAREW(con,stmt,sql,len)\ (con->functions[55].funcW)(stmt,sql,len) #define DM_SQLPRIMARYKEYS 56 #define CHECK_SQLPRIMARYKEYS(con) (con->functions[56].func!=NULL) #define SQLPRIMARYKEYS(con,stmt,cn,nl1,sn,nl2,tn,nl3)\ (con->functions[56].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3) #define CHECK_SQLPRIMARYKEYSW(con) (con->functions[56].funcW!=NULL) #define SQLPRIMARYKEYSW(con,stmt,cn,nl1,sn,nl2,tn,nl3)\ (con->functions[56].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3) #define DM_SQLPROCEDURECOLUMNS 57 #define CHECK_SQLPROCEDURECOLUMNS(con) (con->functions[57].func!=NULL) #define SQLPROCEDURECOLUMNS(con,stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4)\ (con->functions[57].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4) #define CHECK_SQLPROCEDURECOLUMNSW(con) (con->functions[57].funcW!=NULL) #define SQLPROCEDURECOLUMNSW(con,stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4)\ (con->functions[57].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3,col,nl4) #define DM_SQLPROCEDURES 58 #define CHECK_SQLPROCEDURES(con) (con->functions[58].func!=NULL) #define SQLPROCEDURES(con,stmt,cn,nl1,sn,nl2,tn,nl3)\ (con->functions[58].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3) #define CHECK_SQLPROCEDURESW(con) (con->functions[58].funcW!=NULL) #define SQLPROCEDURESW(con,stmt,cn,nl1,sn,nl2,tn,nl3)\ (con->functions[58].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3) #define DM_SQLPUTDATA 59 #define CHECK_SQLPUTDATA(con) (con->functions[59].func!=NULL) #define SQLPUTDATA(con,stmt,d,p)\ (con->functions[59].func)(stmt,d,p) #define DM_SQLROWCOUNT 60 #define CHECK_SQLROWCOUNT(con) (con->functions[60].func!=NULL) #define DEF_SQLROWCOUNT(con,stmt,cnt)\ (con->functions[60].func)(stmt,cnt) #define DM_SQLSETCONNECTATTR 61 #define CHECK_SQLSETCONNECTATTR(con) (con->functions[61].func!=NULL) #define SQLSETCONNECTATTR(con,dbc,at,vp,sl)\ (con->functions[61].func)\ (dbc,at,vp,sl) #define CHECK_SQLSETCONNECTATTRW(con) (con->functions[61].funcW!=NULL) #define SQLSETCONNECTATTRW(con,dbc,at,vp,sl)\ (con->functions[61].funcW)\ (dbc,at,vp,sl) #define DM_SQLSETCONNECTOPTION 62 #define CHECK_SQLSETCONNECTOPTION(con) (con->functions[62].func!=NULL) #define SQLSETCONNECTOPTION(con,dbc,op,p)\ (con->functions[62].func)\ (dbc,op,p) #define CHECK_SQLSETCONNECTOPTIONW(con) (con->functions[62].funcW!=NULL) #define SQLSETCONNECTOPTIONW(con,dbc,op,p)\ (con->functions[62].funcW)\ (dbc,op,p) #define DM_SQLSETCURSORNAME 63 #define CHECK_SQLSETCURSORNAME(con) (con->functions[63].func!=NULL) #define SQLSETCURSORNAME(con,stmt,nam,len)\ (con->functions[63].func)(stmt,nam,len) #define CHECK_SQLSETCURSORNAMEW(con) (con->functions[63].funcW!=NULL) #define SQLSETCURSORNAMEW(con,stmt,nam,len)\ (con->functions[63].funcW)(stmt,nam,len) #define DM_SQLSETDESCFIELD 64 #define CHECK_SQLSETDESCFIELD(con) (con->functions[64].func!=NULL) #define SQLSETDESCFIELD(con,des,rn,fi,vp,bl)\ (con->functions[64].func)\ (des,rn,fi,vp,bl) #define CHECK_SQLSETDESCFIELDW(con) (con->functions[64].funcW!=NULL) #define SQLSETDESCFIELDW(con,des,rn,fi,vp,bl)\ (con->functions[64].funcW)\ (des,rn,fi,vp,bl) #define DM_SQLSETDESCREC 65 #define CHECK_SQLSETDESCREC(con) (con->functions[65].func!=NULL) #define SQLSETDESCREC(con,des,rn,t,st,l,p,sc,dp,slp,ip)\ (con->functions[65].func)\ (des,rn,t,st,l,p,sc,dp,slp,ip) #define DM_SQLSETENVATTR 66 #define CHECK_SQLSETENVATTR(con) (con->functions[66].func!=NULL) #define SQLSETENVATTR(con,env,attr,val,len)\ (con->functions[66].func)(env,attr,val,len) #define DM_SQLSETPARAM 67 #define CHECK_SQLSETPARAM(con) (con->functions[67].func!=NULL) #define SQLSETPARAM(con,stmt,pn,vt,pt,lp,ps,pv,sli)\ (con->functions[67].func)\ (stmt,pn,vt,pt,lp,ps,pv,sli) #define DM_SQLSETPOS 68 #define CHECK_SQLSETPOS(con) (con->functions[68].func!=NULL) #define SQLSETPOS(con,stmt,rn,op,lt)\ (con->functions[68].func)\ (stmt,rn,op,lt) #define DM_SQLSETSCROLLOPTIONS 69 #define CHECK_SQLSETSCROLLOPTIONS(con) (con->functions[69].func!=NULL) #define SQLSETSCROLLOPTIONS(con,stmt,fc,cr,rs)\ (con->functions[69].func)\ (stmt,fc,cr,rs) #define DM_SQLSETSTMTATTR 70 #define CHECK_SQLSETSTMTATTR(con) (con->functions[70].func!=NULL) #define SQLSETSTMTATTR(con,stmt,attr,vp,sl)\ (con->functions[70].func)\ (stmt,attr,vp,sl) #define CHECK_SQLSETSTMTATTRW(con) (con->functions[70].funcW!=NULL) #define SQLSETSTMTATTRW(con,stmt,attr,vp,sl)\ (con->functions[70].funcW)\ (stmt,attr,vp,sl) #define DM_SQLSETSTMTOPTION 71 #define CHECK_SQLSETSTMTOPTION(con) (con->functions[71].func!=NULL) #define SQLSETSTMTOPTION(con,stmt,op,val)\ (con->functions[71].func)\ (stmt,op,val) #define CHECK_SQLSETSTMTOPTIONW(con) (con->functions[71].funcW!=NULL) #define SQLSETSTMTOPTIONW(con,stmt,op,val)\ (con->functions[71].funcW)\ (stmt,op,val) #define DM_SQLSPECIALCOLUMNS 72 #define CHECK_SQLSPECIALCOLUMNS(con) (con->functions[72].func!=NULL) #define SQLSPECIALCOLUMNS(con,stmt,it,cn,nl1,sn,nl2,tn,nl3,s,n)\ (con->functions[72].func)\ (stmt,it,cn,nl1,sn,nl2,tn,nl3,s,n) #define CHECK_SQLSPECIALCOLUMNSW(con) (con->functions[72].funcW!=NULL) #define SQLSPECIALCOLUMNSW(con,stmt,it,cn,nl1,sn,nl2,tn,nl3,s,n)\ (con->functions[72].funcW)\ (stmt,it,cn,nl1,sn,nl2,tn,nl3,s,n) #define DM_SQLSTATISTICS 73 #define CHECK_SQLSTATISTICS(con) (con->functions[73].func!=NULL) #define SQLSTATISTICS(con,stmt,cn,nl1,sn,nl2,tn,nl3,un,res)\ (con->functions[73].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3,un,res) #define CHECK_SQLSTATISTICSW(con) (con->functions[73].funcW!=NULL) #define SQLSTATISTICSW(con,stmt,cn,nl1,sn,nl2,tn,nl3,un,res)\ (con->functions[73].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3,un,res) #define DM_SQLTABLEPRIVILEGES 74 #define CHECK_SQLTABLEPRIVILEGES(con) (con->functions[74].func!=NULL) #define SQLTABLEPRIVILEGES(con,stmt,cn,nl1,sn,nl2,tn,nl3)\ (con->functions[74].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3) #define CHECK_SQLTABLEPRIVILEGESW(con) (con->functions[74].funcW!=NULL) #define SQLTABLEPRIVILEGESW(con,stmt,cn,nl1,sn,nl2,tn,nl3)\ (con->functions[74].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3) #define DM_SQLTABLES 75 #define CHECK_SQLTABLES(con) (con->functions[75].func!=NULL) #define SQLTABLES(con,stmt,cn,nl1,sn,nl2,tn,nl3,tt,nl4)\ (con->functions[75].func)\ (stmt,cn,nl1,sn,nl2,tn,nl3,tt,nl4) #define CHECK_SQLTABLESW(con) (con->functions[75].funcW!=NULL) #define SQLTABLESW(con,stmt,cn,nl1,sn,nl2,tn,nl3,tt,nl4)\ (con->functions[75].funcW)\ (stmt,cn,nl1,sn,nl2,tn,nl3,tt,nl4) #define DM_SQLTRANSACT 76 #define CHECK_SQLTRANSACT(con) (con->functions[76].func!=NULL) #define SQLTRANSACT(con,eh,ch,op)\ (con->functions[76].func)(eh,ch,op) #define DM_SQLGETDIAGREC 77 #define CHECK_SQLGETDIAGREC(con) (con->functions[77].func!=NULL) #define SQLGETDIAGREC(con,typ,han,rn,st,nat,msg,bl,tlp)\ (con->functions[77].func)\ (typ,han,rn,st,nat,msg,bl,tlp) #define CHECK_SQLGETDIAGRECW(con) (con->functions[77].funcW!=NULL) #define SQLGETDIAGRECW(con,typ,han,rn,st,nat,msg,bl,tlp)\ (con->functions[77].funcW)\ (typ,han,rn,st,nat,msg,bl,tlp) #define DM_SQLCANCELHANDLE 78 #define CHECK_SQLCANCELHANDLE(con) (con->functions[78].func!=NULL) #define SQLCANCELHANDLE(con,typ,han)\ (con->functions[78].func)\ (typ,han) #endif unixODBC-2.3.9/DriverManager/SQLPutData.c0000644000175000017500000002232713303466667014721 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLPutData.c,v 1.5 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLPutData.c,v $ * Revision 1.5 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.4 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:06 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:41:00 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:08 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * Revision 1.2 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLPutData.c,v $ $Revision: 1.5 $"; SQLRETURN SQLPutData( SQLHSTMT statement_handle, SQLPOINTER data, SQLLEN strlen_or_ind ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tData = %p\ \n\t\t\tStrLen = %d", statement, data, (int)strlen_or_ind ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 || statement -> state == STATE_S4 || statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 || statement -> state == STATE_S8 || statement -> state == STATE_S13 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * not the first put for this paramenter and we * try and set a NULL */ if ( statement -> state == STATE_S10 && strlen_or_ind == SQL_NULL_DATA ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY011" ); __post_internal_error( &statement -> error, ERROR_HY011, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLPUTDATA ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( data == NULL && strlen_or_ind != 0 && strlen_or_ind != SQL_DEFAULT_PARAM && strlen_or_ind != SQL_NULL_DATA ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( !CHECK_SQLPUTDATA( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLPUTDATA( statement -> connection, statement -> driver_stmt, data, strlen_or_ind ); if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLPUTDATA; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else if ( SQL_SUCCEEDED( ret )) { if ( statement -> state == STATE_S13 ) { statement -> state = STATE_S14; } else { statement -> state = STATE_S10; } } else { if ( statement -> interupted_func == SQL_API_SQLEXECDIRECT ) { statement -> state = STATE_S1; } else if ( statement -> interupted_func == SQL_API_SQLEXECUTE && statement -> hascols ) { statement -> state = STATE_S3; } else if ( statement -> interupted_func == SQL_API_SQLEXECUTE ) { statement -> state = STATE_S2; } else if ( statement -> interupted_func == SQL_API_SQLBULKOPERATIONS && statement -> interupted_state == STATE_S5 ) { statement -> state = STATE_S5; } else if ( statement -> interupted_func == SQL_API_SQLSETPOS && statement -> interupted_state == STATE_S7 ) { statement -> state = STATE_S7; } else { statement -> state = STATE_S6; statement -> eod = 0; } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLGetEnvAttr.c0000644000175000017500000001704113303466667015377 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLGetEnvAttr.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLGetEnvAttr.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.4 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/10/29 09:54:53 lurcher * * Add automake to libodbcinstQ * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:25 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:55 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:07 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/09 23:27:11 nick * All the API done now * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLGetEnvAttr.c,v $ $Revision: 1.6 $"; SQLRETURN SQLGetEnvAttr( SQLHENV environment_handle, SQLINTEGER attribute, SQLPOINTER value, SQLINTEGER buffer_length, SQLINTEGER *string_length ) { DMHENV environment = (DMHENV) environment_handle; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check environment */ if ( !__validate_env( environment )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( environment ); if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tEntry:\ \n\t\t\tEnvironment = %p\ \n\t\t\tAttribute = %s\ \n\t\t\tValue = %p\ \n\t\t\tBuffer Len = %d\ \n\t\t\tStrLen = %p", environment, __env_attr_as_string( s1, attribute ), value, (int)buffer_length, (void*)string_length ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } thread_protect( SQL_HANDLE_ENV, environment ); switch ( attribute ) { case SQL_ATTR_CONNECTION_POOLING: if ( value ) { memcpy( value, &environment -> connection_pooling, sizeof( environment -> connection_pooling )); } break; case SQL_ATTR_CP_MATCH: if ( value ) { memcpy( value, &environment -> cp_match, sizeof( environment -> cp_match )); } break; case SQL_ATTR_ODBC_VERSION: if ( !environment -> version_set ) { __post_internal_error( &environment -> error, ERROR_HY010, NULL, SQL_OV_ODBC3 ); return function_return( SQL_HANDLE_ENV, environment, SQL_ERROR, DEFER_R0 ); } if ( value ) { memcpy( value, &environment -> requested_version, sizeof( environment -> requested_version )); } break; case SQL_ATTR_OUTPUT_NTS: if ( value ) { SQLINTEGER i = SQL_TRUE; memcpy( value, &i, sizeof( i )); } break; /* * unixODBC additions */ case SQL_ATTR_UNIXODBC_VERSION: if ( value ) { if ( buffer_length >= strlen( VERSION )) { strcpy( value, VERSION ); } else { memcpy( value, VERSION, buffer_length ); ((char*)value)[ buffer_length ] = '\0'; } if ( string_length ) { *string_length = strlen( VERSION ); } } break; case SQL_ATTR_UNIXODBC_SYSPATH: if ( value ) { char b1[ 512 ]; if ( buffer_length >= strlen( odbcinst_system_file_path( b1 ))) { strcpy( value, odbcinst_system_file_path( b1 )); } else { memcpy( value, odbcinst_system_file_path( b1 ), buffer_length ); ((char*)value)[ buffer_length ] = '\0'; } if ( string_length ) { *string_length = strlen( odbcinst_system_file_path( b1 )); } } break; default: dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY092" ); __post_internal_error( &environment -> error, ERROR_HY092, NULL, environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_ENV, environment, SQL_ERROR ); } if ( log_info.log_flag ) { sprintf( environment -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, environment -> msg ); } return function_return( SQL_HANDLE_ENV, environment, SQL_SUCCESS, DEFER_R0 ); } unixODBC-2.3.9/DriverManager/SQLBindParameter.c0000644000175000017500000003225313567213517016067 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBindParameter.c,v 1.12 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLBindParameter.c,v $ * Revision 1.12 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.11 2007/03/05 09:49:23 lurcher * Get it to build on VMS again * * Revision 1.10 2006/04/18 10:24:47 lurcher * Add a couple of changes from Mark Vanderwiel * * Revision 1.9 2006/04/11 10:22:56 lurcher * Fix a data type check * * Revision 1.8 2006/03/08 11:22:13 lurcher * Add check for valid C_TYPE * * Revision 1.7 2005/09/05 09:49:48 lurcher * New QT detection macros added * * Revision 1.6 2005/04/26 08:40:35 lurcher * * Add data type mapping for SQLSetPos. * Remove out of date macro in sqlext.h * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.2 2001/12/13 13:00:31 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.7 1999/10/09 00:56:16 ngorham * * Added Manush's patch to map ODBC 3-2 datetime values * * Revision 1.6 1999/10/09 00:15:58 ngorham * * Add mapping from SQL_TYPE_X to SQL_X and SQL_C_TYPE_X to SQL_C_X * when the driver is a ODBC 2 one * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.3 1999/06/02 20:12:10 ngorham * * Fixed botched log entry, and removed the dos \r from the sql header files. * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLBindParameter.c,v $ $Revision: 1.12 $"; SQLRETURN SQLBindParameter( SQLHSTMT statement_handle, SQLUSMALLINT ipar, SQLSMALLINT f_param_type, SQLSMALLINT f_c_type, SQLSMALLINT f_sql_type, SQLULEN cb_col_def, SQLSMALLINT ib_scale, SQLPOINTER rgb_value, SQLLEN cb_value_max, SQLLEN *pcb_value ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tParam Number = %d\ \n\t\t\tParam Type = %d\ \n\t\t\tC Type = %d %s\ \n\t\t\tSQL Type = %d %s\ \n\t\t\tCol Def = %d\ \n\t\t\tScale = %d\ \n\t\t\tRgb Value = %p\ \n\t\t\tValue Max = %d\ \n\t\t\tStrLen Or Ind = %p", statement, ipar, f_param_type, f_c_type, __c_as_text( f_c_type ), f_sql_type, __sql_as_text( f_sql_type ), (int)cb_col_def, (int)ib_scale, (void*)rgb_value, (int)cb_value_max, (void*)pcb_value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( ipar < 1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error_api( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version, SQL_API_SQLBINDPARAMETER ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( ((f_c_type == SQL_C_CHAR || f_c_type == SQL_C_BINARY || f_c_type == SQL_C_WCHAR) || (f_c_type == SQL_C_DEFAULT && (f_sql_type == SQL_DEFAULT || f_sql_type == SQL_CHAR || f_sql_type == SQL_BINARY || f_sql_type == SQL_LONGVARCHAR || f_sql_type == SQL_LONGVARBINARY || f_sql_type == SQL_VARBINARY || f_sql_type == SQL_VARCHAR || f_sql_type == SQL_WCHAR || f_sql_type == SQL_WLONGVARCHAR || f_sql_type == SQL_WVARCHAR))) && cb_value_max < 0 && cb_value_max != SQL_NTS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( rgb_value == NULL && pcb_value == NULL && f_param_type != SQL_PARAM_OUTPUT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY009" ); __post_internal_error( &statement -> error, ERROR_HY009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> connection -> environment -> requested_version == SQL_OV_ODBC3_80 ) { if ( f_param_type != SQL_PARAM_INPUT && f_param_type != SQL_PARAM_INPUT_OUTPUT && f_param_type != SQL_PARAM_OUTPUT && f_param_type != SQL_PARAM_OUTPUT_STREAM && f_param_type != SQL_PARAM_INPUT_OUTPUT_STREAM ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY105" ); __post_internal_error( &statement -> error, ERROR_HY105, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } else { if ( f_param_type != SQL_PARAM_INPUT && f_param_type != SQL_PARAM_INPUT_OUTPUT && f_param_type != SQL_PARAM_OUTPUT ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY105" ); __post_internal_error( &statement -> error, ERROR_HY105, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * Alter the types, this is a special to cope with a AllBase bug... */ if ( f_c_type == SQL_C_SLONG && 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Map from SQL_C_SLONG,SQL_C_CHAR to SQL_C_LONG,SQL_INTEGER" ); f_c_type = SQL_C_LONG; f_sql_type = SQL_INTEGER; } /* * check states */ if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check valid C_TYPE */ if ( !check_target_type( f_c_type, statement -> connection -> environment -> requested_version )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY003" ); __post_internal_error( &statement -> error, ERROR_HY003, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( CHECK_SQLBINDPARAMETER( statement -> connection )) { ret = SQLBINDPARAMETER( statement -> connection, statement -> driver_stmt, ipar, f_param_type, __map_type(MAP_C_DM2D,statement->connection,f_c_type), __map_type(MAP_SQL_DM2D,statement->connection,f_sql_type), cb_col_def, ib_scale, rgb_value, cb_value_max, pcb_value ); } else if ( CHECK_SQLBINDPARAM( statement -> connection )) { ret = SQLBINDPARAM( statement -> connection, statement -> driver_stmt, ipar, __map_type(MAP_C_DM2D,statement->connection,f_c_type), __map_type(MAP_SQL_DM2D,statement->connection,f_sql_type), cb_col_def, ib_scale, rgb_value, pcb_value ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( log_info.log_flag ) { SQLCHAR buf[ 128 ]; sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, buf )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLCancel.c0000644000175000017500000002326113676600620014532 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLCancel.c,v 1.4 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLCancel.c,v $ * Revision 1.4 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.3 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.2 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/04 22:41:12 nick * and another night ends * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLCancel.c,v $ $Revision: 1.4 $"; SQLRETURN SQLCancel( SQLHSTMT statement_handle ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p", statement ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } #if defined( HAVE_LIBPTH ) || defined( HAVE_LIBPTHREAD ) || defined( HAVE_LIBTHREAD ) /* * Allow this past the thread checks if the driver is at all thread safe, as SQLCancel can * be called across threads */ if ( statement -> connection -> protection_level == 3 ) { thread_protect( SQL_HANDLE_STMT, statement ); } #endif /* * check states */ if ( !CHECK_SQLCANCEL( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); #if defined( HAVE_LIBPTH ) || defined( HAVE_LIBPTHREAD ) || defined( HAVE_LIBTHREAD ) if ( statement -> connection -> protection_level == 3 ) { return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else { return function_return_nodrv( IGNORE_THREAD, statement, SQL_ERROR ); } #else return function_return_nodrv( IGNORE_THREAD, statement, SQL_ERROR ); #endif } ret = SQLCANCEL( statement -> connection, statement -> driver_stmt ); if ( SQL_SUCCEEDED( ret )) { if (ret == SQL_SUCCESS_WITH_INFO ) { SQLULEN nRecs = 0; SQLSMALLINT len; SQLRETURN ret2 = statement->connection->unicode_driver && CHECK_SQLGETDIAGFIELDW( statement->connection ) ? SQLGETDIAGFIELDW ( statement -> connection, SQL_HANDLE_STMT, statement->driver_stmt, 0, SQL_DIAG_NUMBER, &nRecs, 0, &len ) : SQLGETDIAGFIELD( statement -> connection, SQL_HANDLE_STMT, statement->driver_stmt, 0, SQL_DIAG_NUMBER, &nRecs, 0, &len); if ( SQL_SUCCEEDED( ret2 ) && nRecs ) { SQLSMALLINT recNo = 1; while (nRecs--) { SQLCHAR state[12]; /* use the same buffer for both, length must be long enough to hold 5 SQLWCHARs + NULL */ ret2 = statement->connection->unicode_driver && CHECK_SQLGETDIAGRECW( statement->connection ) ? SQLGETDIAGRECW( statement->connection, SQL_HANDLE_STMT, statement->driver_stmt, recNo, (SQLWCHAR*)state, NULL, NULL, 0, NULL ) : SQLGETDIAGREC( statement->connection, SQL_HANDLE_STMT, statement->driver_stmt, recNo, state, NULL, NULL, 0, NULL ) ; if ( SQL_SUCCEEDED( ret2 ) && (statement->connection->unicode_driver ? !memcmp(state, "0\0001\000S\0000\0005\0", 10) : !memcmp(state, "01S05", 5)) ) { ret = SQL_SUCCESS; break; } recNo++; } } } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { if ( statement -> interupted_func == SQL_API_SQLEXECDIRECT ) { statement -> state = STATE_S1; } else if ( statement -> interupted_func == SQL_API_SQLEXECUTE ) { if ( statement -> hascols ) { statement -> state = STATE_S3; } else { statement -> state = STATE_S2; } } else if ( statement -> interupted_func == SQL_API_SQLBULKOPERATIONS ) { statement -> state = STATE_S6; statement -> eod = 0; } else if ( statement -> interupted_func == SQL_API_SQLSETPOS ) { if ( statement -> interupted_state == STATE_S5 || statement -> interupted_state == STATE_S6 ) { statement -> state = STATE_S6; statement -> eod = 0; } else if ( statement -> interupted_state == STATE_S7 ) { statement -> state = STATE_S7; } } } else if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { statement -> state = STATE_S12; } else { /* Same action as SQLFreeStmt( SQL_CLOSE ) */ if ( statement -> state == STATE_S4 ) { if ( statement -> prepared ) statement -> state = STATE_S2; else statement -> state = STATE_S1; } else { if ( statement -> prepared ) statement -> state = STATE_S3; else statement -> state = STATE_S1; } statement -> hascols = 0; } } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } #if defined( HAVE_LIBPTH ) || defined( HAVE_LIBPTHREAD ) || defined( HAVE_LIBTHREAD ) if ( statement -> connection -> protection_level == 3 ) { return function_return( SQL_HANDLE_STMT, statement, SQL_ERROR, DEFER_R2 ); } else { return function_return( IGNORE_THREAD, statement, ret, DEFER_R2 ); } #else return function_return( IGNORE_THREAD, statement, ret, DEFER_R2 ); #endif } unixODBC-2.3.9/DriverManager/SQLExtendedFetch.c0000644000175000017500000002372513303466667016074 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLExtendedFetch.c,v 1.6 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLExtendedFetch.c,v $ * Revision 1.6 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.5 2007/11/29 12:00:30 lurcher * Add 64 bit type changes to SQLExtendedFetch etc * * Revision 1.4 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.4 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.3 2001/01/14 09:13:21 nick * * Remove stray printf * * Revision 1.2 2000/12/05 16:49:21 nick * * Add missing identifier_type in SQLSpecialColumns log * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.7 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.6 1999/10/24 23:54:18 ngorham * * First part of the changes to the error reporting * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:06 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.2 1999/05/03 19:50:43 nick * Another check point * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLExtendedFetch.c,v $ $Revision: 1.6 $"; SQLRETURN SQLExtendedFetch( SQLHSTMT statement_handle, SQLUSMALLINT f_fetch_type, SQLLEN irow, SQLULEN *pcrow, SQLUSMALLINT *rgf_row_status ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tFetch Type = %d\ \n\t\t\tRow = %d\ \n\t\t\tPcRow = %p\ \n\t\t\tRow Status = %p", statement, f_fetch_type, (int)irow, pcrow, (void*)rgf_row_status ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( f_fetch_type != SQL_FETCH_NEXT && f_fetch_type != SQL_FETCH_PRIOR && f_fetch_type != SQL_FETCH_FIRST && f_fetch_type != SQL_FETCH_LAST && f_fetch_type != SQL_FETCH_ABSOLUTE && f_fetch_type != SQL_FETCH_RELATIVE && f_fetch_type != SQL_FETCH_BOOKMARK ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY106" ); __post_internal_error( &statement -> error, ERROR_HY106, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S1 || statement -> state == STATE_S2 || statement -> state == STATE_S3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S4 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S6 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLEXTENDEDFETCH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( !CHECK_SQLEXTENDEDFETCH( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLEXTENDEDFETCH( statement -> connection, statement -> driver_stmt, f_fetch_type, irow, pcrow, rgf_row_status ); if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLEXTENDEDFETCH; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) { statement -> interupted_state = statement -> state; statement -> state = STATE_S11; } } else if ( SQL_SUCCEEDED( ret )) { statement -> eod = 0; statement -> state = STATE_S7; } else if ( ret == SQL_NO_DATA ) { statement -> eod = 1; statement -> state = STATE_S7; } else if (statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { statement -> state = statement -> interupted_state; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/__attribute.c0000644000175000017500000011737213303466667015305 00000000000000/********************************************************************* * * Written by Nick Gorham * (nick@lurcher.org). * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: __attribute.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: __attribute.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.7 2007/07/13 09:01:08 lurcher * Add isql option to quote field data * * Revision 1.6 2006/04/18 10:24:47 lurcher * Add a couple of changes from Mark Vanderwiel * * Revision 1.5 2004/10/27 08:57:57 lurcher * Remove -module from cur Makefile.am, it seems to stop the lib building on HPUX... * * Revision 1.4 2004/06/21 10:01:12 lurcher * * Fix a couple of 64 bit issues * * Revision 1.3 2003/01/23 15:33:25 lurcher * * Fix problems with using putenv() * * Revision 1.2 2002/02/21 18:44:09 lurcher * * Fix bug on 32 bit platforms without long long support * Add option to set environment variables from the ini file * * Revision 1.1.1.1 2001/10/17 16:40:09 lurcher * * First upload to SourceForge * * Revision 1.1 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * **********************************************************************/ #include #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: __attribute.c,v $"; /* * these are taken directly from odbctest/attr.cpp * so any bugs or additions, should be added there also */ typedef struct attr_value { char *text; int value; char *version; int data_type; } attr_value; typedef struct attr_options { char *text; int attr; attr_value values[ 6 ]; char *version; int data_type; int is_bitmap; int is_pointer; } attr_options; static attr_options stmt_options[] = { { "SQL_ATTR_APP_PARAM_DESC", SQL_ATTR_APP_PARAM_DESC, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_APP_ROW_DESC", SQL_ATTR_APP_ROW_DESC, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_ASYNC_ENABLE", SQL_ATTR_ASYNC_ENABLE, { { "SQL_ASYNC_ENABLE_OFF", SQL_ASYNC_ENABLE_OFF }, { "SQL_ASYNC_ENABLE_ON", SQL_ASYNC_ENABLE_ON }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_CONCURRENCY", SQL_ATTR_CONCURRENCY, { { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY }, { "SQL_CONCUR_LOCK", SQL_CONCUR_LOCK }, { "SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER }, { "SQL_CONCUR_VALUES", SQL_CONCUR_VALUES }, { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_CURSOR_SCROLLABLE", SQL_ATTR_CURSOR_SCROLLABLE, { { "SQL_NONSCROLLABLE", SQL_NONSCROLLABLE }, { "SQL_SCROLLABLE", SQL_SCROLLABLE }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_CURSOR_SENSITIVITY", SQL_ATTR_CURSOR_SENSITIVITY, { { "SQL_UNSPECIFIED", SQL_UNSPECIFIED }, { "SQL_INSENSITIVE", SQL_INSENSITIVE }, { "SQL_SENSITIVE", SQL_SENSITIVE }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_CURSOR_TYPE", SQL_ATTR_CURSOR_TYPE, { { "SQL_CURSOR_FORWARD_ONLY", SQL_CURSOR_FORWARD_ONLY }, { "SQL_CURSOR_STATIC", SQL_CURSOR_STATIC }, { "SQL_CURSOR_KEYSET_DRIVEN", SQL_CURSOR_KEYSET_DRIVEN }, { "SQL_CURSOR_DYNAMIC", SQL_CURSOR_DYNAMIC }, { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_ENABLE_AUTO_IPD", SQL_ATTR_ENABLE_AUTO_IPD, { { "SQL_FALSE", SQL_FALSE }, { "SQL_TRUE", SQL_TRUE }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_FETCH_BOOKMARK_PTR", SQL_ATTR_FETCH_BOOKMARK_PTR, { { NULL } }, "3.0", SQL_INTEGER, FALSE, TRUE }, { "SQL_ATTR_FETCH_IMP_PARAM_DESC", SQL_ATTR_IMP_PARAM_DESC, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_FETCH_IMP_ROW_DESC", SQL_ATTR_IMP_ROW_DESC, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_KEYSET_SIZE", SQL_ATTR_KEYSET_SIZE, { { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_MAX_LENGTH", SQL_ATTR_MAX_LENGTH, { { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_MAX_ROWS", SQL_ATTR_MAX_ROWS, { { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_METADATA_ID", SQL_ATTR_METADATA_ID, { { "SQL_FALSE", SQL_FALSE }, { "SQL_TRUE", SQL_TRUE }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_NOSCAN", SQL_ATTR_NOSCAN, { { "SQL_NOSCAN_OFF", SQL_NOSCAN_OFF }, { "SQL_NOSCAN_ON", SQL_NOSCAN_ON }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_PARAM_BIND_OFFSET_PTR", SQL_ATTR_PARAM_BIND_OFFSET_PTR, { { NULL } }, "3.0", SQL_INTEGER, FALSE, TRUE }, { "SQL_ATTR_PARAM_BIND_TYPE", SQL_ATTR_PARAM_BIND_TYPE, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_PARAM_OPERATION_PTR", SQL_ATTR_PARAM_OPERATION_PTR, { { NULL } }, "3.0", SQL_SMALLINT, FALSE, TRUE }, { "SQL_ATTR_PARAM_STATUS_PTR", SQL_ATTR_PARAM_STATUS_PTR, { { NULL } }, "3.0", SQL_SMALLINT, FALSE, TRUE }, { "SQL_ATTR_PARAMS_PROCESSED_PTR", SQL_ATTR_PARAMS_PROCESSED_PTR, { { NULL } }, "3.0", SQL_SMALLINT, FALSE, TRUE }, { "SQL_ATTR_PARAMSET_SIZE", SQL_ATTR_PARAMSET_SIZE, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_QUERY_TIMEOUT", SQL_ATTR_QUERY_TIMEOUT, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_RETRIEVE_DATA", SQL_ATTR_RETRIEVE_DATA, { { "SQL_RD_ON", SQL_RD_ON }, { "SQL_RD_OFF", SQL_RD_OFF }, { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_ROW_ARRAY_SIZE", SQL_ATTR_ROW_ARRAY_SIZE, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_ROW_BIND_OFFSET_PTR", SQL_ATTR_ROW_BIND_OFFSET_PTR, { { NULL } }, "3.0", SQL_INTEGER, FALSE, TRUE }, { "SQL_ATTR_ROW_BIND_TYPE", SQL_ATTR_ROW_BIND_TYPE, { { "SQL_BIND_BY_COLUMN", SQL_BIND_BY_COLUMN }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_ROW_NUMBER", SQL_ATTR_ROW_NUMBER, { { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_ROW_OPERATION_PTR", SQL_ATTR_ROW_OPERATION_PTR, { { NULL } }, "3.0", SQL_SMALLINT, FALSE, TRUE }, { "SQL_ATTR_ROW_STATUS_PTR", SQL_ATTR_ROW_STATUS_PTR, { { NULL } }, "3.0", SQL_SMALLINT, FALSE, TRUE }, { "SQL_ATTR_ROWS_FETCHED_PTR", SQL_ATTR_ROWS_FETCHED_PTR, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_SIMULATE_CURSOR", SQL_ATTR_SIMULATE_CURSOR, { { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_USE_BOOKMARKS", SQL_ATTR_USE_BOOKMARKS, { { NULL } }, "2.0", SQL_INTEGER }, { NULL } }; static attr_options stmt_opt_options[] = { { "SQL_ASYNC_ENABLE", SQL_ASYNC_ENABLE, { { "SQL_ASYNC_ENABLE_OFF", SQL_ASYNC_ENABLE_OFF }, { "SQL_ASYNC_ENABLE_ON", SQL_ASYNC_ENABLE_ON }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_BIND_TYPE", SQL_BIND_TYPE, { { "SQL_BIND_BY_COLUMN", SQL_BIND_BY_COLUMN }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_CONCURRENCY", SQL_CONCURRENCY, { { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY }, { "SQL_CONCUR_LOCK", SQL_CONCUR_LOCK }, { "SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER }, { "SQL_CONCUR_VALUES", SQL_CONCUR_VALUES }, { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY }, { NULL } }, "2.0", SQL_INTEGER }, { "SQL_CURSOR_TYPE", SQL_CURSOR_TYPE, { { "SQL_CURSOR_FORWARD_ONLY", SQL_CURSOR_FORWARD_ONLY }, { "SQL_CURSOR_STATIC", SQL_CURSOR_STATIC }, { "SQL_CURSOR_KEYSET_DRIVEN", SQL_CURSOR_KEYSET_DRIVEN }, { "SQL_CURSOR_DYNAMIC", SQL_CURSOR_DYNAMIC }, { NULL } }, "2.0", SQL_INTEGER }, { "SQL_KEYSET_SIZE", SQL_KEYSET_SIZE, { { NULL } }, "2.0", SQL_INTEGER }, { "SQL_MAX_LENGTH", SQL_MAX_LENGTH, { { NULL } }, "1.0", SQL_INTEGER }, { "SQL_MAX_ROWS", SQL_MAX_ROWS, { { NULL } }, "1.0", SQL_INTEGER }, { "SQL_NOSCAN", SQL_NOSCAN, { { "SQL_NOSCAN_OFF", SQL_NOSCAN_OFF }, { "SQL_NOSCAN_ON", SQL_NOSCAN_ON }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_QUERY_TIMEOUT", SQL_QUERY_TIMEOUT, { { NULL } }, "1.0", SQL_INTEGER }, { "SQL_RETRIEVE_DATA", SQL_RETRIEVE_DATA, { { "SQL_RD_ON", SQL_RD_ON }, { "SQL_RD_OFF", SQL_RD_OFF }, { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ROWSET_SIZE", SQL_ROWSET_SIZE, { { NULL } }, "2.0", SQL_INTEGER }, { "SQL_SIMULATE_CURSOR", SQL_SIMULATE_CURSOR, { { "SQL_SC_NON_UNIQUE", SQL_SC_NON_UNIQUE }, { "SQL_SC_TRY_UNIQUE", SQL_SC_TRY_UNIQUE }, { "SQL_SC_UNIQUE", SQL_SC_UNIQUE }, { NULL } }, "2.0", SQL_INTEGER }, { "SQL_USE_BOOKMARKS", SQL_USE_BOOKMARKS, { { "SQL_UB_ON", SQL_UB_ON }, { "SQL_UB_OFF", SQL_UB_OFF }, { NULL } }, "2.0", SQL_INTEGER }, { NULL } }; static attr_options conn_options[] = { { "SQL_ATTR_ACCESS_MODE", SQL_ATTR_ACCESS_MODE, { { "SQL_MODE_READ_WRITE", SQL_MODE_READ_WRITE }, { "SQL_MODE_READ_ONLY", SQL_MODE_READ_ONLY }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_ASYNC_ENABLE", SQL_ATTR_ASYNC_ENABLE, { { "SQL_ASYNC_ENABLE_OFF", SQL_ASYNC_ENABLE_OFF }, { "SQL_ASYNC_ENABLE_ON", SQL_ASYNC_ENABLE_ON }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_AUTO_IPD", SQL_ATTR_AUTO_IPD, { { "SQL_TRUE", SQL_TRUE }, { "SQL_FALSE", SQL_FALSE }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_AUTOCOMMIT", SQL_ATTR_AUTOCOMMIT, { { "SQL_AUTOCOMMIT_ON", SQL_AUTOCOMMIT_ON }, { "SQL_AUTOCOMMIT_OFF", SQL_AUTOCOMMIT_OFF }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_CONNECTION_TIMEOUT", SQL_ATTR_CONNECTION_TIMEOUT, { { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_CURRENT_CATALOG", SQL_ATTR_CURRENT_CATALOG, { { NULL } }, "2.0", SQL_CHAR }, { "SQL_ATTR_LOGIN_TIMEOUT", SQL_ATTR_LOGIN_TIMEOUT, { { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_METADATA_ID", SQL_ATTR_METADATA_ID, { { "SQL_TRUE", SQL_TRUE }, { "SQL_FALSE", SQL_FALSE }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_ODBC_CURSORS", SQL_ATTR_ODBC_CURSORS, { { "SQL_CUR_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED }, { "SQL_CUR_USE_ODBC", SQL_CUR_USE_ODBC }, { "SQL_CUR_USE_DRIVER", SQL_CUR_USE_DRIVER }, { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_PACKET_SIZE", SQL_ATTR_PACKET_SIZE, { { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_QUIET_MODE", SQL_ATTR_QUIET_MODE, { { NULL } }, "2.0", SQL_INTEGER }, { "SQL_ATTR_TRACE", SQL_ATTR_TRACE, { { "SQL_OPT_TRACE_OFF", SQL_OPT_TRACE_OFF }, { "SQL_OPT_TRACE_ON", SQL_OPT_TRACE_ON }, { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_TRACEFILE", SQL_ATTR_TRACEFILE, { { NULL } }, "1.0", SQL_CHAR }, { "SQL_ATTR_TRANSLATE_LIB", SQL_ATTR_TRANSLATE_LIB, { { NULL } }, "1.0", SQL_CHAR }, { "SQL_ATTR_TRANSLATE_OPTION", SQL_ATTR_TRANSLATE_OPTION, { { NULL } }, "1.0", SQL_INTEGER }, { "SQL_ATTR_TXN_ISOLATION", SQL_ATTR_TXN_ISOLATION, { { "SQL_TXN_READ_UNCOMMITTED", SQL_TXN_READ_UNCOMMITTED }, { "SQL_TXN_READ_COMMITTED", SQL_TXN_READ_COMMITTED }, { "SQL_TXN_REPEATABLE_READ", SQL_TXN_REPEATABLE_READ }, { "SQL_TXN_SERIALIZABLE", SQL_TXN_SERIALIZABLE }, { NULL } }, "1.0", SQL_INTEGER }, { NULL } }; static attr_options conn_opt_options[] = { { "conn: SQL_ACCESS_MODE", SQL_ACCESS_MODE, { { "SQL_MODE_READ_ONLY", SQL_MODE_READ_ONLY }, { "SQL_MODE_READ_WRITE", SQL_MODE_READ_WRITE }, { NULL } }, "1.0", SQL_INTEGER }, { "conn: SQL_AUTOCOMMIT", SQL_AUTOCOMMIT, { { "SQL_AUTOCOMMIT_ON", SQL_AUTOCOMMIT_ON }, { "SQL_AUTOCOMMIT_OFF", SQL_AUTOCOMMIT_OFF }, { NULL } }, "1.0", SQL_INTEGER }, { "conn: SQL_CURRENT_QUALIFIER", SQL_CURRENT_QUALIFIER, { { NULL } }, "2.0", SQL_CHAR }, { "conn: SQL_LOGIN_TIMEOUT", SQL_LOGIN_TIMEOUT, { { NULL } }, "1.0", SQL_INTEGER }, { "conn: SQL_ODBC_CURSORS", SQL_ODBC_CURSORS, { { "SQL_CUR_USE_IF_NEEDED", SQL_CUR_USE_IF_NEEDED }, { "SQL_CUR_USE_ODBC", SQL_CUR_USE_ODBC }, { "SQL_CUR_USE_DRIVER", SQL_CUR_USE_DRIVER }, { NULL } }, "2.0", SQL_INTEGER }, { "conn: SQL_OPT_TRACE", SQL_OPT_TRACE, { { "SQL_OPT_TRACE_ON", SQL_OPT_TRACE_ON }, { "SQL_OPT_TRACE_OFF", SQL_OPT_TRACE_OFF }, { NULL } }, "1.0", SQL_INTEGER }, { "conn: SQL_OPT_TRACEFILE", SQL_OPT_TRACEFILE, { { NULL } }, "1.0", SQL_CHAR }, { "conn: SQL_PACKET_SIZE", SQL_PACKET_SIZE, { { NULL } }, "2.0", SQL_INTEGER }, { "conn: SQL_QUIET_MODE", SQL_QUIET_MODE, { { NULL } }, "2.0", SQL_INTEGER }, { "conn: SQL_TRANSLATE_DLL", SQL_TRANSLATE_DLL, { { NULL } }, "1.0", SQL_CHAR }, { "conn: SQL_TRANSLATE_OPTION", SQL_TRANSLATE_OPTION, { { NULL } }, "1.0", SQL_INTEGER }, { "conn: SQL_TXN_ISOLATION", SQL_TXN_ISOLATION, { { "SQL_TXN_READ_UNCOMMITED", SQL_TXN_READ_UNCOMMITTED }, { "SQL_TXN_READ_COMMITED", SQL_TXN_READ_COMMITTED }, { "SQL_TXN_REPEATABLE_READ", SQL_TXN_REPEATABLE_READ }, { "SQL_TXN_SERIALIZABLE", SQL_TXN_SERIALIZABLE }, { "SQL_TXN_VERSIONING", 0x00000010L }, { NULL } }, "1.0", SQL_INTEGER }, { "stmt: SQL_ASYNC_ENABLE", SQL_ASYNC_ENABLE, { { "SQL_ASYNC_ENABLE_OFF", SQL_ASYNC_ENABLE_OFF }, { "SQL_ASYNC_ENABLE_ON", SQL_ASYNC_ENABLE_ON }, { NULL } }, "1.0", SQL_INTEGER }, { "stmt: SQL_BIND_TYPE", SQL_BIND_TYPE, { { "SQL_BIND_BY_COLUMN", SQL_BIND_BY_COLUMN }, { NULL } }, "1.0", SQL_INTEGER }, { "stmt: SQL_CONCURRENCY", SQL_CONCURRENCY, { { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY }, { "SQL_CONCUR_LOCK", SQL_CONCUR_LOCK }, { "SQL_CONCUR_ROWVER", SQL_CONCUR_ROWVER }, { "SQL_CONCUR_VALUES", SQL_CONCUR_VALUES }, { "SQL_CONCUR_READ_ONLY", SQL_CONCUR_READ_ONLY }, { NULL } }, "2.0", SQL_INTEGER }, { "stmt: SQL_CURSOR_TYPE", SQL_CURSOR_TYPE, { { "SQL_CURSOR_FORWARD_ONLY", SQL_CURSOR_FORWARD_ONLY }, { "SQL_CURSOR_STATIC", SQL_CURSOR_STATIC }, { "SQL_CURSOR_KEYSET_DRIVEN", SQL_CURSOR_KEYSET_DRIVEN }, { "SQL_CURSOR_DYNAMIC", SQL_CURSOR_DYNAMIC }, { NULL } }, "2.0", SQL_INTEGER }, { "stmt: SQL_KEYSET_SIZE", SQL_KEYSET_SIZE, { { NULL } }, "2.0", SQL_INTEGER }, { "stmt: SQL_MAX_LENGTH", SQL_MAX_LENGTH, { { NULL } }, "1.0", SQL_INTEGER }, { "stmt: SQL_MAX_ROWS", SQL_MAX_ROWS, { { NULL } }, "1.0", SQL_INTEGER }, { "stmt: SQL_NOSCAN", SQL_NOSCAN, { { "SQL_NOSCAN_OFF", SQL_NOSCAN_OFF }, { "SQL_NOSCAN_ON", SQL_NOSCAN_ON }, { NULL } }, "1.0", SQL_INTEGER }, { "stmt: SQL_QUERY_TIMEOUT", SQL_QUERY_TIMEOUT, { { NULL } }, "1.0", SQL_INTEGER }, { "stmt: SQL_RETRIEVE_DATA", SQL_RETRIEVE_DATA, { { "SQL_RD_ON", SQL_RD_ON }, { "SQL_RD_OFF", SQL_RD_OFF }, { NULL } }, "2.0", SQL_INTEGER }, { "stmt: SQL_ROWSET_SIZE", SQL_ROWSET_SIZE, { { NULL } }, "2.0", SQL_INTEGER }, { "stmt: SQL_SIMULATE_CURSOR", SQL_SIMULATE_CURSOR, { { "SQL_SC_NON_UNIQUE", SQL_SC_NON_UNIQUE }, { "SQL_SC_TRY_UNIQUE", SQL_SC_TRY_UNIQUE }, { "SQL_SC_UNIQUE", SQL_SC_UNIQUE }, { NULL } }, "2.0", SQL_INTEGER }, { "stmt: SQL_USE_BOOKMARKS", SQL_USE_BOOKMARKS, { { "SQL_UB_ON", SQL_UB_ON }, { "SQL_UB_OFF", SQL_UB_OFF }, { NULL } }, "2.0", SQL_INTEGER }, { NULL } }; static attr_options env_options[] = { { "SQL_ATTR_ODBC_VERSION", SQL_ATTR_ODBC_VERSION, { { "SQL_OV_ODBC2", SQL_OV_ODBC2 }, { "SQL_OV_ODBC3", SQL_OV_ODBC3 }, { "SQL_OV_ODBC3_80", SQL_OV_ODBC3_80 }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_CP_MATCH", SQL_ATTR_CP_MATCH, { { "SQL_CP_STRICT_MATCH", SQL_CP_STRICT_MATCH }, { "SQL_CP_RELAXED_MATCH", SQL_CP_RELAXED_MATCH }, { "SQL_CP_MATCH_DEFAULT", SQL_CP_MATCH_DEFAULT }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_CONNECTION_POOLING", SQL_ATTR_CONNECTION_POOLING, { { "SQL_CP_OFF", SQL_OV_ODBC2 }, { "SQL_CP_ONE_PER_DRIVER", SQL_CP_ONE_PER_DRIVER }, { "SQL_CP_ONE_PER_HENV", SQL_CP_ONE_PER_HENV }, { "SQL_CP_DEFAULT", SQL_CP_DEFAULT }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_OUTPUT_NTS", SQL_ATTR_OUTPUT_NTS, { { "SQL_TRUE", SQL_TRUE }, { "SQL_FALSE", SQL_FALSE }, { NULL } }, "3.0", SQL_INTEGER }, { "SQL_ATTR_UNIXODBC_ENVATTR", SQL_ATTR_UNIXODBC_ENVATTR, { { NULL } }, "3.0", SQL_CHAR }, { NULL } }; static int find_option( char *kw, struct attr_set *as, struct attr_options *opt ) { struct attr_value *val; int found = 0; while( opt -> text && !found ) { if ( strcasecmp( kw, opt -> text ) == 0 ) { found = 1; val = opt -> values; as -> attribute = opt -> attr; while ( val -> text ) { if ( strcasecmp( as -> value, val -> text ) == 0 ) { break; } val ++; } if ( val -> text ) { as -> is_int_type = 1; as -> int_value = val -> value; } else { if ( opt -> data_type != SQL_CHAR ) { as -> is_int_type = 1; as -> int_value = atoi( as -> value ); } } } opt ++; } /* * Handle non standard attributes by [numeric_value]={char value} or [numeric_value]=\int_value */ if ( !found ) { if ( kw[ 0 ] == '[' ) { as -> attribute = atoi( kw + 1 ); if ( as -> value[ 0 ] == '\\' ) { as -> is_int_type = 1; as -> int_value = atoi( as -> value + 1 ); } found = 1; } } return found; } struct attr_set * __get_set( char ** cp, int *skip ) { char *ptr, *kw; int len; struct attr_set *as; /* * flag to indicate a non valid option */ *skip = 0; ptr = *cp; if ( !**cp ) return NULL; while ( **cp && **cp != '=' ) { (*cp)++; } if ( !**cp ) return NULL; as = malloc( sizeof( struct attr_set )); if ( !as ) { return NULL; } memset( as, 0, sizeof( struct attr_set )); len = *cp - ptr; as -> keyword = malloc( len + 1 ); memcpy( as -> keyword, ptr, len ); as -> keyword[ len ] = '\0'; (*cp)++; ptr = *cp; if ( **cp && **cp == '{' ) { (*cp)++; ptr ++; while ( **cp && **cp != '}' ) (*cp)++; len = *cp - ptr; as -> value = malloc( len + 1 ); memcpy( as -> value, ptr , len ); as -> value[ len ] = '\0'; (*cp)++; } else { while ( **cp && **cp != ';' ) (*cp)++; len = *cp - ptr; as -> value = malloc( len + 1 ); memcpy( as -> value, ptr, len ); as -> value[ len ] = '\0'; } /* * now we translate the keyword and attribute values */ if ( as -> keyword[ 0 ] == '*' ) { kw = as -> keyword + 1; as -> override = 1; } else { kw = as -> keyword; } if ( !find_option( kw, as, env_options ) && !find_option( kw, as, conn_options ) && !find_option( kw, as, conn_opt_options ) && !find_option( kw, as, stmt_options ) && !find_option( kw, as, stmt_opt_options )) { *skip = 1; } if ( **cp ) (*cp)++; return as; } int __append_set( struct attr_struct *attr_str, struct attr_set *ap ) { struct attr_set *ptr, *end, *nap; /* check that the attribute is not already in the list */ end = NULL; if ( attr_str -> count > 0 ) { ptr = attr_str -> list; while( ptr ) { if( ap -> attribute == ptr -> attribute ) { return 0; } end = ptr; ptr = ptr -> next; } } nap = malloc( sizeof( *ptr )); *nap = *ap; nap -> keyword = malloc( strlen( ap -> keyword ) + 1 ); strcpy( nap -> keyword, ap -> keyword ); nap -> value = malloc( strlen( ap -> value ) + 1 ); strcpy( nap -> value, ap -> value ); attr_str -> count ++; if ( attr_str -> list ) { end -> next = nap; nap -> next = NULL; } else { nap -> next = NULL; attr_str -> list = nap; } return 0; } int __parse_attribute_string( struct attr_struct *attr_str, char *str, int str_len ) { struct attr_set *cp; char *local_str, *ptr; int skip; attr_str -> count = 0; attr_str -> list = NULL; if ( str_len != SQL_NTS ) { local_str = malloc( str_len + 1 ); memcpy( local_str, str, str_len ); local_str[ str_len ] = '\0'; } else { local_str = str; } ptr = local_str; while(( cp = __get_set( &ptr, &skip )) != NULL ) { if ( !skip ) { __append_set( attr_str, cp ); } free( cp -> keyword ); free( cp -> value ); free( cp ); } if ( str_len != SQL_NTS ) free( local_str ); return 0; } void __release_attr_str( struct attr_struct *attr_str ) { struct attr_set *set, *ptr; if ( !attr_str ) { return; } set = attr_str -> list; while ( set ) { ptr = set -> next; free( set -> keyword ); free( set -> value ); free( set ); set = ptr; } attr_str -> list = NULL; attr_str -> count = 0; } static void __set_local_attribute( void *handle, int type, struct attr_set *as ) { SQLRETURN ret = SQL_SUCCESS; if ( type == SQL_HANDLE_ENV ) { DMHDBC connection = (DMHDBC) handle; if ( as -> attribute == SQL_ATTR_UNIXODBC_ENVATTR ) { /* * its a memory leak, but not much I can do, see "man putenv" */ putenv( strdup( as -> value )); } else { return; } if ( log_info.log_flag ) { sprintf( connection -> msg, "\t\tENV ATTR [%s=%s] ret = %d", as -> keyword, as -> value, ret ); dm_log_write_diag( connection -> msg ); } } } static void __set_attribute( void *handle, int type, struct attr_set *as ) { SQLRETURN ret = SQL_ERROR; if ( type == SQL_HANDLE_ENV ) { DMHDBC connection = (DMHDBC) handle; if ( as -> attribute == SQL_ATTR_UNIXODBC_ENVATTR ) { return; } if ( connection -> driver_version >= SQL_OV_ODBC3 ) { if ( CHECK_SQLSETENVATTR( connection )) { if ( as -> is_int_type ) { ret = SQLSETENVATTR( connection, connection -> driver_dbc, as -> attribute, as -> int_value, 0 ); } else { ret = SQLSETENVATTR( connection, connection -> driver_dbc, as -> attribute, as -> value, strlen( as -> value )); } } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\t\tENV ATTR [%s=%s] ret = %d", as -> keyword, as -> value, ret ); dm_log_write_diag( connection -> msg ); } } else if ( type == SQL_HANDLE_DBC ) { DMHDBC connection = (DMHDBC) handle; if ( connection -> driver_version >= SQL_OV_ODBC3 ) { if ( CHECK_SQLSETCONNECTATTR( connection )) { if ( as -> is_int_type ) { ret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, as -> attribute, as -> int_value, 0 ); } else { ret = SQLSETCONNECTATTR( connection, connection -> driver_dbc, as -> attribute, as -> value, strlen( as -> value )); } } else if ( CHECK_SQLSETCONNECTOPTION( connection )) { if ( as -> is_int_type ) { ret = SQLSETCONNECTOPTION( connection, connection -> driver_dbc, as -> attribute, as -> int_value ); } else { ret = SQLSETCONNECTOPTION( connection, connection -> driver_dbc, as -> attribute, as -> value ); } } } else { if ( CHECK_SQLSETCONNECTOPTION( connection )) { if ( as -> is_int_type ) { ret = SQLSETCONNECTOPTION( connection, connection -> driver_dbc, as -> attribute, as -> int_value ); } else { ret = SQLSETCONNECTOPTION( connection, connection -> driver_dbc, as -> attribute, as -> value ); } } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\t\tCONN ATTR [%s=%s] ret = %d", as -> keyword, as -> value, ret ); dm_log_write_diag( connection -> msg ); } } else if ( type == SQL_HANDLE_STMT ) { DMHSTMT statement = (DMHSTMT) handle; DMHDBC connection = statement -> connection; if ( connection -> driver_version >= SQL_OV_ODBC3 ) { if ( CHECK_SQLSETSTMTATTR( connection )) { if ( as -> is_int_type ) { ret = SQLSETSTMTATTR( connection, statement -> driver_stmt, as -> attribute, as -> int_value, 0 ); } else { ret = SQLSETSTMTATTR( connection, statement -> driver_stmt, as -> attribute, as -> value, strlen( as -> value )); } } else if ( CHECK_SQLSETSTMTOPTION( connection )) { if ( as -> is_int_type ) { ret = SQLSETSTMTOPTION( connection, statement -> driver_stmt, as -> attribute, as -> int_value ); } else { ret = SQLSETSTMTOPTION( connection, statement -> driver_stmt, as -> attribute, as -> value ); } } } else { if ( CHECK_SQLSETSTMTOPTION( connection )) { if ( as -> is_int_type ) { ret = SQLSETSTMTOPTION( connection, statement -> driver_stmt, as -> attribute, as -> int_value ); } else { ret = SQLSETSTMTOPTION( connection, statement -> driver_stmt, as -> attribute, as -> value ); } } /* * Fall back, the attribute may be ODBC 3 only */ if ( ret == SQL_ERROR ) { if ( CHECK_SQLSETSTMTATTR( connection )) { if ( as -> is_int_type ) { ret = SQLSETSTMTATTR( connection, statement -> driver_stmt, as -> attribute, as -> int_value, 0 ); } else { ret = SQLSETSTMTATTR( connection, statement -> driver_stmt, as -> attribute, as -> value, strlen( as -> value )); } } } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\t\tSTMT ATTR [%s=%s] ret = %d", as -> keyword, as -> value, ret ); dm_log_write_diag( connection -> msg ); } } } void __set_local_attributes( void * handle, int type ) { struct attr_set *as; switch( type ) { case SQL_HANDLE_ENV: as = ((DMHDBC) handle ) -> env_attribute.list; break; default: as = NULL; break; } while( as ) { __set_local_attribute( handle, type, as ); as = as -> next; } } void __set_attributes( void * handle, int type ) { struct attr_set *as; switch( type ) { case SQL_HANDLE_ENV: as = ((DMHDBC) handle ) -> env_attribute.list; break; case SQL_HANDLE_DBC: as = ((DMHDBC) handle ) -> dbc_attribute.list; break; case SQL_HANDLE_STMT: as = ((DMHSTMT) handle ) -> connection -> stmt_attribute.list; break; default: as = NULL; break; } while( as ) { __set_attribute( handle, type, as ); as = as -> next; } } void *__attr_override( void *handle, int type, int attribute, void *value, SQLINTEGER *string_length ) { struct attr_set *as; char *msg; switch( type ) { case SQL_HANDLE_DBC: as = ((DMHDBC) handle ) -> dbc_attribute.list; msg = ((DMHDBC) handle ) -> msg; break; case SQL_HANDLE_STMT: as = ((DMHSTMT) handle ) -> connection -> stmt_attribute.list; msg = ((DMHSTMT) handle ) -> msg; break; default: as = NULL; msg = NULL; break; } while( as ) { if ( as -> override && as -> attribute == attribute ) { break; } as = as -> next; } if ( as ) { if ( log_info.log_flag ) { sprintf( msg, "\t\tATTR OVERRIDE [%s=%s]", as -> keyword + 1, as -> value ); dm_log_write_diag( msg ); } if ( as -> is_int_type ) { #ifdef HAVE_PTRDIFF_T return (void*)(ptrdiff_t) as -> int_value; #else return (void*)(long) as -> int_value; #endif } else { if ( string_length ) { *string_length = strlen( as -> value ); } return as -> value; } } else { return value; } } void *__attr_override_wide( void *handle, int type, int attribute, void *value, SQLINTEGER *string_length, SQLWCHAR *buffer ) { struct attr_set *as; char *msg; switch( type ) { case SQL_HANDLE_DBC: as = ((DMHDBC) handle ) -> dbc_attribute.list; msg = ((DMHDBC) handle ) -> msg; break; case SQL_HANDLE_STMT: as = ((DMHSTMT) handle ) -> connection -> stmt_attribute.list; msg = ((DMHSTMT) handle ) -> msg; break; default: as = NULL; msg = NULL; break; } while( as ) { if ( as -> override && as -> attribute == attribute ) { break; } as = as -> next; } if ( as ) { if ( log_info.log_flag ) { sprintf( msg, "\t\tATTR OVERRIDE [%s=%s]", as -> keyword + 1, as -> value ); dm_log_write_diag( msg ); } if ( as -> is_int_type ) { #ifdef HAVE_PTRDIFF_T return (void*)(ptrdiff_t) as -> int_value; #else return (void*)(long) as -> int_value; #endif } else { if ( string_length ) { *string_length = strlen( as -> value ) * sizeof( SQLWCHAR ); } switch( type ) { case SQL_HANDLE_DBC: ansi_to_unicode_copy( buffer, as->value, SQL_NTS, (DMHDBC) handle, NULL ); break; case SQL_HANDLE_STMT: ansi_to_unicode_copy( buffer, as->value, SQL_NTS, ((DMHSTMT) handle ) -> connection, NULL ); break; } return buffer; } } else { return value; } } /* * check for valid attributes in the setting functions */ int dm_check_connection_attrs( DMHDBC connection, SQLINTEGER attribute, SQLPOINTER value ) { #ifdef HAVE_PTRDIFF_T ptrdiff_t ival; #else SQLINTEGER ival; #endif #ifdef HAVE_PTRDIFF_T ival = (ptrdiff_t) value; #else ival = (SQLINTEGER) value; #endif switch( attribute ) { case SQL_ACCESS_MODE: if ( ival != SQL_MODE_READ_ONLY && ival != SQL_MODE_READ_WRITE ) { return SQL_ERROR; } break; case SQL_ATTR_ASYNC_ENABLE: if ( ival != SQL_ASYNC_ENABLE_OFF && ival != SQL_ASYNC_ENABLE_ON ) { return SQL_ERROR; } break; case SQL_ATTR_AUTO_IPD: if ( ival != SQL_TRUE && ival != SQL_FALSE ) { return SQL_ERROR; } break; case SQL_ATTR_AUTOCOMMIT: if ( ival != SQL_AUTOCOMMIT_ON && ival != SQL_AUTOCOMMIT_OFF ) { return SQL_ERROR; } break; case SQL_ATTR_METADATA_ID: if ( ival != SQL_TRUE && ival != SQL_FALSE ) { return SQL_ERROR; } break; case SQL_ATTR_ODBC_CURSORS: if ( ival != SQL_CUR_USE_IF_NEEDED && ival != SQL_CUR_USE_ODBC && ival != SQL_CUR_USE_DRIVER ) { return SQL_ERROR; } break; case SQL_ATTR_TRACE: if ( ival != SQL_OPT_TRACE_ON && ival != SQL_OPT_TRACE_OFF ) { return SQL_ERROR; } break; case SQL_ATTR_TXN_ISOLATION: if ( ival != SQL_TXN_READ_UNCOMMITTED && ival != SQL_TXN_READ_COMMITTED && ival != SQL_TXN_REPEATABLE_READ && ival != SQL_TXN_SERIALIZABLE ) { return SQL_ERROR; } break; /* * include statement attributes as well */ case SQL_ATTR_CONCURRENCY: if ( ival != SQL_CONCUR_READ_ONLY && ival != SQL_CONCUR_LOCK && ival != SQL_CONCUR_ROWVER && ival != SQL_CONCUR_VALUES ) { return SQL_ERROR; } break; case SQL_ATTR_CURSOR_SCROLLABLE: if ( ival != SQL_NONSCROLLABLE && ival != SQL_SCROLLABLE ) { return SQL_ERROR; } break; case SQL_ATTR_CURSOR_SENSITIVITY: if ( ival != SQL_UNSPECIFIED && ival != SQL_INSENSITIVE && ival != SQL_SENSITIVE ) { return SQL_ERROR; } break; case SQL_ATTR_CURSOR_TYPE: if ( ival != SQL_CURSOR_FORWARD_ONLY && ival != SQL_CURSOR_STATIC && ival != SQL_CURSOR_KEYSET_DRIVEN && ival != SQL_CURSOR_DYNAMIC ) { return SQL_ERROR; } break; case SQL_ATTR_ENABLE_AUTO_IPD: if ( ival != SQL_TRUE && ival != SQL_FALSE ) { return SQL_ERROR; } break; case SQL_ATTR_NOSCAN: if ( ival != SQL_NOSCAN_ON && ival != SQL_NOSCAN_OFF ) { return SQL_ERROR; } break; case SQL_ATTR_RETRIEVE_DATA: if ( ival != SQL_RD_ON && ival != SQL_RD_OFF ) { return SQL_ERROR; } break; case SQL_ATTR_SIMULATE_CURSOR: if ( ival != SQL_SC_NON_UNIQUE && ival != SQL_SC_TRY_UNIQUE && ival != SQL_SC_UNIQUE ) { return SQL_ERROR; } break; case SQL_ATTR_USE_BOOKMARKS: if ( ival != SQL_UB_OFF && ival != SQL_UB_VARIABLE && ival != SQL_UB_FIXED ) { return SQL_ERROR; } break; default: return SQL_SUCCESS; } return SQL_SUCCESS; } int dm_check_statement_attrs( DMHSTMT statement, SQLINTEGER attribute, SQLPOINTER value ) { #ifdef HAVE_PTRDIFF_T ptrdiff_t ival; #else SQLUINTEGER ival; #endif #ifdef HAVE_PTRDIFF_T ival = (ptrdiff_t) value; #else ival = (SQLUINTEGER) value; #endif switch( attribute ) { case SQL_ATTR_ASYNC_ENABLE: if ( ival != SQL_ASYNC_ENABLE_OFF && ival != SQL_ASYNC_ENABLE_ON ) { return SQL_ERROR; } break; case SQL_ATTR_CONCURRENCY: if ( ival != SQL_CONCUR_READ_ONLY && ival != SQL_CONCUR_LOCK && ival != SQL_CONCUR_ROWVER && ival != SQL_CONCUR_VALUES ) { return SQL_ERROR; } break; case SQL_ATTR_CURSOR_SCROLLABLE: if ( ival != SQL_NONSCROLLABLE && ival != SQL_SCROLLABLE ) { return SQL_ERROR; } break; case SQL_ATTR_CURSOR_SENSITIVITY: if ( ival != SQL_UNSPECIFIED && ival != SQL_INSENSITIVE && ival != SQL_SENSITIVE ) { return SQL_ERROR; } break; case SQL_ATTR_CURSOR_TYPE: if ( ival != SQL_CURSOR_FORWARD_ONLY && ival != SQL_CURSOR_STATIC && ival != SQL_CURSOR_KEYSET_DRIVEN && ival != SQL_CURSOR_DYNAMIC ) { return SQL_ERROR; } break; case SQL_ATTR_ENABLE_AUTO_IPD: if ( ival != SQL_TRUE && ival != SQL_FALSE ) { return SQL_ERROR; } break; case SQL_ATTR_NOSCAN: if ( ival != SQL_NOSCAN_ON && ival != SQL_NOSCAN_OFF ) { return SQL_ERROR; } break; case SQL_ATTR_RETRIEVE_DATA: if ( ival != SQL_RD_ON && ival != SQL_RD_OFF ) { return SQL_ERROR; } break; case SQL_ATTR_SIMULATE_CURSOR: if ( ival != SQL_SC_NON_UNIQUE && ival != SQL_SC_TRY_UNIQUE && ival != SQL_SC_UNIQUE ) { return SQL_ERROR; } break; case SQL_ATTR_USE_BOOKMARKS: if ( ival != SQL_UB_OFF && ival != SQL_UB_VARIABLE && ival != SQL_UB_FIXED ) { return SQL_ERROR; } break; case SQL_ROWSET_SIZE: return ival > 0 ? SQL_SUCCESS : SQL_ERROR; default: return SQL_SUCCESS; } return SQL_SUCCESS; } unixODBC-2.3.9/DriverManager/SQLBindCol.c0000644000175000017500000002352513724446745014674 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBindCol.c,v 1.8 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLBindCol.c,v $ * Revision 1.8 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.7 2007/03/05 09:49:23 lurcher * Get it to build on VMS again * * Revision 1.6 2006/04/11 10:22:56 lurcher * Fix a data type check * * Revision 1.5 2006/03/08 11:22:13 lurcher * Add check for valid C_TYPE * * Revision 1.4 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:31 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.9 1999/11/13 23:40:58 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.7 1999/10/09 00:56:16 ngorham * * Added Manush's patch to map ODBC 3-2 datetime values * * Revision 1.6 1999/10/09 00:15:58 ngorham * * Add mapping from SQL_TYPE_X to SQL_X and SQL_C_TYPE_X to SQL_C_X * when the driver is a ODBC 2 one * * Revision 1.5 1999/09/21 22:34:23 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:15 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.2 1999/04/29 20:47:37 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLBindCol.c,v $ $Revision: 1.8 $"; int check_target_type( int c_type, int connection_mode) { /* * driver defined types */ if ( connection_mode >= SQL_OV_ODBC3_80 && c_type >= 0x4000 && c_type <= 0x7FFF ) { return 1; } switch( c_type ) { case SQL_C_CHAR: case SQL_C_LONG: case SQL_C_SHORT: case SQL_C_FLOAT: case SQL_C_NUMERIC: case SQL_C_DEFAULT: case SQL_C_DATE: case SQL_C_TIME: case SQL_C_TIMESTAMP: case SQL_C_TYPE_DATE: case SQL_C_TYPE_TIME: case SQL_C_TYPE_TIMESTAMP: case SQL_C_INTERVAL_YEAR: case SQL_C_INTERVAL_MONTH: case SQL_C_INTERVAL_DAY: case SQL_C_INTERVAL_HOUR: case SQL_C_INTERVAL_MINUTE: case SQL_C_INTERVAL_SECOND: case SQL_C_INTERVAL_YEAR_TO_MONTH: case SQL_C_INTERVAL_DAY_TO_HOUR: case SQL_C_INTERVAL_DAY_TO_MINUTE: case SQL_C_INTERVAL_DAY_TO_SECOND: case SQL_C_INTERVAL_HOUR_TO_MINUTE: case SQL_C_INTERVAL_HOUR_TO_SECOND: case SQL_C_INTERVAL_MINUTE_TO_SECOND: case SQL_C_BINARY: case SQL_C_BIT: case SQL_C_SBIGINT: case SQL_C_UBIGINT: case SQL_C_TINYINT: case SQL_C_SLONG: case SQL_C_SSHORT: case SQL_C_STINYINT: case SQL_C_ULONG: case SQL_C_USHORT: case SQL_C_UTINYINT: case SQL_C_GUID: case SQL_C_WCHAR: case SQL_ARD_TYPE: case SQL_C_DOUBLE: /* * MS Added types */ case -150: /* SQL_SS_VARIANT */ case -151: /* SQL_SS_UDT */ case -152: /* SQL_SS_XML */ case -153: /* SQL_SS_TABLE */ case -154: /* SQL_SS_TIME2 */ case -155: /* SQL_SS_TIMESTAMPOFFSET */ return 1; default: return 0; } } SQLRETURN SQLBindCol( SQLHSTMT statement_handle, SQLUSMALLINT column_number, SQLSMALLINT target_type, SQLPOINTER target_value, SQLLEN buffer_length, SQLLEN *strlen_or_ind ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tColumn Number = %d\ \n\t\t\tTarget Type = %d %s\ \n\t\t\tTarget Value = %p\ \n\t\t\tBuffer Length = %d\ \n\t\t\tStrLen Or Ind = %p", statement, column_number, target_type, __sql_as_text( target_type ), target_value, (int)buffer_length, (void*)strlen_or_ind ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( buffer_length < 0 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * TO_DO * Check the type against a bookmark * check that the length is 4 for a odbc 2 bookmark * remember thats its bound for SQLGetData checks */ /* * check states */ if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S11 || statement -> state == STATE_S12 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S12 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check valid C_TYPE * Its possible to call with the indicator and buffer NULL to unbind without setting the type */ if (( target_value || strlen_or_ind ) && !check_target_type( target_type, statement -> connection -> environment -> requested_version )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY003" ); __post_internal_error( &statement -> error, ERROR_HY003, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( !CHECK_SQLBINDCOL( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLBINDCOL( statement -> connection , statement -> driver_stmt, column_number, __map_type(MAP_C_DM2D,statement->connection,target_type), target_value, buffer_length, strlen_or_ind ); if ( log_info.log_flag ) { SQLCHAR buf[ 128 ]; sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, buf )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/Makefile.am0000755000175000017500000000576712262756114014673 00000000000000lib_LTLIBRARIES = libodbc.la AM_CPPFLAGS = -I@top_srcdir@/include \ $(LTDLINCL) EXTRA_DIST = \ drivermanager.h \ DriverManager.exp \ __stats.h \ drivermanager_axp.opt libodbc_la_LIBADD = \ ../lst/liblstlc.la \ ../log/libloglc.la \ ../ini/libinilc.la \ ../odbcinst/libodbcinstlc.la \ $(LIBLTDL) \ $(LIBICONV) libodbc_la_LDFLAGS = \ -version-info @LIB_VERSION@ \ -no-undefined \ -export-dynamic \ -export-symbols @srcdir@/DriverManager.exp libodbc_la_DEPENDENCIES = $(LTDLDEPS) \ ../lst/liblstlc.la \ ../log/libloglc.la \ ../ini/libinilc.la \ ../odbcinst/libodbcinstlc.la libodbc_la_SOURCES = \ SQLAllocConnect.c \ SQLAllocEnv.c \ SQLAllocHandle.c \ SQLAllocHandleStd.c \ SQLAllocStmt.c \ SQLBindCol.c \ SQLBindParam.c \ SQLBindParameter.c \ SQLBrowseConnect.c \ SQLBulkOperations.c \ SQLCancel.c \ SQLCancelHandle.c \ SQLCloseCursor.c \ SQLColAttribute.c \ SQLColAttributes.c \ SQLColumnPrivileges.c \ SQLColumns.c \ SQLConnect.c \ SQLCopyDesc.c \ SQLDataSources.c \ SQLDescribeCol.c \ SQLDescribeParam.c \ SQLDisconnect.c \ SQLDriverConnect.c \ SQLDrivers.c \ SQLEndTran.c \ SQLError.c \ SQLExecDirect.c \ SQLExecute.c \ SQLExtendedFetch.c \ SQLFetch.c \ SQLFetchScroll.c \ SQLForeignKeys.c \ SQLFreeConnect.c \ SQLFreeEnv.c \ SQLFreeHandle.c \ SQLFreeStmt.c \ SQLGetConnectAttr.c \ SQLGetConnectOption.c \ SQLGetCursorName.c \ SQLGetData.c \ SQLGetDescField.c \ SQLGetDescRec.c \ SQLGetDiagField.c \ SQLGetDiagRec.c \ SQLGetEnvAttr.c \ SQLGetFunctions.c \ SQLGetInfo.c \ SQLGetStmtAttr.c \ SQLGetStmtOption.c \ SQLGetTypeInfo.c \ SQLMoreResults.c \ SQLNativeSql.c \ SQLNumParams.c \ SQLNumResultCols.c \ SQLParamData.c \ SQLParamOptions.c \ SQLPrepare.c \ SQLPrimaryKeys.c \ SQLProcedureColumns.c \ SQLProcedures.c \ SQLPutData.c \ SQLRowCount.c \ SQLSetConnectAttr.c \ SQLSetConnectOption.c \ SQLSetCursorName.c \ SQLSetDescField.c \ SQLSetDescRec.c \ SQLSetEnvAttr.c \ SQLSetParam.c \ SQLSetPos.c \ SQLSetScrollOptions.c \ SQLSetStmtAttr.c \ SQLSetStmtOption.c \ SQLSpecialColumns.c \ SQLStatistics.c \ SQLTablePrivileges.c \ SQLTables.c \ SQLTransact.c \ SQLBrowseConnectW.c \ SQLColAttributeW.c \ SQLColAttributesW.c \ SQLColumnPrivilegesW.c \ SQLColumnsW.c \ SQLConnectW.c \ SQLDataSourcesW.c \ SQLDescribeColW.c \ SQLDriverConnectW.c \ SQLDriversW.c \ SQLErrorW.c \ SQLExecDirectW.c \ SQLForeignKeysW.c \ SQLGetConnectAttrW.c \ SQLGetConnectOptionW.c \ SQLGetCursorNameW.c \ SQLGetDescFieldW.c \ SQLGetDescRecW.c \ SQLGetDiagFieldW.c \ SQLGetDiagRecW.c \ SQLGetInfoW.c \ SQLGetStmtAttrW.c \ SQLGetTypeInfoW.c \ SQLNativeSqlW.c \ SQLPrepareW.c \ SQLPrimaryKeysW.c \ SQLProcedureColumnsW.c \ SQLProceduresW.c \ SQLSetConnectAttrW.c \ SQLSetConnectOptionW.c \ SQLSetCursorNameW.c \ SQLSetDescFieldW.c \ SQLSetStmtAttrW.c \ SQLSetStmtOptionW.c \ SQLSpecialColumnsW.c \ SQLStatisticsW.c \ SQLTablePrivilegesW.c \ SQLTablesW.c \ __connection.c \ __handles.c \ __info.c \ __stats.c \ __attribute.c unixODBC-2.3.9/DriverManager/SQLColumnsW.c0000644000175000017500000002706213303466667015127 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLColumnsW.c,v 1.9 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLColumnsW.c,v $ * Revision 1.9 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.8 2008/08/29 08:01:38 lurcher * Alter the way W functions are passed to the driver * * Revision 1.7 2007/02/28 15:37:47 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.6 2004/01/12 09:54:39 lurcher * * Fix problem where STATE_S5 stops metadata calls * * Revision 1.5 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.4 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.3 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.2 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLColumnsW.c,v $"; SQLRETURN SQLColumnsW( SQLHSTMT statement_handle, SQLWCHAR *catalog_name, SQLSMALLINT name_length1, SQLWCHAR *schema_name, SQLSMALLINT name_length2, SQLWCHAR *table_name, SQLSMALLINT name_length3, SQLWCHAR *column_name, SQLSMALLINT name_length4 ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHSTMT parent_statement; parent_statement = find_parent_handle( statement, SQL_HANDLE_STMT ); if ( parent_statement ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLCOLUMNSW( parent_statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLCOLUMNSW( parent_statement -> connection, statement_handle, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tCatalog Name = %s\ \n\t\t\tSchema Name = %s\ \n\t\t\tTable Name = %s\ \n\t\t\tColumn Type = %s", statement, __wstring_with_length( s1, catalog_name, name_length1 ), __wstring_with_length( s2, schema_name, name_length2 ), __wstring_with_length( s3, table_name, name_length3 ), __wstring_with_length( s4, column_name, name_length4 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if (( catalog_name && name_length1 < 0 && name_length1 != SQL_NTS ) || ( schema_name && name_length2 < 0 && name_length2 != SQL_NTS ) || ( table_name && name_length3 < 0 && name_length3 != SQL_NTS ) || ( column_name && name_length4 < 0 && name_length4 != SQL_NTS )) { __post_internal_error( &statement -> error, ERROR_HY090, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ #ifdef NR_PROBE if ( statement -> state == STATE_S5 || statement -> state == STATE_S6 || statement -> state == STATE_S7 ) #else if (( statement -> state == STATE_S6 && statement -> eod == 0 ) || statement -> state == STATE_S7 ) #endif { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 24000" ); __post_internal_error( &statement -> error, ERROR_24000, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLCOLUMNS ) { __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } /* * TO_DO Check the SQL_ATTR_METADATA_ID settings */ if ( statement -> connection -> unicode_driver || CHECK_SQLCOLUMNSW( statement -> connection )) { if ( !CHECK_SQLCOLUMNSW( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLCOLUMNSW( statement -> connection , statement -> driver_stmt, catalog_name, name_length1, schema_name, name_length2, table_name, name_length3, column_name, name_length4 ); } else { SQLCHAR *as1, *as2, *as3, *as4; int clen; if ( !CHECK_SQLCOLUMNS( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } as1 = (SQLCHAR*) unicode_to_ansi_alloc( catalog_name, name_length1, statement -> connection, &clen ); name_length1 = clen; as2 = (SQLCHAR*) unicode_to_ansi_alloc( schema_name, name_length2, statement -> connection, &clen ); name_length2 = clen; as3 = (SQLCHAR*) unicode_to_ansi_alloc( table_name, name_length3, statement -> connection, &clen ); name_length3 = clen; as4 = (SQLCHAR*) unicode_to_ansi_alloc( column_name, name_length4, statement -> connection, &clen ); name_length4 = clen; ret = SQLCOLUMNS( statement -> connection , statement -> driver_stmt, as1, name_length1, as2, name_length2, as3, name_length3, as4, name_length4 ); if ( as1 ) free( as1 ); if ( as2 ) free( as2 ); if ( as3 ) free( as3 ); if ( as4 ) free( as4 ); } if ( SQL_SUCCEEDED( ret )) { #ifdef NR_PROBE /******** * Added this to get num cols from drivers which can only tell * us after execute - PAH */ /* * grab any errors */ if ( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, statement, ret, TRUE, DEFER_R1 ); } SQLNUMRESULTCOLS( statement -> connection, statement -> driver_stmt, &statement -> numcols ); /******/ #endif statement -> hascols = 1; statement -> state = STATE_S5; statement -> prepared = 0; } else if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLCOLUMNS; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } else { statement -> state = STATE_S1; } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R1 ); } unixODBC-2.3.9/DriverManager/SQLAllocConnect.c0000755000175000017500000000575513303466667015734 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLAllocConnect.c,v 1.2 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLAllocConnect.c,v $ * Revision 1.2 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:03 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.1.1.1 1999/05/29 13:41:04 sShandyb * first go at it * * Revision 1.4 1999/06/02 23:48:45 ngorham * * Added more 3-2 mapping * * * Revision 1.3 1999/06/02 20:01:00 ngorham * * Attempt to fix previous botched log message * * Revision 1.2 1999/06/02 19:57:20 ngorham * * Added code to check if a attempt is being made to compile with a C++ * Compiler, and issue a message. * Start work on the ODBC2-3 conversions. * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #ifdef __cplusplus #error "This code must be compiled with a C compiler," #error "not a C++ one, this is due in part to Microsoft" #error "defining SQLCHAR as unsigned, this means all the" #error "standard library code confilicts." #error "" #error "Alter the compiler line in Common.mk to ecgs or" #error "gcc and remake. This will correctly compile" #error "the C++ elements" #error "" #endif #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLAllocConnect.c,v $ $Revision: 1.2 $"; SQLRETURN SQLAllocConnect( SQLHENV environment_handle, SQLHDBC *connection_handle ) { return __SQLAllocHandle( SQL_HANDLE_DBC, environment_handle, connection_handle, SQL_OV_ODBC2 ); } unixODBC-2.3.9/DriverManager/SQLSetConnectOptionW.c0000644000175000017500000003633113364066464016742 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLSetConnectOptionW.c,v 1.10 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLSetConnectOptionW.c,v $ * Revision 1.10 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.9 2007/02/28 15:37:48 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.8 2006/04/18 10:24:47 lurcher * Add a couple of changes from Mark Vanderwiel * * Revision 1.7 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.6 2003/03/05 09:48:45 lurcher * * Add some 64 bit fixes * * Revision 1.5 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.4 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.3 2002/01/30 12:20:02 lurcher * * Add MyODBC 3 driver source * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:07 lurcher * * First upload to SourceForge * * Revision 1.4 2001/08/08 17:05:17 nick * * Add support for attribute setting in the ini files * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLSetConnectOptionW.c,v $"; SQLRETURN SQLSetConnectOptionW( SQLHDBC connection_handle, SQLUSMALLINT option, SQLULEN value ) { DMHDBC connection = (DMHDBC)connection_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ]; SQLWCHAR buffer[ 512 ]; /* * doesn't require a handle */ if ( option == SQL_ATTR_TRACE ) { if ((SQLLEN) value != SQL_OPT_TRACE_OFF && (SQLLEN) value != SQL_OPT_TRACE_ON ) { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); function_entry( connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } if ( value == SQL_OPT_TRACE_OFF ) { log_info.log_flag = 0; } else { log_info.log_flag = 1; } return SQL_SUCCESS; } else if ( option == SQL_ATTR_TRACEFILE ) { if ( value ) { if (((SQLWCHAR*)value)[ 0 ] == 0 ) { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); function_entry( connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } else { if ( log_info.log_file_name ) { free( log_info.log_file_name ); } log_info.log_file_name = unicode_to_ansi_alloc((SQLWCHAR *) value, SQL_NTS, connection, NULL ); } } else { if ( __validate_dbc( connection )) { thread_protect( SQL_HANDLE_DBC, connection ); function_entry( connection ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else { return SQL_INVALID_HANDLE; } } return SQL_SUCCESS; } /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDBC parent_connection; parent_connection = find_parent_handle( connection, SQL_HANDLE_DBC ); if ( parent_connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLSETCONNECTOPTIONW( parent_connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLSETCONNECTOPTIONW( parent_connection, connection_handle, option, value ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tOption = %s\ \n\t\t\tValue = %d", connection, __con_attr_as_string( s1, option ), (int)value ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( connection -> state == STATE_C2 ) { if ( option == SQL_TRANSLATE_OPTION || option == SQL_TRANSLATE_DLL ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08003" ); __post_internal_error( &connection -> error, ERROR_08003, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else if ( connection -> state == STATE_C3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &connection -> error, ERROR_HY010, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( connection -> state == STATE_C4 || connection -> state == STATE_C5 ) { if ( option == SQL_ODBC_CURSORS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } else if ( connection -> state == STATE_C6 ) { if ( option == SQL_ODBC_CURSORS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } else if ( option == SQL_TXN_ISOLATION ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: S1011" ); __post_internal_error( &connection -> error, ERROR_S1011, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } } /* * is it a legitimate value */ ret = dm_check_connection_attrs( connection, option, (SQLPOINTER)value ); if ( ret != SQL_SUCCESS ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY024" ); __post_internal_error( &connection -> error, ERROR_HY024, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * is it something overridden */ value = (SQLULEN) __attr_override_wide( connection, SQL_HANDLE_DBC, option, (void*) value, NULL, buffer ); if ( option == SQL_LOGIN_TIMEOUT ) { connection -> login_timeout_set = 1; connection -> login_timeout = value; ret = SQL_SUCCESS; } else if ( option == SQL_ATTR_ACCESS_MODE ) { connection -> access_mode = ( SQLLEN ) value; connection -> access_mode_set = 1; } else if ( option == SQL_AUTOCOMMIT ) { connection -> auto_commit = ( SQLINTEGER ) value; connection -> auto_commit_set = 1; } if ( option == SQL_ODBC_CURSORS ) { connection -> cursors = value; ret = SQL_SUCCESS; } else if ( connection -> state == STATE_C2 ) { if ( option == SQL_AUTOCOMMIT ) { connection -> auto_commit = ( SQLINTEGER ) value; connection -> auto_commit_set = 1; } else if ( option == SQL_ATTR_QUIET_MODE ) { connection -> quite_mode = ( SQLLEN ) value; connection -> quite_mode_set = 1; } else if ( option == SQL_ATTR_ACCESS_MODE ) { connection -> access_mode = ( SQLLEN ) value; connection -> access_mode_set = 1; } else { /* * save any unknown attributes untill connect */ struct save_attr *sa = calloc( 1, sizeof( struct save_attr )); sa -> attr_type = option; sa -> intptr_attr = value; sa -> next = connection -> save_attr; connection -> save_attr = sa; } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( SQL_SUCCESS, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_SUCCESS ); } else { /* * call the driver */ if ( CHECK_SQLSETCONNECTOPTIONW( connection )) { ret = SQLSETCONNECTOPTIONW( connection, connection -> driver_dbc, option, value ); } else if ( CHECK_SQLSETCONNECTATTRW( connection )) { SQLINTEGER string_length; switch( option ) { case SQL_ATTR_CURRENT_CATALOG: case SQL_ATTR_TRACEFILE: case SQL_ATTR_TRANSLATE_LIB: string_length = SQL_NTS; break; default: string_length = 0; break; } ret = SQLSETCONNECTATTRW( connection, connection -> driver_dbc, option, value, string_length ); } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]", __get_return_status( ret, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } } /* * catch this */ if ( option == SQL_ATTR_USE_BOOKMARKS && SQL_SUCCEEDED( ret )) { connection -> bookmarks_on = (SQLUINTEGER) value; } return function_return( SQL_HANDLE_DBC, connection, ret, DEFER_R3 ); } unixODBC-2.3.9/DriverManager/SQLBrowseConnectW.c0000644000175000017500000004724413364070362016254 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLBrowseConnectW.c,v 1.13 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLBrowseConnectW.c,v $ * Revision 1.13 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.12 2007/10/19 10:14:05 lurcher * Pull errors from SQLBrowseConnect when it returns SQL_NEED_DATA * * Revision 1.11 2007/02/28 15:37:46 lurcher * deal with drivers that call internal W functions and end up in the driver manager. controlled by the --enable-handlemap configure arg * * Revision 1.10 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.9 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.8 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.7 2002/08/15 08:10:33 lurcher * * Couple of small fixes from John L Miller * * Revision 1.6 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.5 2002/07/24 08:49:51 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.4 2002/02/08 17:59:40 lurcher * * Fix threading problem in SQLBrowseConnect * * Revision 1.3 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.7 2001/07/20 12:35:09 nick * * Fix SQLBrowseConnect operation * * Revision 1.6 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.5 2001/05/15 10:57:44 nick * * Add initial support for VMS * * Revision 1.4 2001/04/16 15:41:24 nick * * Fix some problems calling non existing error funcs * * Revision 1.3 2001/04/12 17:43:35 nick * * Change logging and added autotest to odbctest * * Revision 1.2 2001/01/02 09:55:04 nick * * More unicode bits * * Revision 1.1 2000/12/31 20:30:54 nick * * Add UNICODE support * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLBrowseConnectW.c,v $"; #define BUFFER_LEN 4095 SQLRETURN SQLBrowseConnectW( SQLHDBC hdbc, SQLWCHAR *conn_str_in, SQLSMALLINT len_conn_str_in, SQLWCHAR *conn_str_out, SQLSMALLINT conn_str_out_max, SQLSMALLINT *ptr_conn_str_out ) { DMHDBC connection = (DMHDBC) hdbc; struct con_struct con_struct; char *driver, *dsn; char lib_name[ INI_MAX_PROPERTY_VALUE + 1 ]; char driver_name[ INI_MAX_PROPERTY_VALUE + 1 ]; SQLWCHAR in_str_bufw[ BUFFER_LEN ]; SQLWCHAR *in_str; SQLSMALLINT in_str_len; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ]; int warnings = 0; /* * check connection */ if ( !__validate_dbc( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); #ifdef WITH_HANDLE_REDIRECT { DMHDBC parent_connection; parent_connection = find_parent_handle( connection, SQL_HANDLE_DBC ); if ( parent_connection ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: found parent handle" ); if ( CHECK_SQLBROWSECONNECTW( parent_connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Info: calling redirected driver function" ); return SQLBROWSECONNECTW( parent_connection, connection, conn_str_in, len_conn_str_in, conn_str_out, conn_str_out_max, ptr_conn_str_out ); } } } #endif return SQL_INVALID_HANDLE; } function_entry( connection ); if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tEntry:\ \n\t\t\tConnection = %p\ \n\t\t\tStr In = %s\ \n\t\t\tStr Out = %s\ \n\t\t\tPtr Conn Str Out = %p", connection, __wstring_with_length( s1, conn_str_in, len_conn_str_in ), __wstring_with_length( s2, conn_str_out, conn_str_out_max ), ptr_conn_str_out ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } /* * check the state of the connection */ if ( connection -> state == STATE_C4 || connection -> state == STATE_C5 || connection -> state == STATE_C6 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 08002" ); __post_internal_error( &connection -> error, ERROR_08002, NULL, connection -> environment -> requested_version ); return function_return_nodrv( IGNORE_THREAD, connection, SQL_ERROR ); } thread_protect( SQL_HANDLE_DBC, connection ); if ( len_conn_str_in < 0 && len_conn_str_in != SQL_NTS) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY090" ); __post_internal_error( &connection -> error, ERROR_HY090, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * are we at the start of a connection */ if ( connection -> state == STATE_C2 ) { char in_str_buf[ BUFFER_LEN ]; /* * parse the connection string */ __parse_connection_string_w( &con_struct, conn_str_in, len_conn_str_in ); /* * look for some keywords * have we got a DRIVER= attribute */ driver = __get_attribute_value( &con_struct, "DRIVER" ); if ( driver ) { /* * look up the driver in the ini file */ SQLGetPrivateProfileString( driver, "Driver", "", lib_name, sizeof( lib_name ), "ODBCINST.INI" ); if ( lib_name[ 0 ] == '\0' ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } strcpy( connection -> dsn, "" ); } else { dsn = __get_attribute_value( &con_struct, "DSN" ); if ( !dsn ) { dsn = "DEFAULT"; __append_pair( &con_struct, "DSN", "DEFAULT" ); } if ( strlen( dsn ) > SQL_MAX_DSN_LENGTH ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM012" ); __post_internal_error( &connection -> error, ERROR_IM012, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } /* * look up the dsn in the ini file */ if ( !__find_lib_name( dsn, lib_name, driver_name )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM002" ); __post_internal_error( &connection -> error, ERROR_IM002, NULL, connection -> environment -> requested_version ); __release_conn( &con_struct ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } strcpy( connection -> dsn, dsn ); } __generate_connection_string( &con_struct, in_str_buf, sizeof( in_str_buf )); __release_conn( &con_struct ); ansi_to_unicode_copy( in_str_bufw, in_str_buf, BUFFER_LEN, connection, 0 ); /* * we now have a driver to connect to */ if ( !__connect_part_one( connection, lib_name, driver_name, &warnings )) { __disconnect_part_four( connection ); /* release unicode handles */ dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: connect_part_one fails" ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( !CHECK_SQLBROWSECONNECTW( connection ) && !CHECK_SQLBROWSECONNECT( connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } in_str = in_str_bufw; in_str_len = wide_strlen(in_str); } else { in_str = conn_str_in; in_str_len = len_conn_str_in == SQL_NTS ? wide_strlen(in_str) : len_conn_str_in; } if ( CHECK_SQLBROWSECONNECTW( connection )) { ret = SQLBROWSECONNECTW( connection, connection -> driver_dbc, in_str, in_str_len, conn_str_out, conn_str_out_max, ptr_conn_str_out ); connection -> unicode_driver = 1; } else if (CHECK_SQLBROWSECONNECT( connection )) { SQLCHAR *an_in_str = (SQLCHAR*) unicode_to_ansi_alloc( in_str, SQL_NTS, connection, 0 ); SQLCHAR *ob = conn_str_out ? malloc( (conn_str_out_max + 1) * sizeof(SQLWCHAR) ) : 0; SQLINTEGER len; ret = SQLBROWSECONNECT( connection, connection -> driver_dbc, an_in_str, SQL_NTS, ob, conn_str_out_max, &len ); *ptr_conn_str_out = len; if(ob) { if ( ptr_conn_str_out ) { int wptr; ansi_to_unicode_copy(conn_str_out, (char*)ob, conn_str_out_max, connection, &wptr ); *ptr_conn_str_out = (SQLSMALLINT) wptr; } else { ansi_to_unicode_copy(conn_str_out, (char*)ob, conn_str_out_max, connection, NULL ); } free(ob); } free(an_in_str); connection -> unicode_driver = 0; } else { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ __post_internal_error( &connection -> error, ERROR_IM001, NULL, connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_DBC, connection, SQL_ERROR ); } if ( !SQL_SUCCEEDED( ret ) || ret == SQL_NEED_DATA ) { /* * get the error from the driver before * losing the connection */ if ( connection -> unicode_driver ) { if ( CHECK_SQLGETDIAGFIELDW( connection ) && CHECK_SQLGETDIAGRECW( connection )) { extract_diag_error_w( SQL_HANDLE_DBC, connection -> driver_dbc, connection, &connection -> error, ret, 1 ); } else if ( CHECK_SQLERRORW( connection )) { extract_sql_error_w( SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, connection, &connection -> error, ret ); } else if ( CHECK_SQLGETDIAGFIELD( connection ) && CHECK_SQLGETDIAGREC( connection )) { extract_diag_error( SQL_HANDLE_DBC, connection -> driver_dbc, connection, &connection -> error, ret, 1 ); } else if ( CHECK_SQLERROR( connection )) { extract_sql_error( SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, connection, &connection -> error, ret ); } else { __post_internal_error( &connection -> error, ERROR_HY000, "Driver returned SQL_ERROR or SQL_SUCCESS_WITH_INFO but no error reporting API found", connection -> environment -> requested_version ); } } else { if ( CHECK_SQLGETDIAGFIELD( connection ) && CHECK_SQLGETDIAGREC( connection )) { extract_diag_error( SQL_HANDLE_DBC, connection -> driver_dbc, connection, &connection -> error, ret, 1 ); } else if ( CHECK_SQLERROR( connection )) { extract_sql_error( SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, connection, &connection -> error, ret ); } else if ( CHECK_SQLGETDIAGFIELDW( connection ) && CHECK_SQLGETDIAGRECW( connection )) { extract_diag_error_w( SQL_HANDLE_DBC, connection -> driver_dbc, connection, &connection -> error, ret, 1 ); } else if ( CHECK_SQLERRORW( connection )) { extract_sql_error_w( SQL_NULL_HENV, connection -> driver_dbc, SQL_NULL_HSTMT, connection, &connection -> error, ret ); } else { __post_internal_error( &connection -> error, ERROR_HY000, "Driver returned SQL_ERROR or SQL_SUCCESS_WITH_INFO but no error reporting API found", connection -> environment -> requested_version ); } } if ( ret != SQL_NEED_DATA ) { /* If an error occurred during SQLBrowseConnect, we need to keep the connection in the same state (C2 or C3). This allows the application to either try the SQLBrowseConnect again, or disconnect an active browse session with SQLDisconnect. Otherwise the driver may continue to have an active connection while the DM thinks it does not, causing more errors later on. */ if ( connection -> state == STATE_C2 ) { /* only disconnect and unload if we never started browsing */ __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles - also sets state to C2 */ } } else { connection -> state = STATE_C3; } } else { /* * we should be connected now */ connection -> state = STATE_C4; if( ret == SQL_SUCCESS_WITH_INFO ) { function_return_ex( IGNORE_THREAD, connection, ret, TRUE, DEFER_R0 ); } if ( !__connect_part_two( connection )) { __disconnect_part_two( connection ); __disconnect_part_one( connection ); __disconnect_part_four( connection ); /* release unicode handles */ if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tconnect_part_two fails", __get_return_status( SQL_ERROR, s1 )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } return function_return( SQL_HANDLE_DBC, connection, SQL_ERROR, DEFER_R0 ); } } if ( log_info.log_flag ) { sprintf( connection -> msg, "\n\t\tExit:[%s]\ \n\t\t\tPtr Conn Str Out = %s", __get_return_status( ret, s2 ), __sptr_as_string( s1, ptr_conn_str_out )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, connection -> msg ); } if ( warnings && ret == SQL_SUCCESS ) { ret = SQL_SUCCESS_WITH_INFO; } return function_return_nodrv( SQL_HANDLE_DBC, connection, ret ); } unixODBC-2.3.9/DriverManager/__info.c0000664000175000017500000044315213616772063014232 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: __info.c,v 1.50 2009/02/18 17:59:08 lurcher Exp $ * * $Log: __info.c,v $ * Revision 1.50 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.49 2009/02/17 09:47:44 lurcher * Clear up a number of bugs * * Revision 1.48 2008/09/29 14:02:45 lurcher * Fix missing dlfcn group option * * Revision 1.47 2008/01/02 15:10:33 lurcher * Fix problems trying to use the cursor lib on a non select statement * * Revision 1.46 2007/11/26 11:37:23 lurcher * Sync up before tag * * Revision 1.45 2007/09/28 13:20:22 lurcher * Add timestamp to logging * * Revision 1.44 2007/04/02 10:50:19 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.43 2007/03/05 09:49:24 lurcher * Get it to build on VMS again * * Revision 1.42 2006/11/27 14:08:34 lurcher * Sync up dirs * * Revision 1.41 2006/03/08 11:22:13 lurcher * Add check for valid C_TYPE * * Revision 1.40 2005/12/19 18:43:26 lurcher * Add new parts to contrib and alter how the errors are returned from the driver * * Revision 1.39 2005/11/08 09:37:10 lurcher * Allow the driver and application to have different length handles * * Revision 1.38 2005/02/07 11:46:45 lurcher * Add missing ODBC2 installer stubs * * Revision 1.37 2004/07/24 17:55:37 lurcher * Sync up CVS * * Revision 1.36 2004/05/17 08:25:00 lurcher * Update the way the libltso is used, and fix a problem with gODBCConfig * not closeing correctly. * * Revision 1.35 2004/03/30 13:20:11 lurcher * * * Fix problem with SQLCopyDesc * Add additional target for iconv * * Revision 1.34 2003/12/01 16:37:17 lurcher * * Fix a bug in SQLWritePrivateProfileString * * Revision 1.33 2003/10/30 18:20:46 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.32 2003/09/08 15:34:29 lurcher * * A couple of small but perfectly formed fixes * * Revision 1.31 2003/07/21 11:12:59 lurcher * * Fix corruption in Postgre7.1 driver * Tidy up gODBCconfig * * Revision 1.30 2003/06/24 09:40:58 lurcher * * Extra UNICODE stuff * * Revision 1.29 2003/06/04 12:49:45 lurcher * * Further PID logging tweeks * * Revision 1.28 2003/06/03 13:52:13 lurcher * * Change the mode of PID logfiles to allow the process to change to another * user * * Revision 1.27 2003/06/02 16:51:36 lurcher * * Add TracePid option * * Revision 1.26 2003/02/25 13:28:31 lurcher * * Allow errors on the drivers AllocHandle to be reported * Fix a problem that caused errors to not be reported in the log * Remove a redundant line from the spec file * * Revision 1.25 2003/02/06 12:58:25 lurcher * * Fix a speeling problem :-) * * Revision 1.24 2002/12/05 17:44:31 lurcher * * Display unknown return values in return logging * * Revision 1.23 2002/11/11 17:10:20 lurcher * * VMS changes * * Revision 1.22 2002/11/06 16:08:01 lurcher * * Update missing * * Revision 1.21 2002/08/23 09:42:37 lurcher * * Fix some build warnings with casts, and a AIX linker mod, to include * deplib's on the link line, but not the libtool generated ones * * Revision 1.20 2002/08/20 12:41:07 lurcher * * Fix incorrect return state from SQLEndTran/SQLTransact * * Revision 1.19 2002/08/19 09:11:49 lurcher * * Fix Maxor ineffiecny in Postgres Drivers, and fix a return state * * Revision 1.18 2002/08/15 08:10:33 lurcher * * Couple of small fixes from John L Miller * * Revision 1.17 2002/08/12 16:20:44 lurcher * * Make it try and find a working iconv set of encodings * * Revision 1.16 2002/08/12 13:17:52 lurcher * * Replicate the way the MS DM handles loading of driver libs, and allocating * handles in the driver. usage counting in the driver means that dlopen is * only called for the first use, and dlclose for the last. AllocHandle for * the driver environment is only called for the first time per driver * per application environment. * * Revision 1.15 2002/07/25 09:30:26 lurcher * * Additional unicode and iconv changes * * Revision 1.14 2002/07/24 08:49:52 lurcher * * Alter UNICODE support to use iconv for UNICODE-ANSI conversion * * Revision 1.13 2002/07/10 15:05:57 lurcher * * Alter the return code in the Postgres driver, for a warning, it should be * 01000 it was 00000 * Fix a problem in DriverManagerII with the postgres driver as the driver * doesn't return a propper list of schemas * Allow the delimiter to be set in isql to a hex/octal char not just a * printable one * * Revision 1.12 2002/07/08 16:37:35 lurcher * * Fix bug in unicode_to_ansi_copy * * Revision 1.11 2002/07/04 17:27:56 lurcher * * Small bug fixes * * Revision 1.9 2002/05/28 13:30:34 lurcher * * Tidy up for AIX * * Revision 1.8 2002/05/21 14:19:44 lurcher * * * Update libtool to escape from AIX build problem * * Add fix to avoid file handle limitations * * Add more UNICODE changes, it looks like it is native 16 representation * the old way can be reproduced by defining UCS16BE * * Add iusql, its just the same as isql but uses the wide functions * * Revision 1.7 2002/04/10 11:04:36 lurcher * * Fix endian issue with 4 byte unicode support * * Revision 1.6 2002/02/27 11:27:14 lurcher * * Fix bug in error reporting * * Revision 1.5 2002/01/21 18:00:51 lurcher * * Assorted fixed and changes, mainly UNICODE/bug fixes * * Revision 1.4 2001/12/13 13:56:31 lurcher * * init a global for Peter * * Revision 1.3 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.2 2001/11/15 18:38:21 lurcher * * Make the errors returned from SQLError reset after each API call * if the app is expecting ODBC 3 operation * * Revision 1.1.1.1 2001/10/17 16:40:09 lurcher * * First upload to SourceForge * * Revision 1.23 2001/09/27 17:05:48 nick * * Assorted fixes and tweeks * * Revision 1.22 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.21 2001/07/02 17:09:37 nick * * Add some portability changes * * Revision 1.20 2001/06/20 17:25:32 pat * Correct msg1 length in 4 extract diag functions * * Revision 1.19 2001/06/20 08:19:25 nick * * Fix buffer overflow in error handling * * Revision 1.18 2001/04/23 13:58:43 nick * * Assorted tweeks to text driver to get it to work with StarOffice * * Revision 1.17 2001/04/20 16:57:25 nick * * Add extra mapping of data types * * Revision 1.16 2001/04/18 15:03:37 nick * * Fix problem when going to DB2 unicode driver * * Revision 1.15 2001/04/16 22:35:10 nick * * More tweeks to the AutoTest code * * Revision 1.14 2001/04/14 10:42:03 nick * * Extra work on the autotest feature of odbctest * * Revision 1.13 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.12 2001/04/03 16:34:12 nick * * Add support for strangly broken unicode drivers * * Revision 1.11 2001/01/09 23:15:18 nick * * More unicode error fixes * * Revision 1.10 2001/01/09 22:33:13 nick * * Stop passing NULL into SQLExtendedFetch * Further fixes to unicode to ansi conversions * * Revision 1.9 2001/01/09 11:03:32 nick * * Fixed overrun bug * * Revision 1.8 2001/01/06 15:00:12 nick * * Fix bug in SQLError introduced with UNICODE * * Revision 1.7 2000/12/31 20:30:54 nick * * Add UNICODE support * * Revision 1.6 2000/10/25 12:45:51 nick * * Add mapping for both ODBC 2 - 3 and ODBC 3 - 2 error states * * Revision 1.5 2000/10/25 12:32:41 nick * * The mapping was the wrong way around for errors, ODBC3 error are mapped * to ODBC 2 not the other way around * * Revision 1.4 2000/10/25 09:13:26 nick * * Remove some invalid ODBC2-ODBC3 error mappings * * Revision 1.3 2000/10/13 15:18:49 nick * * Change string length parameter from SQLINTEGER to SQLSMALLINT * * Revision 1.2 2000/09/19 13:13:13 nick * * Add display of returned error text in log file * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.28 2000/07/31 08:46:11 ngorham * * Avoid potential buffer overrun * * Revision 1.27 2000/06/23 16:11:38 ngorham * * Map ODBC 2 SQLSTATE values to ODBC 3 * * Revision 1.25 2000/06/21 11:07:36 ngorham * * Stop Errors from SQLAllocHandle being lost * * Revision 1.24 2000/06/20 12:44:01 ngorham * * Fix bug that caused a success with info message from SQLExecute or * SQLExecDirect to be lost if used with a ODBC 3 driver and the application * called SQLGetDiagRec * * Revision 1.23 2000/06/01 11:00:51 ngorham * * return errors from descriptor functions * * Revision 1.22 2001/05/31 23:24:20 ngorham * * Update timestamps * * Revision 1.21 2000/05/21 21:49:19 ngorham * * Assorted fixes * * Revision 1.20 2001/04/11 09:00:05 ngorham * * remove stray printf * * Revision 1.19 2001/04/01 00:06:50 ngorham * * Dont use stderr, if the log file fails to open. * * Revision 1.18 2000/03/14 07:45:35 ngorham * * Fix bug that discarded connection errors * * Revision 1.17 2000/01/18 17:24:50 ngorham * * Add missing [unixODBC] prefix in front of error messages. * * Revision 1.16 1999/12/14 19:02:25 ngorham * * Mask out the password fields in the logging * * Revision 1.15 1999/12/04 17:01:23 ngorham * * Remove C++ comments from the Postgres code * * Revision 1.14 1999/12/01 09:20:07 ngorham * * Fix some threading problems * * Revision 1.13 1999/11/17 21:08:58 ngorham * * Fix Bug with the ODBC 3 error handling * * Revision 1.12 1999/11/13 23:41:01 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.11 1999/11/10 22:15:48 ngorham * * Fix some bugs with the DM and error reporting. * * Revision 1.10 1999/11/10 03:51:34 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.9 1999/10/24 23:54:19 ngorham * * First part of the changes to the error reporting * * Revision 1.8 1999/10/03 23:05:16 ngorham * * First public outing of the cursor lib * * Revision 1.7 1999/09/19 22:24:34 ngorham * * Added support for the cursor library * * Revision 1.6 1999/08/03 21:47:39 shandyb * Moving to automake: changed files in DriverManager * * Revision 1.5 1999/07/10 21:10:17 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.4 1999/07/05 19:54:05 ngorham * * Fix a problem where a long string could crash the DM * * Revision 1.3 1999/07/04 21:05:08 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/19 17:51:41 ngorham * * Applied assorted minor bug fixes * * Revision 1.1.1.1 1999/05/29 13:41:09 sShandyb * first go at it * * Revision 1.2 1999/06/03 22:20:25 ngorham * * Finished off the ODBC3-2 mapping * * Revision 1.1.1.1 1999/05/27 18:23:18 pharvey * Imported sources * * * **********************************************************************/ #include #include #include #include #if defined( HAVE_GETTIMEOFDAY ) && defined( HAVE_SYS_TIME_H ) #include #elif defined( HAVE_FTIME ) && defined( HAVE_SYS_TIMEB_H ) #include #elif defined( DHAVE_TIME ) && defined( HAVE_TIME_H ) #include #endif #ifdef HAVE_LANGINFO_H #include #endif #include "drivermanager.h" static char const rcsid[]= "$RCSfile: __info.c,v $ $Revision: 1.50 $"; struct log_structure log_info = { NULL, NULL, 0, 0 }; SQLINTEGER ODBCSharedTraceFlag = 0; /* * unicode setup functions, do them on a connection basis. */ int unicode_setup( DMHDBC connection ) { #ifdef HAVE_ICONV char ascii[ 256 ], unicode[ 256 ]; char *be_ucode[] = { "UCS-2-INTERNAL", "UCS-2BE", "UCS-2", "ucs2", NULL }; char *le_ucode[] = { "UCS-2-INTERNAL", "UCS-2LE", NULL }; char *asc[] = { "char", "char", "ISO8859-1", "ISO-8859-1", "8859-1", "iso8859_1", "ASCII", NULL }; union { long l; char c[sizeof (long)]; } u; int be; if ( connection -> iconv_cd_uc_to_ascii != (iconv_t)(-1) && connection -> iconv_cd_ascii_to_uc != (iconv_t)(-1)) { return 1; } /* * is this a bigendian machine ? */ u.l = 1; be = (u.c[sizeof (long) - 1] == 1); mutex_iconv_entry(); #if defined( HAVE_NL_LANGINFO ) && defined(HAVE_LANGINFO_CODESET) /* * Try with current locale settings first */ asc[ 0 ] = nl_langinfo(CODESET); #endif /* * if required find a match */ if ( strcmp( ASCII_ENCODING, "auto-search" ) == 0 && strcmp( connection -> unicode_string, "auto-search" ) == 0 ) { /* * look for both */ int i, j, found; iconv_t icvt; ascii[ 0 ] = '\0'; unicode[ 0 ] = '\0'; for ( i = found = 0; ( be ? be_ucode[ i ] : le_ucode[ i ] ) != NULL && !found; i ++ ) { for ( j = 0; asc[ j ] && !found; j ++ ) { if (( icvt = iconv_open( asc[ j ], be ? be_ucode[ i ] : le_ucode[ i ] )) != ((iconv_t) -1 ) ) { strcpy( ascii, asc[ j ] ); strcpy( unicode, be ? be_ucode[ i ] : le_ucode[ i ] ); iconv_close( icvt ); found = 1; } } } } else if ( strcmp( ASCII_ENCODING, "auto-search" ) == 0 ) { /* * look for ascii */ int j; iconv_t icvt; strcpy( unicode, connection -> unicode_string ); for ( j = 0; asc[ j ]; j ++ ) { if (( icvt = iconv_open( asc[ j ], unicode )) != ((iconv_t) -1 ) ) { strcpy( ascii, asc[ j ] ); iconv_close( icvt ); break; } } } else if ( strcmp( connection -> unicode_string, "auto-search" ) == 0 ) { /* * look for unicode */ int i; iconv_t icvt; strcpy( ascii, ASCII_ENCODING ); for ( i = 0; be ? be_ucode[ i ] : le_ucode[ i ]; i ++ ) { if (( icvt = iconv_open( ascii, be ? be_ucode[ i ] : le_ucode[ i ] )) != ((iconv_t) -1 ) ) { strcpy( unicode, be ? be_ucode[ i ] : le_ucode[ i ] ); iconv_close( icvt ); break; } } } else { strcpy( ascii, ASCII_ENCODING ); strcpy( unicode, connection -> unicode_string ); } if ( log_info.log_flag ) { sprintf( connection -> msg, "\t\tUNICODE Using encoding ASCII '%s' and UNICODE '%s'", ascii, unicode ); dm_log_write_diag( connection -> msg ); } connection -> iconv_cd_uc_to_ascii = iconv_open( ascii, unicode ); connection -> iconv_cd_ascii_to_uc = iconv_open( unicode, ascii ); mutex_iconv_exit(); if ( connection -> iconv_cd_uc_to_ascii == (iconv_t)(-1) || connection -> iconv_cd_ascii_to_uc == (iconv_t)(-1)) { return 0; } else { return 1; } #else return 1; #endif } void unicode_shutdown( DMHDBC connection ) { #ifdef HAVE_ICONV mutex_iconv_entry(); if ( connection -> iconv_cd_ascii_to_uc != (iconv_t)(-1) ) { iconv_close( connection -> iconv_cd_ascii_to_uc ); } if ( connection -> iconv_cd_uc_to_ascii != (iconv_t)(-1)) { iconv_close( connection -> iconv_cd_uc_to_ascii ); } connection -> iconv_cd_uc_to_ascii = (iconv_t)(-1); connection -> iconv_cd_ascii_to_uc = (iconv_t)(-1); mutex_iconv_exit(); #endif } /* * returned a malloc'd buffer in unicode converted from the ansi buffer */ SQLWCHAR *ansi_to_unicode_alloc( SQLCHAR *str, SQLINTEGER len, DMHDBC connection, int *wlen ) { SQLWCHAR *ustr; if ( wlen ) { *wlen = len; } if( !str ) { return NULL; } if ( len == SQL_NTS ) { len = strlen((char*) str ); } ustr = malloc( sizeof( SQLWCHAR ) * ( len + 1 )); if ( !ustr ) { return NULL; } return ansi_to_unicode_copy( ustr, (char*) str, len, connection, wlen ); } /* * return a ansi representation of a unicode buffer, according to * the chosen conversion method */ char *unicode_to_ansi_alloc( SQLWCHAR *str, SQLINTEGER len, DMHDBC connection, int *clen ) { char *aptr; if ( clen ) { *clen = len; } if ( !str ) { return NULL; } if ( len == SQL_NTS ) { len = wide_strlen( str ); } aptr = malloc(( len * 4 ) + 1 ); /* There may be UTF8 */ if ( !aptr ) { return NULL; } return unicode_to_ansi_copy( aptr, len * 4, str, len, connection, clen ); } /* * copy from a unicode buffer to a ansi buffer using the chosen conversion */ char *unicode_to_ansi_copy( char * dest, int dest_len, SQLWCHAR *src, SQLINTEGER buffer_len, DMHDBC connection, int *clen ) { int i; if ( !src || !dest ) { return NULL; } if ( buffer_len == SQL_NTS ) { buffer_len = wide_strlen( src ); } #ifdef HAVE_ICONV mutex_iconv_entry(); if ( connection && connection -> iconv_cd_uc_to_ascii != (iconv_t)(-1)) { size_t ret; size_t inbl = buffer_len * sizeof( SQLWCHAR ); size_t obl = dest_len; char *ipt = (char*)src; char *opt = (char*)dest; if (( ret = iconv( connection -> iconv_cd_uc_to_ascii, (ICONV_CONST char**)&ipt, &inbl, &opt, &obl )) != (size_t)(-1)) { mutex_iconv_exit(); if ( clen ) { *clen = opt - dest; } /* Null terminate outside of iconv, so that the length returned does not include the null terminator. */ if ( obl ) { *opt = '\0'; } return dest; } } mutex_iconv_exit(); #endif for ( i = 0; i < buffer_len && i < dest_len && src[ i ] != 0; i ++ ) { #ifdef SQL_WCHART_CONVERT dest[ i ] = (char)(src[ i ] & 0x000000ff); #else dest[ i ] = src[ i ] & 0x00FF; #endif } if ( clen ) { *clen = i; } if (dest_len) { dest[ i < dest_len ? i : i-1 ] = '\0'; } return dest; } /* * copy from a ansi buffer to a unicode buffer using the chosen conversion */ SQLWCHAR *ansi_to_unicode_copy( SQLWCHAR * dest, char *src, SQLINTEGER buffer_len, DMHDBC connection, int *wlen ) { int i; if ( !src || !dest ) { return NULL; } if ( buffer_len == SQL_NTS ) { buffer_len = strlen( src ); } #ifdef HAVE_ICONV if ( connection && connection -> iconv_cd_ascii_to_uc != (iconv_t)(-1)) { size_t inbl = buffer_len; size_t obl = buffer_len * sizeof( SQLWCHAR ); char *ipt = (char*)src; char *opt = (char*)dest; mutex_iconv_entry(); if ( iconv( connection -> iconv_cd_ascii_to_uc, (ICONV_CONST char**)&ipt, &inbl, &opt, &obl ) != (size_t)(-1)) { mutex_iconv_exit(); if ( wlen ) { *wlen = ( opt - ((char*)dest)) / sizeof( SQLWCHAR ); } /* Null terminate outside of iconv, so that the length returned does not include the null terminator. */ dest[( opt - ((char*)dest)) / sizeof( SQLWCHAR )] = 0; return dest; } mutex_iconv_exit(); } #endif for ( i = 0; i < buffer_len && src[ i ] != 0; i ++ ) { #ifdef SQL_WCHART_CONVERT dest[ i ] = src[ i ] & 0x000000ff; #else dest[ i ] = src[ i ] & 0x00FF; #endif } if ( wlen ) { *wlen = i; } dest[ i ] = 0; return dest; } /* * display a SQLGetTypeInfo type as a astring */ char * __type_as_string( SQLCHAR *s, SQLSMALLINT type ) { switch( type ) { case SQL_DOUBLE: sprintf((char*) s, "SQL_DOUBLE" ); break; case SQL_FLOAT: sprintf((char*) s, "SQL_FLOAT" ); break; case SQL_REAL: sprintf((char*) s, "SQL_REAL" ); break; case SQL_BIT: sprintf((char*) s, "SQL_BIT" ); break; case SQL_CHAR: sprintf((char*) s, "SQL_CHAR" ); break; case SQL_VARCHAR: sprintf((char*) s, "SQL_VARCHAR" ); break; case SQL_LONGVARCHAR: sprintf((char*) s, "SQL_LONGVARCHAR" ); break; case SQL_BINARY: sprintf((char*) s, "SQL_BINARY" ); break; case SQL_VARBINARY: sprintf((char*) s, "SQL_VARBINARY" ); break; case SQL_LONGVARBINARY: sprintf((char*) s, "SQL_LONGVARBINARY" ); break; case SQL_DECIMAL: sprintf((char*) s, "SQL_DECIMAL" ); break; case SQL_NUMERIC: sprintf((char*) s, "SQL_NUMERIC" ); break; case SQL_BIGINT: sprintf((char*) s, "SQL_BIGINT" ); break; case SQL_INTEGER: sprintf((char*) s, "SQL_INTEGER" ); break; case SQL_SMALLINT: sprintf((char*) s, "SQL_SMALLINT" ); break; case SQL_TINYINT: sprintf((char*) s, "SQL_TINYINT" ); break; case SQL_TYPE_DATE: sprintf((char*) s, "SQL_TYPE_DATE" ); break; case SQL_TYPE_TIME: sprintf((char*) s, "SQL_TYPE_TIME" ); break; case SQL_TYPE_TIMESTAMP: sprintf((char*) s, "SQL_TYPE_TIMESTAMP" ); break; case SQL_DATE: sprintf((char*) s, "SQL_DATE" ); break; case SQL_TIME: sprintf((char*) s, "SQL_TIME" ); break; case SQL_TIMESTAMP: sprintf((char*) s, "SQL_TIMESTAMP" ); break; case SQL_INTERVAL_YEAR: sprintf((char*) s, "SQL_INTERVAL_YEAR" ); break; case SQL_INTERVAL_YEAR_TO_MONTH: sprintf((char*) s, "SQL_INTERVAL_YEAR_TO_MONTH" ); break; case SQL_INTERVAL_MONTH: sprintf((char*) s, "SQL_INTERVAL_MONTH" ); break; case SQL_INTERVAL_DAY_TO_SECOND: sprintf((char*) s, "SQL_INTERVAL_DAY_TO_SECOND" ); break; case SQL_INTERVAL_DAY_TO_MINUTE: sprintf((char*) s, "SQL_INTERVAL_DAY_TO_MINUTE" ); break; case SQL_INTERVAL_DAY: sprintf((char*) s, "SQL_INTERVAL_DAY" ); break; case SQL_INTERVAL_HOUR_TO_SECOND: sprintf((char*) s, "SQL_INTERVAL_HOUR_TO_SECOND" ); break; case SQL_INTERVAL_HOUR_TO_MINUTE: sprintf((char*) s, "SQL_INTERVAL_HOUR_TO_MINUTE" ); break; case SQL_INTERVAL_HOUR: sprintf((char*) s, "SQL_INTERVAL_HOUR" ); break; case SQL_INTERVAL_MINUTE_TO_SECOND: sprintf((char*) s, "SQL_INTERVAL_MINUTE_TO_SECOND" ); break; case SQL_INTERVAL_MINUTE: sprintf((char*) s, "SQL_INTERVAL_MINUTE" ); break; case SQL_INTERVAL_SECOND: sprintf((char*) s, "SQL_INTERVAL_SECOND" ); break; case SQL_ALL_TYPES: sprintf((char*) s, "SQL_ALL_TYPES" ); break; default: sprintf((char*) s, "Unknown(%d)", (int)type ); break; } return (char*) s; } /* * display a data field as a string */ char * __sdata_as_string( SQLCHAR *s, SQLINTEGER type, SQLSMALLINT *ptr, SQLPOINTER buf ) { SQLLEN iptr; if ( ptr ) { iptr = *ptr; return __data_as_string( s, type, &iptr, buf ); } else { return __data_as_string( s, type, NULL, buf ); } return (char*) s; } char * __idata_as_string( SQLCHAR *s, SQLINTEGER type, SQLINTEGER *ptr, SQLPOINTER buf ) { SQLLEN iptr; if ( ptr ) { iptr = *ptr; return __data_as_string( s, type, &iptr, buf ); } else { return __data_as_string( s, type, NULL, buf ); } return (char*) s; } char * __data_as_string( SQLCHAR *s, SQLINTEGER type, SQLLEN *ptr, SQLPOINTER buf ) { if ( ptr && *ptr == SQL_NULL_DATA ) { sprintf((char*) s, "SQL_NULL_DATA" ); } else if ( ptr && *ptr < 0 ) { sprintf((char*) s, "Indicator = %d", (int)*ptr ); } else if ( !buf ) { sprintf((char*) s, "[NULLPTR]" ); } else { switch ( type ) { case SQL_INTEGER: { SQLINTEGER val; memcpy( &val, buf, sizeof( SQLINTEGER )); sprintf((char*) s, "[%d]", (int)val ); } break; case SQL_CHAR: case SQL_VARCHAR: sprintf((char*) s, "[%.*s]", LOG_MESSAGE_LEN, (char*)buf ); break; case SQL_WCHAR: case SQL_WVARCHAR: { int len = LOG_MESSAGE_LEN; signed short *ptr = (signed short*)buf; char *optr; optr = (char*) s; sprintf((char*) s, "[" ); optr ++; while( len > 0 ) { if ( *ptr == 0x0000 ) break; sprintf( optr, "%c", *ptr & 0x00FF ); optr ++; len --; ptr ++; } sprintf( optr, "](unicode)" ); } break; case SQL_DOUBLE: { double val; memcpy( &val, buf, sizeof( double )); sprintf((char*) s, "[%g]", val ); } break; case SQL_FLOAT: case SQL_REAL: { float val; memcpy( &val, buf, sizeof( float )); sprintf((char*) s, "[%g]", val ); } break; case SQL_BIT: { SQLCHAR val; memcpy( &val, buf, sizeof( SQLCHAR )); sprintf((char*) s, "[%d]", (int)val ); } break; case SQL_LONGVARCHAR: sprintf((char*) s, "[LONGVARCHARDATA...]" ); break; case SQL_BINARY: sprintf((char*) s, "[BINARYDATA...]" ); break; case SQL_VARBINARY: sprintf((char*) s, "[VARBINARYDATA...]" ); break; case SQL_LONGVARBINARY: sprintf((char*) s, "[LONGVARBINARYDATA...]" ); break; case SQL_DECIMAL: sprintf((char*) s, "[DECIMAL...]" ); break; case SQL_NUMERIC: sprintf((char*) s, "[NUMERIC...]" ); break; case SQL_BIGINT: sprintf((char*) s, "[BIGINT...]" ); break; case SQL_SMALLINT: { short val; memcpy( &val, buf, sizeof( short )); sprintf((char*) s, "[%d]", (int)val ); } break; case SQL_TINYINT: { char val; memcpy( &val, buf, sizeof( char )); sprintf((char*) s, "[%d]", (int)val ); } break; case SQL_TYPE_DATE: case SQL_DATE: sprintf((char*) s, "[DATE...]" ); break; case SQL_TYPE_TIME: case SQL_TIME: sprintf((char*) s, "[TIME...]" ); break; case SQL_TYPE_TIMESTAMP: case SQL_TIMESTAMP: sprintf((char*) s, "[TIMESTAMP...]" ); break; case SQL_INTERVAL_YEAR: case SQL_INTERVAL_YEAR_TO_MONTH: case SQL_INTERVAL_MONTH: case SQL_INTERVAL_DAY_TO_SECOND: case SQL_INTERVAL_DAY_TO_MINUTE: case SQL_INTERVAL_DAY: case SQL_INTERVAL_HOUR_TO_SECOND: case SQL_INTERVAL_HOUR_TO_MINUTE: case SQL_INTERVAL_HOUR: case SQL_INTERVAL_MINUTE_TO_SECOND: case SQL_INTERVAL_MINUTE: case SQL_INTERVAL_SECOND: sprintf((char*) s, "[INTERVAL...]" ); break; default: sprintf((char*) s, "[Data...]" ); break; } } return (char*) s; } /* * display a pointer to a int */ char * __iptr_as_string( SQLCHAR *s, SQLINTEGER *ptr ) { if ( ptr ) { sprintf((char*) s, "%p -> %ld (%d bits)", (void*)ptr, (long)*ptr, (int)sizeof( SQLINTEGER ) * 8 ); } else { sprintf((char*) s, "NULLPTR" ); } return (char*) s; } char * __ptr_as_string( SQLCHAR *s, SQLLEN *ptr ) { if ( ptr ) { sprintf((char*) s, "%p -> %ld (%d bits)", (void*)ptr, (long)*ptr, (int)sizeof( SQLLEN ) * 8 ); } else { sprintf((char*) s, "NULLPTR" ); } return (char*) s; } /* * display a pointer to a int */ char * __sptr_as_string( SQLCHAR *s, SQLSMALLINT *ptr ) { if ( ptr ) { sprintf((char*) s, "%p -> %d", (void*)ptr, (int)*ptr ); } else { sprintf((char*) s, "NULLPTR" ); } return (char*) s; } /* * convert a function id to a string */ char * __fid_as_string( SQLCHAR *s, SQLINTEGER type ) { switch( type ) { case SQL_API_SQLALLOCCONNECT: sprintf((char*) s, "SQLAllocConnect" ); break; case SQL_API_SQLALLOCENV: sprintf((char*) s, "SQLAllocEnv" ); break; case SQL_API_SQLALLOCHANDLE: sprintf((char*) s, "SQLAllocHandle" ); break; case SQL_API_SQLALLOCSTMT: sprintf((char*) s, "SQLAllocStmt" ); break; case SQL_API_SQLALLOCHANDLESTD: sprintf((char*) s, "SQLAllochandleStd" ); break; case SQL_API_SQLBINDCOL: sprintf((char*) s, "SQLBindCol" ); break; case SQL_API_SQLBINDPARAM: sprintf((char*) s, "SQLBindParam" ); break; case SQL_API_SQLBINDPARAMETER: sprintf((char*) s, "SQLBindParameter" ); break; case SQL_API_SQLBROWSECONNECT: sprintf((char*) s, "SQLBrowseConnect" ); break; case SQL_API_SQLBULKOPERATIONS: sprintf((char*) s, "SQLBulkOperations" ); break; case SQL_API_SQLCANCEL: sprintf((char*) s, "SQLCancel" ); break; case SQL_API_SQLCLOSECURSOR: sprintf((char*) s, "SQLCloseCursor" ); break; case SQL_API_SQLCOLATTRIBUTES: sprintf((char*) s, "SQLColAttribute(s)" ); break; case SQL_API_SQLCOLUMNPRIVILEGES: sprintf((char*) s, "SQLColumnPrivileges" ); break; case SQL_API_SQLCOLUMNS: sprintf((char*) s, "SQLColumns" ); break; case SQL_API_SQLCONNECT: sprintf((char*) s, "SQLConnect" ); break; case SQL_API_SQLCOPYDESC: sprintf((char*) s, "SQLCopyDesc" ); break; case SQL_API_SQLDATASOURCES: sprintf((char*) s, "SQLDataSources" ); break; case SQL_API_SQLDESCRIBECOL: sprintf((char*) s, "SQLDescribeCol" ); break; case SQL_API_SQLDESCRIBEPARAM: sprintf((char*) s, "SQLDescribeParam" ); break; case SQL_API_SQLDISCONNECT: sprintf((char*) s, "SQLDisconnect" ); break; case SQL_API_SQLDRIVERCONNECT: sprintf((char*) s, "SQLDriverConnect" ); break; case SQL_API_SQLDRIVERS: sprintf((char*) s, "SQLDrivers" ); break; case SQL_API_SQLENDTRAN: sprintf((char*) s, "SQLEndTran" ); break; case SQL_API_SQLERROR: sprintf((char*) s, "SQLError" ); break; case SQL_API_SQLEXECDIRECT: sprintf((char*) s, "SQLExecDirect" ); break; case SQL_API_SQLEXECUTE: sprintf((char*) s, "SQLExecute" ); break; case SQL_API_SQLEXTENDEDFETCH: sprintf((char*) s, "SQLExtendedFetch" ); break; case SQL_API_SQLFETCH: sprintf((char*) s, "SQLFetch" ); break; case SQL_API_SQLFETCHSCROLL: sprintf((char*) s, "SQLFetchScroll" ); break; case SQL_API_SQLFOREIGNKEYS: sprintf((char*) s, "SQLForeignKeys" ); break; case SQL_API_SQLFREEENV: sprintf((char*) s, "SQLFreeEnv" ); break; case SQL_API_SQLFREEHANDLE: sprintf((char*) s, "SQLFreeHandle" ); break; case SQL_API_SQLFREESTMT: sprintf((char*) s, "SQLFreeStmt" ); break; case SQL_API_SQLFREECONNECT: sprintf((char*) s, "SQLFreeConnect" ); break; case SQL_API_SQLGETCONNECTATTR: sprintf((char*) s, "SQLGetConnectAttr" ); break; case SQL_API_SQLGETCONNECTOPTION: sprintf((char*) s, "SQLGetConnectOption" ); break; case SQL_API_SQLGETCURSORNAME: sprintf((char*) s, "SQLGetCursorName" ); break; case SQL_API_SQLGETDATA: sprintf((char*) s, "SQLGetData" ); break; case SQL_API_SQLGETDESCFIELD: sprintf((char*) s, "SQLGetDescField" ); break; case SQL_API_SQLGETDESCREC: sprintf((char*) s, "SQLGetDescRec" ); break; case SQL_API_SQLGETDIAGFIELD: sprintf((char*) s, "SQLGetDiagField" ); break; case SQL_API_SQLGETENVATTR: sprintf((char*) s, "SQLGetEnvAttr" ); break; case SQL_API_SQLGETFUNCTIONS: sprintf((char*) s, "SQLGetFunctions" ); break; case SQL_API_SQLGETINFO: sprintf((char*) s, "SQLGetInfo" ); break; case SQL_API_SQLGETSTMTATTR: sprintf((char*) s, "SQLGetStmtAttr" ); break; case SQL_API_SQLGETSTMTOPTION: sprintf((char*) s, "SQLGetStmtOption" ); break; case SQL_API_SQLGETTYPEINFO: sprintf((char*) s, "SQLGetTypeInfo" ); break; case SQL_API_SQLMORERESULTS: sprintf((char*) s, "SQLMoreResults" ); break; case SQL_API_SQLNATIVESQL: sprintf((char*) s, "SQLNativeSql" ); break; case SQL_API_SQLNUMPARAMS: sprintf((char*) s, "SQLNumParams" ); break; case SQL_API_SQLNUMRESULTCOLS: sprintf((char*) s, "SQLNumResultCols" ); break; case SQL_API_SQLPARAMDATA: sprintf((char*) s, "SQLParamData" ); break; case SQL_API_SQLPARAMOPTIONS: sprintf((char*) s, "SQLParamOptions" ); break; case SQL_API_SQLPREPARE: sprintf((char*) s, "SQLPrepare" ); break; case SQL_API_SQLPRIMARYKEYS: sprintf((char*) s, "SQLPrimaryKeys" ); break; case SQL_API_SQLPROCEDURECOLUMNS: sprintf((char*) s, "SQLProcedureColumns" ); break; case SQL_API_SQLPROCEDURES: sprintf((char*) s, "SQLProcedures" ); break; case SQL_API_SQLPUTDATA: sprintf((char*) s, "SQLPutData" ); break; case SQL_API_SQLROWCOUNT: sprintf((char*) s, "SQLRowCount" ); break; case SQL_API_SQLSETCONNECTATTR: sprintf((char*) s, "SQLSetConnectAttr" ); break; case SQL_API_SQLSETCONNECTOPTION: sprintf((char*) s, "SQLSetConnectOption" ); break; case SQL_API_SQLSETCURSORNAME: sprintf((char*) s, "SQLSetCursorName" ); break; case SQL_API_SQLSETDESCFIELD: sprintf((char*) s, "SQLSetDescField" ); break; case SQL_API_SQLSETDESCREC: sprintf((char*) s, "SQLSetDescRec" ); break; case SQL_API_SQLSETENVATTR: sprintf((char*) s, "SQLSetEnvAttr" ); break; case SQL_API_SQLSETPARAM: sprintf((char*) s, "SQLSetParam" ); break; case SQL_API_SQLSETPOS: sprintf((char*) s, "SQLSetPos" ); break; case SQL_API_SQLSETSCROLLOPTIONS: sprintf((char*) s, "SQLSetScrollOptions" ); break; case SQL_API_SQLSETSTMTATTR: sprintf((char*) s, "SQLSetStmtAttr" ); break; case SQL_API_SQLSETSTMTOPTION: sprintf((char*) s, "SQLSetStmtOption" ); break; case SQL_API_SQLSPECIALCOLUMNS: sprintf((char*) s, "SQLSpecialColumns" ); break; case SQL_API_SQLSTATISTICS: sprintf((char*) s, "SQLStatistics" ); break; case SQL_API_SQLTABLEPRIVILEGES: sprintf((char*) s, "SQLTablePrivileges" ); break; case SQL_API_SQLTABLES: sprintf((char*) s, "SQLTables" ); break; case SQL_API_SQLTRANSACT: sprintf((char*) s, "SQLTransact" ); break; case SQL_API_SQLGETDIAGREC: sprintf((char*) s, "SQLGetDiagRec" ); break; default: sprintf((char*) s, "%d", (int)type ); } return (char*) s; } /* * convert a column attribute to a string */ char * __col_attr_as_string( SQLCHAR *s, SQLINTEGER type ) { switch( type ) { case SQL_DESC_AUTO_UNIQUE_VALUE: sprintf((char*) s, "SQL_DESC_AUTO_UNIQUE_VALUE" ); break; case SQL_DESC_BASE_COLUMN_NAME: sprintf((char*) s, "SQL_DESC_BASE_COLUMN_NAME" ); break; case SQL_DESC_BASE_TABLE_NAME: sprintf((char*) s, "SQL_DESC_BASE_TABLE_NAME" ); break; case SQL_DESC_CASE_SENSITIVE: sprintf((char*) s, "SQL_DESC_CASE_SENSITIVE" ); break; case SQL_DESC_CATALOG_NAME: sprintf((char*) s, "SQL_DESC_CATALOG_NAME" ); break; case SQL_DESC_CONCISE_TYPE: sprintf((char*) s, "SQL_DESC_CONCISE_TYPE" ); break; case SQL_DESC_DISPLAY_SIZE: sprintf((char*) s, "SQL_DESC_DISPLAY_SIZE" ); break; case SQL_DESC_FIXED_PREC_SCALE: sprintf((char*) s, "SQL_DESC_FIXED_PREC_SCALE" ); break; case SQL_DESC_LABEL: sprintf((char*) s, "SQL_DESC_LABEL" ); break; case SQL_COLUMN_NAME: sprintf((char*) s, "SQL_COLUMN_NAME" ); break; case SQL_DESC_LENGTH: sprintf((char*) s, "SQL_DESC_LENGTH" ); break; case SQL_COLUMN_LENGTH: sprintf((char*) s, "SQL_COLUMN_LENGTH" ); break; case SQL_DESC_LITERAL_PREFIX: sprintf((char*) s, "SQL_DESC_LITERAL_PREFIX" ); break; case SQL_DESC_LITERAL_SUFFIX: sprintf((char*) s, "SQL_DESC_LITERAL_SUFFIX" ); break; case SQL_DESC_LOCAL_TYPE_NAME: sprintf((char*) s, "SQL_DESC_LOCAL_TYPE_NAME" ); break; case SQL_DESC_NAME: sprintf((char*) s, "SQL_DESC_NAME" ); break; case SQL_DESC_NULLABLE: sprintf((char*) s, "SQL_DESC_NULLABLE" ); break; case SQL_COLUMN_NULLABLE: sprintf((char*) s, "SQL_COLUMN_NULLABLE" ); break; case SQL_DESC_NUM_PREC_RADIX: sprintf((char*) s, "SQL_DESC_NUM_PREC_RADIX" ); break; case SQL_DESC_OCTET_LENGTH: sprintf((char*) s, "SQL_DESC_OCTET_LENGTH" ); break; case SQL_DESC_PRECISION: sprintf((char*) s, "SQL_DESC_PRECISION" ); break; case SQL_COLUMN_PRECISION: sprintf((char*) s, "SQL_COLUMN_PRECISION" ); break; case SQL_DESC_SCALE: sprintf((char*) s, "SQL_DESC_SCALE" ); break; case SQL_COLUMN_SCALE: sprintf((char*) s, "SQL_COLUMN_SCALE" ); break; case SQL_DESC_SCHEMA_NAME: sprintf((char*) s, "SQL_DESC_SCHEMA_NAME" ); break; case SQL_DESC_SEARCHABLE: sprintf((char*) s, "SQL_DESC_SEARCHABLE" ); break; case SQL_DESC_TABLE_NAME: sprintf((char*) s, "SQL_DESC_TABLE_NAME" ); break; case SQL_DESC_TYPE: sprintf((char*) s, "SQL_DESC_TYPE" ); break; case SQL_DESC_TYPE_NAME: sprintf((char*) s, "SQL_DESC_TYPE_NAME" ); break; case SQL_DESC_UNNAMED: sprintf((char*) s, "SQL_DESC_UNNAMED" ); break; case SQL_DESC_UNSIGNED: sprintf((char*) s, "SQL_DESC_UNSIGNED" ); break; case SQL_DESC_UPDATABLE: sprintf((char*) s, "SQL_DESC_UPDATABLE" ); break; default: sprintf((char*) s, "%d", (int)type ); } return (char*) s; } /* * convert a connect attribute to a string */ char * __env_attr_as_string( SQLCHAR *s, SQLINTEGER type ) { switch( type ) { case SQL_ATTR_CONNECTION_POOLING: sprintf((char*) s, "SQL_ATTR_CONNECTION_POOLING" ); break; case SQL_ATTR_CP_MATCH: sprintf((char*) s, "SQL_ATTR_CP_MATCH" ); break; case SQL_ATTR_ODBC_VERSION: sprintf((char*) s, "SQL_ATTR_ODBC_VERSION" ); break; case SQL_ATTR_OUTPUT_NTS: sprintf((char*) s, "SQL_ATTR_OUTPUT_NTS" ); break; default: sprintf((char*) s, "%d", (int)type ); } return (char*) s; } /* * convert a connect attribute to a string */ char * __con_attr_as_string( SQLCHAR *s, SQLINTEGER type ) { switch( type ) { case SQL_ATTR_ACCESS_MODE: sprintf((char*) s, "SQL_ATTR_ACCESS_MODE" ); break; case SQL_ATTR_ASYNC_ENABLE: sprintf((char*) s, "SQL_ATTR_ASYNC_ENABLE" ); break; case SQL_ATTR_AUTO_IPD: sprintf((char*) s, "SQL_ATTR_AUTO_IPD" ); break; case SQL_ATTR_AUTOCOMMIT: sprintf((char*) s, "SQL_ATTR_AUTOCOMMIT" ); break; case SQL_ATTR_CONNECTION_TIMEOUT: sprintf((char*) s, "SQL_ATTR_CONNECTION_TIMEOUT" ); break; case SQL_ATTR_CURRENT_CATALOG: sprintf((char*) s, "SQL_ATTR_CURRENT_CATALOG" ); break; case SQL_ATTR_LOGIN_TIMEOUT: sprintf((char*) s, "SQL_ATTR_LOGIN_TIMEOUT" ); break; case SQL_ATTR_METADATA_ID: sprintf((char*) s, "SQL_ATTR_METADATA_ID" ); break; case SQL_ATTR_ODBC_CURSORS: sprintf((char*) s, "SQL_ATTR_ODBC_CURSORS" ); break; case SQL_ATTR_PACKET_SIZE: sprintf((char*) s, "SQL_ATTR_PACKET_SIZE" ); break; case SQL_ATTR_QUIET_MODE: sprintf((char*) s, "SQL_ATTR_QUIET_MODE" ); break; case SQL_ATTR_TRACE: sprintf((char*) s, "SQL_ATTR_TRACE" ); break; case SQL_ATTR_TRACEFILE: sprintf((char*) s, "SQL_ATTR_TRACEFILE" ); break; case SQL_ATTR_TRANSLATE_LIB: sprintf((char*) s, "SQL_ATTR_TRANSLATE_LIB" ); break; case SQL_ATTR_TRANSLATE_OPTION: sprintf((char*) s, "SQL_ATTR_TRANSLATE_OPTION" ); break; case SQL_ATTR_TXN_ISOLATION: sprintf((char*) s, "SQL_ATTR_TXN_ISOLATION" ); break; default: sprintf((char*) s, "%d", (int)type ); } return (char*) s; } /* * convert a diagnostic attribute to a string */ char * __diag_attr_as_string( SQLCHAR *s, SQLINTEGER type ) { switch( type ) { case SQL_DIAG_CURSOR_ROW_COUNT: sprintf((char*) s, "SQL_DIAG_CURSOR_ROW_COUNT" ); break; case SQL_DIAG_DYNAMIC_FUNCTION: sprintf((char*) s, "SQL_DIAG_DYNAMIC_FUNCTION" ); break; case SQL_DIAG_DYNAMIC_FUNCTION_CODE: sprintf((char*) s, "SQL_DIAG_DYNAMIC_FUNCTION_CODE" ); break; case SQL_DIAG_NUMBER: sprintf((char*) s, "SQL_DIAG_NUMBER" ); break; case SQL_DIAG_RETURNCODE: sprintf((char*) s, "SQL_DIAG_RETURNCODE" ); break; case SQL_DIAG_ROW_COUNT: sprintf((char*) s, "SQL_DIAG_ROW_COUNT" ); break; case SQL_DIAG_CLASS_ORIGIN: sprintf((char*) s, "SQL_DIAG_CLASS_ORIGIN" ); break; case SQL_DIAG_COLUMN_NUMBER: sprintf((char*) s, "SQL_DIAG_COLUMN_NUMBER" ); break; case SQL_DIAG_CONNECTION_NAME: sprintf((char*) s, "SQL_DIAG_CONNECTION_NAME" ); break; case SQL_DIAG_MESSAGE_TEXT: sprintf((char*) s, "SQL_DIAG_MESSAGE_TEXT" ); break; case SQL_DIAG_NATIVE: sprintf((char*) s, "SQL_DIAG_NATIVE" ); break; case SQL_DIAG_ROW_NUMBER: sprintf((char*) s, "SQL_DIAG_ROW_NUMBER" ); break; case SQL_DIAG_SERVER_NAME: sprintf((char*) s, "SQL_DIAG_SERVER_NAME" ); break; case SQL_DIAG_SQLSTATE: sprintf((char*) s, "SQL_DIAG_SQLSTATE" ); break; case SQL_DIAG_SUBCLASS_ORIGIN: sprintf((char*) s, "SQL_DIAG_SUBCLASS_ORIGIN" ); break; default: sprintf((char*) s, "%d", (int)type ); } return (char*) s; } /* * convert a descriptor attribute to a string */ char * __desc_attr_as_string( SQLCHAR *s, SQLINTEGER type ) { switch( type ) { case SQL_DESC_ALLOC_TYPE: sprintf((char*) s, "SQL_DESC_ALLOC_TYPE" ); break; case SQL_DESC_ARRAY_SIZE: sprintf((char*) s, "SQL_DESC_ARRAY_SIZE" ); break; case SQL_DESC_ARRAY_STATUS_PTR: sprintf((char*) s, "SQL_DESC_ARRAY_STATUS_PTR" ); break; case SQL_DESC_BIND_OFFSET_PTR: sprintf((char*) s, "SQL_DESC_BIND_OFFSET_PTR" ); break; case SQL_DESC_BIND_TYPE: sprintf((char*) s, "SQL_DESC_BIND_TYPE" ); break; case SQL_DESC_COUNT: sprintf((char*) s, "SQL_DESC_COUNT" ); break; case SQL_DESC_ROWS_PROCESSED_PTR: sprintf((char*) s, "SQL_DESC_ROWS_PROCESSED_PTR" ); break; case SQL_DESC_AUTO_UNIQUE_VALUE: sprintf((char*) s, "SQL_DESC_AUTO_UNIQUE_VALUE" ); break; case SQL_DESC_BASE_COLUMN_NAME: sprintf((char*) s, "SQL_DESC_BASE_COLUMN_NAME" ); break; case SQL_DESC_BASE_TABLE_NAME: sprintf((char*) s, "SQL_DESC_BASE_TABLE_NAME" ); break; case SQL_DESC_CASE_SENSITIVE: sprintf((char*) s, "SQL_DESC_CASE_SENSITIVE" ); break; case SQL_DESC_CATALOG_NAME: sprintf((char*) s, "SQL_DESC_CATALOG_NAME" ); break; case SQL_DESC_CONCISE_TYPE: sprintf((char*) s, "SQL_DESC_CONCISE_TYPE" ); break; case SQL_DESC_DATA_PTR: sprintf((char*) s, "SQL_DESC_DATA_PTR" ); break; case SQL_DESC_DATETIME_INTERVAL_CODE: sprintf((char*) s, "SQL_DESC_DATETIME_INTERVAL_CODE" ); break; case SQL_DESC_DATETIME_INTERVAL_PRECISION: sprintf((char*) s, "SQL_DESC_DATETIME_INTERVAL_PRECISION" ); break; case SQL_DESC_DISPLAY_SIZE: sprintf((char*) s, "SQL_DESC_DISPLAY_SIZE" ); break; case SQL_DESC_FIXED_PREC_SCALE: sprintf((char*) s, "SQL_DESC_FIXED_PREC_SCALE" ); break; case SQL_DESC_INDICATOR_PTR: sprintf((char*) s, "SQL_DESC_INDICATOR_PTR" ); break; case SQL_DESC_LABEL: sprintf((char*) s, "SQL_DESC_LABEL" ); break; case SQL_DESC_LENGTH: sprintf((char*) s, "SQL_DESC_LENGTH" ); break; case SQL_DESC_LITERAL_PREFIX: sprintf((char*) s, "SQL_DESC_LITERAL_PREFIX" ); break; case SQL_DESC_LITERAL_SUFFIX: sprintf((char*) s, "SQL_DESC_LITERAL_SUFFIX" ); break; case SQL_DESC_LOCAL_TYPE_NAME: sprintf((char*) s, "SQL_DESC_LOCAL_TYPE_NAME" ); break; case SQL_DESC_NAME: sprintf((char*) s, "SQL_DESC_NAME" ); break; case SQL_DESC_NULLABLE: sprintf((char*) s, "SQL_DESC_NULLABLE" ); break; case SQL_DESC_NUM_PREC_RADIX: sprintf((char*) s, "SQL_DESC_NUM_PREC_RADIX" ); break; case SQL_DESC_OCTET_LENGTH: sprintf((char*) s, "SQL_DESC_OCTET_LENGTH" ); break; case SQL_DESC_OCTET_LENGTH_PTR: sprintf((char*) s, "SQL_DESC_OCTET_LENGTH_PTR" ); break; case SQL_DESC_PARAMETER_TYPE: sprintf((char*) s, "SQL_DESC_PARAMETER_TYPE" ); break; case SQL_DESC_PRECISION: sprintf((char*) s, "SQL_DESC_PRECISION" ); break; case SQL_DESC_SCALE: sprintf((char*) s, "SQL_DESC_SCALE" ); break; case SQL_DESC_SCHEMA_NAME: sprintf((char*) s, "SQL_DESC_SCHEMA_NAME" ); break; case SQL_DESC_SEARCHABLE: sprintf((char*) s, "SQL_DESC_SEARCHABLE" ); break; case SQL_DESC_TABLE_NAME: sprintf((char*) s, "SQL_DESC_TABLE_NAME" ); break; case SQL_DESC_TYPE: sprintf((char*) s, "SQL_DESC_TYPE" ); break; case SQL_DESC_TYPE_NAME: sprintf((char*) s, "SQL_DESC_TYPE_NAME" ); break; case SQL_DESC_UNNAMED: sprintf((char*) s, "SQL_DESC_UNNAMED" ); break; case SQL_DESC_UNSIGNED: sprintf((char*) s, "SQL_DESC_UNSIGNED" ); break; case SQL_DESC_UPDATABLE: sprintf((char*) s, "SQL_DESC_UPDATABLE" ); break; default: sprintf((char*) s, "%d", (int)type ); } return (char*) s; } /* * convert a statement attribute to a string */ char * __stmt_attr_as_string( SQLCHAR *s, SQLINTEGER type ) { switch( type ) { case SQL_ATTR_APP_PARAM_DESC: sprintf((char*) s, "SQL_ATTR_APP_PARAM_DESC" ); break; case SQL_ATTR_APP_ROW_DESC: sprintf((char*) s, "SQL_ATTR_APP_ROW_DESC" ); break; case SQL_ATTR_ASYNC_ENABLE: sprintf((char*) s, "SQL_ATTR_ASYNC_ENABLE" ); break; case SQL_ATTR_CONCURRENCY: sprintf((char*) s, "SQL_ATTR_CONCURRENCY" ); break; case SQL_ATTR_CURSOR_SCROLLABLE: sprintf((char*) s, "SQL_ATTR_CURSOR_SCROLLABLE" ); break; case SQL_ATTR_CURSOR_SENSITIVITY: sprintf((char*) s, "SQL_ATTR_CURSOR_SENSITIVITY" ); break; case SQL_ATTR_CURSOR_TYPE: sprintf((char*) s, "SQL_ATTR_CURSOR_TYPE" ); break; case SQL_ATTR_ENABLE_AUTO_IPD: sprintf((char*) s, "SQL_ATTR_ENABLE_AUTO_IPD" ); break; case SQL_ATTR_FETCH_BOOKMARK_PTR: sprintf((char*) s, "SQL_ATTR_FETCH_BOOKMARK_PTR" ); break; case SQL_ATTR_IMP_PARAM_DESC: sprintf((char*) s, "SQL_ATTR_IMP_PARAM_DESC" ); break; case SQL_ATTR_IMP_ROW_DESC: sprintf((char*) s, "SQL_ATTR_IMP_ROW_DESC" ); break; case SQL_ATTR_KEYSET_SIZE: sprintf((char*) s, "SQL_ATTR_KEYSET_SIZE" ); break; case SQL_ATTR_MAX_LENGTH: sprintf((char*) s, "SQL_ATTR_MAX_LENGTH" ); break; case SQL_ATTR_MAX_ROWS: sprintf((char*) s, "SQL_ATTR_MAX_ROWS" ); break; case SQL_ATTR_METADATA_ID: sprintf((char*) s, "SQL_ATTR_METADATA_ID" ); break; case SQL_ATTR_NOSCAN: sprintf((char*) s, "SQL_ATTR_NOSCAN" ); break; case SQL_ATTR_PARAM_BIND_OFFSET_PTR: sprintf((char*) s, "SQL_ATTR_PARAM_BIND_OFFSET_PTR" ); break; case SQL_ATTR_PARAM_BIND_TYPE: sprintf((char*) s, "SQL_ATTR_PARAM_BIND_TYPE" ); break; case SQL_ATTR_PARAM_OPERATION_PTR: sprintf((char*) s, "SQL_ATTR_PARAM_OPERATION_PTR" ); break; case SQL_ATTR_PARAM_STATUS_PTR: sprintf((char*) s, "SQL_ATTR_PARAM_STATUS_PTR" ); break; case SQL_ATTR_PARAMS_PROCESSED_PTR: sprintf((char*) s, "SQL_ATTR_PARAMS_PROCESSED_PTR" ); break; case SQL_ATTR_PARAMSET_SIZE: sprintf((char*) s, "SQL_ATTR_PARAMSET_SIZE" ); break; case SQL_ATTR_QUERY_TIMEOUT: sprintf((char*) s, "SQL_ATTR_QUERY_TIMEOUT" ); break; case SQL_ATTR_RETRIEVE_DATA: sprintf((char*) s, "SQL_ATTR_RETRIEVE_DATA" ); break; case SQL_ROWSET_SIZE: sprintf((char*) s, "SQL_ROWSET_SIZE" ); break; case SQL_ATTR_ROW_ARRAY_SIZE: sprintf((char*) s, "SQL_ATTR_ROW_ARRAY_SIZE" ); break; case SQL_ATTR_ROW_BIND_OFFSET_PTR: sprintf((char*) s, "SQL_ATTR_ROW_BIND_OFFSET_PTR" ); break; case SQL_ATTR_ROW_BIND_TYPE: sprintf((char*) s, "SQL_ATTR_ROW_BIND_TYPE" ); break; case SQL_ATTR_ROW_NUMBER: sprintf((char*) s, "SQL_ATTR_ROW_NUMBER" ); break; case SQL_ATTR_ROW_OPERATION_PTR: sprintf((char*) s, "SQL_ATTR_ROW_OPERATION_PTR" ); break; case SQL_ATTR_ROW_STATUS_PTR: sprintf((char*) s, "SQL_ATTR_ROW_STATUS_PTR" ); break; case SQL_ATTR_ROWS_FETCHED_PTR: sprintf((char*) s, "SQL_ATTR_ROWS_FETCHED_PTR" ); break; case SQL_ATTR_SIMULATE_CURSOR: sprintf((char*) s, "SQL_ATTR_SIMULATE_CURSOR" ); break; case SQL_ATTR_USE_BOOKMARKS: sprintf((char*) s, "SQL_ATTR_USE_BOOKMARKS" ); break; default: sprintf((char*) s, "%d", (int)type ); } return (char*) s; } /* * return a SQLGetInfo type as a string */ char * __info_as_string( SQLCHAR *s, SQLINTEGER type ) { switch( type ) { case SQL_ACCESSIBLE_PROCEDURES: sprintf((char*) s, "SQL_ACCESSIBLE_PROCEDURES" ); break; case SQL_ACCESSIBLE_TABLES: sprintf((char*) s, "SQL_ACCESSIBLE_TABLES" ); break; case SQL_ACTIVE_ENVIRONMENTS: sprintf((char*) s, "SQL_ACTIVE_ENVIRONMENTS" ); break; case SQL_AGGREGATE_FUNCTIONS: sprintf((char*) s, "SQL_AGGREGATE_FUNCTIONS" ); break; case SQL_ALTER_DOMAIN: sprintf((char*) s, "SQL_ALTER_DOMAIN" ); break; case SQL_ALTER_TABLE: sprintf((char*) s, "SQL_ALTER_TABLE" ); break; case SQL_ASYNC_MODE: sprintf((char*) s, "SQL_ASYNC_MODE" ); break; case SQL_BATCH_ROW_COUNT: sprintf((char*) s, "SQL_BATCH_ROW_COUNT" ); break; case SQL_BATCH_SUPPORT: sprintf((char*) s, "SQL_BATCH_SUPPORT" ); break; case SQL_BOOKMARK_PERSISTENCE: sprintf((char*) s, "SQL_BOOKMARK_PERSISTENCE" ); break; case SQL_CATALOG_LOCATION: sprintf((char*) s, "SQL_CATALOG_LOCATION" ); break; case SQL_CATALOG_NAME: sprintf((char*) s, "SQL_CATALOG_NAME" ); break; case SQL_CATALOG_NAME_SEPARATOR: sprintf((char*) s, "SQL_CATALOG_NAME_SEPARATOR" ); break; case SQL_CATALOG_TERM: sprintf((char*) s, "SQL_CATALOG_TERM" ); break; case SQL_CATALOG_USAGE: sprintf((char*) s, "SQL_CATALOG_USAGE" ); break; case SQL_COLLATION_SEQ: sprintf((char*) s, "SQL_COLLATION_SEQ" ); break; case SQL_COLUMN_ALIAS: sprintf((char*) s, "SQL_COLUMN_ALIAS" ); break; case SQL_CONCAT_NULL_BEHAVIOR: sprintf((char*) s, "SQL_CONCAT_NULL_BEHAVIOR" ); break; case SQL_CONVERT_BIGINT: sprintf((char*) s, "SQL_CONVERT_BIGINT" ); break; case SQL_CONVERT_BINARY: sprintf((char*) s, "SQL_CONVERT_BINARY" ); break; case SQL_CONVERT_BIT: sprintf((char*) s, "SQL_CONVERT_BIT" ); break; case SQL_CONVERT_CHAR: sprintf((char*) s, "SQL_CONVERT_CHAR" ); break; case SQL_CONVERT_DATE: sprintf((char*) s, "SQL_CONVERT_DATE" ); break; case SQL_CONVERT_DECIMAL: sprintf((char*) s, "SQL_CONVERT_DECIMAL" ); break; case SQL_CONVERT_DOUBLE: sprintf((char*) s, "SQL_CONVERT_DOUBLE" ); break; case SQL_CONVERT_FLOAT: sprintf((char*) s, "SQL_CONVERT_FLOAT" ); break; case SQL_CONVERT_INTEGER: sprintf((char*) s, "SQL_CONVERT_INTEGER" ); break; case SQL_CONVERT_INTERVAL_YEAR_MONTH: sprintf((char*) s, "SQL_CONVERT_INTERVAL_YEAR_MONTH" ); break; case SQL_CONVERT_INTERVAL_DAY_TIME: sprintf((char*) s, "SQL_CONVERT_INTERVAL_DAY_TIME" ); break; case SQL_CONVERT_LONGVARBINARY: sprintf((char*) s, "SQL_CONVERT_LONGVARBINARY" ); break; case SQL_CONVERT_LONGVARCHAR: sprintf((char*) s, "SQL_CONVERT_LONGVARCHAR" ); break; case SQL_CONVERT_NUMERIC: sprintf((char*) s, "SQL_CONVERT_NUMERIC" ); break; case SQL_CONVERT_REAL: sprintf((char*) s, "SQL_CONVERT_REAL" ); break; case SQL_CONVERT_SMALLINT: sprintf((char*) s, "SQL_CONVERT_SMALLINT" ); break; case SQL_CONVERT_TIME: sprintf((char*) s, "SQL_CONVERT_TIME" ); break; case SQL_CONVERT_TIMESTAMP: sprintf((char*) s, "SQL_CONVERT_TIMESTAMP" ); break; case SQL_CONVERT_TINYINT: sprintf((char*) s, "SQL_CONVERT_TINYINT" ); break; case SQL_CONVERT_VARBINARY: sprintf((char*) s, "SQL_CONVERT_VARBINARY" ); break; case SQL_CONVERT_VARCHAR: sprintf((char*) s, "SQL_CONVERT_VARCHAR" ); break; case SQL_CONVERT_FUNCTIONS: sprintf((char*) s, "SQL_CONVERT_FUNCTIONS" ); break; case SQL_CORRELATION_NAME: sprintf((char*) s, "SQL_CORRELATION_NAME" ); break; case SQL_CREATE_ASSERTION: sprintf((char*) s, "SQL_CREATE_ASSERTION" ); break; case SQL_CREATE_CHARACTER_SET: sprintf((char*) s, "SQL_CREATE_CHARACTER_SET" ); break; case SQL_CREATE_COLLATION: sprintf((char*) s, "SQL_CREATE_COLLATION" ); break; case SQL_CREATE_DOMAIN: sprintf((char*) s, "SQL_CREATE_DOMAIN" ); break; case SQL_CREATE_SCHEMA: sprintf((char*) s, "SQL_CREATE_SCHEMA" ); break; case SQL_CREATE_TABLE: sprintf((char*) s, "SQL_CREATE_TABLE" ); break; case SQL_CREATE_TRANSLATION: sprintf((char*) s, "SQL_CREATE_TRANSLATION" ); break; case SQL_CREATE_VIEW: sprintf((char*) s, "SQL_CREATE_VIEW" ); break; case SQL_CURSOR_COMMIT_BEHAVIOR: sprintf((char*) s, "SQL_CURSOR_COMMIT_BEHAVIOR" ); break; case SQL_CURSOR_ROLLBACK_BEHAVIOR: sprintf((char*) s, "SQL_CURSOR_ROLLBACK_BEHAVIOR" ); break; case SQL_CURSOR_SENSITIVITY: sprintf((char*) s, "SQL_CURSOR_SENSITIVITY" ); break; case SQL_DATA_SOURCE_NAME: sprintf((char*) s, "SQL_DATA_SOURCE_NAME" ); break; case SQL_DATA_SOURCE_READ_ONLY: sprintf((char*) s, "SQL_DATA_SOURCE_READ_ONLY" ); break; case SQL_DATABASE_NAME: sprintf((char*) s, "SQL_DATABASE_NAME" ); break; case SQL_DATETIME_LITERALS: sprintf((char*) s, "SQL_DATETIME_LITERALS" ); break; case SQL_DBMS_NAME: sprintf((char*) s, "SQL_DBMS_NAME" ); break; case SQL_DBMS_VER: sprintf((char*) s, "SQL_DBMS_VER" ); break; case SQL_DDL_INDEX: sprintf((char*) s, "SQL_DDL_INDEX" ); break; case SQL_DEFAULT_TXN_ISOLATION: sprintf((char*) s, "SQL_DEFAULT_TXN_ISOLATION" ); break; case SQL_DESCRIBE_PARAMETER: sprintf((char*) s, "SQL_DESCRIBE_PARAMETER" ); break; case SQL_DRIVER_NAME: sprintf((char*) s, "SQL_DRIVER_NAME" ); break; case SQL_DRIVER_HLIB: sprintf((char*) s, "SQL_DRIVER_HLIB" ); break; case SQL_DRIVER_HSTMT: sprintf((char*) s, "SQL_DRIVER_HSTMT" ); break; case SQL_DRIVER_ODBC_VER: sprintf((char*) s, "SQL_DRIVER_ODBC_VER" ); break; case SQL_DRIVER_VER: sprintf((char*) s, "SQL_DRIVER_VER" ); break; case SQL_ODBC_VER: sprintf((char*) s, "SQL_ODBC_VER" ); break; case SQL_DROP_ASSERTION: sprintf((char*) s, "SQL_DROP_ASSERTION" ); break; case SQL_DROP_CHARACTER_SET: sprintf((char*) s, "SQL_DROP_CHARACTER_SET" ); break; case SQL_DROP_COLLATION: sprintf((char*) s, "SQL_DROP_COLLATION" ); break; case SQL_DROP_DOMAIN: sprintf((char*) s, "SQL_DROP_DOMAIN" ); break; case SQL_DROP_SCHEMA: sprintf((char*) s, "SQL_DROP_SCHEMA" ); break; case SQL_DROP_TABLE: sprintf((char*) s, "SQL_DROP_TABLE" ); break; case SQL_DROP_TRANSLATION: sprintf((char*) s, "SQL_DROP_TRANSLATION" ); break; case SQL_DROP_VIEW: sprintf((char*) s, "SQL_DROP_VIEW" ); break; case SQL_DYNAMIC_CURSOR_ATTRIBUTES1: sprintf((char*) s, "SQL_DYNAMIC_CURSOR_ATTRIBUTES1" ); break; case SQL_DYNAMIC_CURSOR_ATTRIBUTES2: sprintf((char*) s, "SQL_EXPRESSIONS_IN_ORDERBY" ); break; case SQL_EXPRESSIONS_IN_ORDERBY: sprintf((char*) s, "SQL_EXPRESSIONS_IN_ORDERBY" ); break; case SQL_FILE_USAGE: sprintf((char*) s, "SQL_FILE_USAGE" ); break; case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1: sprintf((char*) s, "SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1" ); break; case SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2: sprintf((char*) s, "SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2" ); break; case SQL_GETDATA_EXTENSIONS: sprintf((char*) s, "SQL_GETDATA_EXTENSIONS" ); break; case SQL_GROUP_BY: sprintf((char*) s, "SQL_GROUP_BY" ); break; case SQL_IDENTIFIER_CASE: sprintf((char*) s, "SQL_IDENTIFIER_CASE" ); break; case SQL_IDENTIFIER_QUOTE_CHAR: sprintf((char*) s, "SQL_IDENTIFIER_QUOTE_CHAR" ); break; case SQL_INDEX_KEYWORDS: sprintf((char*) s, "SQL_INDEX_KEYWORDS" ); break; case SQL_INFO_SCHEMA_VIEWS: sprintf((char*) s, "SQL_INFO_SCHEMA_VIEWS" ); break; case SQL_INSERT_STATEMENT: sprintf((char*) s, "SQL_INSERT_STATEMENT" ); break; case SQL_INTEGRITY: sprintf((char*) s, "SQL_INTEGRITY" ); break; case SQL_KEYSET_CURSOR_ATTRIBUTES1: sprintf((char*) s, "SQL_KEYSET_CURSOR_ATTRIBUTES1" ); break; case SQL_KEYSET_CURSOR_ATTRIBUTES2: sprintf((char*) s, "SQL_KEYSET_CURSOR_ATTRIBUTES2" ); break; case SQL_KEYWORDS: sprintf((char*) s, "SQL_KEYWORDS" ); break; case SQL_LIKE_ESCAPE_CLAUSE: sprintf((char*) s, "SQL_LIKE_ESCAPE_CLAUSE" ); break; case SQL_MAX_ASYNC_CONCURRENT_STATEMENTS: sprintf((char*) s, "SQL_MAX_ASYNC_CONCURRENT_STATEMENTS" ); break; case SQL_MAX_BINARY_LITERAL_LEN: sprintf((char*) s, "SQL_MAX_BINARY_LITERAL_LEN" ); break; case SQL_MAX_CATALOG_NAME_LEN: sprintf((char*) s, "SQL_MAX_CATALOG_NAME_LEN" ); break; case SQL_MAX_CHAR_LITERAL_LEN: sprintf((char*) s, "SQL_MAX_CHAR_LITERAL_LEN" ); break; case SQL_MAX_COLUMN_NAME_LEN: sprintf((char*) s, "SQL_MAX_COLUMN_NAME_LEN" ); break; case SQL_MAX_COLUMNS_IN_GROUP_BY: sprintf((char*) s, "SQL_MAX_COLUMNS_IN_GROUP_BY" ); break; case SQL_MAX_COLUMNS_IN_INDEX: sprintf((char*) s, "SQL_MAX_COLUMNS_IN_INDEX" ); break; case SQL_MAX_COLUMNS_IN_SELECT: sprintf((char*) s, "SQL_MAX_COLUMNS_IN_SELECT" ); break; case SQL_MAX_COLUMNS_IN_ORDER_BY: sprintf((char*) s, "SQL_MAX_COLUMNS_IN_ORDER_BY" ); break; case SQL_MAX_COLUMNS_IN_TABLE: sprintf((char*) s, "SQL_MAX_COLUMNS_IN_TABLE" ); break; case SQL_MAX_CONCURRENT_ACTIVITIES: sprintf((char*) s, "SQL_MAX_CONCURRENT_ACTIVITIES" ); break; case SQL_MAX_CURSOR_NAME_LEN: sprintf((char*) s, "SQL_MAX_CURSOR_NAME_LEN" ); break; case SQL_MAX_DRIVER_CONNECTIONS: sprintf((char*) s, "SQL_MAX_DRIVER_CONNECTIONS" ); break; case SQL_MAX_IDENTIFIER_LEN: sprintf((char*) s, "SQL_MAX_IDENTIFIER_LEN" ); break; case SQL_MAX_INDEX_SIZE: sprintf((char*) s, "SQL_MAX_INDEX_SIZE" ); break; case SQL_MAX_PROCEDURE_NAME_LEN: sprintf((char*) s, "SQL_MAX_PROCEDURE_NAME_LEN" ); break; case SQL_MAX_ROW_SIZE: sprintf((char*) s, "SQL_MAX_ROW_SIZE" ); break; case SQL_MAX_ROW_SIZE_INCLUDES_LONG: sprintf((char*) s, "SQL_MAX_ROW_SIZE_INCLUDES_LONG" ); break; case SQL_MAX_SCHEMA_NAME_LEN: sprintf((char*) s, "SQL_MAX_SCHEMA_NAME_LEN" ); break; case SQL_MAX_STATEMENT_LEN: sprintf((char*) s, "SQL_MAX_STATEMENT_LEN" ); break; case SQL_MAX_TABLE_NAME_LEN: sprintf((char*) s, "SQL_MAX_TABLE_NAME_LEN" ); break; case SQL_MAX_TABLES_IN_SELECT: sprintf((char*) s, "SQL_MAX_TABLES_IN_SELECT" ); break; case SQL_MAX_USER_NAME_LEN: sprintf((char*) s, "SQL_MAX_USER_NAME_LEN" ); break; case SQL_MULT_RESULT_SETS: sprintf((char*) s, "SQL_MULT_RESULT_SETS" ); break; case SQL_MULTIPLE_ACTIVE_TXN: sprintf((char*) s, "SQL_MULTIPLE_ACTIVE_TXN" ); break; case SQL_NEED_LONG_DATA_LEN: sprintf((char*) s, "SQL_NEED_LONG_DATA_LEN" ); break; case SQL_NON_NULLABLE_COLUMNS: sprintf((char*) s, "SQL_NON_NULLABLE_COLUMNS" ); break; case SQL_NULL_COLLATION: sprintf((char*) s, "SQL_NULL_COLLATION" ); break; case SQL_NUMERIC_FUNCTIONS: sprintf((char*) s, "SQL_NUMERIC_FUNCTIONS" ); break; case SQL_ODBC_INTERFACE_CONFORMANCE: sprintf((char*) s, "SQL_ODBC_INTERFACE_CONFORMANCE" ); break; case SQL_OJ_CAPABILITIES: sprintf((char*) s, "SQL_OJ_CAPABILITIES" ); break; case SQL_ORDER_BY_COLUMNS_IN_SELECT: sprintf((char*) s, "SQL_ORDER_BY_COLUMNS_IN_SELECT" ); break; case SQL_PARAM_ARRAY_ROW_COUNTS: sprintf((char*) s, "SQL_PARAM_ARRAY_ROW_COUNTS" ); break; case SQL_PARAM_ARRAY_SELECTS: sprintf((char*) s, "SQL_PARAM_ARRAY_SELECTS" ); break; case SQL_PROCEDURE_TERM: sprintf((char*) s, "SQL_PROCEDURE_TERM" ); break; case SQL_PROCEDURES: sprintf((char*) s, "SQL_PROCEDURES" ); break; case SQL_QUOTED_IDENTIFIER_CASE: sprintf((char*) s, "SQL_QUOTED_IDENTIFIER_CASE" ); break; case SQL_ROW_UPDATES: sprintf((char*) s, "SQL_ROW_UPDATES" ); break; case SQL_SCHEMA_TERM: sprintf((char*) s, "SQL_SCHEMA_TERM" ); break; case SQL_SCHEMA_USAGE: sprintf((char*) s, "SQL_SCHEMA_USAGE" ); break; case SQL_SCROLL_OPTIONS: sprintf((char*) s, "SQL_SCROLL_OPTIONS" ); break; case SQL_SEARCH_PATTERN_ESCAPE: sprintf((char*) s, "SQL_SEARCH_PATTERN_ESCAPE" ); break; case SQL_SERVER_NAME: sprintf((char*) s, "SQL_SERVER_NAME" ); break; case SQL_SPECIAL_CHARACTERS: sprintf((char*) s, "SQL_SPECIAL_CHARACTERS" ); break; case SQL_SQL_CONFORMANCE: sprintf((char*) s, "SQL_SQL_CONFORMANCE" ); break; case SQL_SQL92_DATETIME_FUNCTIONS: sprintf((char*) s, "SQL_SQL92_DATETIME_FUNCTIONS" ); break; case SQL_SQL92_FOREIGN_KEY_DELETE_RULE: sprintf((char*) s, "SQL_SQL92_FOREIGN_KEY_DELETE_RULE" ); break; case SQL_SQL92_FOREIGN_KEY_UPDATE_RULE: sprintf((char*) s, "SQL_SQL92_FOREIGN_KEY_UPDATE_RULE" ); break; case SQL_SQL92_GRANT: sprintf((char*) s, "SQL_SQL92_GRANT" ); break; case SQL_SQL92_NUMERIC_VALUE_FUNCTIONS: sprintf((char*) s, "SQL_SQL92_NUMERIC_VALUE_FUNCTIONS" ); break; case SQL_SQL92_PREDICATES: sprintf((char*) s, "SQL_SQL92_PREDICATES" ); break; case SQL_SQL92_RELATIONAL_JOIN_OPERATORS: sprintf((char*) s, "SQL_SQL92_RELATIONAL_JOIN_OPERATORS" ); break; case SQL_SQL92_REVOKE: sprintf((char*) s, "SQL_SQL92_REVOKE" ); break; case SQL_SQL92_ROW_VALUE_CONSTRUCTOR: sprintf((char*) s, "SQL_SQL92_ROW_VALUE_CONSTRUCTOR" ); break; case SQL_SQL92_STRING_FUNCTIONS: sprintf((char*) s, "SQL_SQL92_STRING_EXPRESSIONS" ); break; case SQL_SQL92_VALUE_EXPRESSIONS: sprintf((char*) s, "SQL_SQL92_VALUE_EXPRESSIONS" ); break; case SQL_STANDARD_CLI_CONFORMANCE: sprintf((char*) s, "SQL_STANDARD_CLI_CONFORMANCE" ); break; case SQL_STATIC_CURSOR_ATTRIBUTES1: sprintf((char*) s, "SQL_STATIC_CURSOR_ATTRIBUTES1" ); break; case SQL_STATIC_CURSOR_ATTRIBUTES2: sprintf((char*) s, "SQL_STATIC_CURSOR_ATTRIBUTES2" ); break; case SQL_STRING_FUNCTIONS: sprintf((char*) s, "SQL_STRING_FUNCTIONS" ); break; case SQL_SUBQUERIES: sprintf((char*) s, "SQL_SUBQUERIES" ); break; case SQL_SYSTEM_FUNCTIONS: sprintf((char*) s, "SQL_SYSTEM_FUNCTIONS" ); break; case SQL_TABLE_TERM: sprintf((char*) s, "SQL_TABLE_TERM" ); break; case SQL_TIMEDATE_ADD_INTERVALS: sprintf((char*) s, "SQL_TIMEDATE_ADD_INTERVALS" ); break; case SQL_TIMEDATE_DIFF_INTERVALS: sprintf((char*) s, "SQL_TIMEDATE_DIFF_INTERVALS" ); break; case SQL_TIMEDATE_FUNCTIONS: sprintf((char*) s, "SQL_TIMEDATE_FUNCTIONS" ); break; case SQL_TXN_CAPABLE: sprintf((char*) s, "SQL_TXN_CAPABLE" ); break; case SQL_TXN_ISOLATION_OPTION: sprintf((char*) s, "SQL_TXN_ISOLATION_OPTION" ); break; case SQL_UNION: sprintf((char*) s, "SQL_UNION" ); break; case SQL_USER_NAME: sprintf((char*) s, "SQL_USER_NAME" ); break; case SQL_XOPEN_CLI_YEAR: sprintf((char*) s, "SQL_XOPEN_CLI_YEAR" ); break; case SQL_FETCH_DIRECTION: sprintf((char*) s, "SQL_FETCH_DIRECTION" ); break; case SQL_LOCK_TYPES: sprintf((char*) s, "SQL_LOCK_TYPES" ); break; case SQL_ODBC_API_CONFORMANCE: sprintf((char*) s, "SQL_ODBC_API_CONFORMANCE" ); break; case SQL_ODBC_SQL_CONFORMANCE: sprintf((char*) s, "SQL_ODBC_SQL_CONFORMANCE" ); break; case SQL_POS_OPERATIONS: sprintf((char*) s, "SQL_POS_OPERATIONS" ); break; case SQL_POSITIONED_STATEMENTS: sprintf((char*) s, "SQL_POSITIONED_STATEMENTS" ); break; case SQL_SCROLL_CONCURRENCY: sprintf((char*) s, "SQL_SCROLL_CONCURRENCY" ); break; case SQL_STATIC_SENSITIVITY: sprintf((char*) s, "SQL_STATIC_SENSITIVITY" ); break; case SQL_OUTER_JOINS: sprintf((char*) s, "SQL_OUTER_JOINS" ); break; case SQL_DRIVER_AWARE_POOLING_SUPPORTED: sprintf((char*) s, "SQL_DRIVER_AWARE_POOLING_SUPPORTED" ); break; default: sprintf((char*) s, "%d", (int)type ); } return (char*) s; } /* * convert from type 3 error states to type 2 */ struct state_map { char ver2[6]; char ver3[6]; }; static const struct state_map state_mapping_3_2[] = { { "01S03", "01001" }, { "01S04", "01001" }, { "22003", "HY019" }, { "22005", "22018" }, { "22008", "22007" }, { "24000", "07005" }, { "37000", "42000" }, { "70100", "HY018" }, { "S0001", "42S01" }, { "S0002", "42S02" }, { "S0011", "42S11" }, { "S0012", "42S12" }, { "S0021", "42S21" }, { "S0022", "42S22" }, { "S0023", "42S23" }, { "S1000", "HY000" }, { "S1001", "HY001" }, { "S1002", "07009" }, { "S1003", "HY003" }, { "S1004", "HY004" }, { "S1007", "HY007" }, { "S1008", "HY008" }, { "S1009", "HY009" }, { "S1010", "HY010" }, { "S1011", "HY011" }, { "S1012", "HY012" }, { "S1090", "HY090" }, { "S1091", "HY091" }, { "S1092", "HY092" }, { "S1093", "07009" }, { "S1096", "HY096" }, { "S1097", "HY097" }, { "S1098", "HY098" }, { "S1099", "HY099" }, { "S1100", "HY100" }, { "S1101", "HY101" }, { "S1103", "HY103" }, { "S1104", "HY104" }, { "S1105", "HY105" }, { "S1106", "HY106" }, { "S1107", "HY107" }, { "S1108", "HY108" }, { "S1109", "HY109" }, { "S1110", "HY110" }, { "S1111", "HY111" }, { "S1C00", "HYC00" }, { "S1T00", "HYT00" }, { "", "" } }; /* * the book doesn't say that it should map ODBC 2 states to ODBC 3 * but the MS Windows DM can be seen to do just that */ static const struct state_map state_mapping_2_3[] = { { "01S03", "01001" }, { "01S04", "01001" }, { "22005", "22018" }, { "37000", "42000" }, { "70100", "HY018" }, { "S0001", "42S01" }, { "S0002", "42S02" }, { "S0011", "42S11" }, { "S0012", "42S12" }, { "S0021", "42S21" }, { "S0022", "42S22" }, { "S0023", "42S23" }, { "S1000", "HY000" }, { "S1001", "HY001" }, { "S1002", "07009" }, { "S1003", "HY003" }, { "S1004", "HY004" }, { "S1007", "HY007" }, { "S1008", "HY008" }, { "S1009", "HY009" }, { "S1010", "HY010" }, { "S1011", "HY011" }, { "S1012", "HY012" }, { "S1090", "HY090" }, { "S1091", "HY091" }, { "S1092", "HY092" }, { "S1093", "07009" }, { "S1096", "HY096" }, { "S1097", "HY097" }, { "S1098", "HY098" }, { "S1099", "HY099" }, { "S1100", "HY100" }, { "S1101", "HY101" }, { "S1103", "HY103" }, { "S1104", "HY104" }, { "S1105", "HY105" }, { "S1106", "HY106" }, { "S1107", "HY107" }, { "S1108", "HY108" }, { "S1109", "HY109" }, { "S1110", "HY110" }, { "S1111", "HY111" }, { "S1C00", "HYC00" }, { "S1T00", "HYT00" }, { "", "" } }; /* * map ODBC3 states to/from ODBC 2 */ void __map_error_state( char * state, int requested_version ) { const struct state_map *ptr; if ( !state ) return; if ( requested_version == SQL_OV_ODBC2 ) { ptr = state_mapping_3_2; while( ptr -> ver3[0] ) { if ( strcmp( ptr -> ver3, state ) == 0 ) { strcpy( state, ptr -> ver2 ); return; } ptr ++; } } else if ( requested_version >= SQL_OV_ODBC3 ) { ptr = state_mapping_2_3; while( ptr -> ver2[0] ) { if ( strcmp( ptr -> ver2, state ) == 0 ) { strcpy( state, ptr -> ver3 ); return; } ptr ++; } } } void __map_error_state_w( SQLWCHAR * wstate, int requested_version ) { char state[ 6 ]; unicode_to_ansi_copy( state, 6, wstate, SQL_NTS, NULL, NULL ); __map_error_state( state, requested_version ); ansi_to_unicode_copy( wstate, state, SQL_NTS, NULL, NULL ); } /* * return the process id as a string */ char * __get_pid( SQLCHAR * str ) { sprintf((char *) str, "%d", getpid()); return (char*)str; } /* * take a SQL string and its length indicator and format it for * display */ char * __string_with_length( SQLCHAR *ostr, SQLCHAR *instr, SQLINTEGER len ) { if ( instr == NULL ) { sprintf((char*) ostr, "[NULL]" ); } else if ( len == SQL_NTS ) { if ( strlen((char*) instr ) > LOG_MESSAGE_LEN ) { sprintf((char*) ostr, "[%.*s...][length = %ld (SQL_NTS)]", LOG_MESSAGE_LEN, instr, (long int)strlen((char*) instr )); } else { sprintf((char*) ostr, "[%s][length = %ld (SQL_NTS)]", instr, (long int)strlen((char*) instr )); } } else { if ( len < LOG_MESSAGE_LEN ) sprintf((char*) ostr, "[%.*s][length = %d]", (int)len, instr, (int)len ); else sprintf((char*) ostr, "[%.*s...][length = %d]", LOG_MESSAGE_LEN, instr, (int)len ); } return (char*)ostr; } char * __wstring_with_length( SQLCHAR *ostr, SQLWCHAR *instr, SQLINTEGER len ) { int i = 0; char tmp[ LOG_MESSAGE_LEN ]; if ( instr == NULL ) { sprintf((char*) ostr, "[NULL]" ); } else if ( len == SQL_NTS ) { if ( ( i = wide_strlen( instr ) ) < LOG_MESSAGE_LEN ) { strcpy((char*) ostr, "[" ); unicode_to_ansi_copy((char*) ostr + 1, LOG_MESSAGE_LEN, instr, i, NULL, NULL ); strcat((char*) ostr, "]" ); } else { strcpy((char*) ostr, "[" ); unicode_to_ansi_copy((char*) ostr + 1, LOG_MESSAGE_LEN, instr, LOG_MESSAGE_LEN, NULL, NULL ); strcat((char*) ostr, "...]" ); } sprintf( tmp, "[length = %d (SQL_NTS)]", i ); strcat((char*) ostr, tmp ); } else { if ( len < LOG_MESSAGE_LEN ) { strcpy((char*) ostr, "[" ); unicode_to_ansi_copy((char*) ostr + 1, LOG_MESSAGE_LEN, instr, len, NULL, NULL ); strcat((char*) ostr, "]" ); } else { strcpy((char*) ostr, "[" ); unicode_to_ansi_copy((char*) ostr + 1, LOG_MESSAGE_LEN, instr, LOG_MESSAGE_LEN, NULL, NULL ); strcat((char*) ostr, "...]" ); } sprintf( tmp, "[length = %d]", (int)len ); strcat((char*) ostr, tmp ); } return (char*)ostr; } /* * replace password with **** */ char * __string_with_length_pass( SQLCHAR *out, SQLCHAR *str, SQLINTEGER len ) { char *p = __string_with_length( out, str, len ); /* * the string will be of the form [text] */ if ( str ) { char * ptr = p + 1; while ( *ptr && *ptr != ']' ) { *ptr = '*'; ptr ++; } } return p; } char * __wstring_with_length_pass( SQLCHAR *out, SQLWCHAR *str, SQLINTEGER len ) { char *p = __wstring_with_length( out, str, len ); /* * the string will be of the form [text] */ if ( str ) { char * ptr = p + 1; while ( *ptr && *ptr != ']' ) { *ptr = '*'; ptr ++; } } return p; } /* * mask out PWD=str; * wont work on lower case pwd but there you go */ char * __string_with_length_hide_pwd( SQLCHAR *out, SQLCHAR *str, SQLINTEGER len ) { char *p = __string_with_length( out, str, len ); if ( str ) { char *ptr; ptr = strstr( p, "PWD=" ); while ( ptr ) { ptr += 4; while ( *ptr && *ptr != ';' && *ptr != ']' ) { *ptr = '*'; ptr ++; } ptr = strstr( ptr, "PWD=" ); } } return p; } char * __wstring_with_length_hide_pwd( SQLCHAR *out, SQLWCHAR *str, SQLINTEGER len ) { char *p = __wstring_with_length( out, str, len ); return p; } /* * display a C type as a string */ char * __c_as_text( SQLINTEGER type ) { switch( type ) { case SQL_C_CHAR: return "SQL_C_CHAR"; case SQL_C_LONG: return "SQL_C_LONG"; case SQL_C_SHORT: return "SQL_C_SHORT"; case SQL_C_FLOAT: return "SQL_C_FLOAT"; case SQL_C_DOUBLE: return "SQL_C_DOUBLE"; case SQL_C_NUMERIC: return "SQL_C_NUMERIC"; case SQL_C_DEFAULT: return "SQL_C_DEFAULT"; case SQL_C_DATE: return "SQL_C_DATE"; case SQL_C_TIME: return "SQL_C_TIME"; case SQL_C_TIMESTAMP: return "SQL_C_TIMESTAMP"; case SQL_C_TYPE_DATE: return "SQL_C_TYPE_DATE"; case SQL_C_TYPE_TIME: return "SQL_C_TYPE_TIME"; case SQL_C_TYPE_TIMESTAMP: return "SQL_C_TYPE_TIMESTAMP "; case SQL_C_INTERVAL_YEAR: return "SQL_C_INTERVAL_YEAR "; case SQL_C_INTERVAL_MONTH: return "SQL_C_INTERVAL_MONTH"; case SQL_C_INTERVAL_DAY: return "SQL_C_INTERVAL_DAY "; case SQL_C_INTERVAL_HOUR: return "SQL_C_INTERVAL_HOUR"; case SQL_C_INTERVAL_MINUTE: return "SQL_C_INTERVAL_MINUTE"; case SQL_C_INTERVAL_SECOND: return "SQL_C_INTERVAL_SECOND"; case SQL_C_INTERVAL_YEAR_TO_MONTH: return "SQL_C_INTERVAL_YEAR_TO_MONTH"; case SQL_C_INTERVAL_DAY_TO_HOUR: return "SQL_C_INTERVAL_DAY_TO_HOUR "; case SQL_C_INTERVAL_DAY_TO_MINUTE: return "SQL_C_INTERVAL_DAY_TO_MINUTE"; case SQL_C_INTERVAL_DAY_TO_SECOND: return "SQL_C_INTERVAL_DAY_TO_SECOND"; case SQL_C_INTERVAL_HOUR_TO_MINUTE: return "SQL_C_INTERVAL_HOUR_TO_MINUTE"; case SQL_C_INTERVAL_HOUR_TO_SECOND: return "SQL_C_INTERVAL_HOUR_TO_SECOND"; case SQL_C_INTERVAL_MINUTE_TO_SECOND: return "SQL_C_INTERVAL_MINUTE_TO_SECOND"; case SQL_C_BINARY: return "SQL_C_BINARY"; case SQL_C_BIT: return "SQL_C_BIT"; case SQL_C_SBIGINT: return "SQL_C_SBIGINT"; case SQL_C_UBIGINT: return "SQL_C_UBIGINT"; case SQL_C_TINYINT: return "SQL_C_TINYINT"; case SQL_C_SLONG: return "SQL_C_SLONG"; case SQL_C_SSHORT: return "SQL_C_SSHORT"; case SQL_C_STINYINT: return "SQL_C_STINYINT"; case SQL_C_ULONG: return "SQL_C_ULONG"; case SQL_C_USHORT: return "SQL_C_USHORT"; case SQL_C_UTINYINT: return "SQL_C_UTINYINT"; case SQL_C_GUID: return "SQL_C_GUID"; case SQL_C_WCHAR: return "SQL_C_WCHAR"; default: return ""; } } /* * display a SQL type as a string */ char * __sql_as_text( SQLINTEGER type ) { switch( type ) { case SQL_DECIMAL: return "SQL_DECIMAL"; case SQL_VARCHAR: return "SQL_VARCHAR"; case SQL_LONGVARCHAR: return "SQL_LONGVARCHAR"; case SQL_LONGVARBINARY: return "SQL_LONGVARBINARY"; case SQL_C_BINARY: return "SQL_C_BINARY"; case SQL_VARBINARY: return "SQL_VARBINARY"; case SQL_CHAR: return "SQL_CHAR"; case SQL_WCHAR: return "SQL_WCHAR"; case SQL_WVARCHAR: return "SQL_WVARCHAR"; case SQL_INTEGER: return "SQL_INTEGER"; case SQL_C_ULONG: return "SQL_C_ULONG"; case SQL_C_SLONG: return "SQL_C_SLONG"; case SQL_BIGINT: return "SQL_BIGINT"; case SQL_C_UBIGINT: return "SQL_C_SBIGINT"; case SQL_C_SBIGINT: return "SQL_C_SBIGINT"; case SQL_SMALLINT: return "SQL_SMALLINT"; case SQL_C_USHORT: return "SQL_C_USHORT"; case SQL_C_SSHORT: return "SQL_C_SSHORT"; case SQL_TINYINT: return "SQL_TINYINT"; case SQL_C_UTINYINT: return "SQL_C_UTINYINT"; case SQL_C_STINYINT: return "SQL_C_STINYINT"; case SQL_BIT: return "SQL_BIT"; case SQL_NUMERIC: return "SQL_NUMERIC"; case SQL_REAL: return "SQL_REAL"; case SQL_DOUBLE: return "SQL_DOUBLE"; case SQL_FLOAT: return "SQL_FLOAT"; case SQL_TYPE_DATE: return "SQL_TYPE_DATE"; case SQL_DATE: return "SQL_DATE"; case SQL_TYPE_TIME: return "SQL_TYPE_TIME"; case SQL_TIME: return "SQL_TIME"; case SQL_TYPE_TIMESTAMP: return "SQL_TYPE_TIMESTAMP"; case SQL_TIMESTAMP: return "SQL_TIMESTAMP"; case SQL_INTERVAL_YEAR: return "SQL_INTERVAL_YEAR "; case SQL_INTERVAL_MONTH: return "SQL_INTERVAL_MONTH"; case SQL_INTERVAL_DAY: return "SQL_INTERVAL_DAY "; case SQL_INTERVAL_HOUR: return "SQL_INTERVAL_HOUR"; case SQL_INTERVAL_MINUTE: return "SQL_INTERVAL_MINUTE"; case SQL_INTERVAL_SECOND: return "SQL_INTERVAL_SECOND"; case SQL_INTERVAL_YEAR_TO_MONTH: return "SQL_INTERVAL_YEAR_TO_MONTH"; case SQL_INTERVAL_DAY_TO_HOUR: return "SQL_INTERVAL_DAY_TO_HOUR "; case SQL_INTERVAL_DAY_TO_MINUTE: return "SQL_INTERVAL_DAY_TO_MINUTE"; case SQL_INTERVAL_DAY_TO_SECOND: return "SQL_INTERVAL_DAY_TO_SECOND"; case SQL_INTERVAL_HOUR_TO_MINUTE: return "SQL_INTERVAL_HOUR_TO_MINUTE"; case SQL_INTERVAL_HOUR_TO_SECOND: return "SQL_INTERVAL_HOUR_TO_SECOND"; case SQL_INTERVAL_MINUTE_TO_SECOND: return "SQL_INTERVAL_MINUTE_TO_SECOND"; default: return ""; } } /* * convert a return type as a string */ char * __get_return_status( SQLRETURN ret, SQLCHAR *buffer ) { switch ( ret ) { case SQL_SUCCESS: return "SQL_SUCCESS"; case SQL_ERROR: return "SQL_ERROR"; case SQL_SUCCESS_WITH_INFO: return "SQL_SUCCESS_WITH_INFO"; case SQL_NO_DATA: return "SQL_NO_DATA"; case SQL_STILL_EXECUTING: return "SQL_STILL_EXECUTING"; case SQL_INVALID_HANDLE: return "SQL_INVALID_HANDLE"; case SQL_NEED_DATA: return "SQL_NEED_DATA"; case SQL_PARAM_DATA_AVAILABLE: return "SQL_PARAM_DATA_AVAILABLE"; default: sprintf((char*) buffer, "UNKNOWN(%d)", ret ); return (char*)buffer; } } int wide_ansi_strncmp( SQLWCHAR *str1, char *str2, int len ) { char c; while( len > 0 ) { if ( *str1 == 0 || *str2 == 0 ) break; c = (char) *str1; if ( c != *str2 ) return *str2 - c; str1 ++; str2 ++; len --; } c = (char) *str1; return *str2 - c; } SQLWCHAR *wide_strcpy( SQLWCHAR *str1, SQLWCHAR *str2 ) { SQLWCHAR *retp = str1; if ( !str1 ) return NULL; while( *str2 ) { *str1 = *str2; str1 ++; str2 ++; } *str1 = 0; return retp; } SQLWCHAR *wide_strncpy( SQLWCHAR *str1, SQLWCHAR *str2, int buffer_length ) { SQLWCHAR *retp = str1; if ( !str1 ) return NULL; while( *str2 && buffer_length > 0 ) { *str1 = *str2; str1 ++; str2 ++; buffer_length --; } *str1 = 0; return retp; } SQLWCHAR *wide_strcat( SQLWCHAR *str1, SQLWCHAR *str2 ) { SQLWCHAR *retp = str1; while( *str1 ) { str1 ++; } while( *str2 ) { *str1 = *str2; str1 ++; str2 ++; } *str1 = 0; return retp; } SQLWCHAR *wide_strdup( SQLWCHAR *str1 ) { SQLWCHAR *ptr; int len = 0; while( str1[ len ] ) len ++; ptr = malloc( sizeof( SQLWCHAR ) * ( len + 1 )); if ( !ptr ) return NULL; return wide_strcpy( ptr, str1 ); } int wide_strlen( SQLWCHAR *str1 ) { int len = 0; while( str1[ len ] ) { len ++; } return len; } static int check_error_order( ERROR *e1, ERROR *e2, EHEAD *head ) { char *s1, *s2; int ret; /* * as far as I can see, a simple strcmp gives the order we need */ s1 = unicode_to_ansi_alloc( e1 -> sqlstate, SQL_NTS, __get_connection( head ), NULL); s2 = unicode_to_ansi_alloc( e2 -> sqlstate, SQL_NTS, __get_connection( head ), NULL ); ret = strcmp( s1, s2 ); free( s1 ); free( s2 ); return ret; } /* * insert the error into the list, making sure its in the correct * order */ static void insert_into_error_list( EHEAD *error_header, ERROR *e1 ) { error_header -> sql_error_head.error_count ++; if ( error_header -> sql_error_head.error_list_head ) { /* * find where in the list it needs to go */ ERROR *curr, *prev; prev = NULL; curr = error_header -> sql_error_head.error_list_head; while ( curr && check_error_order( curr, e1, error_header ) >= 0 ) { prev = curr; curr = curr -> next; } if ( curr ) { if ( prev ) { /* * in the middle */ e1 -> next = curr; e1 -> prev = curr -> prev; curr -> prev -> next = e1; curr -> prev = e1; } else { /* * at the beginning */ e1 -> next = error_header -> sql_error_head.error_list_head; e1 -> prev = NULL; e1 -> next -> prev = e1; error_header -> sql_error_head.error_list_head = e1; } } else { /* * at the end */ e1 -> next = NULL; e1 -> prev = error_header -> sql_error_head.error_list_tail; e1 -> prev -> next = e1; error_header -> sql_error_head.error_list_tail = e1; } } else { e1 -> next = e1 -> prev = NULL; error_header -> sql_error_head.error_list_tail = e1; error_header -> sql_error_head.error_list_head = e1; } } static void insert_into_diag_list( EHEAD *error_header, ERROR *e2 ) { error_header -> sql_diag_head.internal_count ++; if ( error_header -> sql_diag_head.internal_list_head ) { /* * find where in the list it needs to go */ ERROR *curr, *prev; prev = NULL; curr = error_header -> sql_diag_head.internal_list_head; while ( curr && check_error_order( curr, e2, error_header ) >= 0 ) { prev = curr; curr = curr -> next; } if ( curr ) { if ( prev ) { /* * in the middle */ e2 -> next = curr; e2 -> prev = curr -> prev; curr -> prev -> next = e2; curr -> prev = e2; } else { /* * at the beginning */ e2 -> next = error_header -> sql_diag_head.internal_list_head; e2 -> prev = NULL; e2 -> next -> prev = e2; error_header -> sql_diag_head.internal_list_head = e2; } } else { /* * at the end */ e2 -> next = NULL; e2 -> prev = error_header -> sql_diag_head.internal_list_tail; e2 -> prev -> next = e2; error_header -> sql_diag_head.internal_list_tail = e2; } } else { e2 -> next = e2 -> prev = NULL; error_header -> sql_diag_head.internal_list_tail = e2; error_header -> sql_diag_head.internal_list_head = e2; } } void __post_internal_error_ex( EHEAD *error_header, SQLCHAR *sqlstate, SQLINTEGER native_error, SQLCHAR *message_text, int class_origin, int subclass_origin ) { SQLCHAR msg[ SQL_MAX_MESSAGE_LENGTH + 32 ]; /* * add our prefix */ strcpy((char*) msg, ERROR_PREFIX ); strcat((char*) msg, (char*) message_text ); __post_internal_error_ex_noprefix( error_header, sqlstate, native_error, msg, class_origin, subclass_origin ); } void __post_internal_error_ex_noprefix( EHEAD *error_header, SQLCHAR *sqlstate, SQLINTEGER native_error, SQLCHAR *msg, int class_origin, int subclass_origin ) { /* * create a error block and add to the lists, * leave space for the error prefix */ ERROR *e1, *e2; DMHDBC conn = __get_connection( error_header ); e1 = malloc( sizeof( ERROR )); if (e1 == NULL) return; e2 = malloc( sizeof( ERROR )); if (e2 == NULL) { free(e1); return; } memset( e1, 0, sizeof( *e1 )); memset( e2, 0, sizeof( *e2 )); e1 -> native_error = native_error; e2 -> native_error = native_error; ansi_to_unicode_copy(e1 -> sqlstate, (char*)sqlstate, SQL_NTS, conn, NULL ); wide_strcpy( e2 -> sqlstate, e1 -> sqlstate ); e1 -> msg = ansi_to_unicode_alloc( msg, SQL_NTS, conn, NULL ); if ( !e1 -> msg ) { free( e1 ); free( e2 ); return; } e2 -> msg = wide_strdup( e1 -> msg ); if ( !e2 -> msg ) { free( e1 -> msg); free( e1 ); free( e2 ); return; } e1 -> return_val = SQL_ERROR; e2 -> return_val = SQL_ERROR; e1 -> diag_column_number_ret = SQL_NO_COLUMN_NUMBER; e1 -> diag_row_number_ret = SQL_NO_ROW_NUMBER; e1 -> diag_class_origin_ret = SQL_SUCCESS; e1 -> diag_subclass_origin_ret = SQL_SUCCESS; e1 -> diag_connection_name_ret = SQL_SUCCESS; e1 -> diag_server_name_ret = SQL_SUCCESS; e1 -> diag_column_number = 0; e1 -> diag_row_number = 0; e2 -> diag_column_number_ret = SQL_NO_COLUMN_NUMBER; e2 -> diag_row_number_ret = SQL_NO_ROW_NUMBER; e2 -> diag_class_origin_ret = SQL_SUCCESS; e2 -> diag_subclass_origin_ret = SQL_SUCCESS; e2 -> diag_connection_name_ret = SQL_SUCCESS; e2 -> diag_server_name_ret = SQL_SUCCESS; e2 -> diag_column_number = 0; e2 -> diag_row_number = 0; if ( class_origin == SUBCLASS_ODBC ) ansi_to_unicode_copy( e1 -> diag_class_origin, (char*) "ODBC 3.0", SQL_NTS, conn, NULL ); else ansi_to_unicode_copy( e1 -> diag_class_origin, (char*) "ISO 9075", SQL_NTS, conn, NULL ); wide_strcpy( e2 -> diag_class_origin, e1 -> diag_class_origin ); if ( subclass_origin == SUBCLASS_ODBC ) ansi_to_unicode_copy( e1 -> diag_subclass_origin, (char*) "ODBC 3.0", SQL_NTS, conn, NULL ); else ansi_to_unicode_copy( e1 -> diag_subclass_origin, (char*) "ISO 9075", SQL_NTS, conn, NULL ); wide_strcpy( e2 -> diag_subclass_origin, e1 -> diag_subclass_origin ); ansi_to_unicode_copy( e1 -> diag_connection_name, (char*) "", SQL_NTS, conn, NULL ); wide_strcpy( e2 -> diag_connection_name, e1 -> diag_connection_name ); ansi_to_unicode_copy( e1 -> diag_server_name, conn ? conn->dsn : (char*) "", SQL_NTS, conn, NULL ); wide_strcpy( e2 -> diag_server_name, e1 -> diag_server_name ); /* * the list for SQLError puts both local and driver * errors in the same list */ insert_into_error_list( error_header, e1 ); insert_into_diag_list( error_header, e2 ); } void __post_internal_error_ex_w( EHEAD *error_header, SQLWCHAR *sqlstate, SQLINTEGER native_error, SQLWCHAR *message_text, int class_origin, int subclass_origin ) { SQLWCHAR msg[ SQL_MAX_MESSAGE_LENGTH + 32 ]; /* * add our prefix */ ansi_to_unicode_copy(msg, (char*) ERROR_PREFIX, SQL_NTS, __get_connection( error_header ), NULL); wide_strcat( msg, message_text ); __post_internal_error_ex_w_noprefix( error_header, sqlstate, native_error, msg, class_origin, subclass_origin ); } void __post_internal_error_ex_w_noprefix( EHEAD *error_header, SQLWCHAR *sqlstate, SQLINTEGER native_error, SQLWCHAR *msg, int class_origin, int subclass_origin ) { /* * create a error block and add to the lists, * leave space for the error prefix */ ERROR *e1, *e2; e1 = malloc( sizeof( ERROR )); if ( !e1 ) return; e2 = malloc( sizeof( ERROR )); if ( !e2 ) { free(e1); return; } memset( e1, 0, sizeof( *e1 )); memset( e2, 0, sizeof( *e2 )); e1 -> native_error = native_error; e2 -> native_error = native_error; wide_strcpy( e1 -> sqlstate, sqlstate ); wide_strcpy( e2 -> sqlstate, sqlstate ); e1 -> msg = wide_strdup( msg ); e2 -> msg = wide_strdup( msg ); e1 -> return_val = SQL_ERROR; e2 -> return_val = SQL_ERROR; e1 -> diag_column_number_ret = SQL_NO_COLUMN_NUMBER; e1 -> diag_row_number_ret = SQL_NO_ROW_NUMBER; e1 -> diag_class_origin_ret = SQL_SUCCESS; e1 -> diag_subclass_origin_ret = SQL_SUCCESS; e1 -> diag_connection_name_ret = SQL_SUCCESS; e1 -> diag_server_name_ret = SQL_SUCCESS; e1 -> diag_column_number = 0; e1 -> diag_row_number = 0; e2 -> diag_column_number_ret = SQL_NO_COLUMN_NUMBER; e2 -> diag_row_number_ret = SQL_NO_ROW_NUMBER; e2 -> diag_class_origin_ret = SQL_SUCCESS; e2 -> diag_subclass_origin_ret = SQL_SUCCESS; e2 -> diag_connection_name_ret = SQL_SUCCESS; e2 -> diag_server_name_ret = SQL_SUCCESS; e2 -> diag_column_number = 0; e2 -> diag_row_number = 0; if ( class_origin == SUBCLASS_ODBC ) ansi_to_unicode_copy( e1 -> diag_class_origin, (char*) "ODBC 3.0", SQL_NTS, __get_connection( error_header ), NULL ); else ansi_to_unicode_copy( e1 -> diag_class_origin, (char*) "ISO 9075", SQL_NTS, __get_connection( error_header ), NULL ); wide_strcpy( e2 -> diag_class_origin, e1 -> diag_class_origin ); if ( subclass_origin == SUBCLASS_ODBC ) ansi_to_unicode_copy( e1 -> diag_subclass_origin, (char*) "ODBC 3.0", SQL_NTS, __get_connection( error_header ), NULL ); else ansi_to_unicode_copy( e1 ->diag_subclass_origin, (char*) "ISO 9075", SQL_NTS, __get_connection( error_header ), NULL ); wide_strcpy( e2 -> diag_subclass_origin, e1 -> diag_subclass_origin ); e1 -> diag_connection_name[ 0 ] = 0; e2 -> diag_connection_name[ 0 ] = 0; e1 -> diag_server_name[ 0 ] = 0; e2 -> diag_server_name[ 0 ] = 0; error_header -> return_code = SQL_ERROR; /* * the list for SQLError puts both local and driver * errors in the same list */ insert_into_error_list( error_header, e1 ); insert_into_diag_list( error_header, e2 ); } /* * initialise a error header and take note what it belongs to */ void setup_error_head( EHEAD *error_header, void *handle, int type ) { memset( error_header, 0, sizeof( *error_header )); error_header -> owning_handle = handle; error_header -> handle_type = type; } /* * free any resources used but the error headers */ void clear_error_head( EHEAD *error_header ) { ERROR *cur, *prev; prev = NULL; cur = error_header -> sql_error_head.error_list_head; while( cur ) { prev = cur; free( prev -> msg ); cur = prev -> next; free( prev ); } error_header -> sql_error_head.error_list_head = NULL; error_header -> sql_error_head.error_list_tail = NULL; prev = NULL; cur = error_header -> sql_diag_head.error_list_head; while( cur ) { prev = cur; free( prev -> msg ); cur = prev -> next; free( prev ); } error_header -> sql_diag_head.error_list_head = NULL; error_header -> sql_diag_head.error_list_tail = NULL; prev = NULL; cur = error_header -> sql_diag_head.internal_list_head; while( cur ) { prev = cur; free( prev -> msg ); cur = prev -> next; free( prev ); } error_header -> sql_diag_head.internal_list_head = NULL; error_header -> sql_diag_head.internal_list_tail = NULL; } /* * get the error values from the handle */ void extract_diag_error( int htype, DRV_SQLHANDLE handle, DMHDBC connection, EHEAD *head, int return_code, int save_to_diag ) { SQLRETURN ret; SQLCHAR msg[ SQL_MAX_MESSAGE_LENGTH + 32 ]; SQLCHAR msg1[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLCHAR sqlstate[ 6 ]; SQLINTEGER native, len; SQLINTEGER rec_number; head -> return_code = return_code; head -> header_set = 0; head -> diag_cursor_row_count_ret = SQL_ERROR; head -> diag_dynamic_function_ret = SQL_ERROR; head -> diag_dynamic_function_code_ret = SQL_ERROR; head -> diag_number_ret = SQL_ERROR; head -> diag_row_count_ret = SQL_ERROR; rec_number = 1; do { len = 0; ret = SQLGETDIAGREC( connection, head -> handle_type, handle, rec_number, sqlstate, &native, msg1, sizeof( msg1 ), &len ); if ( SQL_SUCCEEDED( ret )) { ERROR *e = malloc( sizeof( ERROR )); SQLWCHAR *tmp; /* * make sure we are truncated in the right place */ if ( ret == SQL_SUCCESS_WITH_INFO || len >= SQL_MAX_MESSAGE_LENGTH ) { msg1[ SQL_MAX_MESSAGE_LENGTH - 1 ] = '\0'; } #ifdef STRICT_ODBC_ERROR strcpy((char*) msg, (char*)msg1 ); #else strcpy((char*) msg, ERROR_PREFIX ); strcat((char*) msg, (char*)msg1 ); #endif /* * add to the SQLError list */ e -> native_error = native; tmp = ansi_to_unicode_alloc( sqlstate, SQL_NTS, connection, NULL ); wide_strcpy( e -> sqlstate, tmp ); free( tmp ); e -> msg = ansi_to_unicode_alloc( msg, SQL_NTS, connection, NULL ); e -> return_val = return_code; insert_into_error_list( head, e ); /* * we do this if called from a DM function that goes on to call * a further driver function before returning */ if ( save_to_diag ) { SQLWCHAR *tmp; e = malloc( sizeof( ERROR )); e -> native_error = native; tmp = ansi_to_unicode_alloc( sqlstate, SQL_NTS, connection, NULL ); wide_strcpy( e -> sqlstate, tmp ); free( tmp ); e -> msg = ansi_to_unicode_alloc( msg, SQL_NTS, connection, NULL ); e -> return_val = return_code; insert_into_diag_list( head, e ); /* * now we need to do some extra calls to get * extended info */ e -> diag_column_number_ret = SQL_ERROR; e -> diag_row_number_ret = SQL_ERROR; e -> diag_class_origin_ret = SQL_ERROR; e -> diag_subclass_origin_ret = SQL_ERROR; e -> diag_connection_name_ret = SQL_ERROR; e -> diag_server_name_ret= SQL_ERROR; if ( head -> handle_type == SQL_HANDLE_STMT ) { if ( rec_number == 1 ) { head -> header_set = 1; head -> diag_cursor_row_count_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, 0, SQL_DIAG_CURSOR_ROW_COUNT, &head->diag_cursor_row_count, 0, NULL ); if ( SQL_SUCCEEDED( head -> diag_dynamic_function_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, 0, SQL_DIAG_DYNAMIC_FUNCTION, msg, sizeof( msg ), &len ))) { tmp = ansi_to_unicode_alloc(msg, SQL_NTS, connection, NULL ); wide_strcpy( head->diag_dynamic_function, tmp ); free( tmp ); } head -> diag_dynamic_function_code_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, 0, SQL_DIAG_DYNAMIC_FUNCTION_CODE, &head->diag_dynamic_function_code, 0, NULL ); head -> diag_number_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, 0, SQL_DIAG_NUMBER, &head->diag_number, 0, NULL ); head -> diag_row_count_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, 0, SQL_DIAG_ROW_COUNT, &head->diag_row_count, 0, NULL ); } e -> diag_column_number_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, rec_number, SQL_DIAG_COLUMN_NUMBER, &e->diag_column_number, 0, NULL ); e -> diag_row_number_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, rec_number, SQL_DIAG_ROW_NUMBER, &e->diag_row_number, 0, NULL ); } else { e -> diag_column_number_ret = SQL_ERROR; e -> diag_row_number_ret = SQL_ERROR; e -> diag_class_origin_ret = SQL_ERROR; e -> diag_subclass_origin_ret = SQL_ERROR; e -> diag_connection_name_ret = SQL_ERROR; e -> diag_server_name_ret= SQL_ERROR; if ( SQL_SUCCEEDED( e -> diag_class_origin_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, rec_number, SQL_DIAG_CLASS_ORIGIN, msg, sizeof( msg ), &len ))) { tmp = ansi_to_unicode_alloc( msg, SQL_NTS, connection, NULL ); wide_strcpy( e->diag_class_origin, tmp ); free( tmp ); } if ( SQL_SUCCEEDED( e -> diag_subclass_origin_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, rec_number, SQL_DIAG_SUBCLASS_ORIGIN, msg, sizeof( msg ), &len ))) { tmp = ansi_to_unicode_alloc(msg, SQL_NTS, connection, NULL ); wide_strcpy( e->diag_subclass_origin, tmp ); free( tmp ); } if ( SQL_SUCCEEDED( e -> diag_connection_name_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, rec_number, SQL_DIAG_CONNECTION_NAME, msg, sizeof( msg ), &len ))) { tmp = ansi_to_unicode_alloc( msg, SQL_NTS, connection, NULL ); wide_strcpy( e->diag_connection_name, tmp ); free( tmp ); } if ( SQL_SUCCEEDED( e -> diag_server_name_ret = SQLGETDIAGFIELD( connection, head -> handle_type, handle, rec_number, SQL_DIAG_SERVER_NAME, msg, sizeof( msg ), &len ))) { tmp = ansi_to_unicode_alloc( msg, SQL_NTS, connection, NULL ); wide_strcpy( e -> diag_server_name, tmp ); free( tmp ); } } } else { head -> sql_diag_head.error_count ++; } rec_number ++; /* * add to logfile */ if ( log_info.log_flag ) { sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, msg1 ); dm_log_write_diag( connection -> msg ); } } } while( SQL_SUCCEEDED( ret )); } void extract_sql_error( DRV_SQLHANDLE henv, DRV_SQLHANDLE hdbc, DRV_SQLHANDLE hstmt, DMHDBC connection, EHEAD *head, int return_code ) { SQLRETURN ret; SQLCHAR msg[ SQL_MAX_MESSAGE_LENGTH + 32 ]; SQLCHAR msg1[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLCHAR sqlstate[ 6 ]; SQLINTEGER native; SQLSMALLINT len; head -> return_code = return_code; head -> header_set = 0; head -> diag_cursor_row_count_ret = SQL_ERROR; head -> diag_dynamic_function_ret = SQL_ERROR; head -> diag_dynamic_function_code_ret = SQL_ERROR; head -> diag_number_ret = SQL_ERROR; head -> diag_row_count_ret = SQL_ERROR; do { len = 0; ret = SQLERROR( connection, henv, hdbc, hstmt, sqlstate, &native, msg1, sizeof( msg1 ), &len ); if ( SQL_SUCCEEDED( ret )) { SQLWCHAR *tmp; ERROR *e = malloc( sizeof( ERROR )); /* * add to the lists, SQLError list first */ /* * add our prefix */ /* * make sure we are truncated in the right place */ if ( ret == SQL_SUCCESS_WITH_INFO || len >= SQL_MAX_MESSAGE_LENGTH ) { msg1[ SQL_MAX_MESSAGE_LENGTH ] = '\0'; } #ifdef STRICT_ODBC_ERROR strcpy((char*) msg, (char*)msg1 ); #else strcpy((char*) msg, ERROR_PREFIX ); strcat((char*) msg, (char*)msg1 ); #endif e -> native_error = native; tmp = ansi_to_unicode_alloc( sqlstate, SQL_NTS, connection, NULL ); wide_strcpy( e -> sqlstate, tmp ); free( tmp ); e -> msg = ansi_to_unicode_alloc( msg, SQL_NTS, connection, NULL ); e -> return_val = return_code; insert_into_error_list( head, e ); /* * SQLGetDiagRec list next */ e = malloc( sizeof( ERROR )); e -> diag_column_number_ret = SQL_ERROR; e -> diag_row_number_ret = SQL_ERROR; e -> diag_class_origin_ret = SQL_ERROR; e -> diag_subclass_origin_ret = SQL_ERROR; e -> diag_connection_name_ret = SQL_ERROR; e -> diag_server_name_ret= SQL_ERROR; e -> native_error = native; tmp = ansi_to_unicode_alloc( sqlstate, SQL_NTS, connection, NULL ); wide_strcpy( e -> sqlstate, tmp ); free( tmp ); e -> msg = ansi_to_unicode_alloc( msg, SQL_NTS, connection, NULL ); e -> return_val = return_code; insert_into_diag_list( head, e ); /* * add to logfile */ if ( log_info.log_flag ) { sprintf( connection -> msg, "\t\tDIAG [%s] %s", sqlstate, msg1 ); dm_log_write_diag( connection -> msg ); } } } while( SQL_SUCCEEDED( ret )); } void extract_diag_error_w( int htype, DRV_SQLHANDLE handle, DMHDBC connection, EHEAD *head, int return_code, int save_to_diag ) { SQLRETURN ret; SQLWCHAR msg[ SQL_MAX_MESSAGE_LENGTH + 32 ]; SQLWCHAR msg1[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLWCHAR sqlstate[ 6 ]; SQLINTEGER native, len; SQLINTEGER rec_number; head -> return_code = return_code; head -> header_set = 0; head -> diag_cursor_row_count_ret = SQL_ERROR; head -> diag_dynamic_function_ret = SQL_ERROR; head -> diag_dynamic_function_code_ret = SQL_ERROR; head -> diag_number_ret = SQL_ERROR; head -> diag_row_count_ret = SQL_ERROR; rec_number = 1; do { len = 0; ret = SQLGETDIAGRECW( connection, head -> handle_type, handle, rec_number, sqlstate, &native, msg1, SQL_MAX_MESSAGE_LENGTH, &len ); if ( SQL_SUCCEEDED( ret )) { ERROR *e = malloc( sizeof( ERROR )); #ifndef STRICT_ODBC_ERROR SQLWCHAR *tmp; #endif /* * make sure we are truncated in the right place */ if ( ret == SQL_SUCCESS_WITH_INFO || len >= SQL_MAX_MESSAGE_LENGTH ) { msg1[ SQL_MAX_MESSAGE_LENGTH ] = 0; } #ifdef STRICT_ODBC_ERROR wide_strcpy( msg, msg1 ); #else tmp = ansi_to_unicode_alloc((SQLCHAR*) ERROR_PREFIX, SQL_NTS, connection ); wide_strcpy( msg, tmp ); free( tmp ); wide_strcat( msg, msg1 ); #endif /* * add to the SQLError list */ e -> native_error = native; wide_strcpy( e -> sqlstate, sqlstate ); e -> msg = wide_strdup( msg ); e -> return_val = return_code; insert_into_error_list( head, e ); /* * we do this if called from a DM function that goes on to call * a further driver function before returning */ if ( save_to_diag ) { e = malloc( sizeof( ERROR )); e -> native_error = native; wide_strcpy( e -> sqlstate, sqlstate ); e -> msg = wide_strdup( msg ); e -> return_val = return_code; insert_into_diag_list( head, e ); /* * now we need to do some extra calls to get * extended info */ e -> diag_column_number_ret = SQL_ERROR; e -> diag_row_number_ret = SQL_ERROR; e -> diag_class_origin_ret = SQL_ERROR; e -> diag_subclass_origin_ret = SQL_ERROR; e -> diag_connection_name_ret = SQL_ERROR; e -> diag_server_name_ret= SQL_ERROR; if ( head -> handle_type == SQL_HANDLE_STMT ) { if ( rec_number == 1 ) { head -> header_set = 1; head -> diag_cursor_row_count_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, 0, SQL_DIAG_CURSOR_ROW_COUNT, &head->diag_cursor_row_count, 0, NULL ); head -> diag_dynamic_function_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, 0, SQL_DIAG_DYNAMIC_FUNCTION, head->diag_dynamic_function, sizeof( head->diag_dynamic_function ), &len ); head -> diag_dynamic_function_code_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, 0, SQL_DIAG_DYNAMIC_FUNCTION_CODE, &head->diag_dynamic_function_code, 0, NULL ); head -> diag_number_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, 0, SQL_DIAG_NUMBER, &head->diag_number, 0, NULL ); head -> diag_row_count_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, 0, SQL_DIAG_ROW_COUNT, &head->diag_row_count, 0, NULL ); } e -> diag_column_number_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, rec_number, SQL_DIAG_COLUMN_NUMBER, &e->diag_column_number, 0, NULL ); e -> diag_row_number_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, rec_number, SQL_DIAG_ROW_NUMBER, &e->diag_row_number, 0, NULL ); } else { e -> diag_column_number_ret = SQL_ERROR; e -> diag_row_number_ret = SQL_ERROR; e -> diag_class_origin_ret = SQL_ERROR; e -> diag_subclass_origin_ret = SQL_ERROR; e -> diag_connection_name_ret = SQL_ERROR; e -> diag_server_name_ret= SQL_ERROR; e -> diag_class_origin_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, rec_number, SQL_DIAG_CLASS_ORIGIN, e->diag_class_origin, sizeof( e->diag_class_origin ), &len ); e -> diag_subclass_origin_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, rec_number, SQL_DIAG_SUBCLASS_ORIGIN, e->diag_subclass_origin, sizeof( e->diag_subclass_origin ), &len ); e -> diag_connection_name_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, rec_number, SQL_DIAG_CONNECTION_NAME, e->diag_connection_name, sizeof( e->diag_connection_name ), &len ); e -> diag_server_name_ret = SQLGETDIAGFIELDW( connection, head -> handle_type, handle, rec_number, SQL_DIAG_SERVER_NAME, e->diag_server_name, sizeof( e->diag_server_name ), &len ); } } else { head -> sql_diag_head.error_count ++; } rec_number ++; /* * add to logfile */ if ( log_info.log_flag ) { SQLCHAR *as1, *as2; as1 = (SQLCHAR*) unicode_to_ansi_alloc( sqlstate, SQL_NTS, connection, NULL ); as2 = (SQLCHAR*) unicode_to_ansi_alloc( msg1, SQL_NTS, connection, NULL ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", as1, as2 ); if( as1 ) free( as1 ); if( as2 ) free( as2 ); dm_log_write_diag( connection -> msg ); } } } while( SQL_SUCCEEDED( ret )); } void extract_sql_error_w( DRV_SQLHANDLE henv, DRV_SQLHANDLE hdbc, DRV_SQLHANDLE hstmt, DMHDBC connection, EHEAD *head, int return_code ) { SQLRETURN ret; SQLWCHAR msg[ SQL_MAX_MESSAGE_LENGTH + 32 ]; SQLWCHAR msg1[ SQL_MAX_MESSAGE_LENGTH + 1 ]; SQLWCHAR sqlstate[ 6 ]; SQLINTEGER native; SQLSMALLINT len; head -> return_code = return_code; do { len = 0; ret = SQLERRORW( connection, henv, hdbc, hstmt, sqlstate, &native, msg1, SQL_MAX_MESSAGE_LENGTH, &len ); if ( SQL_SUCCEEDED( ret )) { #ifndef STRICT_ODBC_ERROR SQLWCHAR *tmp; #endif /* * add to the lists, SQLError list first */ ERROR *e = malloc( sizeof( ERROR )); /* * add our prefix */ /* * make sure we are truncated in the right place */ if ( ret == SQL_SUCCESS_WITH_INFO || len >= SQL_MAX_MESSAGE_LENGTH ) { msg1[ SQL_MAX_MESSAGE_LENGTH ] = 0; } #ifdef STRICT_ODBC_ERROR wide_strcpy( msg, msg1 ); #else tmp = ansi_to_unicode_alloc((SQLCHAR*) ERROR_PREFIX, SQL_NTS, connection, NULL ); wide_strcpy( msg, tmp ); free( tmp ); wide_strcat( msg, msg1 ); #endif e -> native_error = native; wide_strcpy( e -> sqlstate, sqlstate ); e -> msg = wide_strdup( msg ); e -> return_val = return_code; insert_into_error_list( head, e ); /* * SQLGetDiagRec list next */ e = malloc( sizeof( ERROR )); e -> native_error = native; wide_strcpy( e -> sqlstate, sqlstate ); e -> msg = wide_strdup( msg ); e -> return_val = return_code; insert_into_diag_list( head, e ); /* * add to logfile */ if ( log_info.log_flag ) { SQLCHAR *as1, *as2; as1 = (SQLCHAR*) unicode_to_ansi_alloc( sqlstate, SQL_NTS, connection, NULL ); as2 = (SQLCHAR*) unicode_to_ansi_alloc( msg1, SQL_NTS, connection, NULL ); sprintf( connection -> msg, "\t\tDIAG [%s] %s", as1, as2 ); if( as1 ) free( as1 ); if( as2 ) free( as2 ); dm_log_write_diag( connection -> msg ); } } } while( SQL_SUCCEEDED( ret )); } /* * Extract diag information from driver */ void extract_error_from_driver( EHEAD * error_handle, DMHDBC hdbc, int ret_code, int save_to_diag ) { void (*extracterrorfunc)( DRV_SQLHANDLE, DRV_SQLHANDLE, DRV_SQLHANDLE, DMHDBC, EHEAD *, int ) = 0; void (*extractdiagfunc)( int, DRV_SQLHANDLE, DMHDBC, EHEAD*, int, int ) = 0; DRV_SQLHANDLE hdbc_drv = SQL_NULL_HDBC; DRV_SQLHANDLE hstmt_drv = SQL_NULL_HSTMT; DRV_SQLHANDLE handle_diag_extract = __get_driver_handle( error_handle ); if ( error_handle->handle_type == SQL_HANDLE_ENV ) { return; } if ( error_handle->handle_type == SQL_HANDLE_DBC ) { hdbc_drv = handle_diag_extract; } else if ( error_handle->handle_type == SQL_HANDLE_STMT ) { hstmt_drv = handle_diag_extract; } /* If we have the W functions may as well use them */ if ( CHECK_SQLGETDIAGFIELDW( hdbc ) && CHECK_SQLGETDIAGRECW( hdbc )) { extractdiagfunc = extract_diag_error_w; } else if ( CHECK_SQLERRORW( hdbc )) { extracterrorfunc = extract_sql_error_w; } else if ( CHECK_SQLGETDIAGFIELD( hdbc ) && CHECK_SQLGETDIAGREC( hdbc )) { extractdiagfunc = extract_diag_error; } else if ( CHECK_SQLERROR( hdbc )) { extracterrorfunc = extract_sql_error; } if ( extractdiagfunc ) { extractdiagfunc( error_handle->handle_type, handle_diag_extract, hdbc, error_handle, ret_code, save_to_diag ); } else if ( error_handle->handle_type != SQL_HANDLE_DESC && extracterrorfunc ) { extracterrorfunc( SQL_NULL_HENV, hdbc_drv, hstmt_drv, hdbc, error_handle, ret_code ); } else { __post_internal_error( error_handle, ERROR_HY000, "Driver returned SQL_ERROR or SQL_SUCCESS_WITH_INFO but no error reporting API found", hdbc->environment->requested_version ); } } /* Return without collecting diag recs from the handle - to be called if the DM function is returning before calling the driver function. */ int function_return_nodrv( int level, void *handle, int ret_code) { if ( level != IGNORE_THREAD ) { thread_release( level, handle ); } return ret_code; } /* * capture function returns and check error's if necessary */ int function_return_ex( int level, void * handle, int ret_code, int save_to_diag, int defer_type ) { DMHENV henv; DMHDBC hdbc; DMHSTMT hstmt; DMHDESC hdesc; EHEAD *herror = NULL; if ( ret_code == SQL_SUCCESS_WITH_INFO || ret_code == SQL_ERROR ) { /* * find what type of handle it is */ henv = handle; switch ( henv -> type ) { case HENV_MAGIC: { /* * do nothing, it must be local */ } break; case HDBC_MAGIC: { hdbc = handle; /* * are we connected ? */ if ( hdbc -> state >= STATE_C4 ) { herror = &hdbc->error; } } break; case HSTMT_MAGIC: { hstmt = handle; herror = &hstmt->error; hdbc = hstmt->connection; } break; case HDESC_MAGIC: { hdesc = handle; herror = &hdesc->error; hdbc = hdesc->connection; } break; } if ( herror ) { /* * set defer flag */ herror->defer_extract = ( ret_code == SQL_SUCCESS_WITH_INFO ? defer_type : defer_type >> 1 ) & 1; if ( herror->defer_extract ) { herror->ret_code_deferred = ret_code; } else { extract_error_from_driver( herror, hdbc, ret_code, save_to_diag ); } } } /* * release any threads */ if ( level != IGNORE_THREAD ) { thread_release( level, handle ); } return ret_code; } /* * clear errors down at the start of a new statement * only clear for the ODBC lists, the rest stay */ void function_entry( void *handle ) { ERROR *cur, *prev; EHEAD *error_header; DMHENV henv; DMHDBC hdbc; DMHSTMT hstmt; DMHDESC hdesc; int version; /* * find what the handle is */ henv = handle; switch( henv -> type ) { case HENV_MAGIC: error_header = &henv -> error; version = henv -> requested_version; break; case HDBC_MAGIC: hdbc = handle; error_header = &hdbc -> error; version = hdbc -> environment -> requested_version; break; case HSTMT_MAGIC: hstmt = handle; error_header = &hstmt -> error; version = hstmt -> connection -> environment -> requested_version; break; case HDESC_MAGIC: hdesc = handle; error_header = &hdesc -> error; version = hdesc -> connection -> environment -> requested_version; break; } error_header->defer_extract = 0; error_header->ret_code_deferred = 0; prev = NULL; cur = error_header -> sql_diag_head.error_list_head; while( cur ) { prev = cur; free( prev -> msg ); cur = prev -> next; free( prev ); } error_header -> sql_diag_head.error_list_head = NULL; error_header -> sql_diag_head.error_list_tail = NULL; error_header -> sql_diag_head.error_count = 0; error_header -> header_set = 0; prev = NULL; cur = error_header -> sql_diag_head.internal_list_head; while( cur ) { prev = cur; free( prev -> msg ); cur = prev -> next; free( prev ); } error_header -> sql_diag_head.internal_list_head = NULL; error_header -> sql_diag_head.internal_list_tail = NULL; error_header -> sql_diag_head.internal_count = 0; /* * if version is SQL_OV_ODBC3 then clear the SQLError list * as well */ #ifdef USE_OLD_ODBC2_ERROR_CLEARING if ( version >= SQL_OV_ODBC3 ) #endif { prev = NULL; cur = error_header -> sql_error_head.error_list_head; while( cur ) { prev = cur; free( prev -> msg ); cur = prev -> next; free( prev ); } error_header -> sql_error_head.error_list_head = NULL; error_header -> sql_error_head.error_list_tail = NULL; error_header -> sql_error_head.error_count = 0; } } void __post_internal_error( EHEAD *error_handle, error_id id, char *txt, int connection_mode ) { __post_internal_error_api( error_handle, id, txt, connection_mode, 0 ); } void __post_internal_error_api( EHEAD *error_handle, error_id id, char *txt, int connection_mode, int calling_api ) { char sqlstate[ 6 ]; char *message; SQLCHAR msg[ SQL_MAX_MESSAGE_LENGTH ]; SQLRETURN ret = SQL_ERROR; int class, subclass; class = SUBCLASS_ISO; subclass = SUBCLASS_ISO; switch( id ) { case ERROR_01000: strcpy( sqlstate, "01000" ); message = "General warning"; break; case ERROR_01004: strcpy( sqlstate, "01004" ); message = "String data, right truncated"; break; case ERROR_01S02: strcpy( sqlstate, "01S02" ); message = "Option value changed"; subclass = SUBCLASS_ODBC; break; case ERROR_01S06: strcpy( sqlstate, "01S06" ); message = "Attempt to fetch before the result set returned the first rowset"; subclass = SUBCLASS_ODBC; break; case ERROR_07005: strcpy( sqlstate, "07005" ); message = "Prepared statement not a cursor-specification"; break; case ERROR_07009: switch( calling_api ) { case SQL_API_SQLDESCRIBEPARAM: case SQL_API_SQLBINDPARAMETER: case SQL_API_SQLSETPARAM: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "07009" ); else strcpy( sqlstate, "S1093" ); message = "Invalid parameter index"; break; default: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "07009" ); else strcpy( sqlstate, "S1002" ); message = "Invalid descriptor index"; break; } break; case ERROR_08002: strcpy( sqlstate, "08002" ); message = "Connection in use"; break; case ERROR_08003: strcpy( sqlstate, "08003" ); message = "Connection not open"; break; case ERROR_24000: strcpy( sqlstate, "24000" ); message = "Invalid cursor state"; break; case ERROR_25000: message = "Invalid transaction state"; strcpy( sqlstate, "25000" ); break; case ERROR_25S01: message = "Transaction state unknown"; strcpy( sqlstate, "25S01" ); subclass = SUBCLASS_ODBC; break; case ERROR_S1000: message = "General error"; strcpy( sqlstate, "S1000" ); break; case ERROR_S1003: message = "Program type out of range"; strcpy( sqlstate, "S1003" ); break; case ERROR_S1010: message = "Function sequence error"; strcpy( sqlstate, "S1010" ); break; case ERROR_S1011: message = "Operation invalid at this time"; strcpy( sqlstate, "S1011" ); break; case ERROR_S1107: message = "Row value out of range"; strcpy( sqlstate, "S1107" ); break; case ERROR_S1108: message = "Concurrency option out of range"; strcpy( sqlstate, "S1108" ); break; case ERROR_S1C00: message = "Driver not capable"; strcpy( sqlstate, "S1C00" ); break; case ERROR_HY001: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY001" ); else strcpy( sqlstate, "S1011" ); message = "Memory allocation error"; break; case ERROR_HY003: if ( connection_mode >= SQL_OV_ODBC3 ) { strcpy( sqlstate, "HY003" ); /* Windows DM returns " Program type out of range" instead of "Invalid application buffer type" */ message = "Program type out of range"; } else { strcpy( sqlstate, "S1003" ); message = "Invalid application buffer type"; } break; case ERROR_HY004: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY004" ); else strcpy( sqlstate, "S1004" ); message = "Invalid SQL data type"; break; case ERROR_HY007: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY007" ); else strcpy( sqlstate, "S1007" ); message = "Associated statement is not prepared"; break; case ERROR_HY009: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY009" ); else strcpy( sqlstate, "S1009" ); message = "Invalid use of null pointer"; break; case ERROR_HY010: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY010" ); else strcpy( sqlstate, "S1010" ); message = "Function sequence error"; break; case ERROR_HY011: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY011" ); else strcpy( sqlstate, "S1011" ); message = "Attribute cannot be set now"; break; case ERROR_HY012: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY012" ); else strcpy( sqlstate, "S1012" ); message = "Invalid transaction operation code"; break; case ERROR_HY013: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY013" ); else strcpy( sqlstate, "S1013" ); message = "Memory management error"; break; case ERROR_HY017: strcpy( sqlstate, "HY017" ); message = "Invalid use of an automatically allocated descriptor handle"; break; case ERROR_HY024: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY024" ); else strcpy( sqlstate, "S1009" ); message = "Invalid attribute value"; break; case ERROR_HY090: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY090" ); else strcpy( sqlstate, "S1090" ); message = "Invalid string or buffer length"; break; case ERROR_HY092: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY092" ); else strcpy( sqlstate, "S1092" ); message = "Invalid attribute/option identifier"; break; case ERROR_HY095: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY095" ); else strcpy( sqlstate, "S1095" ); message = "Function type out of range"; break; case ERROR_HY097: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY097" ); else strcpy( sqlstate, "S1097" ); message = "Column type out of range"; break; case ERROR_HY098: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY098" ); else strcpy( sqlstate, "S1098" ); message = "Scope type out of range"; break; case ERROR_HY099: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY099" ); else strcpy( sqlstate, "S1099" ); message = "Nullable type out of range"; break; case ERROR_HY100: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY100" ); else strcpy( sqlstate, "S1100" ); message = "Uniqueness option type out of range"; break; case ERROR_HY101: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY101" ); else strcpy( sqlstate, "S1101" ); message = "Accuracy option type out of range"; break; case ERROR_HY103: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY103" ); else strcpy( sqlstate, "S1103" ); message = "Invalid retrieval code"; break; case ERROR_HY105: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY105" ); else strcpy( sqlstate, "S1105" ); message = "Invalid parameter type"; break; case ERROR_HY106: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY106" ); else strcpy( sqlstate, "S1106" ); message = "Fetch type out of range"; break; case ERROR_HY110: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY110" ); else strcpy( sqlstate, "S1110" ); message = "Invalid driver completion"; break; case ERROR_HY111: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY111" ); else strcpy( sqlstate, "S1111" ); message = "Invalid bookmark value"; break; case ERROR_HYC00: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HYC00" ); else strcpy( sqlstate, "S1C00" ); message = "Optional feature not implemented"; break; case ERROR_IM001: strcpy( sqlstate, "IM001" ); message = "Driver does not support this function"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_IM002: strcpy( sqlstate, "IM002" ); message = "Data source name not found and no default driver specified"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_IM003: strcpy( sqlstate, "IM003" ); message = "Specified driver could not be loaded"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_IM004: strcpy( sqlstate, "IM004" ); message = "Driver's SQLAllocHandle on SQL_HANDLE_HENV failed"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_IM005: strcpy( sqlstate, "IM005" ); message = "Driver's SQLAllocHandle on SQL_HANDLE_DBC failed"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_IM010: strcpy( sqlstate, "IM010" ); message = "Data source name too long"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_IM011: strcpy( sqlstate, "IM011" ); message = "Driver name too long"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_IM012: strcpy( sqlstate, "IM012" ); message = "DRIVER keyword syntax error"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_SL004: strcpy( sqlstate, "SL004" ); message = "Result set not generated by a SELECT statement"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_SL009: strcpy( sqlstate, "SL009" ); message = "No columns were bound prior to calling SQLFetch or SQLFetchScroll"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_SL010: strcpy( sqlstate, "SL010" ); message = "SQLBindCol returned SQL_ERROR on a attempt to bind a internal buffer"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_SL008: strcpy( sqlstate, "SL008" ); message = "SQLGetData is not allowed on a forward only (non-buffered) cursor"; subclass = SUBCLASS_ODBC; class = SUBCLASS_ODBC; break; case ERROR_HY000: if ( connection_mode >= SQL_OV_ODBC3 ) strcpy( sqlstate, "HY000" ); else strcpy( sqlstate, "S1000" ); message = "General error"; break; default: strcpy( sqlstate, "?????" ); message = "Unknown"; } if ( txt ) message = txt; strcpy((char*) msg, DM_ERROR_PREFIX ); strncat((char*) msg, message, sizeof(msg) - sizeof(DM_ERROR_PREFIX) ); error_handle -> return_code = ret; __post_internal_error_ex( error_handle, (SQLCHAR*)sqlstate, 0, msg, class, subclass ); } /* * open a log file */ void dm_log_open( char *program_name, char *log_file_name, int pid_logging ) { if ( log_info.program_name ) { free( log_info.program_name ); } if ( log_info.log_file_name ) { free( log_info.log_file_name ); } log_info.program_name = strdup( program_name ); log_info.log_file_name = strdup( log_file_name ); log_info.log_flag = 1; /* * are we doing perprocess logging */ log_info.pid_logging = pid_logging; log_info.ref_count++; } void dm_log_write( char *function_name, int line, int type, int severity, char *message ) { FILE *fp; char tmp[ 24 ]; if ( !log_info.log_flag && !ODBCSharedTraceFlag ) return; if ( log_info.pid_logging ) { char file_name[ 256 ], str[ 20 ]; if ( !log_info.log_file_name ) { strcpy( file_name, "/tmp/sql.log" ); } else { sprintf( file_name, "%s/%s", log_info.log_file_name, __get_pid((SQLCHAR*) str )); } fp = uo_fopen( file_name, "a" ); /* * Change the mode to be rw for all */ chmod( file_name, 0666 ); } else { if ( !log_info.log_file_name ) { fp = uo_fopen( "/tmp/sql.log", "a" ); } else { fp = uo_fopen( log_info.log_file_name, "a" ); } } if ( fp ) { char tstamp_str[ 128 ]; #if defined( HAVE_GETTIMEOFDAY ) && defined( HAVE_SYS_TIME_H ) { struct timeval tv; void* tz = NULL; gettimeofday( &tv, tz ); sprintf( tstamp_str, "[%ld.%06ld]", tv.tv_sec, tv.tv_usec ); } #elif defined( HAVE_FTIME ) && defined( HAVE_SYS_TIMEB_H ) { struct timeb tp; ftime( &tp ); sprintf( tstamp_str, "[%ld.%03d]", tp.time, tp.millitm ); } #elif defined( DHAVE_TIME ) && defined( HAVE_TIME_H ) { time_t tv; time( &tv ); sprintf( tstamp_str, "[%ld]", tv ); } #else tstamp_str[ 0 ] = '\0'; #endif if ( !log_info.program_name ) { uo_fprintf( fp, "[ODBC][%s]%s[%s][%d]%s\n", __get_pid((SQLCHAR*) tmp ), tstamp_str, function_name, line, message ); } else { uo_fprintf( fp, "[%s][%s]%s[%s][%d]%s\n", log_info.program_name, __get_pid((SQLCHAR*) tmp ), tstamp_str, function_name, line, message ); } uo_fclose( fp ); } } void dm_log_write_diag( char *message ) { FILE *fp; if ( !log_info.log_flag && !ODBCSharedTraceFlag ) return; if ( log_info.pid_logging ) { char file_name[ 256 ], str[ 20 ]; if ( !log_info.log_file_name ) { strcpy( file_name, "/tmp/sql.log" ); } else { sprintf( file_name, "%s/%s", log_info.log_file_name, __get_pid((SQLCHAR*) str )); } fp = uo_fopen( file_name, "a" ); /* * Change the mode to be rw for all */ chmod( file_name, 0666 ); } else { if ( !log_info.log_file_name ) { fp = uo_fopen( "/tmp/sql.log", "a" ); } else { fp = uo_fopen( log_info.log_file_name, "a" ); } } if ( fp ) { uo_fprintf( fp, "%s\n\n", message ); uo_fclose( fp ); } } void dm_log_close( void ) { if ( !log_info.ref_count ) return; log_info.ref_count--; if ( !log_info.ref_count ) { free( log_info.program_name ); free( log_info.log_file_name ); log_info.program_name = NULL; log_info.log_file_name = NULL; log_info.log_flag = 0; } } unixODBC-2.3.9/DriverManager/DriverManager.exp0000644000175000017500000000472513303466730016070 00000000000000SQLAllocConnect SQLAllocEnv SQLAllocHandle SQLAllocHandleStd SQLAllocStmt SQLBindCol SQLBindParam SQLBindParameter SQLBrowseConnect SQLBrowseConnectW SQLBrowseConnectA SQLBulkOperations SQLCancel SQLCancelHandle SQLCloseCursor SQLColAttribute SQLColAttributeW SQLColAttributeA SQLColAttributes SQLColAttributesW SQLColAttributesA SQLColumnPrivileges SQLColumnPrivilegesW SQLColumnPrivilegesA SQLColumns SQLColumnsW SQLColumnsA SQLConnect SQLConnectW SQLConnectA SQLCopyDesc SQLDataSources SQLDataSourcesW SQLDataSourcesA SQLDescribeCol SQLDescribeColW SQLDescribeColA SQLDescribeParam SQLDisconnect SQLDriverConnect SQLDriverConnectW SQLDriverConnectA SQLDrivers SQLDriversW SQLDriversA SQLEndTran SQLError SQLErrorW SQLErrorA SQLExecDirect SQLExecDirectW SQLExecDirectA SQLExecute SQLExtendedFetch SQLFetch SQLFetchScroll SQLForeignKeys SQLForeignKeysW SQLForeignKeysA SQLFreeConnect SQLFreeEnv SQLFreeHandle SQLFreeStmt SQLGetConnectAttr SQLGetConnectAttrW SQLGetConnectAttrA SQLGetConnectOption SQLGetConnectOptionW SQLGetConnectOptionA SQLGetCursorName SQLGetCursorNameW SQLGetCursorNameA SQLGetData SQLGetDescField SQLGetDescFieldW SQLGetDescFieldA SQLGetDescRec SQLGetDescRecW SQLGetDescRecA SQLGetDiagField SQLGetDiagFieldW SQLGetDiagFieldA SQLGetDiagRec SQLGetDiagRecW SQLGetDiagRecA SQLGetEnvAttr SQLGetFunctions SQLGetInfo SQLGetInfoW SQLGetInfoA SQLGetStmtAttr SQLGetStmtAttrW SQLGetStmtAttrA SQLGetStmtOption SQLGetTypeInfo SQLGetTypeInfoW SQLGetTypeInfoA SQLMoreResults SQLNativeSql SQLNativeSqlW SQLNativeSqlA SQLNumParams SQLNumResultCols SQLParamData SQLParamOptions SQLPrepare SQLPrepareW SQLPrepareA SQLPrimaryKeys SQLPrimaryKeysW SQLPrimaryKeysA SQLProcedureColumns SQLProcedureColumnsW SQLProcedureColumnsA SQLProcedures SQLProceduresW SQLProceduresA SQLPutData SQLRowCount SQLSetConnectAttr SQLSetConnectAttrW SQLSetConnectAttrA SQLSetConnectOption SQLSetConnectOptionW SQLSetConnectOptionA SQLSetCursorName SQLSetCursorNameW SQLSetCursorNameA SQLSetDescField SQLSetDescFieldW SQLSetDescFieldA SQLSetDescRec SQLSetEnvAttr SQLSetParam SQLSetPos SQLSetScrollOptions SQLSetStmtAttr SQLSetStmtAttrW SQLSetStmtAttrA SQLSetStmtOption SQLSetStmtOptionA SQLSetStmtOptionW SQLSpecialColumns SQLSpecialColumnsW SQLSpecialColumnsA SQLStatistics SQLStatisticsW SQLStatisticsA SQLTablePrivileges SQLTablePrivilegesW SQLTablePrivilegesA SQLTables SQLTablesW SQLTablesA SQLTransact ODBCSharedTraceFlag uodbc_open_stats uodbc_close_stats uodbc_get_stats uodbc_stats_error ODBCSetTryWaitValue ODBCGetTryWaitValue unixODBC-2.3.9/DriverManager/SQLAllocEnv.c0000755000175000017500000000425313303466667015063 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLAllocEnv.c,v 1.2 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLAllocEnv.c,v $ * Revision 1.2 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.1.1.1 2001/10/17 16:40:03 lurcher * * First upload to SourceForge * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.2 1999/07/04 21:05:06 ngorham * * Add LGPL Headers to code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.1 1999/04/25 23:02:41 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLAllocEnv.c,v $ $Revision: 1.2 $"; SQLRETURN SQLAllocEnv( SQLHENV *environment_handle ) { return __SQLAllocHandle( SQL_HANDLE_ENV, SQL_NULL_HENV, environment_handle, SQL_OV_ODBC2 ); } unixODBC-2.3.9/DriverManager/SQLDescribeParam.c0000644000175000017500000002455513303466667016065 00000000000000/********************************************************************* * * This is based on code created by Peter Harvey, * (pharvey@codebydesign.com). * * Modified and extended by Nick Gorham * (nick@lurcher.org). * * Any bugs or problems should be considered the fault of Nick and not * Peter. * * copyright (c) 1999 Nick Gorham * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ********************************************************************** * * $Id: SQLDescribeParam.c,v 1.7 2009/02/18 17:59:08 lurcher Exp $ * * $Log: SQLDescribeParam.c,v $ * Revision 1.7 2009/02/18 17:59:08 lurcher * Shift to using config.h, the compile lines were making it hard to spot warnings * * Revision 1.6 2008/05/20 13:43:47 lurcher * Vms fixes * * Revision 1.5 2007/04/02 10:50:19 lurcher * Fix some 64bit problems (only when sizeof(SQLLEN) == 8 ) * * Revision 1.4 2003/10/30 18:20:45 lurcher * * Fix broken thread protection * Remove SQLNumResultCols after execute, lease S4/S% to driver * Fix string overrun in SQLDriverConnect * Add initial support for Interix * * Revision 1.3 2002/12/05 17:44:30 lurcher * * Display unknown return values in return logging * * Revision 1.2 2001/12/13 13:00:32 lurcher * * Remove most if not all warnings on 64 bit platforms * Add support for new MS 3.52 64 bit changes * Add override to disable the stopping of tracing * Add MAX_ROWS support in postgres driver * * Revision 1.1.1.1 2001/10/17 16:40:05 lurcher * * First upload to SourceForge * * Revision 1.3 2001/07/03 09:30:41 nick * * Add ability to alter size of displayed message in the log * * Revision 1.2 2001/04/12 17:43:36 nick * * Change logging and added autotest to odbctest * * Revision 1.1.1.1 2000/09/04 16:42:52 nick * Imported Sources * * Revision 1.10 2000/07/28 16:34:52 ngorham * * Fix problems with SQLColAttributes, and SQLDescribeParam * * Revision 1.9 1999/11/13 23:40:59 ngorham * * Alter the way DM logging works * Upgrade the Postgres driver to 6.4.6 * * Revision 1.8 1999/11/10 03:51:33 ngorham * * Update the error reporting in the DM to enable ODBC 3 and 2 calls to * work at the same time * * Revision 1.7 1999/10/24 23:54:17 ngorham * * First part of the changes to the error reporting * * Revision 1.6 1999/10/09 00:56:16 ngorham * * Added Manush's patch to map ODBC 3-2 datetime values * * Revision 1.5 1999/09/21 22:34:24 ngorham * * Improve performance by removing unneeded logging calls when logging is * disabled * * Revision 1.4 1999/07/10 21:10:16 ngorham * * Adjust error sqlstate from driver manager, depending on requested * version (ODBC2/3) * * Revision 1.3 1999/07/04 21:05:07 ngorham * * Add LGPL Headers to code * * Revision 1.2 1999/06/30 23:56:54 ngorham * * Add initial thread safety code * * Revision 1.1.1.1 1999/05/29 13:41:05 sShandyb * first go at it * * Revision 1.1.1.1 1999/05/27 18:23:17 pharvey * Imported sources * * Revision 1.3 1999/05/03 19:50:43 nick * Another check point * * Revision 1.2 1999/04/30 16:22:47 nick * Another checkpoint * * Revision 1.1 1999/04/25 23:06:11 nick * Initial revision * * **********************************************************************/ #include #include "drivermanager.h" static char const rcsid[]= "$RCSfile: SQLDescribeParam.c,v $ $Revision: 1.7 $"; SQLRETURN SQLDescribeParam( SQLHSTMT statement_handle, SQLUSMALLINT ipar, SQLSMALLINT *pf_sql_type, SQLULEN *pcb_param_def, SQLSMALLINT *pib_scale, SQLSMALLINT *pf_nullable ) { DMHSTMT statement = (DMHSTMT) statement_handle; SQLRETURN ret; SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ]; SQLCHAR s6[ 100 + LOG_MESSAGE_LEN ]; /* * check statement */ if ( !__validate_stmt( statement )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: SQL_INVALID_HANDLE" ); return SQL_INVALID_HANDLE; } function_entry( statement ); if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tEntry:\ \n\t\t\tStatement = %p\ \n\t\t\tParameter Number = %d\ \n\t\t\tSQL Type = %p\ \n\t\t\tParam Def = %p\ \n\t\t\tScale = %p\ \n\t\t\tNullable = %p", statement, ipar, pf_sql_type, pcb_param_def, pib_scale, pf_nullable ); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } thread_protect( SQL_HANDLE_STMT, statement ); if ( ipar < 1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: 07009" ); __post_internal_error( &statement -> error, ERROR_07009, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } /* * check states */ if ( statement -> state == STATE_S1 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if (( statement -> state == STATE_S4 || statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) && statement -> connection -> environment -> requested_version >= SQL_OV_ODBC3 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if (( statement -> state == STATE_S8 || statement -> state == STATE_S9 || statement -> state == STATE_S10 || statement -> state == STATE_S13 || statement -> state == STATE_S14 || statement -> state == STATE_S15 ) && statement -> connection -> environment -> requested_version == SQL_OV_ODBC2 ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } else if ( statement -> state == STATE_S11 || statement -> state == STATE_S12 ) { if ( statement -> interupted_func != SQL_API_SQLDESCRIBEPARAM ) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: HY010" ); __post_internal_error( &statement -> error, ERROR_HY010, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } } if ( !CHECK_SQLDESCRIBEPARAM( statement -> connection )) { dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, "Error: IM001" ); __post_internal_error( &statement -> error, ERROR_IM001, NULL, statement -> connection -> environment -> requested_version ); return function_return_nodrv( SQL_HANDLE_STMT, statement, SQL_ERROR ); } ret = SQLDESCRIBEPARAM( statement -> connection, statement -> driver_stmt, ipar, pf_sql_type, pcb_param_def, pib_scale, pf_nullable ); if ( ret == SQL_STILL_EXECUTING ) { statement -> interupted_func = SQL_API_SQLDESCRIBEPARAM; if ( statement -> state != STATE_S11 && statement -> state != STATE_S12 ) statement -> state = STATE_S11; } if ( (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) && pf_sql_type ) { *pf_sql_type = __map_type(MAP_SQL_D2DM,statement->connection, *pf_sql_type); } if ( log_info.log_flag ) { sprintf( statement -> msg, "\n\t\tExit:[%s]\ \n\t\t\tSQL Type = %p\ \n\t\t\tParam Def = %p\ \n\t\t\tScale = %p\ \n\t\t\tNullable = %p", __get_return_status( ret, s6 ), __sptr_as_string( s1, pf_sql_type ), __ptr_as_string( s2, (SQLLEN*)pcb_param_def ), __sptr_as_string( s3, pib_scale ), __sptr_as_string( s4, pf_nullable )); dm_log_write( __FILE__, __LINE__, LOG_INFO, LOG_INFO, statement -> msg ); } return function_return( SQL_HANDLE_STMT, statement, ret, DEFER_R3 ); }