tdbc::mysql

Check-in [ea2767612b]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:more efficient use of mysqlSuffixes[] table
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ea2767612be818c880170111de060a497b7fa1d9
User & Date: jan.nijtmans 2015-06-26 13:44:38
References
2016-03-10
02:38 New ticket [f3c6ec0369] segfault on Linux when no mysql libs available. artifact: 3d2c16b4dc user: anonymous
2016-03-09
17:27
follow [ea2767612b] with mysqlStubLibNames Leaf check-in: 138f8939e5 user: aspect tags: aspect-stubinit
Context
2015-10-05
11:54
re-generate "configure" with latest TEA check-in: d6142cd71e user: jan.nijtmans tags: trunk
2015-06-26
13:44
more efficient use of mysqlSuffixes[] table check-in: ea2767612b user: jan.nijtmans tags: trunk
13:03
Make mysqlStubs a 'const'ant, as only Tcl_LoadFile() is allowed to fill this table. check-in: c4394a8239 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/mysqlStubInit.c.

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
...
136
137
138
139
140
141
142
143
144
145
146

147
148

149
150
151
152
153
154
155
    /* @[email protected]: DO NOT EDIT THESE NAMES */
    "mysqlclient_r", "mysqlclient", "mysql", NULL
    /* @[email protected] */
};

/* ABI Version numbers of the MySQL API that we can cope with */

static const char *const mysqlSuffixes[] = {
    "", ".18", ".17", ".16", ".15", NULL
};

/* Names of the functions that we need from MySQL */

static const char *const mysqlSymbolNames[] = {
    /* @[email protected]: DO NOT EDIT THESE NAMES */
    "mysql_server_init",
................................................................................
    shlibext = Tcl_GetObjResult(interp);
    Tcl_IncrRefCount(shlibext);

    /* Walk the list of possible library names to find an MySQL client */

    status = TCL_ERROR;
    for (i = 0; status == TCL_ERROR && mysqlStubLibNames[i] != NULL; ++i) {
	for (j = 0; status == TCL_ERROR && mysqlSuffixes[j] != NULL; ++j) {
	    path = Tcl_NewStringObj(LIBPREFIX, -1);
	    Tcl_AppendToObj(path, mysqlStubLibNames[j], -1);
#ifdef __CYGWIN__

	    Tcl_AppendToObj(path, "-", -1);
	    Tcl_AppendToObj(path, mysqlSuffixes[j]+1, -1);

#endif
	    Tcl_AppendObjToObj(path, shlibext);
#ifndef __CYGWIN__
	    Tcl_AppendToObj(path, mysqlSuffixes[j], -1);
#endif
	    Tcl_IncrRefCount(path);







|
|







 







|



>
|
|
>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
...
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
    /* @[email protected]: DO NOT EDIT THESE NAMES */
    "mysqlclient_r", "mysqlclient", "mysql", NULL
    /* @[email protected] */
};

/* ABI Version numbers of the MySQL API that we can cope with */

static const char mysqlSuffixes[][4] = {
    "", ".18", ".17", ".16", ".15"
};

/* Names of the functions that we need from MySQL */

static const char *const mysqlSymbolNames[] = {
    /* @[email protected]: DO NOT EDIT THESE NAMES */
    "mysql_server_init",
................................................................................
    shlibext = Tcl_GetObjResult(interp);
    Tcl_IncrRefCount(shlibext);

    /* Walk the list of possible library names to find an MySQL client */

    status = TCL_ERROR;
    for (i = 0; status == TCL_ERROR && mysqlStubLibNames[i] != NULL; ++i) {
	for (j = 0; status == TCL_ERROR && (j < sizeof(mysqlSuffixes)/sizeof(mysqlSuffixes[0])); ++j) {
	    path = Tcl_NewStringObj(LIBPREFIX, -1);
	    Tcl_AppendToObj(path, mysqlStubLibNames[j], -1);
#ifdef __CYGWIN__
	    if (*mysqlSuffixes[j]) {
		Tcl_AppendToObj(path, "-", -1);
		Tcl_AppendToObj(path, mysqlSuffixes[j]+1, -1);
	    }
#endif
	    Tcl_AppendObjToObj(path, shlibext);
#ifndef __CYGWIN__
	    Tcl_AppendToObj(path, mysqlSuffixes[j], -1);
#endif
	    Tcl_IncrRefCount(path);