| 1580 | } |
| 1581 | |
| 1582 | PyMODINIT_FUNC |
| 1583 | initupscaledb() |
| 1584 | { |
| 1585 | PyObject *m = Py_InitModule3("upscaledb", upscaledb_methods, "upscaledb"); |
| 1586 | if (!m) |
| 1587 | return; |
| 1588 | |
| 1589 | UpsDatabase_Type.ob_type = &PyType_Type; |
| 1590 | UpsEnvironment_Type.ob_type = &PyType_Type; |
| 1591 | UpsCursor_Type.ob_type = &PyType_Type; |
| 1592 | UpsTransaction_Type.ob_type = &PyType_Type; |
| 1593 | UpsResult_Type.ob_type = &PyType_Type; |
| 1594 | |
| 1595 | PyObject *d = PyModule_GetDict(m); |
| 1596 | g_exception = PyErr_NewException((char *)"upscaledb.error", NULL, NULL); |
| 1597 | PyDict_SetItemString(d, "error", g_exception); |
| 1598 | |
| 1599 | add_const(d, "UPS_TYPE_BINARY", UPS_TYPE_BINARY); |
| 1600 | add_const(d, "UPS_TYPE_CUSTOM", UPS_TYPE_CUSTOM); |
| 1601 | add_const(d, "UPS_TYPE_UINT8", UPS_TYPE_UINT8); |
| 1602 | add_const(d, "UPS_TYPE_UINT16", UPS_TYPE_UINT16); |
| 1603 | add_const(d, "UPS_TYPE_UINT32", UPS_TYPE_UINT32); |
| 1604 | add_const(d, "UPS_TYPE_UINT64", UPS_TYPE_UINT64); |
| 1605 | add_const(d, "UPS_TYPE_REAL32", UPS_TYPE_REAL32); |
| 1606 | add_const(d, "UPS_TYPE_REAL64", UPS_TYPE_REAL64); |
| 1607 | add_const(d, "UPS_SUCCESS", UPS_SUCCESS); |
| 1608 | add_const(d, "UPS_INV_RECORD_SIZE", UPS_INV_RECORD_SIZE); |
| 1609 | add_const(d, "UPS_INV_KEY_SIZE", UPS_INV_KEY_SIZE); |
| 1610 | add_const(d, "UPS_INV_PAGE_SIZE", UPS_INV_PAGE_SIZE); |
| 1611 | add_const(d, "UPS_OUT_OF_MEMORY", UPS_OUT_OF_MEMORY); |
| 1612 | add_const(d, "UPS_INV_PARAMETER", UPS_INV_PARAMETER); |
| 1613 | add_const(d, "UPS_INV_FILE_HEADER", UPS_INV_FILE_HEADER); |
| 1614 | add_const(d, "UPS_INV_FILE_VERSION", UPS_INV_FILE_VERSION); |
| 1615 | add_const(d, "UPS_KEY_NOT_FOUND", UPS_KEY_NOT_FOUND); |
| 1616 | add_const(d, "UPS_DUPLICATE_KEY", UPS_DUPLICATE_KEY); |
| 1617 | add_const(d, "UPS_INTEGRITY_VIOLATED", UPS_INTEGRITY_VIOLATED); |
| 1618 | add_const(d, "UPS_INTERNAL_ERROR", UPS_INTERNAL_ERROR); |
| 1619 | add_const(d, "UPS_WRITE_PROTECTED", UPS_WRITE_PROTECTED); |
| 1620 | add_const(d, "UPS_BLOB_NOT_FOUND", UPS_BLOB_NOT_FOUND); |
| 1621 | add_const(d, "UPS_IO_ERROR", UPS_IO_ERROR); |
| 1622 | add_const(d, "UPS_NOT_IMPLEMENTED", UPS_NOT_IMPLEMENTED); |
| 1623 | add_const(d, "UPS_FILE_NOT_FOUND", UPS_FILE_NOT_FOUND); |
| 1624 | add_const(d, "UPS_WOULD_BLOCK", UPS_WOULD_BLOCK); |
| 1625 | add_const(d, "UPS_NOT_READY", UPS_NOT_READY); |
| 1626 | add_const(d, "UPS_LIMITS_REACHED", UPS_LIMITS_REACHED); |
| 1627 | add_const(d, "UPS_ALREADY_INITIALIZED", UPS_ALREADY_INITIALIZED); |
| 1628 | add_const(d, "UPS_NEED_RECOVERY", UPS_NEED_RECOVERY); |
| 1629 | add_const(d, "UPS_CURSOR_STILL_OPEN", UPS_CURSOR_STILL_OPEN); |
| 1630 | add_const(d, "UPS_FILTER_NOT_FOUND", UPS_FILTER_NOT_FOUND); |
| 1631 | add_const(d, "UPS_TXN_CONFLICT", UPS_TXN_CONFLICT); |
| 1632 | add_const(d, "UPS_KEY_ERASED_IN_TXN", UPS_KEY_ERASED_IN_TXN); |
| 1633 | add_const(d, "UPS_TXN_STILL_OPEN", UPS_TXN_STILL_OPEN); |
| 1634 | add_const(d, "UPS_CURSOR_IS_NIL", UPS_CURSOR_IS_NIL); |
| 1635 | add_const(d, "UPS_DATABASE_NOT_FOUND", UPS_DATABASE_NOT_FOUND); |
| 1636 | add_const(d, "UPS_DATABASE_ALREADY_EXISTS", UPS_DATABASE_ALREADY_EXISTS); |
| 1637 | add_const(d, "UPS_DATABASE_ALREADY_OPEN", UPS_DATABASE_ALREADY_OPEN); |
| 1638 | add_const(d, "UPS_ENVIRONMENT_ALREADY_OPEN", UPS_ENVIRONMENT_ALREADY_OPEN); |
| 1639 | add_const(d, "UPS_LOG_INV_FILE_HEADER", UPS_LOG_INV_FILE_HEADER); |
nothing calls this directly
no test coverage detected