void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)
{
    unsigned long hash;
    OPENSSL_LH_NODE *nn, **rn;
    void *ret;
    lh->error = 0;
    rn = getrn(lh, data, &hash);
    if (*rn == NULL) {
        lh->num_no_delete++;
        return (NULL);
    } else {
        nn = *rn;
        *rn = nn->next;
        ret = nn->data;
        OPENSSL_free(nn);
        lh->num_delete++;
    }
    lh->num_items--;
    if ((lh->num_nodes > MIN_NODES) &&
        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))
        contract(lh);
    return (ret);
}
['static int test_int_lhash(void)\n{\n    static struct {\n        int data;\n        int null;\n    } dels[] = {\n        { 65537,    0 },\n        { 173,      0 },\n        { 999,      1 },\n        { 37,       0 },\n        { 1,        0 },\n        { 34,       1 }\n    };\n    const unsigned int n_dels = OSSL_NELEM(dels);\n    LHASH_OF(int) *h = lh_int_new(&int_hash, &int_cmp);\n    unsigned int i;\n    int testresult = 0, j, *p;\n    if (h == NULL) {\n        fprintf(stderr, "test lhash int allocation\\n");\n        goto end;\n    }\n    for (i = 0; i < n_int_tests; i++)\n        if (lh_int_insert(h, int_tests + i) != NULL) {\n            fprintf(stderr, "test lhash int insert %d\\n", i);\n            goto end;\n        }\n    if (lh_int_num_items(h) != n_int_tests) {\n            fprintf(stderr, "test lhash int num items\\n");\n            goto end;\n    }\n    for (i = 0; i < n_int_tests; i++)\n        if (*lh_int_retrieve(h, int_tests + i) != int_tests[i]) {\n            fprintf(stderr, "test lhash int retrieve value %d\\n", i);\n            goto end;\n        }\n    for (i = 0; i < n_int_tests; i++)\n        if (lh_int_retrieve(h, int_tests + i) != int_tests + i) {\n            fprintf(stderr, "test lhash int retrieve address %d\\n", i);\n            goto end;\n        }\n    j = 1;\n    if (lh_int_retrieve(h, &j) != int_tests + 2) {\n        fprintf(stderr, "test lhash int retrieve other\\n");\n        goto end;\n    }\n    j = 13;\n    if ((p = lh_int_insert(h, &j)) == NULL) {\n        fprintf(stderr, "test lhash int replacement insert\\n");\n        goto end;\n    }\n    if (p != int_tests + 1) {\n        fprintf(stderr, "test lhash int replacement pointer\\n");\n        goto end;\n    }\n    if (lh_int_retrieve(h, int_tests + 1) != &j) {\n        fprintf(stderr, "test lhash int replacement variable\\n");\n        goto end;\n    }\n    memset(int_found, 0, sizeof(int_found));\n    lh_int_doall(h, &int_doall);\n    for (i = 0; i < n_int_tests; i++)\n        if (int_found[i] != 1) {\n            fprintf(stderr, "test lhash int doall %d\\n", i);\n            goto end;\n        }\n    memset(int_found, 0, sizeof(int_found));\n    lh_int_doall_short(h, int_doall_arg, int_found);\n    for (i = 0; i < n_int_tests; i++)\n        if (int_found[i] != 1) {\n            fprintf(stderr, "test lhash int doall arg %d\\n", i);\n            goto end;\n        }\n    for (i = 0; i < n_dels; i++) {\n        const int b = lh_int_delete(h, &dels[i].data) == NULL;\n        if ((b ^ dels[i].null) != 0) {\n            fprintf(stderr, "test lhash int delete %d\\n", i);\n            goto end;\n        }\n    }\n    if (lh_int_error(h) != 0) {\n        fprintf(stderr, "test lhash int error\\n");\n        goto end;\n    }\n    testresult = 1;\nend:\n    lh_int_free(h);\n    return testresult;\n}', 'DEFINE_LHASH_OF(int)', 'void *OPENSSL_LH_insert(OPENSSL_LHASH *lh, void *data)\n{\n    unsigned long hash;\n    OPENSSL_LH_NODE *nn, **rn;\n    void *ret;\n    lh->error = 0;\n    if ((lh->up_load <= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)) && !expand(lh))\n        return NULL;\n    rn = getrn(lh, data, &hash);\n    if (*rn == NULL) {\n        if ((nn = OPENSSL_malloc(sizeof(*nn))) == NULL) {\n            lh->error++;\n            return (NULL);\n        }\n        nn->data = data;\n        nn->next = NULL;\n        nn->hash = hash;\n        *rn = nn;\n        ret = NULL;\n        lh->num_insert++;\n        lh->num_items++;\n    } else {\n        ret = (*rn)->data;\n        (*rn)->data = data;\n        lh->num_replace++;\n    }\n    return (ret);\n}', 'void *OPENSSL_LH_delete(OPENSSL_LHASH *lh, const void *data)\n{\n    unsigned long hash;\n    OPENSSL_LH_NODE *nn, **rn;\n    void *ret;\n    lh->error = 0;\n    rn = getrn(lh, data, &hash);\n    if (*rn == NULL) {\n        lh->num_no_delete++;\n        return (NULL);\n    } else {\n        nn = *rn;\n        *rn = nn->next;\n        ret = nn->data;\n        OPENSSL_free(nn);\n        lh->num_delete++;\n    }\n    lh->num_items--;\n    if ((lh->num_nodes > MIN_NODES) &&\n        (lh->down_load >= (lh->num_items * LH_LOAD_MULT / lh->num_nodes)))\n        contract(lh);\n    return (ret);\n}']