Changeset: 1146e57bb1c7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1146e57bb1c7
Modified Files:
        buildtools/conf/fixlicense.py
        clients/odbc/driver/ODBCDbc.h
        clients/odbc/driver/ODBCDesc.h
        clients/odbc/driver/ODBCGlobal.h
        clients/odbc/driver/ODBCStmt.h
        clients/odbc/driver/ODBCUtil.c
        clients/odbc/driver/SQLAllocConnect.c
        clients/odbc/driver/SQLAllocEnv.c
        clients/odbc/driver/SQLAllocHandle.c
        clients/odbc/driver/SQLAllocStmt.c
        clients/odbc/driver/SQLBindCol.c
        clients/odbc/driver/SQLBindParameter.c
        clients/odbc/driver/SQLBrowseConnect.c
        clients/odbc/driver/SQLCancel.c
        clients/odbc/driver/SQLCloseCursor.c
        clients/odbc/driver/SQLColAttribute.c
        clients/odbc/driver/SQLColAttributes.c
        clients/odbc/driver/SQLColumnPrivileges.c
        clients/odbc/driver/SQLColumns.c
        clients/odbc/driver/SQLConnect.c
        clients/odbc/driver/SQLDataSources.c
        clients/odbc/driver/SQLDescribeCol.c
        clients/odbc/driver/SQLDriverConnect.c
        clients/odbc/driver/SQLEndTran.c
        clients/odbc/driver/SQLError.c
        clients/odbc/driver/SQLExecDirect.c
        clients/odbc/driver/SQLExecute.c
        clients/odbc/driver/SQLExtendedFetch.c
        clients/odbc/driver/SQLFetch.c
        clients/odbc/driver/SQLFetchScroll.c
        clients/odbc/driver/SQLForeignKeys.c
        clients/odbc/driver/SQLFreeConnect.c
        clients/odbc/driver/SQLFreeEnv.c
        clients/odbc/driver/SQLFreeHandle.c
        clients/odbc/driver/SQLFreeStmt.c
        clients/odbc/driver/SQLGetConnectAttr.c
        clients/odbc/driver/SQLGetConnectOption.c
        clients/odbc/driver/SQLGetCursorName.c
        clients/odbc/driver/SQLGetDescField.c
        clients/odbc/driver/SQLGetDescRec.c
        clients/odbc/driver/SQLGetDiagField.c
        clients/odbc/driver/SQLGetDiagRec.c
        clients/odbc/driver/SQLGetEnvAttr.c
        clients/odbc/driver/SQLGetInfo.c
        clients/odbc/driver/SQLGetStmtAttr.c
        clients/odbc/driver/SQLGetStmtOption.c
        clients/odbc/driver/SQLGetTypeInfo.c
        clients/odbc/driver/SQLNativeSql.c
        clients/odbc/driver/SQLParamOptions.c
        clients/odbc/driver/SQLPrepare.c
        clients/odbc/driver/SQLPrimaryKeys.c
        clients/odbc/driver/SQLProcedureColumns.c
        clients/odbc/driver/SQLProcedures.c
        clients/odbc/driver/SQLSetConnectAttr.c
        clients/odbc/driver/SQLSetConnectOption.c
        clients/odbc/driver/SQLSetCursorName.c
        clients/odbc/driver/SQLSetDescField.c
        clients/odbc/driver/SQLSetDescRec.c
        clients/odbc/driver/SQLSetParam.c
        clients/odbc/driver/SQLSetStmtAttr.c
        clients/odbc/driver/SQLSetStmtOption.c
        clients/odbc/driver/SQLSpecialColumns.c
        clients/odbc/driver/SQLStatistics.c
        clients/odbc/driver/SQLTablePrivileges.c
        clients/odbc/driver/SQLTables.c
        clients/odbc/driver/SQLTransact.c
        clients/odbc/samples/arraytest.c
        gdk/gdk_aggr.c
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (truncated from 2769 to 300 lines):

