NCBI C++ ToolKit
odbc.h
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* FreeTDS - Library of routines accessing Sybase and Microsoft databases
2  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Brian Bruns
3  * Copyright (C) 2004-2010 Frediano Ziglio
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20 
21 #ifndef _sql_h_
22 #define _sql_h_
23 
24 #define TDS_DONT_DEFINE_DEFAULT_FUNCTIONS
25 #include <freetds/tds.h>
26 #include <freetds/thread.h>
27 #include <freetds/data.h>
28 
29 #if defined(UNIXODBC) || defined(_WIN32) || defined(TDS_NO_DM)
30 #include <sql.h>
31 #include <sqlext.h>
32 #if defined(UNIXODBC) || defined(_WIN32)
33 #include <odbcinst.h>
34 #endif
35 #else /* IODBC */
36 #include <isql.h>
37 #include <isqlext.h>
38 #ifdef HAVE_IODBCINST_H
39 #include <iodbcinst.h>
40 #endif /* HAVE_IODBCINST_H */
41 #endif
42 
43 #ifdef HAVE_WCHAR_H
44 #include <wchar.h>
45 #endif
46 
47 #ifndef HAVE_SQLLEN
48 #ifndef SQLULEN
49 #define SQLULEN SQLUINTEGER
50 #endif
51 #ifndef SQLLEN
52 #define SQLLEN SQLINTEGER
53 #endif
54 #endif
55 
56 #ifndef HAVE_SQLSETPOSIROW
57 #define SQLSETPOSIROW SQLUSMALLINT
58 #endif
59 
60 #ifndef HAVE_SQLROWOFFSET
61 #define SQLROWOFFSET SQLLEN
62 #endif
63 
64 #ifndef HAVE_SQLROWSETSIZE
65 #define SQLROWSETSIZE SQLULEN
66 #endif
67 
68 #ifdef __cplusplus
69 extern "C"
70 {
71 #if 0
72 }
73 #endif
74 #endif
75 
76 #include <freetds/pushvis.h>
77 #ifdef __clang__
78 #define ODBC_API SQL_API __attribute__((visibility("default")))
79 #elif defined(__GNUC__) && __GNUC__ >= 4 && !defined(__MINGW32__)
80 #define ODBC_API SQL_API __attribute__((externally_visible))
81 #else
82 #define ODBC_API SQL_API
83 #endif
84 
85 #if (defined(_WIN32) || defined(__CYGWIN__)) && defined(__GNUC__)
86 # define ODBC_PUBLIC __attribute__((dllexport))
87 #else
88 # define ODBC_PUBLIC
89 #endif
90 
91 #define ODBC_MAX(a,b) ( (a) > (b) ? (a) : (b) )
92 #define ODBC_MIN(a,b) ( (a) < (b) ? (a) : (b) )
93 #define ODBC_CLAMP(x,a,b) ( (x) < (a) ? (a) : (x) > (b) ? (b) : (x) )
94 
95 struct _sql_error
96 {
97  const char *msg;
98  char state2[6];
99  char state3[6];
101  char *server;
102  int linenum;
103  int msgstate;
104  int row;
105 };
106 
107 struct _sql_errors
108 {
109  struct _sql_error *errs;
110  int num_errors;
112  char ranked;
113 };
114 
115 typedef struct _sql_errors TDS_ERRS;
116 
117 #if ENABLE_EXTRA_CHECKS
118 void odbc_check_struct_extra(void *p);
119 #else
120 static inline void odbc_check_struct_extra(void *p) {}
121 #endif
122 
123 #define ODBC_RETURN(handle, rc) \
124  do { odbc_check_struct_extra(handle); \
125  return handle->errs.lastrc = (rc); } while(0)
126 #define ODBC_RETURN_(handle) \
127  do { odbc_check_struct_extra(handle); \
128  return handle->errs.lastrc; } while(0)
129 
130 #define ODBC_EXIT(handle, rc) \
131  do { SQLRETURN _odbc_rc = handle->errs.lastrc = (rc); \
132  odbc_check_struct_extra(handle); \
133  tds_mutex_unlock(&handle->mtx); \
134  return _odbc_rc; } while(0)
135 #define ODBC_EXIT_(handle) \
136  do { SQLRETURN _odbc_rc = handle->errs.lastrc; \
137  odbc_check_struct_extra(handle); \
138  tds_mutex_unlock(&handle->mtx); \
139  return _odbc_rc; } while(0)
140 
141 
142 /** reset errors */
143 void odbc_errs_reset(struct _sql_errors *errs);
144 
145 /** add an error to list */
146 void odbc_errs_add(struct _sql_errors *errs, const char *sqlstate, const char *msg);
147 
148 /** Add an error to list. This functions is for error that came from server */
149 void odbc_errs_add_rdbms(struct _sql_errors *errs, TDS_UINT native, const char *sqlstate, const char *msg, int linenum,
150  int msgstate, const char *server, int row);
151 
152 /** Descriptor header */
153 struct _dheader
154 {
156  /* TODO SQLLEN ?? see http://support.microsoft.com/default.aspx?scid=kb;en-us;298678 */
163 };
164 
165 /** Descriptor record */
166 struct _drecord
167 {
181  /* this point to a constant buffer, do not free or modify */
182  const char *sql_desc_literal_prefix;
183  /* this point to a constant buffer, do not free or modify */
184  const char *sql_desc_literal_suffix;
200  /* this point to a constant buffer, do not free or modify */
201  const char *sql_desc_type_name;
205 };
206 
207 struct _hdesc
208 {
209  SQLSMALLINT htype; /* do not reorder this field */
210  struct _sql_errors errs; /* do not reorder this field */
212  int type;
213  /**
214  * Nested descriptor to use.
215  * -1: nested, cannot have focus.
216  * 0 : self.
217  * >0: descriptor from IPD.
218  */
219  int focus;
221  struct _dheader header;
222  struct _drecord *records;
223 };
224 
225 typedef struct _hdesc TDS_DESC;
226 
227 #define DESC_IRD 1
228 #define DESC_IPD 2
229 #define DESC_ARD 3
230 #define DESC_APD 4
231 
232 struct _heattr
233 {
238 };
239 
240 struct _hchk
241 {
242  SQLSMALLINT htype; /* do not reorder this field */
243  struct _sql_errors errs; /* do not reorder this field */
245 };
246 
247 struct _henv
248 {
249  SQLSMALLINT htype; /* do not reorder this field */
250  struct _sql_errors errs; /* do not reorder this field */
253  struct _heattr attr;
254 };
255 
256 struct _hcattr
257 {
276 #ifdef TDS_NO_DM
278  DSTR tracefile;
279 #endif
280 };
281 
282 #define TDS_MAX_APP_DESC 100
283 
284 struct _hstmt;
285 struct _hdbc
286 {
287  SQLSMALLINT htype; /* do not reorder this field */
288  struct _sql_errors errs; /* do not reorder this field */
290  struct _henv *env;
292  DSTR dsn;
293  DSTR oldpwd;
294 #ifdef ENABLE_ODBC_WIDE
295  int original_charset_num;
296  TDSICONV *mb_conv;
297 #endif
298 
299  /**
300  * Statement executing. This should be set AFTER sending query
301  * to avoid race condition and assure to not overwrite it if
302  * another statement is executing a query.
303  */
304  struct _hstmt *current_statement;
305  /** list of all statements allocated from this connection */
306  struct _hstmt *stmt_list;
307  struct _hcattr attr;
308  /** descriptors associated to connection */
310  /** <>0 if server handle cursors */
311  unsigned int cursor_support:1;
312  unsigned int use_oldpwd:1;
314 
316  char *bcphint;
317 };
318 
319 struct _hsattr
320 {
321  /* TODO remove IRD, ARD, IPD, APD from statement, do not duplicate */
322 /* TDS_DESC *app_row_desc; */
323 /* TDS_DESC *app_param_desc; */
336  /* apd->sql_desc_bind_offset_ptr */
337  /* SQLUINTEGER *param_bind_offset_ptr; */
338  /* apd->sql_desc_bind_type */
339  /* SQLUINTEGER param_bind_type; */
340  /* apd->sql_desc_array_status_ptr */
341  /* SQLUSMALLINT *param_operation_ptr; */
342  /* ipd->sql_desc_array_status_ptr */
343  /* SQLUSMALLINT *param_status_ptr; */
344  /* ipd->sql_desc_rows_processed_ptr */
345  /* SQLUSMALLINT *params_processed_ptr; */
346  /* apd->sql_desc_array_size */
347  /* SQLUINTEGER paramset_size; */
350  /* ard->sql_desc_bind_offset_ptr */
351  /* SQLUINTEGER *row_bind_offset_ptr; */
352  /* ard->sql_desc_array_size */
353  /* SQLUINTEGER row_array_size; */
354  /* ard->sql_desc_bind_type */
355  /* SQLUINTEGER row_bind_type; */
357  /* ard->sql_desc_array_status_ptr */
358  /* SQLUINTEGER *row_operation_ptr; */
359  /* ird->sql_desc_array_status_ptr */
360  /* SQLUINTEGER *row_status_ptr; */
361  /* ird->sql_desc_rows_processed_ptr */
362  /* SQLUINTEGER *rows_fetched_ptr; */
365  /* SQLGetStmtAttr only */
366 /* TDS_DESC *imp_row_desc; */
367 /* TDS_DESC *imp_param_desc; */
372 };
373 
374 typedef enum
375 {
382 
383 typedef enum
384 {
391 
392 struct _hstmt
393 {
394  SQLSMALLINT htype; /* do not reorder this field */
395  struct _sql_errors errs; /* do not reorder this field */
397  struct _hdbc *dbc;
398  /** query to execute */
399  DSTR query;
400  /** socket (only if active) */
401  TDSSOCKET *tds;
402 
403  /** next in list */
404  struct _hstmt *next;
405  /** previous in list */
406  struct _hstmt *prev;
407 
408  /* begin prepared query stuff */
409  unsigned is_prepared_query:1;
410  unsigned prepared_query_is_func:1;
411  unsigned prepared_query_is_rpc:1;
412  /**
413  * Prepared statement needs to be prepared again.
414  * This can happen if the parameters was changed or not specified.
415  */
416  unsigned need_reprepare:1;
417  unsigned param_data_called:1;
418  /* end prepared query stuff */
419 
420  /** parameters saved */
422  /** last valid parameter in params, it's a ODBC index (from 1 relative to descriptor) */
423  int param_num;
424  /** position in prepared query to check parameters, used only in RPC */
425  size_t prepared_pos;
426 
427  unsigned int curr_param_row, num_param_rows;
428 
429  /** number of parameter in current query */
430  unsigned int param_count;
431  int row;
432  /** row count to return */
434  /** status of row, it can happen that this flag mark that we are still parsing row, this it's normal */
436  /* do NOT free dynamic, free from socket or attach to connection */
437  TDSDYNAMIC *dyn;
438  TDS_DESC *ard, *ird, *apd, *ipd;
441  struct _hsattr attr;
442  DSTR cursor_name; /* auto generated cursor name */
444  /* do NOT free cursor, free from socket or attach to connection */
445  TDSCURSOR *cursor;
446 };
447 
448 typedef struct _henv TDS_ENV;
449 typedef struct _hdbc TDS_DBC;
450 typedef struct _hstmt TDS_STMT;
451 typedef struct _hchk TDS_CHK;
452 
453 typedef struct {
454  /* this must be the first member */
455  TDSCOLUMNFUNCS common;
456  void (*set_type_info)(TDSCOLUMN *col, struct _drecord *drec, SQLINTEGER odbc_ver);
457 } TDS_FUNCS;
458 
459 #define IS_HENV(x) (((TDS_CHK *)x)->htype == SQL_HANDLE_ENV)
460 #define IS_HDBC(x) (((TDS_CHK *)x)->htype == SQL_HANDLE_DBC)
461 #define IS_HSTMT(x) (((TDS_CHK *)x)->htype == SQL_HANDLE_STMT)
462 #define IS_HDESC(x) (((TDS_CHK *)x)->htype == SQL_HANDLE_DESC)
463 
464 /* fix a bug in MingW headers */
465 #ifdef __MINGW32__
466 #if SQL_INTERVAL_YEAR == (100 + SQL_CODE_SECOND)
467 
468 #undef SQL_INTERVAL_YEAR
469 #undef SQL_INTERVAL_MONTH
470 #undef SQL_INTERVAL_DAY
471 #undef SQL_INTERVAL_HOUR
472 #undef SQL_INTERVAL_MINUTE
473 #undef SQL_INTERVAL_SECOND
474 #undef SQL_INTERVAL_YEAR_TO_MONTH
475 #undef SQL_INTERVAL_DAY_TO_HOUR
476 #undef SQL_INTERVAL_DAY_TO_MINUTE
477 #undef SQL_INTERVAL_DAY_TO_SECOND
478 #undef SQL_INTERVAL_HOUR_TO_MINUTE
479 #undef SQL_INTERVAL_HOUR_TO_SECOND
480 #undef SQL_INTERVAL_MINUTE_TO_SECOND
481 
482 #define SQL_INTERVAL_YEAR (100 + SQL_CODE_YEAR)
483 #define SQL_INTERVAL_MONTH (100 + SQL_CODE_MONTH)
484 #define SQL_INTERVAL_DAY (100 + SQL_CODE_DAY)
485 #define SQL_INTERVAL_HOUR (100 + SQL_CODE_HOUR)
486 #define SQL_INTERVAL_MINUTE (100 + SQL_CODE_MINUTE)
487 #define SQL_INTERVAL_SECOND (100 + SQL_CODE_SECOND)
488 #define SQL_INTERVAL_YEAR_TO_MONTH (100 + SQL_CODE_YEAR_TO_MONTH)
489 #define SQL_INTERVAL_DAY_TO_HOUR (100 + SQL_CODE_DAY_TO_HOUR)
490 #define SQL_INTERVAL_DAY_TO_MINUTE (100 + SQL_CODE_DAY_TO_MINUTE)
491 #define SQL_INTERVAL_DAY_TO_SECOND (100 + SQL_CODE_DAY_TO_SECOND)
492 #define SQL_INTERVAL_HOUR_TO_MINUTE (100 + SQL_CODE_HOUR_TO_MINUTE)
493 #define SQL_INTERVAL_HOUR_TO_SECOND (100 + SQL_CODE_HOUR_TO_SECOND)
494 #define SQL_INTERVAL_MINUTE_TO_SECOND (100 + SQL_CODE_MINUTE_TO_SECOND)
495 
496 #endif
497 #endif
498 
499 #ifdef _WIN32
500 bool get_login_info(HWND hwndParent, TDSLOGIN * login);
501 #endif
502 
503 #define ODBC_PARAM_LIST \
504  ODBC_PARAM(Servername) \
505  ODBC_PARAM(Server) \
506  ODBC_PARAM(DSN) \
507  ODBC_PARAM(UID) \
508  ODBC_PARAM(PWD) \
509  ODBC_PARAM(Address) \
510  ODBC_PARAM(Port) \
511  ODBC_PARAM(TDS_Version) \
512  ODBC_PARAM(Language) \
513  ODBC_PARAM(Database) \
514  ODBC_PARAM(TextSize) \
515  ODBC_PARAM(PacketSize) \
516  ODBC_PARAM(ClientCharset) \
517  ODBC_PARAM(DumpFile) \
518  ODBC_PARAM(DumpFileAppend) \
519  ODBC_PARAM(DebugFlags) \
520  ODBC_PARAM(Encryption) \
521  ODBC_PARAM(Trusted_Connection) \
522  ODBC_PARAM(APP) \
523  ODBC_PARAM(WSID) \
524  ODBC_PARAM(UseNTLMv2) \
525  ODBC_PARAM(MARS_Connection) \
526  ODBC_PARAM(REALM) \
527  ODBC_PARAM(ServerSPN) \
528  ODBC_PARAM(AttachDbFilename) \
529  ODBC_PARAM(ApplicationIntent) \
530  ODBC_PARAM(Timeout)
531 
532 #define ODBC_PARAM(p) ODBC_PARAM_##p,
533 enum {
536 };
537 #undef ODBC_PARAM
538 
539 
540 /*
541  * connectparams.h
542  */
543 
544 typedef struct {
545  const char *p;
546  size_t len;
548 
549 /**
550  * Parses a connection string for SQLDriverConnect().
551  * \param connect_string point to connection string
552  * \param connect_string_end point to end of connection string
553  * \param connection structure where to store informations
554  * \return true if error, false otherwise
555  */
556 bool odbc_parse_connect_string(TDS_ERRS *errs, const char *connect_string, const char *connect_string_end, TDSLOGIN * login, TDS_PARSED_PARAM *parsed_params);
557 int odbc_get_dsn_info(TDS_ERRS *errs, const char *DSN, TDSLOGIN * login);
558 #ifdef _WIN32
559 int odbc_build_connect_string(TDS_ERRS *errs, TDS_PARSED_PARAM *params, char **out);
560 #endif
561 
562 /*
563  * convert_tds2sql.c
564  */
565 SQLLEN odbc_tds2sql_col(TDS_STMT * stmt, TDSCOLUMN *curcol, int desttype, TDS_CHAR * dest, SQLULEN destlen, const struct _drecord *drec_ixd);
566 SQLLEN odbc_tds2sql_int4(TDS_STMT * stmt, TDS_INT *src, int desttype, TDS_CHAR * dest, SQLULEN destlen);
567 
568 
569 
570 /*
571  * descriptor.c
572  */
573 typedef struct {
577 } SQLTVP;
578 
579 TDS_DESC *desc_alloc(SQLHANDLE parent, int desc_type, SQLSMALLINT alloc_type);
581 SQLRETURN desc_alloc_records(TDS_DESC * desc, unsigned count);
582 SQLRETURN desc_copy(TDS_DESC * dest, TDS_DESC * src);
586 void tvp_free(SQLTVP *tvp);
587 
588 /*
589  * odbc.c
590  */
591 
593 
594 /*
595  * odbc_checks.h
596  */
597 #if ENABLE_EXTRA_CHECKS
598 /* macro */
599 #define CHECK_ENV_EXTRA(env) odbc_check_env_extra(env)
600 #define CHECK_DBC_EXTRA(dbc) odbc_check_dbc_extra(dbc)
601 #define CHECK_STMT_EXTRA(stmt) odbc_check_stmt_extra(stmt)
602 #define CHECK_DESC_EXTRA(desc) odbc_check_desc_extra(desc)
603 /* declarations*/
604 void odbc_check_env_extra(TDS_ENV * env);
605 void odbc_check_dbc_extra(TDS_DBC * dbc);
606 void odbc_check_stmt_extra(TDS_STMT * stmt);
607 void odbc_check_desc_extra(TDS_DESC * desc);
608 #else
609 /* macro */
610 #define CHECK_ENV_EXTRA(env)
611 #define CHECK_DBC_EXTRA(dbc)
612 #define CHECK_STMT_EXTRA(stmt)
613 #define CHECK_DESC_EXTRA(desc)
614 #endif
615 
616 /*
617  * odbc_util.h
618  */
619 
620 /* helpers for ODBC wide string support */
621 #undef _wide
622 #undef _WIDE
623 #ifdef ENABLE_ODBC_WIDE
624 typedef union {
625  char mb[1];
626  SQLWCHAR wide[1];
627 } ODBC_CHAR;
628 # define _wide ,wide
629 # define _wide0 ,0
630 # define _WIDE ,int wide
631 #else
632 # define _wide
633 # define _wide0
634 # define _WIDE
635 # define ODBC_CHAR SQLCHAR
636 #endif
638  ssize_t sql_len _WIDE);
639 void odbc_set_return_status(struct _hstmt *stmt, unsigned int n_row);
640 void odbc_set_return_params(struct _hstmt *stmt, unsigned int n_row);
641 
642 void odbc_set_sql_type_info(TDSCOLUMN * col, struct _drecord *drec, SQLINTEGER odbc_ver);
643 
644 int odbc_sql_to_c_type_default(int sql_type);
645 TDS_SERVER_TYPE odbc_sql_to_server_type(TDSCONNECTION * conn, int sql_type, int sql_unsigned);
647 
649 void odbc_rdbms_version(TDSSOCKET * tds_socket, char *pversion_string);
650 SQLLEN odbc_get_param_len(const struct _drecord *drec_axd,
651  const struct _drecord *drec_ixd,
652  const TDS_DESC* axd, SQLSETPOSIROW n_row);
653 
654 #ifdef ENABLE_ODBC_WIDE
655 DSTR* odbc_dstr_copy_flag(TDS_DBC *dbc, DSTR *s, ssize_t size, const ODBC_CHAR * str, int flag);
656 #define odbc_dstr_copy(dbc, s, len, out) \
657  odbc_dstr_copy_flag(dbc, s, len, sizeof((out)->mb) ? (out) : (out), wide)
658 #define odbc_dstr_copy_oct(dbc, s, len, out) \
659  odbc_dstr_copy_flag(dbc, s, len, out, wide|0x20)
660 #else
662 #define odbc_dstr_copy_oct odbc_dstr_copy
663 #endif
664 
665 
667  SQLINTEGER cbBuffer, void FAR * pcbBuffer,
668  const char *s, ssize_t len, int flag);
669 #ifdef ENABLE_ODBC_WIDE
670 #define odbc_set_string(dbc, buf, buf_len, out_len, s, s_len) \
671  odbc_set_string_flag(dbc, sizeof((buf)->mb) ? (buf) : (buf), buf_len, out_len, s, s_len, (wide) | (sizeof(*(out_len)) == sizeof(SQLSMALLINT)?0:0x10))
672 #define odbc_set_string_oct(dbc, buf, buf_len, out_len, s, s_len) \
673  odbc_set_string_flag(dbc, buf, buf_len, out_len, s, s_len, (wide) | (sizeof(*(out_len)) == sizeof(SQLSMALLINT)?0x20:0x30))
674 #else
675 #define odbc_set_string(dbc, buf, buf_len, out_len, s, s_len) \
676  odbc_set_string_flag(dbc, buf, buf_len, out_len, s, s_len, (sizeof(*(out_len)) == sizeof(SQLSMALLINT)?0:0x10))
677 #define odbc_set_string_oct(dbc, buf, buf_len, out_len, s, s_len) \
678  odbc_set_string_flag(dbc, buf, buf_len, out_len, s, s_len, (sizeof(*(out_len)) == sizeof(SQLSMALLINT)?0x20:0x30))
679 #endif
680 
681 #define odbc_set_dstr_oct(dbc, buf, buf_len, out_len, s) odbc_set_string_oct(dbc, buf, buf_len, out_len, tds_dstr_cstr(s), tds_dstr_len(s))
682 #define odbc_set_dstr(dbc, buf, buf_len, out_len, s) odbc_set_string(dbc, buf, buf_len, out_len, tds_dstr_cstr(s), tds_dstr_len(s))
683 
685 SQLRETURN odbc_set_concise_sql_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only);
687 SQLRETURN odbc_set_concise_c_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only);
688 
689 SQLLEN odbc_get_octet_len(int c_type, const struct _drecord *drec);
690 void odbc_convert_err_set(struct _sql_errors *errs, TDS_INT err);
691 
692 /*
693  * prepare_query.c
694  */
696 SQLRETURN native_sql(struct _hdbc *dbc, DSTR *s);
697 int parse_prepared_query(struct _hstmt *stmt, bool compute_row);
698 int start_parse_prepared_query(struct _hstmt *stmt, bool compute_row);
699 int continue_parse_prepared_query(struct _hstmt *stmt, SQLPOINTER DataPtr, SQLLEN StrLen_or_Ind);
700 const char *parse_const_param(const char * s, TDS_SERVER_TYPE *type);
701 const char *odbc_skip_rpc_name(const char *s);
702 
703 /*
704  * sql2tds.c
705  */
706 SQLRETURN odbc_sql2tds(TDS_STMT * stmt, const struct _drecord *drec_ixd,
707  const struct _drecord *drec_axd, TDSCOLUMN *curcol,
708  bool compute_row, const TDS_DESC* axd,
709  SQLSETPOSIROW n_row);
710 TDS_INT convert_datetime2server(int bindtype, const void *src, TDS_DATETIMEALL * dta);
711 
712 /*
713  * bcp.c
714  */
716 void odbc_bcp_init(TDS_DBC *dbc, const ODBC_CHAR *tblname, const ODBC_CHAR *hfile, const ODBC_CHAR *errfile, int direction _WIDE);
717 void odbc_bcp_control(TDS_DBC *dbc, int field, void *value);
718 void odbc_bcp_colptr(TDS_DBC *dbc, const void * colptr, int table_column);
722 void odbc_bcp_bind(TDS_DBC *dbc, const void * varaddr, int prefixlen, int varlen, const void * terminator, int termlen, int vartype, int table_column);
723 
724 /*
725  * sqlwchar.c
726  */
727 #if SIZEOF_SQLWCHAR != SIZEOF_WCHAR_T
728 size_t sqlwcslen(const SQLWCHAR * s);
729 
730 typedef struct sqlwstr_buf {
731  struct sqlwstr_buf *next;
732  wchar_t buf[256];
733 } SQLWSTRBUF;
734 const wchar_t *sqlwstr(const SQLWCHAR * s, SQLWSTRBUF **bufs);
735 void sqlwstr_free(SQLWSTRBUF *bufs);
736 #define SQLWSTR_BUFS(n) SQLWSTRBUF *bufs = NULL
737 #define SQLWSTR(s) sqlwstr(s, &bufs)
738 #define SQLWSTR_FREE() sqlwstr_free(bufs)
739 #else
740 #define sqlwcslen(s) wcslen(s)
741 
742 #define SQLWSTR_BUFS(n) do {} while(0)
743 #define SQLWSTR(s) ((const wchar_t*)(s))
744 #define SQLWSTR_FREE() do {} while(0)
745 #endif
746 
748 
749 #include <freetds/popvis.h>
750 
751 #ifdef __cplusplus
752 #if 0
753 {
754 #endif
755 }
756 #endif
757 
758 #endif
std::ofstream out("events_result.xml")
main entry point for tests
static CS_CONNECTION * conn
Definition: ct_dynamic.c:25
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
Definition: dlist.tmpl.h:56
void odbc_bcp_sendrow(TDS_DBC *dbc)
Write data in host variables to the table.
Definition: bcp.c:236
int odbc_bcp_batch(TDS_DBC *dbc)
Commit a set of rows to the table.
Definition: bcp.c:278
TDS_INT convert_datetime2server(int bindtype, const void *src, TDS_DATETIMEALL *dta)
Definition: sql2tds.c:40
SQLRETURN desc_alloc_records(TDS_DESC *desc, unsigned count)
Definition: descriptor.c:85
void odbc_bcp_free_storage(TDS_DBC *dbc)
Definition: bcp.c:674
TDS_DBC * desc_get_dbc(TDS_DESC *desc)
Definition: descriptor.c:210
void odbc_errs_add(struct _sql_errors *errs, const char *sqlstate, const char *msg)
add an error to list
Definition: error.c:382
void odbc_set_sql_type_info(TDSCOLUMN *col, struct _drecord *drec, SQLINTEGER odbc_ver)
Definition: odbc_data.c:390
const char * parse_const_param(const char *s, TDS_SERVER_TYPE *type)
Definition: native.c:183
SQLINTEGER odbc_get_param_len(const struct _drecord *drec_axd, const struct _drecord *drec_ixd, const TDS_DESC *axd, SQLUSMALLINT n_row)
SQLRETURN desc_free(TDS_DESC *desc)
Definition: descriptor.c:198
void odbc_errs_reset(struct _sql_errors *errs)
reset errors
Definition: error.c:343
DSTR * odbc_dstr_copy(TDS_DBC *dbc, DSTR *s, int size, const SQLCHAR *str)
int parse_prepared_query(struct _hstmt *stmt, int compute_row)
void odbc_errs_add_rdbms(struct _sql_errors *errs, TDS_UINT native, const char *sqlstate, const char *msg, int linenum, int msgstate, const char *server, int row)
Add an error to list.
Definition: error.c:419
int odbc_get_dsn_info(TDS_ERRS *errs, const char *DSN, TDSLOGIN *login)
Read connection information from given DSN.
int odbc_parse_connect_string(TDS_ERRS *errs, const char *connect_string, const char *connect_string_end, TDSLOGIN *login, TDS_PARSED_PARAM *parsed_params)
Parses a connection string for SQLDriverConnect().
TDS_ODBC_ROW_STATUS
Definition: odbc.h:372
@ NOT_IN_ROW
Definition: odbc.h:373
@ IN_NORMAL_ROW
Definition: odbc.h:374
@ AFTER_COMPUTE_ROW
Definition: odbc.h:376
@ PRE_NORMAL_ROW
Definition: odbc.h:377
@ IN_COMPUTE_ROW
Definition: odbc.h:375
SQLRETURN _SQLRowCount(SQLHSTMT hstmt, SQLINTEGER FAR *pcrow)
int odbc_bcp_done(TDS_DBC *dbc)
Conclude the transfer of data from program variables.
Definition: bcp.c:305
SQLRETURN odbc_sql2tds(TDS_STMT *stmt, const struct _drecord *drec_ixd, const struct _drecord *drec_axd, TDSCOLUMN *curcol, int compute_row, const TDS_DESC *axd, SQLUSMALLINT n_row)
TDS_ODBC_SPECIAL_ROWS
Definition: odbc.h:381
@ ODBC_SPECIAL_GETTYPEINFO
Definition: odbc.h:383
@ ODBC_SPECIAL_SPECIALCOLUMNS
Definition: odbc.h:386
@ ODBC_SPECIAL_COLUMNS
Definition: odbc.h:384
@ ODBC_SPECIAL_PROCEDURECOLUMNS
Definition: odbc.h:385
@ ODBC_SPECIAL_NONE
Definition: odbc.h:382
int start_parse_prepared_query(struct _hstmt *stmt, int compute_row)
SQLRETURN desc_free_records(TDS_DESC *desc)
Definition: descriptor.c:134
SQLRETURN prepare_call(struct _hstmt *stmt)
Definition: native.c:242
void odbc_bcp_colptr(TDS_DBC *dbc, const void *colptr, int table_column)
Override bcp_bind() by pointing to a different host variable.
Definition: bcp.c:204
void odbc_bcp_control(TDS_DBC *dbc, int field, void *value)
Set BCP options for data transfer.
Definition: bcp.c:170
SQLRETURN native_sql(struct _hdbc *dbc, DSTR *s)
Definition: native.c:325
const char * odbc_skip_rpc_name(const char *s)
Definition: native.c:225
void odbc_bcp_bind(TDS_DBC *dbc, const void *varaddr, int prefixlen, int varlen, const void *terminator, int termlen, int vartype, int table_column)
Bind a program host variable to a database column.
Definition: bcp.c:345
TDS_DESC * desc_alloc(SQLHANDLE parent, int desc_type, int alloc_type)
Definition: descriptor.c:40
int odbc_set_stmt_query(struct _hstmt *stmt, const SQLCHAR *sql, ssize_t sql_len)
SQLRETURN desc_copy(TDS_DESC *dest, TDS_DESC *src)
Definition: descriptor.c:149
@ ODBC_PARAM_SIZE
Definition: odbc.h:529
size_t odbc_get_string_size(ssize_t size, const SQLCHAR *str)
void odbc_bcp_init(TDS_DBC *dbc, const SQLCHAR *tblname, const SQLCHAR *hfile, const SQLCHAR *errfile, int direction)
int continue_parse_prepared_query(struct _hstmt *stmt, SQLPOINTER DataPtr, SQLINTEGER StrLen_or_Ind)
TDS_SERVER_TYPE
Definition: proto.h:161
tds_sysdep_int32_type TDS_INT
Definition: tds.h:149
tds_sysdep_int64_type TDS_INT8
Definition: tds.h:153
char TDS_CHAR
Definition: tds.h:144
tds_sysdep_uint32_type TDS_UINT
Definition: tds.h:150
static char sql[1024]
Definition: putdata.c:19
static HSTMT stmt
Definition: rebindpar.c:12
static const char * str(char *buf, int n)
Definition: stats.c:84
static HENV env
Definition: transaction2.c:38
static HDBC dbc
Definition: transaction2.c:39
BOOL get_login_info(HWND hwndParent, TDSLOGIN *login)
Use a dialog window to prompt for user_name and password.
Definition: winlogin.c:172
static TDSLOGIN * login
Definition: dataread.c:31
#define TDS_MAX_APP_DESC
Definition: odbc.h:282
#define SQLULEN
Definition: odbc.h:49
SQLINTEGER odbc_tds2sql_int4(TDS_STMT *stmt, TDS_INT *src, int desttype, TDS_CHAR *dest, SQLUINTEGER destlen)
SQLTVP * tvp_alloc(TDS_STMT *stmt)
Definition: descriptor.c:226
#define ODBC_CHAR
Definition: odbc.h:635
void tvp_free(SQLTVP *tvp)
Definition: descriptor.c:242
#define sqlwcslen(s)
Definition: odbc.h:740
#define SQLLEN
Definition: odbc.h:52
#define _WIDE
Definition: odbc.h:634
SQLINTEGER odbc_tds2sql_col(TDS_STMT *stmt, TDSCOLUMN *curcol, int desttype, TDS_CHAR *dest, SQLUINTEGER destlen, const struct _drecord *drec_ixd)
static void odbc_check_struct_extra(void *p)
Definition: odbc.h:120
int odbc_get_wide_canonic(TDSCONNECTION *conn)
Definition: sqlwchar.c:107
#define ODBC_PARAM_LIST
Definition: odbc.h:503
#define SQLSETPOSIROW
Definition: odbc.h:57
#define tds_mutex
Definition: thread.h:336
static bool trace
#define FAR
Definition: ncbistd.hpp:278
SQLRETURN odbc_set_concise_sql_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only)
Set concise type and all cascading field.
Definition: odbc_util.c:990
SQLRETURN odbc_set_concise_c_type(SQLSMALLINT concise_type, struct _drecord *drec, int check_only)
Set concise type and all cascading field.
Definition: odbc_util.c:1117
TDS_SERVER_TYPE odbc_c_to_server_type(int c_type)
Pass this an SQL_C_* type and get a SYB* type which most closely corresponds to the SQL_C_* type.
Definition: odbc_util.c:606
void odbc_set_return_params(struct _hstmt *stmt, unsigned int n_row)
Definition: odbc_util.c:525
int odbc_sql_to_c_type_default(int sql_type)
Definition: odbc_util.c:680
SQLSMALLINT odbc_get_concise_sql_type(SQLSMALLINT type, SQLSMALLINT interval)
Definition: odbc_util.c:962
SQLRETURN odbc_set_string_flag(TDS_DBC *dbc, SQLPOINTER buffer, SQLINTEGER cbBuffer, void FAR *pcbBuffer, const char *s, ssize_t len, int flag)
Copy a string to client setting size according to ODBC convenction.
Definition: odbc_util.c:304
void odbc_set_return_status(struct _hstmt *stmt, unsigned int n_row)
Definition: odbc_util.c:484
void odbc_convert_err_set(struct _sql_errors *errs, TDS_INT err)
Definition: odbc_util.c:1193
TDS_SERVER_TYPE odbc_sql_to_server_type(TDSCONNECTION *conn, int sql_type, int sql_unsigned)
Definition: odbc_util.c:741
SQLINTEGER odbc_get_octet_len(int c_type, const struct _drecord *drec)
Definition: odbc_util.c:1159
void odbc_rdbms_version(TDSSOCKET *tds_socket, char *pversion_string)
Returns the version of the RDBMS in the ODBC format.
Definition: odbc_util.c:861
SQLSMALLINT odbc_get_concise_c_type(SQLSMALLINT type, SQLSMALLINT interval)
Definition: odbc_util.c:1086
char * buf
int len
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
int ssize_t
Definition: ncbiconf_msvc.h:93
static char terminator
Definition: njn_ioutil.cpp:56
static pcre_uint8 * buffer
Definition: pcretest.c:1051
unsigned long SQLUINTEGER
Definition: sqltypes.h:177
unsigned short SQLUSMALLINT
Definition: sqltypes.h:202
void * SQLPOINTER
Definition: sqltypes.h:195
void * SQLHWND
Definition: sqltypes.h:273
WCHAR SQLWCHAR
Definition: sqltypes.h:458
void * HWND
Definition: sqltypes.h:73
long SQLINTEGER
Definition: sqltypes.h:176
SQLHANDLE SQLHSTMT
Definition: sqltypes.h:216
void * SQLHANDLE
Definition: sqltypes.h:213
signed short int SQLSMALLINT
Definition: sqltypes.h:201
SQLSMALLINT SQLRETURN
Definition: sqltypes.h:210
#define row(bind, expected)
Definition: string_bind.c:73
Definition: odbc.h:573
TDS_DESC * apd
Definition: odbc.h:575
DSTR type_name
Definition: odbc.h:574
TDS_DESC * ipd
Definition: odbc.h:576
this structure is not directed connected to a TDS protocol but keeps any DATE/TIME information.
Definition: tds.h:167
Descriptor header.
Definition: odbc.h:152
SQLINTEGER * sql_desc_bind_offset_ptr
Definition: odbc.h:160
SQLUINTEGER sql_desc_array_size
Definition: odbc.h:155
SQLUSMALLINT sql_desc_count
Definition: odbc.h:157
SQLSMALLINT sql_desc_alloc_type
Definition: odbc.h:153
SQLINTEGER sql_desc_bind_type
Definition: odbc.h:154
SQLUINTEGER * sql_desc_rows_processed_ptr
Definition: odbc.h:159
SQLUSMALLINT * sql_desc_array_status_ptr
Definition: odbc.h:158
Descriptor record.
Definition: odbc.h:164
SQLINTEGER * sql_desc_octet_length_ptr
Definition: odbc.h:188
DSTR sql_desc_base_column_name
Definition: odbc.h:166
SQLINTEGER sql_desc_num_prec_radix
Definition: odbc.h:186
SQLUINTEGER sql_desc_auto_unique_value
Definition: odbc.h:165
SQLSMALLINT sql_desc_unnamed
Definition: odbc.h:199
DSTR sql_desc_local_type_name
Definition: odbc.h:183
SQLSMALLINT sql_desc_nullable
Definition: odbc.h:185
SQLSMALLINT sql_desc_updatable
Definition: odbc.h:201
const char * sql_desc_literal_suffix
Definition: odbc.h:182
const char * sql_desc_type_name
Definition: odbc.h:198
DSTR sql_desc_catalog_name
Definition: odbc.h:169
SQLINTEGER * sql_desc_indicator_ptr
Definition: odbc.h:176
DSTR sql_desc_table_name
Definition: odbc.h:195
SQLINTEGER sql_desc_display_size
Definition: odbc.h:174
DSTR sql_desc_name
Definition: odbc.h:184
SQLSMALLINT sql_desc_rowver
Definition: odbc.h:191
SQLSMALLINT sql_desc_parameter_type
Definition: odbc.h:189
DSTR sql_desc_schema_name
Definition: odbc.h:193
SQLSMALLINT sql_desc_fixed_prec_scale
Definition: odbc.h:175
SQLSMALLINT sql_desc_searchable
Definition: odbc.h:194
SQLINTEGER sql_desc_case_sensitive
Definition: odbc.h:168
SQLINTEGER sql_desc_octet_length
Definition: odbc.h:187
SQLSMALLINT sql_desc_unsigned
Definition: odbc.h:200
SQLUINTEGER sql_desc_length
Definition: odbc.h:178
SQLSMALLINT sql_desc_scale
Definition: odbc.h:192
SQLPOINTER sql_desc_data_ptr
Definition: odbc.h:171
SQLINTEGER sql_desc_datetime_interval_precision
Definition: odbc.h:173
const char * sql_desc_literal_prefix
Definition: odbc.h:180
DSTR sql_desc_base_table_name
Definition: odbc.h:167
DSTR sql_desc_label
Definition: odbc.h:177
SQLSMALLINT sql_desc_precision
Definition: odbc.h:190
SQLSMALLINT sql_desc_datetime_interval_code
Definition: odbc.h:172
SQLSMALLINT sql_desc_type
Definition: odbc.h:196
SQLSMALLINT sql_desc_concise_type
Definition: odbc.h:170
Definition: odbc.h:253
SQLUINTEGER packet_size
Definition: odbc.h:264
SQLUINTEGER metadata_id
Definition: odbc.h:262
DSTR translate_lib
Definition: odbc.h:266
SQLUINTEGER auto_ipd
Definition: odbc.h:256
SQLUINTEGER bulk_enabled
Definition: odbc.h:271
SQLUINTEGER mars_enabled
Definition: odbc.h:269
DSTR current_catalog
Definition: odbc.h:260
SQLUINTEGER cursor_type
Definition: odbc.h:270
SQLUINTEGER access_mode
Definition: odbc.h:254
SQLUINTEGER connection_timeout
Definition: odbc.h:259
SQLUINTEGER async_enable
Definition: odbc.h:255
SQLUINTEGER odbc_cursors
Definition: odbc.h:263
SQLUINTEGER connection_dead
Definition: odbc.h:258
SQLUINTEGER translate_option
Definition: odbc.h:267
SQLUINTEGER login_timeout
Definition: odbc.h:261
SQLHWND quite_mode
Definition: odbc.h:265
SQLUINTEGER txn_isolation
Definition: odbc.h:268
SQLUINTEGER autocommit
Definition: odbc.h:257
Definition: odbc.h:233
struct _sql_errors errs
Definition: odbc.h:235
tds_mutex mtx
Definition: odbc.h:244
SQLSMALLINT htype
Definition: odbc.h:234
Definition: odbc.h:282
struct _hcattr attr
Definition: odbc.h:305
SQLSMALLINT htype
Definition: odbc.h:283
struct _hstmt * stmt_list
list of all statements allocated from this connection
Definition: odbc.h:304
DSTR dsn
Definition: odbc.h:290
struct _sql_errors errs
Definition: odbc.h:284
unsigned int use_oldpwd
Definition: odbc.h:310
TDSSOCKET * tds_socket
Definition: odbc.h:289
TDS_INT default_query_timeout
Definition: odbc.h:311
struct _hstmt * current_statement
Statement executing.
Definition: odbc.h:302
tds_mutex mtx
Definition: odbc.h:289
TDS_DESC * uad[100]
descriptors associated to connection
Definition: odbc.h:307
char * bcphint
Definition: odbc.h:314
DSTR oldpwd
Definition: odbc.h:291
unsigned int cursor_support
<>0 if server handle cursors
Definition: odbc.h:309
struct _henv * env
Definition: odbc.h:288
TDSBCPINFO * bcpinfo
Definition: odbc.h:313
Definition: odbc.h:205
SQLSMALLINT htype
Definition: odbc.h:206
int focus
Nested descriptor to use.
Definition: odbc.h:219
struct _sql_errors errs
Definition: odbc.h:207
struct _drecord * records
Definition: odbc.h:214
tds_mutex mtx
Definition: odbc.h:211
SQLHANDLE parent
Definition: odbc.h:212
struct _dheader header
Definition: odbc.h:213
int type
Definition: odbc.h:211
Definition: odbc.h:225
SQLUINTEGER connection_pooling
Definition: odbc.h:226
SQLINTEGER odbc_version
Definition: odbc.h:228
SQLINTEGER output_nts
Definition: odbc.h:229
SQLUINTEGER cp_match
Definition: odbc.h:227
Definition: odbc.h:242
SQLSMALLINT htype
Definition: odbc.h:243
struct _heattr attr
Definition: odbc.h:249
TDSCONTEXT * tds_ctx
Definition: odbc.h:248
struct _sql_errors errs
Definition: odbc.h:244
tds_mutex mtx
Definition: odbc.h:251
Definition: odbc.h:318
SQLUINTEGER metadata_id
Definition: odbc.h:332
SQLUINTEGER cursor_scrollable
Definition: odbc.h:324
SQLUINTEGER max_rows
Definition: odbc.h:331
DSTR qn_options
Definition: odbc.h:367
SQLUINTEGER keyset_size
Definition: odbc.h:329
SQLUINTEGER enable_auto_ipd
Definition: odbc.h:327
SQLPOINTER fetch_bookmark_ptr
Definition: odbc.h:328
SQLUINTEGER cursor_sensitivity
Definition: odbc.h:325
SQLUINTEGER simulate_cursor
Definition: odbc.h:361
SQLUINTEGER async_enable
Definition: odbc.h:322
SQLUINTEGER row_number
Definition: odbc.h:354
SQLUINTEGER cursor_type
Definition: odbc.h:326
SQLUINTEGER param_focus
Definition: odbc.h:371
SQLUINTEGER use_bookmarks
Definition: odbc.h:362
DSTR qn_msgtext
Definition: odbc.h:366
SQLUINTEGER qn_timeout
Definition: odbc.h:368
SQLUINTEGER concurrency
Definition: odbc.h:323
SQLUINTEGER max_length
Definition: odbc.h:330
SQLUINTEGER noscan
Definition: odbc.h:333
SQLUINTEGER retrieve_data
Definition: odbc.h:347
SQLUINTEGER query_timeout
Definition: odbc.h:346
Definition: odbc.h:390
TDSCURSOR * cursor
Definition: odbc.h:440
unsigned int num_param_rows
Definition: odbc.h:422
struct _hstmt * prev
previous in list
Definition: odbc.h:405
unsigned prepared_query_is_func
Definition: odbc.h:409
unsigned int param_count
number of parameter in current query
Definition: odbc.h:425
unsigned is_prepared_query
Definition: odbc.h:408
TDS_DESC * orig_apd
Definition: odbc.h:434
TDS_ODBC_ROW_STATUS row_status
status of row, it can happen that this flag mark that we are still parsing row, this it's normal
Definition: odbc.h:430
size_t prepared_pos
position in prepared query to check parameters, used only in RPC
Definition: odbc.h:425
TDSPARAMINFO * params
parameters saved
Definition: odbc.h:416
TDSSOCKET * tds
socket (only if active)
Definition: odbc.h:400
struct _sql_errors errs
Definition: odbc.h:392
SQLUINTEGER sql_rowset_size
Definition: odbc.h:435
DSTR cursor_name
Definition: odbc.h:437
TDS_DESC * ard
Definition: odbc.h:433
TDS_ODBC_SPECIAL_ROWS special_row
Definition: odbc.h:438
TDS_INT8 row_count
row count to return
Definition: odbc.h:428
struct _hstmt * next
next in list
Definition: odbc.h:403
SQLSMALLINT htype
Definition: odbc.h:391
unsigned int curr_param_row
Definition: odbc.h:422
int param_num
last valid parameter in params, it's a ODBC index (from 1 relative to descriptor)
Definition: odbc.h:418
TDS_DESC * ird
Definition: odbc.h:433
DSTR query
query to execute
Definition: odbc.h:398
TDS_DESC * apd
Definition: odbc.h:433
struct _hdbc * dbc
Definition: odbc.h:396
unsigned prepared_query_is_rpc
Definition: odbc.h:410
TDS_DESC * ipd
Definition: odbc.h:433
unsigned need_reprepare
Prepared statement needs to be prepared again.
Definition: odbc.h:411
TDSDYNAMIC * dyn
Definition: odbc.h:432
int row
Definition: odbc.h:426
tds_mutex mtx
Definition: odbc.h:396
TDS_DESC * orig_ard
Definition: odbc.h:434
struct _hsattr attr
Definition: odbc.h:436
unsigned param_data_called
Definition: odbc.h:412
char * server
Definition: odbc.h:100
char state2[6]
Definition: odbc.h:97
int linenum
Definition: odbc.h:101
int msgstate
Definition: odbc.h:102
char state3[6]
Definition: odbc.h:98
int row
Definition: odbc.h:103
TDS_UINT native
Definition: odbc.h:99
const char * msg
Definition: odbc.h:96
int num_errors
Definition: odbc.h:109
char ranked
Definition: odbc.h:111
SQLRETURN lastrc
Definition: odbc.h:110
struct _sql_error * errs
Definition: odbc.h:108
Metadata about columns in regular and compute rows.
Definition: tds.h:761
Holds informations about a cursor.
Definition: tds.h:1007
Structure to hold a string.
Definition: tds.h:116
Holds information for a dynamic (also called prepared) query.
Definition: tds.h:1047
Definition: tds.h:584
Hold information for any results.
Definition: tds.h:842
Information for a server connection.
Definition: tds.h:1211
Definition: type.c:6
Modified on Thu Jun 13 17:25:21 2024 by modify_doxy.py rev. 669887