PostgresLibrary.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. //
  2. // System.Data.SqlClient.PostgresLibrary.cs
  3. //
  4. // PInvoke methods to libpq
  5. // which is PostgreSQL client library
  6. //
  7. // May also contain enumerations,
  8. // data types, or wrapper methods.
  9. //
  10. // Author:
  11. // Rodrigo Moya ([email protected])
  12. // Daniel Morgan ([email protected])
  13. //
  14. // (C) Ximian, Inc 2002
  15. //
  16. using System;
  17. using System.Data;
  18. using System.Runtime.InteropServices;
  19. using System.Diagnostics;
  20. using System.Collections;
  21. namespace System.Data.SqlClient {
  22. /* IMPORTANT: DO NOT CHANGE ANY OF THESE ENUMS BELOW */
  23. internal enum ConnStatusType
  24. {
  25. CONNECTION_OK,
  26. CONNECTION_BAD,
  27. CONNECTION_STARTED,
  28. CONNECTION_MADE,
  29. CONNECTION_AWAITING_RESPONSE,
  30. CONNECTION_AUTH_OK,
  31. CONNECTION_SETENV
  32. }
  33. internal enum PostgresPollingStatusType
  34. {
  35. PGRES_POLLING_FAILED = 0,
  36. PGRES_POLLING_READING,
  37. PGRES_POLLING_WRITING,
  38. PGRES_POLLING_OK,
  39. PGRES_POLLING_ACTIVE
  40. }
  41. internal enum ExecStatusType
  42. {
  43. PGRES_EMPTY_QUERY = 0,
  44. PGRES_COMMAND_OK,
  45. PGRES_TUPLES_OK,
  46. PGRES_COPY_OUT,
  47. PGRES_COPY_IN,
  48. PGRES_BAD_RESPONSE,
  49. PGRES_NONFATAL_ERROR,
  50. PGRES_FATAL_ERROR
  51. }
  52. internal struct PostgresType {
  53. public int oid;
  54. public string typname;
  55. public DbType dbType;
  56. }
  57. sealed internal class PostgresHelper {
  58. // translates the PostgreSQL typname to System.Data.DbType
  59. public static DbType TypnameToSqlDbType(string typname) {
  60. DbType sqlType;
  61. switch(typname) {
  62. case "abstime":
  63. sqlType = DbType.Int32;
  64. break;
  65. case "aclitem":
  66. sqlType = DbType.String;
  67. break;
  68. case "bit":
  69. sqlType = DbType.String;
  70. break;
  71. case "bool":
  72. sqlType = DbType.Boolean;
  73. break;
  74. case "box":
  75. sqlType = DbType.String;
  76. break;
  77. case "bpchar":
  78. sqlType = DbType.String;
  79. break;
  80. case "bytea":
  81. sqlType = DbType.String;
  82. break;
  83. case "char":
  84. sqlType = DbType.String;
  85. break;
  86. case "cidr":
  87. sqlType = DbType.String;
  88. break;
  89. case "circle":
  90. sqlType = DbType.String;
  91. break;
  92. case "date":
  93. sqlType = DbType.String;
  94. break;
  95. case "float4":
  96. sqlType = DbType.Single;
  97. break;
  98. case "float8":
  99. sqlType = DbType.Double;
  100. break;
  101. case "inet":
  102. sqlType = DbType.String;
  103. break;
  104. case "int2":
  105. sqlType = DbType.Int16;
  106. break;
  107. case "int4":
  108. sqlType = DbType.Int32;
  109. break;
  110. case "int8":
  111. sqlType = DbType.Int64;
  112. break;
  113. case "interval":
  114. sqlType = DbType.String;
  115. break;
  116. case "line":
  117. sqlType = DbType.String;
  118. break;
  119. case "lseg":
  120. sqlType = DbType.String;
  121. break;
  122. case "macaddr":
  123. sqlType = DbType.String;
  124. break;
  125. case "money":
  126. sqlType = DbType.Decimal;
  127. break;
  128. case "name":
  129. sqlType = DbType.String;
  130. break;
  131. case "numeric":
  132. sqlType = DbType.Decimal;
  133. break;
  134. case "oid":
  135. sqlType = DbType.Int32;
  136. break;
  137. case "path":
  138. sqlType = DbType.String;
  139. break;
  140. case "point":
  141. sqlType = DbType.String;
  142. break;
  143. case "polygon":
  144. sqlType = DbType.String;
  145. break;
  146. case "refcursor":
  147. sqlType = DbType.String;
  148. break;
  149. case "reltime":
  150. sqlType = DbType.String;
  151. break;
  152. case "text":
  153. sqlType = DbType.String;
  154. break;
  155. case "time":
  156. sqlType = DbType.String;
  157. break;
  158. case "timestamp":
  159. sqlType = DbType.String;
  160. break;
  161. case "timestamptz":
  162. sqlType = DbType.String;
  163. break;
  164. case "timetz":
  165. sqlType = DbType.String;
  166. break;
  167. case "tinterval":
  168. sqlType = DbType.String;
  169. break;
  170. case "varbit":
  171. sqlType = DbType.String;
  172. break;
  173. case "varchar":
  174. sqlType = DbType.String;
  175. break;
  176. default:
  177. sqlType = DbType.String;
  178. break;
  179. }
  180. return sqlType;
  181. }
  182. // Converts data value from database to .NET System type.
  183. public static object ConvertDbTypeToSystem (DbType typ, String value) {
  184. object obj = null;
  185. // FIXME: more types need
  186. // to be converted
  187. // from PostgreSQL oid type
  188. // to .NET System.<type>
  189. switch(typ) {
  190. case DbType.String:
  191. obj = (object) String.Copy(value);
  192. break;
  193. case DbType.Boolean:
  194. obj = (object) Boolean.Parse(value);
  195. break;
  196. case DbType.Int16:
  197. obj = (object) Int16.Parse(value);
  198. break;
  199. case DbType.Int32:
  200. obj = (object) Int32.Parse(value);
  201. break;
  202. case DbType.Int64:
  203. obj = (object) Int64.Parse(value);
  204. break;
  205. case DbType.Decimal:
  206. obj = (object) Decimal.Parse(value);
  207. break;
  208. case DbType.Single:
  209. obj = (object) Single.Parse(value);
  210. break;
  211. case DbType.Double:
  212. obj = (object) Double.Parse(value);
  213. break;
  214. default:
  215. obj = (object) String.Copy(value);
  216. break;
  217. }
  218. return obj;
  219. }
  220. // Translates System.Data.DbType to System.Type
  221. public static Type DbTypeToSystemType (DbType dType) {
  222. // FIXME: more types need
  223. // to be mapped
  224. // from PostgreSQL oid type
  225. // to .NET System.<type>
  226. Type typ = null;
  227. switch(dType) {
  228. case DbType.String:
  229. typ = typeof(String);
  230. break;
  231. case DbType.Boolean:
  232. typ = typeof(Boolean);
  233. break;
  234. case DbType.Int16:
  235. typ = typeof(Int16);
  236. break;
  237. case DbType.Int32:
  238. typ = typeof(Int32);
  239. break;
  240. case DbType.Int64:
  241. typ = typeof(Int64);
  242. break;
  243. case DbType.Decimal:
  244. typ = typeof(Decimal);
  245. break;
  246. case DbType.Single:
  247. typ = typeof(Single);
  248. break;
  249. case DbType.Double:
  250. typ = typeof(Double);
  251. break;
  252. default:
  253. typ = typeof(String);
  254. break;
  255. }
  256. return typ;
  257. }
  258. // Find DbType for oid
  259. // which requires a look up of PostgresTypes
  260. // DbType <-> typname <-> oid
  261. public static string OidToTypname (int oid, ArrayList pgTypes) {
  262. // FIXME: more types need
  263. // to be mapped
  264. // from PostgreSQL oid type
  265. // to .NET System.<type>
  266. string typname = "text"; // default
  267. int i;
  268. for(i = 0; i < pgTypes.Count; i++) {
  269. PostgresType pt = (PostgresType) pgTypes[i];
  270. if(pt.oid == oid) {
  271. typname = pt.typname;
  272. break;
  273. }
  274. }
  275. return typname;
  276. }
  277. }
  278. sealed internal class PostgresLibrary
  279. {
  280. #region PInvoke Functions
  281. // pinvoke prototypes to PostgreSQL client library
  282. // pq.dll on windows and libpq.so on linux
  283. [DllImport("pq")]
  284. public static extern IntPtr PQconnectStart (string conninfo);
  285. // PGconn *PQconnectStart(const char *conninfo);
  286. [DllImport("pq")]
  287. public static extern PostgresPollingStatusType PQconnectPoll (IntPtr conn);
  288. // PostgresPollingStatusType PQconnectPoll(PGconn *conn);
  289. [DllImport("pq")]
  290. public static extern IntPtr PQconnectdb (string conninfo);
  291. // PGconn *PQconnectdb(const char *conninfo);
  292. [DllImport("pq")]
  293. public static extern IntPtr PQsetdbLogin (string pghost,
  294. string pgport, string pgoptions,
  295. string pgtty, string dbName,
  296. string login, string pwd);
  297. // PGconn *PQsetdbLogin(const char *pghost,
  298. // const char *pgport, const char *pgoptions,
  299. // const char *pgtty, const char *dbName,
  300. // const char *login, const char *pwd);
  301. [DllImport("pq")]
  302. public static extern void PQfinish (IntPtr conn);
  303. // void PQfinish(PGconn *conn);
  304. [DllImport("pq")]
  305. public static extern IntPtr PQconndefaults ();
  306. // PQconninfoOption *PQconndefaults(void);
  307. [DllImport("pq")]
  308. public static extern void PQconninfoFree (IntPtr connOptions);
  309. // void PQconninfoFree(PQconninfoOption *connOptions);
  310. [DllImport("pq")]
  311. public static extern int PQresetStart (IntPtr conn);
  312. // int PQresetStart(PGconn *conn);
  313. [DllImport("pq")]
  314. public static extern IntPtr PQresetPoll (IntPtr conn);
  315. // PostgresPollingStatusType PQresetPoll(PGconn *conn);
  316. [DllImport("pq")]
  317. public static extern void PQreset (IntPtr conn);
  318. // void PQreset(PGconn *conn);
  319. [DllImport("pq")]
  320. public static extern int PQrequestCancel (IntPtr conn);
  321. // int PQrequestCancel(PGconn *conn);
  322. [DllImport("pq")]
  323. public static extern string PQdb (IntPtr conn);
  324. // char *PQdb(const PGconn *conn);
  325. [DllImport("pq")]
  326. public static extern string PQuser (IntPtr conn);
  327. // char *PQuser(const PGconn *conn);
  328. [DllImport("pq")]
  329. public static extern string PQpass (IntPtr conn);
  330. // char *PQpass(const PGconn *conn);
  331. [DllImport("pq")]
  332. public static extern string PQhost (IntPtr conn);
  333. // char *PQhost(const PGconn *conn);
  334. [DllImport("pq")]
  335. public static extern string PQport (IntPtr conn);
  336. // char *PQport(const PGconn *conn);
  337. [DllImport("pq")]
  338. public static extern string PQtty (IntPtr conn);
  339. // char *PQtty(const PGconn *conn);
  340. [DllImport("pq")]
  341. public static extern string PQoptions (IntPtr conn);
  342. // char *PQoptions(const PGconn *conn);
  343. [DllImport("pq")]
  344. public static extern ConnStatusType PQstatus (IntPtr conn);
  345. // ConnStatusType PQstatus(const PGconn *conn);
  346. [DllImport("pq")]
  347. public static extern string PQerrorMessage (IntPtr conn);
  348. // char *PQerrorMessage(const PGconn *conn);
  349. [DllImport("pq")]
  350. public static extern int PQsocket (IntPtr conn);
  351. // int PQsocket(const PGconn *conn);
  352. [DllImport("pq")]
  353. public static extern int PQbackendPID (IntPtr conn);
  354. // int PQbackendPID(const PGconn *conn);
  355. [DllImport("pq")]
  356. public static extern int PQclientEncoding (IntPtr conn);
  357. // int PQclientEncoding(const PGconn *conn);
  358. [DllImport("pq")]
  359. public static extern int PQsetClientEncoding (IntPtr conn,
  360. string encoding);
  361. // int PQsetClientEncoding(PGconn *conn,
  362. // const char *encoding);
  363. //FIXME: when loading, causes runtime exception
  364. //[DllImport("pq")]
  365. //public static extern IntPtr PQgetssl (IntPtr conn);
  366. // SSL *PQgetssl(PGconn *conn);
  367. [DllImport("pq")]
  368. public static extern void PQtrace (IntPtr conn,
  369. IntPtr debug_port);
  370. // void PQtrace(PGconn *conn,
  371. // FILE *debug_port);
  372. [DllImport("pq")]
  373. public static extern void PQuntrace (IntPtr conn);
  374. // void PQuntrace(PGconn *conn);
  375. [DllImport("pq")]
  376. public static extern IntPtr PQsetNoticeProcessor (IntPtr conn,
  377. IntPtr proc, IntPtr arg);
  378. // PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
  379. // PQnoticeProcessor proc, void *arg);
  380. [DllImport("pq")]
  381. public static extern int PQescapeString (string to,
  382. string from, int length);
  383. // size_t PQescapeString(char *to,
  384. // const char *from, size_t length);
  385. [DllImport("pq")]
  386. public static extern string PQescapeBytea (string bintext,
  387. int binlen, IntPtr bytealen);
  388. // unsigned char *PQescapeBytea(unsigned char *bintext,
  389. // size_t binlen, size_t *bytealen);
  390. [DllImport("pq")]
  391. public static extern IntPtr PQexec (IntPtr conn,
  392. string query);
  393. // PGresult *PQexec(PGconn *conn,
  394. // const char *query);
  395. [DllImport("pq")]
  396. public static extern IntPtr PQnotifies (IntPtr conn);
  397. // PGnotify *PQnotifies(PGconn *conn);
  398. [DllImport("pq")]
  399. public static extern void PQfreeNotify (IntPtr notify);
  400. // void PQfreeNotify(PGnotify *notify);
  401. [DllImport("pq")]
  402. public static extern int PQsendQuery (IntPtr conn,
  403. string query);
  404. // int PQsendQuery(PGconn *conn,
  405. // const char *query);
  406. [DllImport("pq")]
  407. public static extern IntPtr PQgetResult (IntPtr conn);
  408. // PGresult *PQgetResult(PGconn *conn);
  409. [DllImport("pq")]
  410. public static extern int PQisBusy (IntPtr conn);
  411. // int PQisBusy(PGconn *conn);
  412. [DllImport("pq")]
  413. public static extern int PQconsumeInput (IntPtr conn);
  414. // int PQconsumeInput(PGconn *conn);
  415. [DllImport("pq")]
  416. public static extern int PQgetline (IntPtr conn,
  417. string str, int length);
  418. // int PQgetline(PGconn *conn,
  419. // char *string, int length);
  420. [DllImport("pq")]
  421. public static extern int PQputline (IntPtr conn,
  422. string str);
  423. // int PQputline(PGconn *conn,
  424. // const char *string);
  425. [DllImport("pq")]
  426. public static extern int PQgetlineAsync (IntPtr conn,
  427. string buffer, int bufsize);
  428. // int PQgetlineAsync(PGconn *conn, char *buffer,
  429. // int bufsize);
  430. [DllImport("pq")]
  431. public static extern int PQputnbytes (IntPtr conn,
  432. string buffer, int nbytes);
  433. // int PQputnbytes(PGconn *conn,
  434. //const char *buffer, int nbytes);
  435. [DllImport("pq")]
  436. public static extern int PQendcopy (IntPtr conn);
  437. // int PQendcopy(PGconn *conn);
  438. [DllImport("pq")]
  439. public static extern int PQsetnonblocking (IntPtr conn,
  440. int arg);
  441. // int PQsetnonblocking(PGconn *conn, int arg);
  442. [DllImport("pq")]
  443. public static extern int PQisnonblocking (IntPtr conn);
  444. // int PQisnonblocking(const PGconn *conn);
  445. [DllImport("pq")]
  446. public static extern int PQflush (IntPtr conn);
  447. // int PQflush(PGconn *conn);
  448. [DllImport("pq")]
  449. public static extern IntPtr PQfn (IntPtr conn, int fnid,
  450. IntPtr result_buf, IntPtr result_len,
  451. int result_is_int, IntPtr args,
  452. int nargs);
  453. // PGresult *PQfn(PGconn *conn, int fnid,
  454. // int *result_buf, int *result_len,
  455. // int result_is_int, const PQArgBlock *args,
  456. // int nargs);
  457. [DllImport("pq")]
  458. public static extern ExecStatusType PQresultStatus (IntPtr res);
  459. // ExecStatusType PQresultStatus(const PGresult *res);
  460. [DllImport("pq")]
  461. public static extern string PQresStatus (ExecStatusType status);
  462. // char *PQresStatus(ExecStatusType status);
  463. [DllImport("pq")]
  464. public static extern string PQresultErrorMessage (IntPtr res);
  465. // char *PQresultErrorMessage(const PGresult *res);
  466. [DllImport("pq")]
  467. public static extern int PQntuples (IntPtr res);
  468. // int PQntuples(const PGresult *res);
  469. [DllImport("pq")]
  470. public static extern int PQnfields (IntPtr res);
  471. // int PQnfields(const PGresult *res);
  472. [DllImport("pq")]
  473. public static extern int PQbinaryTuples (IntPtr res);
  474. // int PQbinaryTuples(const PGresult *res);
  475. [DllImport("pq")]
  476. public static extern string PQfname (IntPtr res,
  477. int field_num);
  478. // char *PQfname(const PGresult *res,
  479. // int field_num);
  480. [DllImport("pq")]
  481. public static extern int PQfnumber (IntPtr res,
  482. string field_name);
  483. // int PQfnumber(const PGresult *res,
  484. // const char *field_name);
  485. [DllImport("pq")]
  486. public static extern int PQftype (IntPtr res,
  487. int field_num);
  488. // Oid PQftype(const PGresult *res,
  489. // int field_num);
  490. [DllImport("pq")]
  491. public static extern int PQfsize (IntPtr res,
  492. int field_num);
  493. // int PQfsize(const PGresult *res,
  494. // int field_num);
  495. [DllImport("pq")]
  496. public static extern int PQfmod (IntPtr res, int field_num);
  497. // int PQfmod(const PGresult *res, int field_num);
  498. [DllImport("pq")]
  499. public static extern string PQcmdStatus (IntPtr res);
  500. // char *PQcmdStatus(PGresult *res);
  501. [DllImport("pq")]
  502. public static extern string PQoidStatus (IntPtr res);
  503. // char *PQoidStatus(const PGresult *res);
  504. [DllImport("pq")]
  505. public static extern int PQoidValue (IntPtr res);
  506. // Oid PQoidValue(const PGresult *res);
  507. [DllImport("pq")]
  508. public static extern string PQcmdTuples (IntPtr res);
  509. // char *PQcmdTuples(PGresult *res);
  510. [DllImport("pq")]
  511. public static extern string PQgetvalue (IntPtr res,
  512. int tup_num, int field_num);
  513. // char *PQgetvalue(const PGresult *res,
  514. // int tup_num, int field_num);
  515. [DllImport("pq")]
  516. public static extern int PQgetlength (IntPtr res,
  517. int tup_num, int field_num);
  518. // int PQgetlength(const PGresult *res,
  519. // int tup_num, int field_num);
  520. [DllImport("pq")]
  521. public static extern int PQgetisnull (IntPtr res,
  522. int tup_num, int field_num);
  523. // int PQgetisnull(const PGresult *res,
  524. // int tup_num, int field_num);
  525. [DllImport("pq")]
  526. public static extern void PQclear (IntPtr res);
  527. // void PQclear(PGresult *res);
  528. [DllImport("pq")]
  529. public static extern IntPtr PQmakeEmptyPGresult (IntPtr conn,
  530. IntPtr status);
  531. // PGresult *PQmakeEmptyPGresult(PGconn *conn,
  532. // ExecStatusType status);
  533. [DllImport("pq")]
  534. public static extern void PQprint (IntPtr fout,
  535. IntPtr res, IntPtr ps);
  536. // void PQprint(FILE *fout,
  537. // const PGresult *res, const PQprintOpt *ps);
  538. [DllImport("pq")]
  539. public static extern void PQdisplayTuples (IntPtr res,
  540. IntPtr fp, int fillAlign, string fieldSep,
  541. int printHeader, int quiet);
  542. // void PQdisplayTuples(const PGresult *res,
  543. // FILE *fp, int fillAlign, const char *fieldSep,
  544. // int printHeader, int quiet);
  545. [DllImport("pq")]
  546. public static extern void PQprintTuples (IntPtr res,
  547. IntPtr fout, int printAttName, int terseOutput,
  548. int width);
  549. // void PQprintTuples(const PGresult *res,
  550. // FILE *fout, int printAttName, int terseOutput,
  551. // int width);
  552. [DllImport("pq")]
  553. public static extern int lo_open (IntPtr conn,
  554. int lobjId, int mode);
  555. // int lo_open(PGconn *conn,
  556. // Oid lobjId, int mode);
  557. [DllImport("pq")]
  558. public static extern int lo_close (IntPtr conn, int fd);
  559. // int lo_close(PGconn *conn, int fd);
  560. [DllImport("pq")]
  561. public static extern int lo_read (IntPtr conn,
  562. int fd, string buf, int len);
  563. // int lo_read(PGconn *conn,
  564. // int fd, char *buf, size_t len);
  565. [DllImport("pq")]
  566. public static extern int lo_write (IntPtr conn,
  567. int fd, string buf, int len);
  568. // int lo_write(PGconn *conn,
  569. // int fd, char *buf, size_t len);
  570. [DllImport("pq")]
  571. public static extern int lo_lseek (IntPtr conn,
  572. int fd, int offset, int whence);
  573. // int lo_lseek(PGconn *conn,
  574. // int fd, int offset, int whence);
  575. [DllImport("pq")]
  576. public static extern int lo_creat (IntPtr conn,
  577. int mode);
  578. // Oid lo_creat(PGconn *conn,
  579. // int mode);
  580. [DllImport("pq")]
  581. public static extern int lo_tell (IntPtr conn, int fd);
  582. // int lo_tell(PGconn *conn, int fd);
  583. [DllImport("pq")]
  584. public static extern int lo_unlink (IntPtr conn,
  585. int lobjId);
  586. // int lo_unlink(PGconn *conn,
  587. // Oid lobjId);
  588. [DllImport("pq")]
  589. public static extern int lo_import (IntPtr conn,
  590. string filename);
  591. // Oid lo_import(PGconn *conn,
  592. // const char *filename);
  593. [DllImport("pq")]
  594. public static extern int lo_export (IntPtr conn,
  595. int lobjId, string filename);
  596. // int lo_export(PGconn *conn,
  597. // Oid lobjId, const char *filename);
  598. [DllImport("pq")]
  599. public static extern int PQmblen (string s,
  600. int encoding);
  601. // int PQmblen(const unsigned char *s,
  602. // int encoding);
  603. [DllImport("pq")]
  604. public static extern int PQenv2encoding ();
  605. // int PQenv2encoding(void);
  606. #endregion
  607. }
  608. }