* lo_tell * returns the current seek location of the large object */
| 519 | * returns the current seek location of the large object |
| 520 | */ |
| 521 | int |
| 522 | lo_tell(PGconn *conn, int fd) |
| 523 | { |
| 524 | int retval; |
| 525 | PQArgBlock argv[1]; |
| 526 | PGresult *res; |
| 527 | int result_len; |
| 528 | |
| 529 | if (lo_initialize(conn) < 0) |
| 530 | return -1; |
| 531 | |
| 532 | argv[0].isint = 1; |
| 533 | argv[0].len = 4; |
| 534 | argv[0].u.integer = fd; |
| 535 | |
| 536 | res = PQfn(conn, conn->lobjfuncs->fn_lo_tell, |
| 537 | &retval, &result_len, 1, argv, 1); |
| 538 | if (PQresultStatus(res) == PGRES_COMMAND_OK) |
| 539 | { |
| 540 | PQclear(res); |
| 541 | return retval; |
| 542 | } |
| 543 | else |
| 544 | { |
| 545 | PQclear(res); |
| 546 | return -1; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | /* |
| 551 | * lo_tell64 |
nothing calls this directly
no test coverage detected