diff --git a/buildtools/conf/fixlicense.py b/buildtools/conf/fixlicense.py
--- a/buildtools/conf/fixlicense.py
+++ b/buildtools/conf/fixlicense.py
@@ -70,7 +70,7 @@ def main():
     pre = post = start = end = None
     verbose = False
     try:
-        opts, args = getopt.getopt(sys.argv[1:], 'arl:v',
+        opts, args = getopt.getopt(sys.argv[1:], 'arl:sv',
                                    ['pre=', 'post=', 'start=', 'end='])
     except getopt.GetoptError:
         print >> sys.stderr, usage % {'prog': sys.argv[0]}
@@ -80,6 +80,8 @@ def main():
             func = addlicense
         elif o == '-r':
             func = dellicense
+        elif o == '-s':
+            func = listfile
         elif o == '-l':
             try:
                 f = open(a)
@@ -144,7 +146,7 @@ suffixrules = {
     '.pm':   ('',      '',    '# ',   ''),
     '.py':   ('',      '',    '# ',   ''),
     '.rb':   ('',      '',    '# ',   ''),
-    '.rc':   ('',      '',    '# ',   ''),
+    '.rc':   ('',      '',    '// ',  ''),
     '.rst':  ('',      '',    '.. ',  ''),
     '.sh':   ('',      '',    '# ',   ''),
     '.sql':  ('',      '',    '-- ',  ''),
@@ -175,10 +177,6 @@ def addlicense(file, pre = None, post = 
                 ext = '.sh'
             else:
                 return
-        if ext == '.rc':
-            # .rc suffix only used for shell scripts in TestTools directory
-            if 'TestTools' not in file:
-                return
         pre, post, start, end = suffixrules[ext]
     if not pre:
         pre = ''
@@ -297,10 +295,6 @@ def dellicense(file, pre = None, post = 
                 ext = '.sh'
             else:
                 return
-        if ext == '.rc':
-            # .rc suffix only used for shell scripts in TestTools directory
-            if 'TestTools' not in file:
-                return
         pre, post, start, end = suffixrules[ext]
     if not pre:
         pre = ''
@@ -459,5 +453,142 @@ def dellicense(file, pre = None, post = 
     except OSError:
         print >> sys.stderr, 'Cannot move file %s into position' % file
 
+def listfile(file, pre = None, post = None, start = None, end = None, verbose 
= False):
+    ext = ''
+    if pre is None and post is None and start is None and end is None:
+        root, ext = os.path.splitext(file)
+        if ext == '.in':
+            # special case: .in suffix doesn't count
+            root, ext = os.path.splitext(root)
+        if not suffixrules.has_key(ext):
+            # no known suffix
+            # see if file starts with #! (i.e. shell script)
+            try:
+                f = open(file)
+                line = f.readline()
+                f.close()
+            except IOError:
+                return
+            if line[:2] == '#!':
+                ext = '.sh'
+            else:
+                return
+        pre, post, start, end = suffixrules[ext]
+    if not pre:
+        pre = ''
+    if not post:
+        post = ''
+    if not start:
+        start = ''
+    if not end:
+        end = ''
+    pre = normalize(pre)
+    post = normalize(post)
+    start = normalize(start)
+    end = normalize(end)
+    try:
+        f = open(file)
+    except IOError:
+        print >> sys.stderr, 'Cannot open file %s' % file
+        return
+    data = f.read()
+    res = re_copyright.search(data)
+    if res is not None:
+        pos = res.end(0)
+        if ext == '.pm':
+            start = pre = post = end = ''
+        nl = data.find('\n', pos) + 1
+        nstart = normalize(start)
+        while normalize(data[pos:nl]) == nstart:
+            pos = nl
+            nl = data.find('\n', pos) + 1
+        line = data[pos:nl]
+        for l in license:
+            nline = normalize(line)
+            if nline.find(normalize(l)) >= 0:
+                pos = nl
+                nl = data.find('\n', pos) + 1
+                line = data[pos:nl]
+                nline = normalize(line)
+            else:
+                # doesn't match
+                print >> sys.stderr, 'line doesn\'t match in file %s' % file
+                print >> sys.stderr, 'file:    "%s"' % line
+                print >> sys.stderr, 'license: "%s"' % l
+                f.close()
+                try:
+                    os.unlink(file + '.new')
+                except OSError:
+                    pass
+                return
+        pos2 = pos
+        nl2 = nl
+        if normalize(line) == normalize(start):
+            pos2 = nl2
+            nl2 = data.find('\n', pos2) + 1
+            line = data[pos2:nl2]
+            nline = normalize(line)
+        if nline.find('Contributors') >= 0:
+            nstart = normalize(start)
+            nstartlen = len(nstart)
+            while normalize(line)[:nstartlen] == nstart and \
+                  len(normalize(line)) > 1:
+                pos2 = nl2
+                nl2 = data.find('\n', pos2) + 1
+                line = data[pos2:nl2]
+                nline = normalize(line)
+            pos = pos2
+    else:
+        f.seek(0)
+        line = f.readline()
+        if line[:2] == '#!':
+            line = f.readline()
+            if line and line == '\n':
+                line = f.readline()
+        if line.find('-*-') >= 0:
+            line = f.readline()
+            if line and line == '\n':
+                line = f.readline()
+        if line[:5] == '<?xml':
+            line = f.readline()
+            if line and line == '\n':
+                line = f.readline()
+        nline = normalize(line)
+        if pre:
+            if nline == pre:
+                line = f.readline()
+                nline = normalize(line)
+            else:
+                # doesn't match
+                print >> sys.stderr, 'PRE doesn\'t match in file %s' % file
+                f.close()
+                try:
+                    os.unlink(file + '.new')
+                except OSError:
+                    pass
+                return
+        for l in license:
+            if nline.find(normalize(l)) >= 0:
+                line = f.readline()
+                nline = normalize(line)
+            else:
+                # doesn't match
+                print >> sys.stderr, 'line doesn\'t match in file %s' % file
+                print >> sys.stderr, 'file:    "%s"' % line
+                print >> sys.stderr, 'license: "%s"' % l
+                f.close()
+                return
+        if post:
+            if nline == post:
+                line = f.readline()
+                nline = normalize(line)
+            else:
+                # doesn't match
+                print >> sys.stderr, 'POST doesn\'t match in file %s' % file
+                f.close()
+                return
+    f.close()
+    print file
+
 if __name__ == '__main__' or sys.argv[0] == __name__:
     main()
diff --git a/clients/odbc/driver/ODBCDbc.h b/clients/odbc/driver/ODBCDbc.h
--- a/clients/odbc/driver/ODBCDbc.h
+++ b/clients/odbc/driver/ODBCDbc.h
@@ -154,10 +154,10 @@ SQLRETURN ODBCConnectionString(SQLRETURN
                               const char *dsn, const char *uid,
                               const char *pwd, const char *host,
                               int port, const char *database);
-SQLRETURN SQLAllocStmt_(ODBCDbc *dbc, SQLHANDLE *pnOutputHandle);
-SQLRETURN SQLConnect_(ODBCDbc *dbc, SQLCHAR *szDataSource, SQLSMALLINT 
nDataSourceLength, SQLCHAR *szUID, SQLSMALLINT nUIDLength, SQLCHAR *szPWD, 
SQLSMALLINT nPWDLength, const char *host, int port, const char *schema);
-SQLRETURN SQLGetConnectAttr_(ODBCDbc *dbc, SQLINTEGER Attribute, SQLPOINTER 
ValuePtr, SQLINTEGER BufferLength, SQLINTEGER *StringLength);
-SQLRETURN SQLSetConnectAttr_(ODBCDbc *dbc, SQLINTEGER Attribute, SQLPOINTER 
ValuePtr, SQLINTEGER StringLength);
+SQLRETURN MNDBAllocStmt(ODBCDbc *dbc, SQLHANDLE *pnOutputHandle);
+SQLRETURN MNDBConnect(ODBCDbc *dbc, SQLCHAR *szDataSource, SQLSMALLINT 
nDataSourceLength, SQLCHAR *szUID, SQLSMALLINT nUIDLength, SQLCHAR *szPWD, 
SQLSMALLINT nPWDLength, const char *host, int port, const char *schema);
+SQLRETURN MNDBGetConnectAttr(ODBCDbc *dbc, SQLINTEGER Attribute, SQLPOINTER 
ValuePtr, SQLINTEGER BufferLength, SQLINTEGER *StringLength);
+SQLRETURN MNDBSetConnectAttr(ODBCDbc *dbc, SQLINTEGER Attribute, SQLPOINTER 
ValuePtr, SQLINTEGER StringLength);
 
 /*
  * Function to translate an ODBC SQL query to native format.
diff --git a/clients/odbc/driver/ODBCDesc.h b/clients/odbc/driver/ODBCDesc.h
--- a/clients/odbc/driver/ODBCDesc.h
+++ b/clients/odbc/driver/ODBCDesc.h
@@ -103,7 +103,7 @@ ODBCDescRec *addODBCDescRec(ODBCDesc *de
 
 SQLULEN ODBCLength(ODBCDescRec *rec, int lengthtype);
 
-SQLRETURN SQLGetDescField_(ODBCDesc *desc, SQLSMALLINT RecordNumber, 
SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, 
SQLINTEGER *StringLength);
-SQLRETURN SQLSetDescField_(ODBCDesc *desc, SQLSMALLINT RecordNumber, 
SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength);
+SQLRETURN MNDBGetDescField(ODBCDesc *desc, SQLSMALLINT RecordNumber, 
SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength, 
SQLINTEGER *StringLength);
+SQLRETURN MNDBSetDescField(ODBCDesc *desc, SQLSMALLINT RecordNumber, 
SQLSMALLINT FieldIdentifier, SQLPOINTER Value, SQLINTEGER BufferLength);
 
 #endif
diff --git a/clients/odbc/driver/ODBCGlobal.h b/clients/odbc/driver/ODBCGlobal.h
--- a/clients/odbc/driver/ODBCGlobal.h
+++ b/clients/odbc/driver/ODBCGlobal.h
@@ -102,10 +102,10 @@
 #endif
 
 /* these functions are called from within the library */
-SQLRETURN SQLAllocHandle_(SQLSMALLINT nHandleType, SQLHANDLE nInputHandle, 
SQLHANDLE *pnOutputHandle);
-SQLRETURN SQLEndTran_(SQLSMALLINT nHandleType, SQLHANDLE nHandle, SQLSMALLINT 
nCompletionType);
-SQLRETURN SQLFreeHandle_(SQLSMALLINT handleType, SQLHANDLE handle);
-SQLRETURN SQLGetDiagRec_(SQLSMALLINT handleType, SQLHANDLE handle, SQLSMALLINT 
recNumber, SQLCHAR *sqlState, SQLINTEGER *nativeErrorPtr, SQLCHAR *messageText, 
SQLSMALLINT bufferLength, SQLSMALLINT *textLengthPtr);
+SQLRETURN MNDBAllocHandle(SQLSMALLINT nHandleType, SQLHANDLE nInputHandle, 
SQLHANDLE *pnOutputHandle);
+SQLRETURN MNDBEndTran(SQLSMALLINT nHandleType, SQLHANDLE nHandle, SQLSMALLINT 
nCompletionType);
+SQLRETURN MNDBFreeHandle(SQLSMALLINT handleType, SQLHANDLE handle);
+SQLRETURN MNDBGetDiagRec(SQLSMALLINT handleType, SQLHANDLE handle, SQLSMALLINT 
recNumber, SQLCHAR *sqlState, SQLINTEGER *nativeErrorPtr, SQLCHAR *messageText, 
SQLSMALLINT bufferLength, SQLSMALLINT *textLengthPtr);
 
 #ifdef ODBCDEBUG
 extern const char *ODBCdebug;
diff --git a/clients/odbc/driver/ODBCStmt.h b/clients/odbc/driver/ODBCStmt.h
--- a/clients/odbc/driver/ODBCStmt.h
+++ b/clients/odbc/driver/ODBCStmt.h
@@ -196,30 +196,30 @@ const char *ODBCGetTypeInfo(int concise_
                            int *sql_data_type, int *sql_datetime_sub);
 int ODBCConciseType(const char *name);
 void ODBCResetStmt(ODBCStmt *stmt);
-SQLRETURN SQLBindParameter_(ODBCStmt *stmt, SQLUSMALLINT ParameterNumber,
+SQLRETURN MNDBBindParameter(ODBCStmt *stmt, SQLUSMALLINT ParameterNumber,
                            SQLSMALLINT InputOutputType, SQLSMALLINT ValueType,
                            SQLSMALLINT ParameterType, SQLULEN ColumnSize,
                            SQLSMALLINT DecimalDigits,
                            SQLPOINTER ParameterValuePtr, SQLLEN BufferLength,
                            SQLLEN *StrLen_or_IndPtr);
-SQLRETURN SQLColAttribute_(ODBCStmt *stmt,
+SQLRETURN MNDBColAttribute(ODBCStmt *stmt,
                           SQLUSMALLINT nCol,
                           SQLUSMALLINT nFieldIdentifier,
                           SQLPOINTER pszValue, SQLSMALLINT nValueLengthMax,
                           SQLSMALLINT *pnValueLength, LENP_OR_POINTER_T 
pnValue);
-SQLRETURN SQLExecDirect_(ODBCStmt *stmt, SQLCHAR *szSqlStr,
+SQLRETURN MNDBExecDirect(ODBCStmt *stmt, SQLCHAR *szSqlStr,
                         SQLINTEGER nSqlStr);
-SQLRETURN SQLExecute_(ODBCStmt *stmt);
-SQLRETURN SQLFetch_(ODBCStmt *stmt);
-SQLRETURN SQLFetchScroll_(ODBCStmt *stmt, SQLSMALLINT nOrientation,
+SQLRETURN MNDBExecute(ODBCStmt *stmt);
+SQLRETURN MNDBFetch(ODBCStmt *stmt);
+SQLRETURN MNDBFetchScroll(ODBCStmt *stmt, SQLSMALLINT nOrientation,
                          SQLLEN nOffset);
-SQLRETURN SQLFreeStmt_(ODBCStmt *stmt, SQLUSMALLINT option);
-SQLRETURN SQLGetStmtAttr_(ODBCStmt *stmt, SQLINTEGER Attribute,
+SQLRETURN MNDBFreeStmt(ODBCStmt *stmt, SQLUSMALLINT option);
+SQLRETURN MNDBGetStmtAttr(ODBCStmt *stmt, SQLINTEGER Attribute,
                          SQLPOINTER Value, SQLINTEGER BufferLength,
                          SQLINTEGER *StringLength);
-SQLRETURN SQLPrepare_(ODBCStmt *stmt, SQLCHAR *szSqlStr,
+SQLRETURN MNDBPrepare(ODBCStmt *stmt, SQLCHAR *szSqlStr,
                      SQLINTEGER nSqlStrLength);
-SQLRETURN SQLSetStmtAttr_(ODBCStmt *stmt, SQLINTEGER Attribute,
+SQLRETURN MNDBSetStmtAttr(ODBCStmt *stmt, SQLINTEGER Attribute,
                          SQLPOINTER Value, SQLINTEGER StringLength);
 const char *ODBCErrorType(const char *msg, const char **emsg);
 
diff --git a/clients/odbc/driver/ODBCUtil.c b/clients/odbc/driver/ODBCUtil.c
--- a/clients/odbc/driver/ODBCUtil.c
+++ b/clients/odbc/driver/ODBCUtil.c
@@ -1011,7 +1011,8 @@ translateCType(SQLSMALLINT ValueType)
        case SQL_INTERVAL:
                return "SQL_INTERVAL";
        default:
-               snprintf(unknown, sizeof(unknown), "unknown (%d)", ValueType);
+               snprintf(unknown, sizeof(unknown), "unknown (%d)",
+                        (int) ValueType);
                return unknown;
        }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to