├── COPYING ├── ChangeLog ├── INSTALL ├── INSTALL.WIN32 ├── LIBVERSION_CP_DBMS_MYSQL ├── LIBVERSION_CP_DBMS_POSTGRES ├── Makefile.in ├── Makefile.vc ├── README ├── README.WIN32 ├── VERSION ├── avl.c ├── avl.h ├── bit_sequence.c ├── bit_sequence.h ├── bstr.c ├── bstr.h ├── client.c ├── client.h ├── collection.c ├── collection.h ├── common.h ├── config.guess ├── config.h.in ├── config.h.vc ├── config.sub ├── configure ├── configure.bat ├── configure.in ├── db.c ├── db.h ├── db_mysql.c ├── db_mysql.h ├── db_postgres.c ├── db_postgres.h ├── example ├── Makefile ├── Makefile.in ├── Makefile.vc ├── README ├── cprops ├── test_avl.c ├── test_avl_multi.c ├── test_bit_sequence.c ├── test_bstr.c ├── test_btree.c ├── test_client.c ├── test_hashlist.c ├── test_hashlist_iterator.c ├── test_hashtable.c ├── test_hashtable2.c ├── test_heap.c ├── test_httpasync.c ├── test_httpclient.c ├── test_list.c ├── test_list_iterator.c ├── test_mempool.c ├── test_multimap.c ├── test_mysql.c ├── test_narytree.c ├── test_pq.c ├── test_priority_list.c ├── test_proxy.c ├── test_rb.c ├── test_reindex.c ├── test_reindex_unique.c ├── test_rtrie.c ├── test_sorted_hash.c ├── test_splay.c ├── test_ssl_client.c ├── test_str.c ├── test_trie.c ├── test_trie2.c ├── test_vector.c ├── test_wtab.c ├── test_wtrie.c └── wf.c ├── hashlist.c ├── hashlist.h ├── hashtable.c ├── hashtable.h ├── heap.c ├── heap.h ├── http.c ├── http.h ├── http.h.in ├── httpclient.c ├── httpclient.h ├── install-sh ├── linked_list.c ├── linked_list.h ├── log.c ├── log.h ├── ltmain.sh ├── makedepend.sh ├── man3 ├── cp_avltree.3 ├── cp_avltree_callback.3 ├── cp_avltree_contains.3 ├── cp_avltree_count.3 ├── cp_avltree_create.3 ├── cp_avltree_create_by_option.3 ├── cp_avltree_delete.3 ├── cp_avltree_destroy.3 ├── cp_avltree_destroy_custom.3 ├── cp_avltree_get.3 ├── cp_avltree_get_mode.3 ├── cp_avltree_insert.3 ├── cp_avltree_lock.3 ├── cp_avltree_rdlock.3 ├── cp_avltree_set_mode.3 ├── cp_avltree_unlock.3 ├── cp_avltree_unset_mode.3 ├── cp_avltree_wrlock.3 ├── cp_bstr.3 ├── cp_bstr_cat.3 ├── cp_bstr_cmp.3 ├── cp_bstr_cpy.3 ├── cp_bstr_create.3 ├── cp_bstr_destroy.3 ├── cp_bstr_dump.3 ├── cp_bstr_dup.3 ├── cp_bstr_shift_left.3 ├── cp_bstr_to_string.3 ├── cp_client.3 ├── cp_client_close.3 ├── cp_client_connect.3 ├── cp_client_create.3 ├── cp_client_create_ssl.3 ├── cp_client_destroy.3 ├── cp_client_get_server_certificate.3 ├── cp_client_read.3 ├── cp_client_read_string.3 ├── cp_client_set_retry.3 ├── cp_client_ssl_init.3 ├── cp_client_ssl_shutdown.3 ├── cp_client_verify_hostname.3 ├── cp_client_write.3 ├── cp_client_write_string.3 ├── cp_connection_descriptor.3 ├── cp_data_source_destroy.3 ├── cp_data_source_get_connection.3 ├── cp_db_connection_close.3 ├── cp_db_connection_close_statement.3 ├── cp_db_connection_commit.3 ├── cp_db_connection_destroy.3 ├── cp_db_connection_escape_binary.3 ├── cp_db_connection_escape_string.3 ├── cp_db_connection_execute_statement.3 ├── cp_db_connection_execute_statement_args.3 ├── cp_db_connection_pool_create.3 ├── cp_db_connection_pool_destroy.3 ├── cp_db_connection_pool_get_connection.3 ├── cp_db_connection_pool_release_connection.3 ├── cp_db_connection_pool_set_blocking.3 ├── cp_db_connection_pool_shutdown.3 ├── cp_db_connection_prepare_statement.3 ├── cp_db_connection_rollback.3 ├── cp_db_connection_select.3 ├── cp_db_connection_set_autocommit.3 ├── cp_db_connection_set_fetch_metadata.3 ├── cp_db_connection_set_fetch_size.3 ├── cp_db_connection_set_read_result_set_at_once.3 ├── cp_db_connection_unescape_binary.3 ├── cp_db_connection_update.3 ├── cp_db_init.3 ├── cp_db_mysql.3 ├── cp_db_postgres.3 ├── cp_db_shutdown.3 ├── cp_db_statement_set_binary.3 ├── cp_dbms.3 ├── cp_dbms_get_data_source.3 ├── cp_dbms_get_data_source_prm.3 ├── cp_dbms_load_driver.3 ├── cp_hashlist.3 ├── cp_hashlist_append.3 ├── cp_hashlist_append_by_option.3 ├── cp_hashlist_callback.3 ├── cp_hashlist_contains.3 ├── cp_hashlist_create.3 ├── cp_hashlist_create_by_mode.3 ├── cp_hashlist_create_by_option.3 ├── cp_hashlist_create_iterator.3 ├── cp_hashlist_destroy.3 ├── cp_hashlist_destroy_by_option.3 ├── cp_hashlist_destroy_custom.3 ├── cp_hashlist_entry_get_key.3 ├── cp_hashlist_entry_get_value.3 ├── cp_hashlist_get.3 ├── cp_hashlist_get_head.3 ├── cp_hashlist_get_mode.3 ├── cp_hashlist_get_tail.3 ├── cp_hashlist_insert.3 ├── cp_hashlist_insert_by_option.3 ├── cp_hashlist_is_empty.3 ├── cp_hashlist_item_count.3 ├── cp_hashlist_iterator.3 ├── cp_hashlist_iterator_append.3 ├── cp_hashlist_iterator_curr.3 ├── cp_hashlist_iterator_curr_key.3 ├── cp_hashlist_iterator_curr_value.3 ├── cp_hashlist_iterator_destroy.3 ├── cp_hashlist_iterator_head.3 ├── cp_hashlist_iterator_init.3 ├── cp_hashlist_iterator_init_tail.3 ├── cp_hashlist_iterator_insert.3 ├── cp_hashlist_iterator_next.3 ├── cp_hashlist_iterator_next_key.3 ├── cp_hashlist_iterator_next_value.3 ├── cp_hashlist_iterator_prev.3 ├── cp_hashlist_iterator_prev_key.3 ├── cp_hashlist_iterator_prev_value.3 ├── cp_hashlist_iterator_release.3 ├── cp_hashlist_iterator_remove.3 ├── cp_hashlist_iterator_tail.3 ├── cp_hashlist_iterator_to_key.3 ├── cp_hashlist_lock.3 ├── cp_hashlist_rdlock.3 ├── cp_hashlist_remove.3 ├── cp_hashlist_remove_by_option.3 ├── cp_hashlist_remove_deep.3 ├── cp_hashlist_remove_head.3 ├── cp_hashlist_remove_head_by_option.3 ├── cp_hashlist_remove_tail.3 ├── cp_hashlist_remove_tail_by_option.3 ├── cp_hashlist_set_max_fill_factor.3 ├── cp_hashlist_set_min_fill_factor.3 ├── cp_hashlist_set_min_size.3 ├── cp_hashlist_set_mode.3 ├── cp_hashlist_unlock.3 ├── cp_hashlist_unset_mode.3 ├── cp_hashlist_wrlock.3 ├── cp_hashtable.3 ├── cp_hashtable_contains.3 ├── cp_hashtable_count.3 ├── cp_hashtable_create.3 ├── cp_hashtable_create_by_mode.3 ├── cp_hashtable_create_by_option.3 ├── cp_hashtable_create_copy.3 ├── cp_hashtable_create_copy_mode.3 ├── cp_hashtable_destroy.3 ├── cp_hashtable_destroy_custom.3 ├── cp_hashtable_destroy_deep.3 ├── cp_hashtable_destroy_shallow.3 ├── cp_hashtable_get.3 ├── cp_hashtable_get_by_option.3 ├── cp_hashtable_get_keys.3 ├── cp_hashtable_get_values.3 ├── cp_hashtable_is_empty.3 ├── cp_hashtable_lock.3 ├── cp_hashtable_put.3 ├── cp_hashtable_put_by_option.3 ├── cp_hashtable_put_copy.3 ├── cp_hashtable_put_safe.3 ├── cp_hashtable_rdlock.3 ├── cp_hashtable_remove.3 ├── cp_hashtable_remove_all.3 ├── cp_hashtable_remove_deep.3 ├── cp_hashtable_set_max_fill_factor.3 ├── cp_hashtable_set_min_fill_factor.3 ├── cp_hashtable_set_min_size.3 ├── cp_hashtable_set_mode.3 ├── cp_hashtable_unlock.3 ├── cp_hashtable_unset_mode.3 ├── cp_hashtable_wrlock.3 ├── cp_heap.3 ├── cp_heap_callback.3 ├── cp_heap_contract.3 ├── cp_heap_count.3 ├── cp_heap_create.3 ├── cp_heap_create_by_option.3 ├── cp_heap_destroy.3 ├── cp_heap_get_mode.3 ├── cp_heap_lock.3 ├── cp_heap_peek.3 ├── cp_heap_pop.3 ├── cp_heap_push.3 ├── cp_heap_set_mode.3 ├── cp_heap_size.3 ├── cp_heap_unlock.3 ├── cp_heap_unset_mode.3 ├── cp_http_init.3 ├── cp_http_request.3 ├── cp_http_request_dump.3 ├── cp_http_request_get_header.3 ├── cp_http_request_get_parameter.3 ├── cp_http_request_get_session.3 ├── cp_http_response.3 ├── cp_http_response_set_body.3 ├── cp_http_response_set_connection_policy.3 ├── cp_http_response_set_content.3 ├── cp_http_response_set_content_type.3 ├── cp_http_response_set_content_type_string.3 ├── cp_http_response_set_cookie.3 ├── cp_http_response_set_header.3 ├── cp_http_response_set_status.3 ├── cp_http_service.3 ├── cp_http_service_create.3 ├── cp_http_service_delete.3 ├── cp_http_session.3 ├── cp_http_session_get.3 ├── cp_http_session_is_fresh.3 ├── cp_http_session_set.3 ├── cp_http_session_set_dtr.3 ├── cp_http_session_set_validity.3 ├── cp_http_shutdown.3 ├── cp_httpclient.3 ├── cp_httpclient_allow_redirects.3 ├── cp_httpclient_create.3 ├── cp_httpclient_create_proxy.3 ├── cp_httpclient_create_proxy_ssl.3 ├── cp_httpclient_create_ssl.3 ├── cp_httpclient_ctl.3 ├── cp_httpclient_ctl_create.3 ├── cp_httpclient_ctl_destroy.3 ├── cp_httpclient_ctl_get_pollfds.3 ├── cp_httpclient_ctl_get_read_fd_set.3 ├── cp_httpclient_ctl_get_write_fd_set.3 ├── cp_httpclient_destroy.3 ├── cp_httpclient_drop_headers.3 ├── cp_httpclient_drop_parameters.3 ├── cp_httpclient_fetch.3 ├── cp_httpclient_fetch_ctl.3 ├── cp_httpclient_fetch_ctl_exec.3 ├── cp_httpclient_fetch_nb.3 ├── cp_httpclient_fetch_nb_exec.3 ├── cp_httpclient_init.3 ├── cp_httpclient_reopen.3 ├── cp_httpclient_result.3 ├── cp_httpclient_set_auto_drop_headers.3 ├── cp_httpclient_set_auto_drop_parameters.3 ├── cp_httpclient_set_cookie_jar.3 ├── cp_httpclient_set_header.3 ├── cp_httpclient_set_http_version.3 ├── cp_httpclient_set_max_redirects.3 ├── cp_httpclient_set_paremeter.3 ├── cp_httpclient_set_request_type.3 ├── cp_httpclient_set_retry.3 ├── cp_httpclient_set_timeout.3 ├── cp_httpclient_set_user_agent.3 ├── cp_httpclient_shutdown.3 ├── cp_httpsocket.3 ├── cp_httpsocket_create.3 ├── cp_httpsocket_create_ssl.3 ├── cp_httpsocket_delete.3 ├── cp_httpsocket_listen.3 ├── cp_httpsocket_register_service.3 ├── cp_httpsocket_stop_all.3 ├── cp_httpsocket_unregister_service.3 ├── cp_list.3 ├── cp_list_append.3 ├── cp_list_callback.3 ├── cp_list_create.3 ├── cp_list_create_iterator.3 ├── cp_list_create_list.3 ├── cp_list_create_nosync.3 ├── cp_list_destroy.3 ├── cp_list_destroy_by_option.3 ├── cp_list_destroy_custom.3 ├── cp_list_get_head.3 ├── cp_list_get_tail.3 ├── cp_list_insert.3 ├── cp_list_insert_after.3 ├── cp_list_insert_before.3 ├── cp_list_is_empty.3 ├── cp_list_item_count.3 ├── cp_list_iterator.3 ├── cp_list_iterator_append.3 ├── cp_list_iterator_curr.3 ├── cp_list_iterator_destroy.3 ├── cp_list_iterator_head.3 ├── cp_list_iterator_init.3 ├── cp_list_iterator_init_tail.3 ├── cp_list_iterator_insert.3 ├── cp_list_iterator_next.3 ├── cp_list_iterator_prev.3 ├── cp_list_iterator_release.3 ├── cp_list_iterator_remove.3 ├── cp_list_iterator_tail.3 ├── cp_list_lock.3 ├── cp_list_rdlock.3 ├── cp_list_remove.3 ├── cp_list_remove_head.3 ├── cp_list_remove_tail.3 ├── cp_list_search.3 ├── cp_list_unlock.3 ├── cp_list_wrlock.3 ├── cp_mempool.3 ├── cp_mempool_alloc.3 ├── cp_mempool_calloc.3 ├── cp_mempool_create.3 ├── cp_mempool_create_by_option.3 ├── cp_mempool_destroy.3 ├── cp_mempool_free.3 ├── cp_mempool_inc_refcount.3 ├── cp_multimap.3 ├── cp_multimap_callback.3 ├── cp_multimap_callback_by_index.3 ├── cp_multimap_callback_postorder.3 ├── cp_multimap_callback_preorder.3 ├── cp_multimap_contains.3 ├── cp_multimap_count.3 ├── cp_multimap_create.3 ├── cp_multimap_create_by_option.3 ├── cp_multimap_create_index.3 ├── cp_multimap_destroy.3 ├── cp_multimap_destroy_custom.3 ├── cp_multimap_find.3 ├── cp_multimap_find_by_index.3 ├── cp_multimap_get.3 ├── cp_multimap_get_by_index.3 ├── cp_multimap_get_mode.3 ├── cp_multimap_insert.3 ├── cp_multimap_lock.3 ├── cp_multimap_rdlock.3 ├── cp_multimap_reindex.3 ├── cp_multimap_remove.3 ├── cp_multimap_remove_by_index.3 ├── cp_multimap_set_mode.3 ├── cp_multimap_share_mempool.3 ├── cp_multimap_size.3 ├── cp_multimap_unlock.3 ├── cp_multimap_unset_mode.3 ├── cp_multimap_use_mempool.3 ├── cp_multimap_wrlock.3 ├── cp_mysql_data_source.3 ├── cp_narytree.3 ├── cp_narytree_callback.3 ├── cp_narytree_contains.3 ├── cp_narytree_count.3 ├── cp_narytree_create.3 ├── cp_narytree_create_by_option.3 ├── cp_narytree_delete.3 ├── cp_narytree_destroy.3 ├── cp_narytree_destroy_custom.3 ├── cp_narytree_get.3 ├── cp_narytree_get_mode.3 ├── cp_narytree_insert.3 ├── cp_narytree_lock.3 ├── cp_narytree_rdlock.3 ├── cp_narytree_set_mode.3 ├── cp_narytree_unlock.3 ├── cp_narytree_unset_mode.3 ├── cp_narytree_wrlock.3 ├── cp_pooled_thread_client_interface.3 ├── cp_pooled_thread_client_interface_create.3 ├── cp_pooled_thread_client_interface_destroy.3 ├── cp_pooled_thread_client_interface_get.3 ├── cp_pooled_thread_client_interface_get_nb.3 ├── cp_pooled_thread_client_interface_get_stoppable.3 ├── cp_pooled_thread_client_interface_get_stoppable_nb.3 ├── cp_pooled_thread_client_negociate.3 ├── cp_pooled_thread_scheduler.3 ├── cp_pooled_thread_scheduler_create.3 ├── cp_pooled_thread_scheduler_destroy.3 ├── cp_pooled_thread_scheduler_register_client.3 ├── cp_postgres_data_source.3 ├── cp_priority_list.3 ├── cp_priority_list_create.3 ├── cp_priority_list_create_by_option.3 ├── cp_priority_list_destroy.3 ├── cp_priority_list_destroy_by_option.3 ├── cp_priority_list_get_next.3 ├── cp_priority_list_get_next_by_option.3 ├── cp_priority_list_insert.3 ├── cp_priority_list_insert_by_option.3 ├── cp_priority_list_is_empty.3 ├── cp_priority_list_item_count.3 ├── cp_priority_list_lock.3 ├── cp_priority_list_rdlock.3 ├── cp_priority_list_unlock.3 ├── cp_priority_list_wrlock.3 ├── cp_rbtree.3 ├── cp_rbtree_callback.3 ├── cp_rbtree_callback_postorder.3 ├── cp_rbtree_callback_preorder.3 ├── cp_rbtree_contains.3 ├── cp_rbtree_count.3 ├── cp_rbtree_create.3 ├── cp_rbtree_create_by_option.3 ├── cp_rbtree_delete.3 ├── cp_rbtree_destroy.3 ├── cp_rbtree_destroy_custom.3 ├── cp_rbtree_get.3 ├── cp_rbtree_get_mode.3 ├── cp_rbtree_insert.3 ├── cp_rbtree_lock.3 ├── cp_rbtree_rdlock.3 ├── cp_rbtree_set_mode.3 ├── cp_rbtree_unlock.3 ├── cp_rbtree_unset_mode.3 ├── cp_rbtree_wrlock.3 ├── cp_result_set.3 ├── cp_result_set_autodispose.3 ├── cp_result_set_destroy.3 ├── cp_result_set_field_count.3 ├── cp_result_set_get_field_type.3 ├── cp_result_set_get_field_types.3 ├── cp_result_set_get_header.3 ├── cp_result_set_get_headers.3 ├── cp_result_set_is_binary.3 ├── cp_result_set_next.3 ├── cp_result_set_release_row.3 ├── cp_result_set_row_count.3 ├── cp_rtrie.3 ├── cp_rtrie_add.3 ├── cp_rtrie_create.3 ├── cp_rtrie_create_trie.3 ├── cp_rtrie_destroy.3 ├── cp_rtrie_exact_match.3 ├── cp_rtrie_fetch_matches.3 ├── cp_rtrie_get_mode.3 ├── cp_rtrie_lock.3 ├── cp_rtrie_prefix_match.3 ├── cp_rtrie_rdlock.3 ├── cp_rtrie_remove.3 ├── cp_rtrie_set_mode.3 ├── cp_rtrie_unlock.3 ├── cp_rtrie_unset_mode.3 ├── cp_rtrie_wrlock.3 ├── cp_shared_mempool.3 ├── cp_shared_mempool_alloc.3 ├── cp_shared_mempool_calloc.3 ├── cp_shared_mempool_create.3 ├── cp_shared_mempool_create_by_option.3 ├── cp_shared_mempool_destroy.3 ├── cp_shared_mempool_free.3 ├── cp_shared_mempool_register.3 ├── cp_socket.3 ├── cp_socket_connection_close.3 ├── cp_socket_create.3 ├── cp_socket_create_ssl.3 ├── cp_socket_delete.3 ├── cp_socket_init.3 ├── cp_socket_listen.3 ├── cp_socket_select.3 ├── cp_socket_set_backlog.3 ├── cp_socket_set_delay.3 ├── cp_socket_set_delay_sec.3 ├── cp_socket_set_delay_usec.3 ├── cp_socket_set_owner.3 ├── cp_socket_set_poolsize_max.3 ├── cp_socket_set_poolsize_min.3 ├── cp_socket_shutdown.3 ├── cp_socket_stop_all.3 ├── cp_sorted_hash.3 ├── cp_sorted_hash_callback.3 ├── cp_sorted_hash_contains.3 ├── cp_sorted_hash_count.3 ├── cp_sorted_hash_create.3 ├── cp_sorted_hash_create_by_mode.3 ├── cp_sorted_hash_delete.3 ├── cp_sorted_hash_destroy.3 ├── cp_sorted_hash_destroy_custom.3 ├── cp_sorted_hash_get.3 ├── cp_sorted_hash_get_mode.3 ├── cp_sorted_hash_insert.3 ├── cp_sorted_hash_lock.3 ├── cp_sorted_hash_rdlock.3 ├── cp_sorted_hash_set_mode.3 ├── cp_sorted_hash_unlock.3 ├── cp_sorted_hash_unset_mode.3 ├── cp_sorted_hash_wrlock.3 ├── cp_splaytree.3 ├── cp_splaytree_callback.3 ├── cp_splaytree_contains.3 ├── cp_splaytree_count.3 ├── cp_splaytree_create.3 ├── cp_splaytree_create_by_option.3 ├── cp_splaytree_delete.3 ├── cp_splaytree_destroy.3 ├── cp_splaytree_destroy_custom.3 ├── cp_splaytree_get.3 ├── cp_splaytree_get_mode.3 ├── cp_splaytree_insert.3 ├── cp_splaytree_lock.3 ├── cp_splaytree_rdlock.3 ├── cp_splaytree_set_mode.3 ├── cp_splaytree_unlock.3 ├── cp_splaytree_unset_mode.3 ├── cp_splaytree_wrlock.3 ├── cp_string.3 ├── cp_string_cat.3 ├── cp_string_cat_bin.3 ├── cp_string_cmp.3 ├── cp_string_cpy.3 ├── cp_string_create.3 ├── cp_string_cstrcat.3 ├── cp_string_cstrcpy.3 ├── cp_string_cstrdup.3 ├── cp_string_delete.3 ├── cp_string_dump.3 ├── cp_string_dup.3 ├── cp_string_len.3 ├── cp_string_read.3 ├── cp_string_reset.3 ├── cp_string_tocstr.3 ├── cp_string_write.3 ├── cp_thread.3 ├── cp_thread_create.3 ├── cp_thread_detach.3 ├── cp_thread_join.3 ├── cp_thread_pool.3 ├── cp_thread_pool_count_available.3 ├── cp_thread_pool_create.3 ├── cp_thread_pool_destroy.3 ├── cp_thread_pool_get.3 ├── cp_thread_pool_get_nb.3 ├── cp_thread_pool_get_stoppable.3 ├── cp_thread_pool_get_stoppable_nb.3 ├── cp_thread_pool_stop.3 ├── cp_timestampz.3 ├── cp_timestampz_create.3 ├── cp_timestampz_create_prm.3 ├── cp_timestampz_destroy.3 ├── cp_timestampz_localtime.3 ├── cp_trie.3 ├── cp_trie_add.3 ├── cp_trie_create.3 ├── cp_trie_destroy.3 ├── cp_trie_exact_match.3 ├── cp_trie_get_mode.3 ├── cp_trie_lock.3 ├── cp_trie_match.3 ├── cp_trie_rdlock.3 ├── cp_trie_remove.3 ├── cp_trie_set_mode.3 ├── cp_trie_unlock.3 ├── cp_trie_unset_mode.3 ├── cp_trie_wrlock.3 ├── cp_vector.3 ├── cp_vector_add_element.3 ├── cp_vector_create.3 ├── cp_vector_create_by_option.3 ├── cp_vector_destroy.3 ├── cp_vector_destroy_custom.3 ├── cp_vector_element_at.3 ├── cp_vector_set_element.3 ├── cp_vector_size.3 ├── cp_wtrie.3 ├── cp_wtrie_add.3 ├── cp_wtrie_create.3 ├── cp_wtrie_create_trie.3 ├── cp_wtrie_destroy.3 ├── cp_wtrie_exact_match.3 ├── cp_wtrie_fetch_matches.3 ├── cp_wtrie_get_mode.3 ├── cp_wtrie_lock.3 ├── cp_wtrie_prefix_match.3 ├── cp_wtrie_rdlock.3 ├── cp_wtrie_remove.3 ├── cp_wtrie_set_mode.3 ├── cp_wtrie_unlock.3 ├── cp_wtrie_unset_mode.3 ├── cp_wtrie_wrlock.3 ├── cprops.3 ├── cstr_to_bstr.3 └── libcprops.3 ├── mempool.c ├── mempool.h ├── mkinstalldirs ├── mtab.c ├── mtab.h ├── multimap.c ├── multimap.h ├── nary.c ├── nary.h ├── priority_list.c ├── priority_list.h ├── rb.c ├── rb.h ├── rtrie.c ├── rtrie.h ├── socket.c ├── socket.h ├── sorted_hash.c ├── sorted_hash.h ├── splay.c ├── splay.h ├── str.c ├── str.h ├── svc ├── Makefile ├── Makefile.in ├── Makefile.vc ├── README ├── cgi.c ├── cgi.h ├── cprops ├── cpsp.c ├── cpsp.h ├── cpsp │ ├── Makefile │ ├── Makefile.cpsp │ ├── Makefile.cpsp.in │ ├── Makefile.cpsp.vc │ ├── Makefile.in │ ├── Makefile.vc │ ├── bison.simple │ ├── cprops │ ├── cpsp-gen.bat │ ├── cpsp-gen.sh │ ├── cpsp-gen.sh.in │ ├── cpsp.l │ └── cpsp.y ├── cpsp_invoker.c ├── cpsp_invoker.h ├── cpsp_worker.c ├── cpsvc.c ├── file.c ├── file.h └── mime.types ├── test ├── README ├── cacert.pem ├── cert.pem └── key.pem ├── testhttpsrv.c ├── thread.c ├── thread.h ├── trie.c ├── trie.h ├── util.c ├── util.h ├── vector.c ├── vector.h ├── wtab.c ├── wtab.h ├── wtrie.c └── wtrie.h /LIBVERSION_CP_DBMS_MYSQL: -------------------------------------------------------------------------------- 1 | 0:0:0 2 | -------------------------------------------------------------------------------- /LIBVERSION_CP_DBMS_POSTGRES: -------------------------------------------------------------------------------- 1 | 0:0:0 2 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.1.12 2 | 15:0:0 3 | -------------------------------------------------------------------------------- /bstr.h: -------------------------------------------------------------------------------- 1 | #ifndef _CP_BSTR_H 2 | #define _CP_BSTR_H 3 | 4 | #include "collection.h" 5 | 6 | typedef struct _cp_bstr 7 | { 8 | unsigned char *bits; 9 | int length; 10 | } cp_bstr; 11 | 12 | #define BYTECOUNT(b) (((b)->length + 7) >> 3) 13 | 14 | CPROPS_DLL 15 | cp_bstr *cp_bstr_create(int length, unsigned char *bits); 16 | 17 | /** 18 | * convenience function for debugging - initialize from a string that looks 19 | * like "1010101" (actually any non-null character but '1' is interpreted as '0') 20 | */ 21 | cp_bstr *cstr_to_bstr(char *str); 22 | 23 | CPROPS_DLL 24 | void cp_bstr_destroy(cp_bstr *seq); 25 | 26 | CPROPS_DLL 27 | cp_bstr *cp_bstr_dup(cp_bstr *seq); 28 | 29 | CPROPS_DLL 30 | cp_bstr *cp_bstr_cpy(cp_bstr *dst, cp_bstr *src); 31 | 32 | CPROPS_DLL 33 | cp_bstr *cp_bstr_cat(cp_bstr *head, cp_bstr *tail); 34 | 35 | /** 36 | * shift bits left by the specified count, resulting in a shorter bit sequence 37 | */ 38 | CPROPS_DLL 39 | int cp_bstr_shift_left(cp_bstr *seq, int count); 40 | 41 | /** 42 | * compares bit sequences a and b, strcmp semantics. if pos is not null it is 43 | * set to the index of the first differing bit. if the sequences are identical 44 | * to the length they are defined, and pos is not null, it is set to the length 45 | * of the shorter sequence - e.g. 010 and 0101 are identical to the third bit, 46 | * hence *pos is set to 3. 47 | */ 48 | CPROPS_DLL 49 | int cp_bstr_cmp(cp_bstr *a, cp_bstr *b, int *pos); 50 | 51 | #define cp_bstr_length(seq) (seq)->length 52 | 53 | CPROPS_DLL 54 | void cp_bstr_dump(cp_bstr *seq); 55 | 56 | CPROPS_DLL 57 | char *cp_bstr_to_string(cp_bstr *seq); 58 | 59 | #endif /* _CP_BSTR_H */ 60 | 61 | -------------------------------------------------------------------------------- /config.h.vc: -------------------------------------------------------------------------------- 1 | #ifndef _CP_CONFIG_H 2 | #define _CP_CONFIG_H 3 | 4 | #include "config-cpwin.h" 5 | 6 | #ifndef _WINDOWS 7 | #define _WINDOWS 8 | #endif 9 | 10 | #ifndef cplusplus 11 | #ifndef inline 12 | #define inline 13 | #endif 14 | #endif /* cplusplus */ 15 | 16 | #define CP_HAS_PCRE 1 17 | #define CP_HAS_STRDUP 1 18 | 19 | #undef CP_HAS_VARIADIC_MACROS 20 | #undef CP_HAS_INLINE 21 | #undef CP_HAS_VSNPRINTF 22 | #undef CP_HAS_REGEX_H 23 | #undef CP_HAS_STRINGS_H 24 | #undef CP_HAS_DIRENT_H 25 | #undef CP_HAS_NETDB_H 26 | #undef CP_HAS_PTHREAD_H 27 | #undef CP_HAS_STRCASECMP 28 | #undef CP_HAS_STRNCASECMP 29 | #undef CP_HAS_SRANDOM 30 | #undef CP_HAS_RANDOM 31 | #undef CP_HAS_STAT 32 | #undef CP_HAS_GETHOSTBYNAME 33 | #undef CP_HAS_READ 34 | #undef CP_HAS_WRITE 35 | #undef CP_HAS_STRINGS_H 36 | #undef CP_HAS_ADDRINFO 37 | #undef CP_HAS_UNISTD_H 38 | #undef CP_HAS_GETOPT 39 | #undef CP_HAS_SYS_TIME_H 40 | #undef CP_HAS_LOCALTIME_R 41 | #undef CP_HAS_LONG_LONG 42 | #undef CP_HAS_STRPTIME 43 | #undef CP_HAS_DLFCN_H 44 | #undef CP_HAS_GETCWD 45 | #undef CP_HAS_NETINET_IN_H 46 | 47 | #endif /* _CP_CONFIG_H */ 48 | -------------------------------------------------------------------------------- /db_mysql.h: -------------------------------------------------------------------------------- 1 | #ifndef _CP_MYSQL_H 2 | #define _CP_MYSQL_H 3 | 4 | /** 5 | * @addtogroup cp_dbms 6 | */ 7 | /** @{ */ 8 | /** 9 | * @file 10 | * definitions for mysql driver 11 | */ 12 | 13 | #include "common.h" 14 | #include "db.h" 15 | 16 | __BEGIN_DECLS 17 | 18 | CPROPS_DLL 19 | cp_data_source * 20 | cp_mysql_data_source(char *host, 21 | char *login, 22 | char *password, 23 | char *db_name, 24 | unsigned int port, 25 | char *unix_socket, 26 | unsigned long client_flag); 27 | 28 | CPROPS_DLL 29 | cp_data_source * 30 | cp_dbms_mysql_get_data_source(char *host, 31 | int port, 32 | char *login, 33 | char *password, 34 | char *dbname); 35 | 36 | CPROPS_DLL 37 | cp_data_source * 38 | cp_dbms_mysql_get_data_source_prm(char *host, 39 | int port, 40 | char *login, 41 | char *password, 42 | char *dbname, 43 | cp_hashtable *prm); 44 | 45 | typedef CPROPS_DLL struct _cp_mysql_connection_parameters 46 | { 47 | char *host; 48 | char *login; 49 | char *password; 50 | char *db_name; 51 | unsigned int port; 52 | char *unix_socket; 53 | unsigned long client_flag; 54 | } cp_mysql_connection_parameters; 55 | 56 | __END_DECLS 57 | 58 | /** @} */ 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /db_postgres.h: -------------------------------------------------------------------------------- 1 | #ifndef _CP_PGSQL_H 2 | #define _CP_PGSQL_H 3 | 4 | /** 5 | * @addtogroup cp_dbms 6 | */ 7 | /** @{ */ 8 | /** 9 | * @file 10 | * definitions for postgres driver 11 | */ 12 | 13 | #include "common.h" 14 | #include "db.h" 15 | 16 | __BEGIN_DECLS 17 | 18 | CPROPS_DLL 19 | cp_data_source * 20 | cp_postgres_data_source(char *host, 21 | int port, 22 | char *login, 23 | char *password, 24 | char *db_name, 25 | char *options, 26 | char *sslmode, 27 | char *krbsrvname, 28 | char *service); 29 | 30 | CPROPS_DLL 31 | cp_data_source * 32 | cp_dbms_postgres_get_data_source(char *host, 33 | int port, 34 | char *login, 35 | char *password, 36 | char *dbname); 37 | 38 | CPROPS_DLL 39 | cp_data_source * 40 | cp_dbms_postgres_get_data_source_prm(char *host, 41 | int port, 42 | char *login, 43 | char *password, 44 | char *dbname, 45 | cp_hashtable *prm); 46 | 47 | typedef CPROPS_DLL struct _cp_pgsql_connection_parameters 48 | { 49 | char *host; 50 | int port; 51 | char *login; 52 | char *password; 53 | char *db_name; 54 | char *options; 55 | char *sslmode; 56 | char *krbsrvname; 57 | char *service; 58 | } cp_pgsql_connection_parameters; 59 | 60 | __END_DECLS 61 | 62 | /** @} */ 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /example/Makefile.vc: -------------------------------------------------------------------------------- 1 | # cprops examples - Makefile 2 | # 3 | # This is a Makefile for cprops examples on Windows. 4 | # 5 | # Copyright (c) 2005-2007 by Ilan Aelion 6 | # iaelion@users.sourceforge.net 7 | # 8 | # 2007-11-30 V 0.1.7 9 | # 10 | ############################################### 11 | 12 | CC=CL 13 | LD=LINK 14 | RM=DEL /Q 15 | 16 | CFLAGS=/I. /DWIN32 /D_WINDOWS 17 | LDFLAGS=/incremental:no /subsystem:console ..\libcprops.lib 18 | LIBS=WS2_32.lib 19 | !INCLUDE win.mak 20 | 21 | EXAMPLE_SRC = test_avl.c test_avl_multi.c test_trie.c test_trie2.c \ 22 | test_rb.c test_splay.c test_client.c test_heap.c \ 23 | test_hashtable.c test_hashtable2.c test_hashlist.c \ 24 | test_hashlist_iterator.c test_list.c test_list_iterator.c \ 25 | test_vector.c test_priority_list.c test_httpclient.c \ 26 | test_httpasync.c test_mempool.c test_sorted_hash.c \ 27 | test_narytree.c test_multimap.c test_reindex.c \ 28 | test_reindex_unique.c $(OPT_SRC) 29 | 30 | EXAMPLE_OBJ = $(EXAMPLE_SRC:.c=.obj) 31 | EXAMPLE_EXE = $(EXAMPLE_SRC:.c=.exe) 32 | 33 | all: linkdir $(EXAMPLE_EXE) 34 | @echo $@: done 35 | 36 | linkdir: 37 | @IF not exist cprops\config.h mkdir cprops 38 | @copy /y ..\*.h cprops > nul: 2>&1 39 | 40 | $(EXAMPLE_EXE): $(EXAMPLE_OBJ) 41 | @echo $@: done 42 | 43 | .c.obj: 44 | $(CC) $(CFLAGS) /c $(@:.obj=.c) /o:$@ 45 | $(LD) $(LDFLAGS) $@ kernel32.lib $(LIBS) 46 | 47 | clean: 48 | $(RM) $(EXAMPLE_OBJ) $(EXAMPLE_EXE) 49 | -------------------------------------------------------------------------------- /example/README: -------------------------------------------------------------------------------- 1 | cprops sample code 2 | ------------------ 3 | 4 | To compile the examples in this directory, 5 | 6 | $ make 7 | 8 | If dynamic linking is enabled (the default on linux) and you haven't done 9 | 'make install' in the root directory, you'll probably get a message complaining 10 | about not being able to find libcprops.so when you try to run the test 11 | programs. To let the dynamic linker know where to find libcprops.so you'll 12 | need to do something like 13 | 14 | $ export LD_LIBRARY_PATH=../.libs 15 | 16 | -------------------------------------------------------------------------------- /example/cprops: -------------------------------------------------------------------------------- 1 | .. -------------------------------------------------------------------------------- /example/test_avl_multi.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | void print_result(cp_vector *v, char *title) 8 | { 9 | int i; 10 | 11 | printf("%s:\n", title); 12 | 13 | for (i = 0; i < cp_vector_size(v); i++) 14 | printf("%s\n", (char *) cp_vector_element_at(v, i)); 15 | } 16 | 17 | int main(int argc, char *argv[]) 18 | { 19 | int i; 20 | cp_vector *res; 21 | cp_avltree *t; 22 | 23 | t = cp_avltree_create_by_option(COLLECTION_MODE_COPY | 24 | COLLECTION_MODE_DEEP | 25 | COLLECTION_MODE_NOSYNC | 26 | COLLECTION_MODE_MULTIPLE_VALUES, 27 | (cp_compare_fn) strcmp, 28 | (cp_copy_fn) strdup, free, 29 | (cp_copy_fn) strdup, free); 30 | 31 | cp_avltree_insert(t, "animal", "winnie"); 32 | cp_avltree_insert(t, "animal", "moby"); 33 | cp_avltree_insert(t, "vegetable", "carrot"); 34 | cp_avltree_insert(t, "vegetable", "tomato"); 35 | 36 | res = cp_avltree_get(t, "animal"); 37 | print_result(res, "animals"); 38 | 39 | res = cp_avltree_get(t, "vegetable"); 40 | print_result(res, "vegetables"); 41 | 42 | printf("\nbefore:\n"); 43 | cp_avltree_dump(t); 44 | 45 | printf("\ndelete vegetables:\n"); 46 | res = cp_avltree_delete(t, "vegetable"); 47 | cp_avltree_dump(t); 48 | 49 | printf("\ndelete animals:\n"); 50 | res = cp_avltree_delete(t, "animal"); 51 | cp_avltree_dump(t); 52 | 53 | cp_avltree_destroy(t); 54 | 55 | return 0; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /example/test_hashlist.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | char key[32]; 10 | char value[32]; 11 | char *res; 12 | cp_hashlist *t; 13 | cp_hashlist_iterator *i; 14 | int j; 15 | 16 | t = cp_hashlist_create_by_option(COLLECTION_MODE_NOSYNC | 17 | COLLECTION_MODE_DEEP | 18 | COLLECTION_MODE_COPY, 19 | 10, 20 | cp_hash_string, 21 | (cp_compare_fn) strcmp, 22 | (cp_copy_fn) strdup, 23 | (cp_destructor_fn) free, 24 | (cp_copy_fn) strdup, 25 | (cp_destructor_fn) free); 26 | if (t == NULL) 27 | { 28 | perror(argv[0]); 29 | exit(1); 30 | } 31 | 32 | for (j = 0; j < 10; j++) 33 | { 34 | sprintf(key, "ENTRY (%d)", j); 35 | sprintf(value, "VALUE (%d)", j); 36 | if (cp_hashlist_insert(t, key, value) == NULL) 37 | { 38 | perror(argv[0]); 39 | exit(1); 40 | } 41 | } 42 | 43 | res = cp_hashlist_get(t, "ENTRY (5)"); 44 | printf("looking up entry #5: %s\n", res ? res : "not found"); 45 | 46 | printf("iterating over list values:\n"); 47 | i = cp_hashlist_create_iterator(t, COLLECTION_LOCK_NONE); 48 | while ((res = cp_hashlist_iterator_next_value(i))) 49 | printf("\to\t%s\n", res); 50 | 51 | cp_hashlist_iterator_destroy(i); 52 | cp_hashlist_destroy(t); 53 | 54 | return 0; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /example/test_heap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | int *i; 13 | int j, val; 14 | int max = 0; 15 | int log_level = 0; 16 | cp_heap *heap; 17 | 18 | if (argc > 1) max = atoi(argv[1]); 19 | if (max == 0) max = 10; 20 | 21 | if (argc > 2) log_level = atoi(argv[2]); 22 | 23 | cp_log_init("heap-test.log", log_level); 24 | 25 | heap = cp_heap_create(cp_hash_compare_int); 26 | 27 | srand(time(NULL)); 28 | 29 | for (j = 0; j < max; j++) 30 | { 31 | val = rand(); 32 | cp_heap_push(heap, intdup(&val)); 33 | } 34 | 35 | while ((i = cp_heap_pop(heap))) 36 | { 37 | printf("%d\n", *i); 38 | max--; 39 | if (max == 50) cp_heap_contract(heap); 40 | cp_free(i); 41 | } 42 | 43 | cp_heap_contract(heap); 44 | 45 | cp_heap_destroy(heap); 46 | 47 | cp_log_close(); 48 | 49 | return 0; 50 | } 51 | 52 | -------------------------------------------------------------------------------- /example/test_list.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void print_and_free(void *ptr) 7 | { 8 | char *txt = (char *) ptr; 9 | 10 | printf(" -> %s", txt); 11 | free(txt); 12 | } 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | int i; 17 | char buf[0x20]; 18 | 19 | cp_list *l = 20 | cp_list_create_list(COLLECTION_MODE_COPY | 21 | COLLECTION_MODE_MULTIPLE_VALUES, 22 | (cp_compare_fn) strcmp, (cp_copy_fn) strdup, NULL); 23 | 24 | for (i = 0; i < 10; i++) 25 | { 26 | sprintf(buf, "item #%d", i); 27 | cp_list_append(l, buf); 28 | } 29 | 30 | cp_list_insert_after(l, "after 8", "item #8"); 31 | cp_list_insert_before(l, "before 9", "item #9"); 32 | cp_list_insert_after(l, "after none", "none"); 33 | cp_list_insert_before(l, "before none", "none"); 34 | 35 | cp_list_destroy_custom(l, print_and_free); 36 | 37 | printf("\n"); 38 | 39 | return 0; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /example/test_priority_list.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | #define MAX_ENTRIES 100 8 | 9 | static cp_priority_list *l; 10 | static int done; 11 | 12 | void *read_fn(void *list) 13 | { 14 | cp_priority_list *l = (cp_priority_list *) list; 15 | char *item; 16 | 17 | while (!done || cp_priority_list_item_count(l)) 18 | { 19 | while (cp_priority_list_item_count(l)) 20 | { 21 | item = cp_priority_list_get_next(l); 22 | printf("[%ld] %s\n", cp_priority_list_item_count(l), item); 23 | free(item); 24 | } 25 | } 26 | 27 | return NULL; 28 | } 29 | 30 | 31 | int main(int argc, char *argv[]) 32 | { 33 | cp_thread reader; 34 | 35 | int i; 36 | int weights[] = {5, 3}; 37 | char *label[] = {"immediate %d ser %d", 38 | "high %d ser %d", 39 | "low %d ser %d"}; 40 | int counter[3] = {0, 0, 0}; 41 | char *item; 42 | 43 | int max_entries; 44 | 45 | srand(time(NULL)); /* that's right */ 46 | max_entries = argc > 1 ? atoi(argv[1]) : MAX_ENTRIES; 47 | 48 | l = cp_priority_list_create(1, 2, weights); 49 | 50 | done = 0; 51 | cp_thread_create(reader, NULL, read_fn, l); 52 | 53 | for (i = 0; i < max_entries; i++) 54 | { 55 | int rnd = rand() % 3; 56 | item = (char *) malloc(64 * sizeof(char)); 57 | sprintf(item, label[rnd], counter[rnd]++, i); 58 | printf("[%ld] %s\n", cp_priority_list_item_count(l), item); 59 | 60 | cp_priority_list_insert(l, item, rnd); 61 | } 62 | 63 | done = 1; 64 | 65 | printf("pushed %d entries (%d, %d, %d)\n", i, counter[0], counter[1], counter[2]); 66 | 67 | cp_thread_join(reader, NULL); 68 | 69 | cp_priority_list_destroy(l); 70 | 71 | return 0; 72 | } 73 | 74 | -------------------------------------------------------------------------------- /example/test_str.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #define PATH_SEPARATOR '/' 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | int i; 11 | cp_string *s = cp_string_create("", 0); 12 | cp_string *s2, *s3; 13 | 14 | for (i = 0; i < argc; i++) 15 | cp_string_cstrcat(s, argv[i]); 16 | 17 | printf("cat: %s\n", cp_string_tocstr(s)); 18 | 19 | cp_string_destroy(s); 20 | 21 | { 22 | cp_string *bp = cp_string_create(argv[0], strlen(argv[0])); 23 | printf("dump #1:\n"); 24 | cp_string_dump(bp); 25 | if (argv[0][strlen(argv[0] - 1)] != PATH_SEPARATOR) 26 | cp_string_cstrcat(bp, "/"); 27 | printf("concatenated: %s\n", cp_string_tocstr(bp)); 28 | printf("dump #2:\n"); 29 | cp_string_dump(bp); 30 | cp_string_destroy(bp); 31 | } 32 | 33 | s = cp_string_cstrdup("string One"); 34 | s2 = cp_string_cstrdup("- string Two"); 35 | s3 = cp_string_cstrdup("- string Three"); 36 | cp_string_cat(s, s2); 37 | cp_string_cat(s, s3); 38 | 39 | printf("\nconcatenated again: %s\n", cp_string_tocstr(s)); 40 | cp_string_dump(s); 41 | 42 | cp_string_destroy(s); 43 | cp_string_destroy(s2); 44 | cp_string_destroy(s3); 45 | 46 | return 0; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /example/test_trie.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | void *prm; 8 | char *v; 9 | cp_trie *t = cp_trie_create(0); 10 | 11 | if (t == NULL) 12 | { 13 | printf("can\'t create trie\n"); 14 | exit(1); 15 | } 16 | 17 | cp_trie_add(t, "ferguson", "xxx"); 18 | cp_trie_add(t, "fermat", "yyy"); 19 | 20 | cp_trie_prefix_match(t, "ferry", &prm); 21 | v = prm; 22 | printf("prefix match for ferry: %s\n", v ? v : "none"); 23 | 24 | v = cp_trie_exact_match(t, "ferry"); 25 | printf("exact match for ferry: %s\n", v ? v : "none"); 26 | 27 | cp_trie_prefix_match(t, "fergusonst", &prm); 28 | v = prm; 29 | printf("prefix match for fergusonst: %s\n", v ? v : "none"); 30 | 31 | v = cp_trie_exact_match(t, "fergusonst"); 32 | printf("exact match for fergusonst: %s\n", v ? v : "none"); 33 | 34 | cp_trie_destroy(t); 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /example/test_vector.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | int i, n; 9 | char *a = "AaAa"; 10 | char *b = "BbBb"; 11 | char *c = "CcCc"; 12 | char *p; 13 | 14 | cp_vector *v = cp_vector_create(1); 15 | 16 | for (i = 0; i < 30; i++) 17 | { 18 | char buf[0x20]; 19 | sprintf(buf, "%s %d", a, i); 20 | cp_vector_add_element(v, strdup(buf)); 21 | sprintf(buf, "%s %d", b, i); 22 | cp_vector_add_element(v, strdup(buf)); 23 | sprintf(buf, "%s %d", c, i); 24 | cp_vector_add_element(v, strdup(buf)); 25 | } 26 | 27 | n = cp_vector_size(v); 28 | 29 | for (i = 0; i < n; i++) 30 | { 31 | p = cp_vector_element_at(v, i); 32 | printf("%d: %s\n", i, p); 33 | } 34 | 35 | cp_vector_destroy_custom(v, free); 36 | 37 | return 0; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /example/test_wtrie.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() 7 | { 8 | void *prm; 9 | char *v; 10 | cp_wtrie *t = cp_wtrie_create(0); 11 | wchar_t FERGUSON[] = { 'F', 'E', 'R', 'G', 'U', 'S', 'O', 'N', 0 }; 12 | wchar_t FERRY[] = { 'F', 'E', 'R', 'R', 'Y', 0 }; 13 | wchar_t FERGUSONST[] = { 'F', 'E', 'R', 'G', 'U', 'S', 'O', 'N', 'S', 'T', 0 };; 14 | wchar_t FERMAT[] = { 'F', 'E', 'R', 'M', 'A', 'T', 0 }; 15 | 16 | 17 | if (t == NULL) 18 | { 19 | printf("can\'t create wtrie\n"); 20 | exit(1); 21 | } 22 | 23 | cp_wtrie_add(t, FERGUSON, "xxx"); 24 | cp_wtrie_add(t, FERMAT, "yyy"); 25 | 26 | cp_wtrie_prefix_match(t, FERRY, &prm); 27 | v = prm; 28 | printf("prefix match for ferry: %s\n", v ? v : "none"); 29 | 30 | v = cp_wtrie_exact_match(t, FERRY); 31 | printf("exact match for ferry: %s\n", v ? v : "none"); 32 | 33 | cp_wtrie_prefix_match(t, FERGUSONST, &prm); 34 | v = prm; 35 | printf("prefix match for fergusonst: %s\n", v ? v : "none"); 36 | 37 | v = cp_wtrie_exact_match(t, FERGUSONST); 38 | printf("exact match for fergusonst: %s\n", v ? v : "none"); 39 | 40 | cp_wtrie_destroy(t); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /log.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabit/libcprops/62a73ca84d6e53fc966b3ad994f7467c33b48532/log.c -------------------------------------------------------------------------------- /makedepend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | file=Makefile 4 | 5 | if [ ! -e $file ] ; then 6 | file=makefile 7 | if [ ! -e $file ] ; then 8 | echo makedepend.sh: error: [mM]akefile is not present 9 | exit 1 10 | fi 11 | fi 12 | 13 | echo "# DO NOT DELETE" >> $file 14 | echo >> $file 15 | 16 | for a in $@ 17 | do 18 | flag=`echo $a | sed '/^[[:punct:]]/d'` 19 | if [ -z $flag ] ; then continue ; fi 20 | b=`echo $a | sed 's/\.c/\.o/'` 21 | cpp -M $a | sed 's/\\//g' | sed 's/[[:space:]]\+/ /g' | sed 's/^[[:space:]]//' | sed 's/[[:space:]]$//' | sed 's/[[:space:]]/\n/g' | grep -vE '\.o' | grep -vE "$a" | sed "s/^/$b: /" >> $file 22 | done 23 | 24 | -------------------------------------------------------------------------------- /man3/cp_avltree_callback.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_insert.3 -------------------------------------------------------------------------------- /man3/cp_avltree_contains.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_insert.3 -------------------------------------------------------------------------------- /man3/cp_avltree_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_insert.3 -------------------------------------------------------------------------------- /man3/cp_avltree_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_create.3 -------------------------------------------------------------------------------- /man3/cp_avltree_delete.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_insert.3 -------------------------------------------------------------------------------- /man3/cp_avltree_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_create.3 -------------------------------------------------------------------------------- /man3/cp_avltree_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_create.3 -------------------------------------------------------------------------------- /man3/cp_avltree_get.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_insert.3 -------------------------------------------------------------------------------- /man3/cp_avltree_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_lock.3 -------------------------------------------------------------------------------- /man3/cp_avltree_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_avltree_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_lock.3 -------------------------------------------------------------------------------- /man3/cp_avltree_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_avltree_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_avltree_lock.3 -------------------------------------------------------------------------------- /man3/cp_bstr_cat.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_bstr_cmp.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_bstr_cpy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_bstr_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_bstr_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_bstr_dump.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_bstr_dup.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_bstr_shift_left.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_bstr_to_string.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/cp_client_close.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MARCH 2006" "libcprops" "cp_client" 2 | .SH NAME 3 | cp_client_close \- close a tcp connection 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "int cp_client_close(cp_client *" client "); 8 | .SH DESCRIPTION 9 | .B cp_client_close 10 | closes an open tcp connection associated with the cp_client \fIclient\fP. 11 | .SH RETURN VALUE 12 | 0 on successful operation, -1 on failure. 13 | .B cp_client_close 14 | may fail if the connection is not open. Errors on close may also indicate a 15 | failure on a previous write operation. 16 | .SH SEE ALSO 17 | .BR cp_client_connect (3), 18 | .BR cp_client_ssl_connect (3) 19 | -------------------------------------------------------------------------------- /man3/cp_client_create_ssl.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_client_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_client_destroy.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MARCH 2006" "libcprops" "cp_client" 2 | .SH NAME 3 | cp_client_destroy \- deallocate a tcp client structure 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void cp_client_destroy(cp_client *" client "); 8 | .SH DESCRIPTION 9 | .B cp_client_destroy 10 | deallocates the memory associated with a 11 | .B cp_client 12 | structure. 13 | -------------------------------------------------------------------------------- /man3/cp_client_get_server_certificate.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MARCH 2006" "libcprops" "cp_client" 2 | .SH NAME 3 | cp_client_get_server_certificate \- return the certificate pesented by the server for an ssl connection 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "X509 *cp_client_get_server_certificate(cp_client *" client "); 8 | .SH DESCRIPTION 9 | .B cp_client_get_server_certificate 10 | may be called on 11 | .B cp_client 12 | sockets created with 13 | .B cp_client_create_ssl 14 | and successfully connected with \fBcp_client_connect\fP to retrieve a 15 | descriptor of the certificate presented by the server during the ssl handshake. 16 | .SH RETURN VALUE 17 | The server certificate if available or NULL otherwise. 18 | -------------------------------------------------------------------------------- /man3/cp_client_read.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MARCH 2006" "libcprops" "cp_client" 2 | .SH NAME 3 | cp_client_read, cp_client_read_string \- read from a tcp connection 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "int cp_client_read(cp_client *" client ", char *" buf ", int " len "); 8 | .sp 9 | .BI "int cp_client_read_string(cp_client *" client ", cp_string *" str ", int " len "); 10 | .SH DESCRIPTION 11 | .B cp_client_read 12 | reads up to 13 | .I len 14 | bytes from the connection associated with cp_client 15 | .I client 16 | into the buffer \fIbuf\fP. 17 | .B cp_client_read_string 18 | reads up to 19 | .I len 20 | bytes into the cp_string \fIstr\fP. 21 | .SH RETURN VALUE 22 | 0 on end of file, -1 on error or the number of bytes successfully read. 23 | .SH SEE ALSO 24 | .BR cp_client_write (3) 25 | -------------------------------------------------------------------------------- /man3/cp_client_read_string.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_client_read.3 -------------------------------------------------------------------------------- /man3/cp_client_set_retry.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MARCH 2006" "libcprops" "cp_client" 2 | .SH NAME 3 | cp_client_set_retry \- set connection retry count on a cp_client structure 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void cp_client_set_retry(cp_client *" client ", int " retry_count "); 8 | .SH DESCRIPTION 9 | .B cp_client_set_retry 10 | sets the number of retries to be made when attempting to establish a connection 11 | in a subsequent call to \fBcp_client_connect\fP. By default a connection will 12 | be attempted up to three times. 13 | .SH SEE ALSO 14 | .BR cp_client_connect (3) 15 | -------------------------------------------------------------------------------- /man3/cp_client_ssl_init.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MARCH 2006" "libcprops" "cp_client" 2 | .SH NAME 3 | cp_client_ssl_init, cp_client_ssl_shutdown \- tcp client ssl initialization / shutdown functions 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void cp_client_ssl_init(); 8 | .sp 9 | .BI "void cp_client_ssl_shutdown(); 10 | .SH DESCRIPTION 11 | Programs using ssl client api functions must call 12 | .B cp_client_ssl_init 13 | before creating a client structure and 14 | .B cp_client_ssl_shutdown 15 | to perform cleanup. 16 | -------------------------------------------------------------------------------- /man3/cp_client_ssl_shutdown.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_client_ssl_init.3 -------------------------------------------------------------------------------- /man3/cp_client_verify_hostname.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MARCH 2006" "libcprops" "cp_client" 2 | .SH NAME 3 | cp_client_verify_hostname \- compare the host name used for a connection to the 4 | host name given in the certificate presented by the server 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "int cp_client_verify_hostname(cp_client *" client "); 9 | .SH DESCRIPTION 10 | .B cp_client_verify_hostname 11 | may be called on 12 | .B cp_client 13 | sockets created with 14 | .B cp_client_create_ssl 15 | and successfully connected with \fBcp_client_connect\fP to determine if the 16 | host name given in the server certificate matches the host name used to make 17 | connection. 18 | .SH RETURN VALUE 19 | .B cp_client_verify_hostname 20 | returns non-zero if the host name used 21 | to make the connection matches the host name given in the server certificate, 22 | or zero on mismatch. 23 | .SH SEE ALSO 24 | .BR cp_client_create_ssl (3), 25 | .BR cp_client_connect (3) 26 | -------------------------------------------------------------------------------- /man3/cp_client_write.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MARCH 2006" "libcprops" "cp_client" 2 | .SH NAME 3 | cp_client_write, cp_client_write_string \- write from a tcp connection 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "int cp_client_write(cp_client *" client ", char *" buf ", int " len "); 8 | .sp 9 | .BI "int cp_client_write_string(cp_client *" client ", cp_string *" str "); 10 | .SH DESCRIPTION 11 | .B cp_client_write 12 | attempts to write 13 | .I len 14 | bytes to the connection associated with the cp_client 15 | .I client 16 | from the buffer \fIbuf\fP. 17 | .B cp_client_write_string 18 | attempts to write the cp_string 19 | .I str 20 | to the client. 21 | .SH RETURN VALUE 22 | the number of bytes successfully written on success or -1 on error. 23 | .SH SEE ALSO 24 | .BR cp_client_read (3) 25 | -------------------------------------------------------------------------------- /man3/cp_client_write_string.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_client_write.3 -------------------------------------------------------------------------------- /man3/cp_connection_descriptor.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "OCTOBER 2005" "libcprops" "cp_socket" 2 | .SH NAME 3 | cp_connection_descriptor \- connection descriptor for cp_socket connections 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_socket *cp_connection_descriptor_get_socket(" 8 | .ti +10n 9 | .BI "cp_connection_descriptor " descriptor "); 10 | .sp 11 | .BI "struct sockaddr_in *cp_connection_descriptor_get_addr(" 12 | .ti +10n 13 | .BI "cp_connection_descriptor " descriptor "); 14 | .sp 15 | .BI "int cp_connection_descriptor_get_fd(" 16 | .ti +10n 17 | .BI "cp_connection_descriptor " descriptor "); 18 | .SH DESCRIPTION 19 | Connections made by a cp_socket created with CPSOCKET_STRATEGY_THREADPOOL call 20 | a user defined thread function with the connection information wrapped in a 21 | .B cp_connection_descriptor 22 | struct. 23 | .sp 24 | .B cp_connection_descriptor_get_socket 25 | returns a pointer to the originating cp_socket; 26 | .sp 27 | .B cp_connection_descriptor_get_addr 28 | returns a pointer to a 29 | .B struct sockaddr_in 30 | describing the address the connection was made from; and 31 | .sp 32 | .B cp_connection_descriptor_get_fd 33 | returns to file descriptor number for this connection. 34 | .SH SEE ALSO 35 | .BR cp_socket (3) 36 | -------------------------------------------------------------------------------- /man3/cp_data_source_destroy.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_data_source_destroy \- release a database connection factory 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void cp_data_source_destroy(cp_data_source *" data_source "); 8 | .SH DESCRIPTION 9 | .B cp_data_source_destroy 10 | releases the memory associated with a 11 | .B cp_data_source 12 | connection factory. 13 | .SH SEE ALSO 14 | .BR cp_dbms_get_data_source (3), 15 | .BR cp_db_postgres (3), 16 | .BR cp_db_mysql (3) 17 | -------------------------------------------------------------------------------- /man3/cp_data_source_get_connection.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_data_source_get_connection \- obtain a database connection from a connection 4 | factory 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "cp_db_connection * 9 | .ti +5n 10 | .BI "cp_data_source_get_connection(cp_data_source *" data_source "); 11 | .SH DESCRIPTION 12 | .B cp_data_source_get_connection 13 | opens a new connection with the parameters specified in the creation of the 14 | connection factory \fIdata_source\fP. 15 | .SH RETURN VALUE 16 | a 17 | .B cp_db_connection 18 | structure representing the newly created connection on success or NULL on 19 | failure. 20 | -------------------------------------------------------------------------------- /man3/cp_db_connection_close.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_close \- close a database connection 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "int cp_db_connection_close(cp_db_connection *" connection "); 9 | .SH DESCRIPTION 10 | .B cp_db_connection_close 11 | closes the database connection described by \fIconnection\fP. 12 | .SH RETURN VALUE 13 | .B cp_db_connection_close 14 | returns zero on success or an implementation dependent non-zero value 15 | indicating an error. 16 | -------------------------------------------------------------------------------- /man3/cp_db_connection_close_statement.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_close_statement \- close a prepared statement 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "void cp_db_connection_close_statement(cp_db_connection *" connection ", 9 | .ti +38n 10 | .BI "cp_db_statement *" statement "); 11 | .SH DESCRIPTION 12 | .B cp_db_connection_close_statement 13 | closes and deallocates a prepared statement created with 14 | .BR cp_db_connection_prepare_statement (3). 15 | -------------------------------------------------------------------------------- /man3/cp_db_connection_commit.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_commit, cp_db_connection_rollback \- perform a COMMIT / 4 | ROLLBACK on a database connection 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "int cp_db_connection_commit(cp_db_connection *" conn "); 10 | .br 11 | .BI "int cp_db_connection_rollback(cp_db_connection *" conn "); 12 | .SH DESCRIPTION 13 | .B cp_db_connection_commit 14 | performs a commit on a database connection. 15 | .sp 16 | .B cp_db_connection_rollback 17 | performs a rollback on a database connection. 18 | .SH RETURN VALUE 19 | .B cp_db_connection_commit 20 | and 21 | .B cp_db_connection_rollback 22 | return zero on success or non-zero on error. 23 | -------------------------------------------------------------------------------- /man3/cp_db_connection_destroy.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_close \- release the memory allocated by a database connection 4 | descriptor 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "void cp_db_connection_destroy(cp_db_connection *" connection "); 10 | .SH DESCRIPTION 11 | .B cp_db_connection_destroy 12 | deallocates the memory associated with a database connection descriptor. 13 | -------------------------------------------------------------------------------- /man3/cp_db_connection_escape_binary.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_connection_escape_string.3 -------------------------------------------------------------------------------- /man3/cp_db_connection_execute_statement_args.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_connection_execute_statement.3 -------------------------------------------------------------------------------- /man3/cp_db_connection_pool_create.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_pool_create, cp_db_connection_pool_destroy \- create / 4 | deallocate a connection pool 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "cp_db_connection_pool * 10 | .ti +5n 11 | .BI "cp_db_connection_pool_create(cp_data_source *" data_source ", 12 | .ti +34n 13 | .BI "int " min_size ", 14 | .ti +34n 15 | .BI "int " max_size ", 16 | .ti +34n 17 | .BI "int " initial_size "); 18 | .br 19 | .BI "void cp_db_connection_pool_destroy(cp_db_connection_pool *" pool "); 20 | 21 | .SH DESCRIPTION 22 | .B cp_db_connection_pool_create 23 | creates a database connection pool for connections on the given 24 | \fIdata_source\fP. Connections may be obtained from the pool by calling 25 | .BR cp_db_connection_pool_get_connection (3). 26 | Connections remain open until the pool is stopped by calling 27 | .BR cp_db_connection_pool_shutdown (3), 28 | which closes all open connections. The pool must be explicitly deallocated 29 | by calling 30 | \fBcp_db_connection_pool_destroy\fP. 31 | .SH RETURN VALUE 32 | .B cp_db_connection_pool_create 33 | returns a 34 | .B cp_db_connection_pool 35 | structure representing the newly created connection pool on success or NULL on 36 | failure. 37 | .SH SEE ALSO 38 | .BR cp_db_connection_pool_shutdown (3), 39 | .BR cp_db_connection_pool_get_connection (3), 40 | .BR cp_db_connection_pool_release_connection (3) 41 | -------------------------------------------------------------------------------- /man3/cp_db_connection_pool_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_connection_pool_create.3 -------------------------------------------------------------------------------- /man3/cp_db_connection_pool_get_connection.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_pool_get_connection, 4 | cp_db_connection_pool_release_connection \- retrieve / return a connection from 5 | a connection pool 6 | 7 | .SH SYNOPSIS 8 | #include 9 | 10 | .BI "cp_db_connection * 11 | .ti +5n 12 | .BI "cp_db_connection_pool_get_connection(cp_db_connection_pool *" pool "); 13 | .br 14 | .BI "void " 15 | .ti +2n 16 | .BI "cp_db_connection_pool_release_connection(cp_db_connection_pool *" pool ", 17 | .ti +43n 18 | .BI "cp_db_connection *" conn "); 19 | .SH DESCRIPTION 20 | .B cp_db_connection_pool_get_connection 21 | retrieves a connection from a connection pool. If the connection pool has no 22 | more connections available cp_db_connection_pool_get_connection either returns 23 | NULL, or blocks until a connection becomes available if the pool was set to 24 | block. 25 | .sp 26 | .B cp_db_connection_pool_release_connection 27 | returns a connection to the pool for reuse. Connections retrieved with 28 | cp_db_connection_pool_get_connection should not be closed explicitly. 29 | .SH RETURN VALUE 30 | .B cp_db_connection_pool_create 31 | returns a 32 | .B cp_db_connection_pool 33 | structure representing the newly created connection pool on success or NULL on 34 | failure. 35 | .SH SEE ALSO 36 | .BR cp_db_connection_pool_set_blocking (3) 37 | -------------------------------------------------------------------------------- /man3/cp_db_connection_pool_release_connection.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_connection_pool_get_connection.3 -------------------------------------------------------------------------------- /man3/cp_db_connection_pool_set_blocking.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_pool_set_blocking \- set a connection pool's behavior when 4 | a connection is requested and none are available 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "void cp_db_connection_pool_set_blocking(cp_db_connection_pool *" pool ", 10 | .ti +40n 11 | .BI "int " block "); 12 | .SH DESCRIPTION 13 | .B cp_db_connection_pool_set_blocking 14 | sets the 15 | .I block 16 | flag on a connection pool to the specified value. If this is non-zero, no 17 | connections are available and the connection pool has reached its maximal size, 18 | .B cp_db_connection_pool_get_connection 19 | will block until a connection becomes available. 20 | .sp 21 | The 22 | .I block 23 | flag is not set by default. 24 | .SH SEE ALSO 25 | .BR cp_db_connection_pool_shutdown (3), 26 | .BR cp_db_connection_pool_get_connection (3) 27 | -------------------------------------------------------------------------------- /man3/cp_db_connection_pool_shutdown.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_pool_shutdown \- stop a connection pool 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "int cp_db_connection_pool_shutdown(cp_db_connection_pool *" pool "); 9 | .SH DESCRIPTION 10 | .B cp_db_connection_pool_shutdown 11 | closes all open connections in the connection pool \fIpool\fP. The pool itself 12 | is not deallocated. To deallocate the pool call 13 | \fBcp_db_connection_pool_destroy\fP. 14 | .sp 15 | If connections have been obtained from the pool and were not yet released with 16 | \fBcp_db_connection_pool_release_connection\fP, the shutdown process blocks 17 | until these connections are released. 18 | .SH RETURN VALUE 19 | .B cp_db_connection_pool_shutdown 20 | always returns 0. 21 | .SH SEE ALSO 22 | .BR cp_db_connection_pool_destroy (3) 23 | -------------------------------------------------------------------------------- /man3/cp_db_connection_prepare_statement.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_prepare_statement \- create a prepared statement 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "cp_db_statement * 9 | .ti +5n 10 | .BI "cp_db_connection_prepare_statement(cp_db_connection *" connection ", 11 | .ti +40n 12 | .BI "int " prm_count ", 13 | .ti +40n 14 | .BI "cp_field_type *" prm_types ", 15 | .ti +40n 16 | .BI "char *" query "); 17 | .SH DESCRIPTION 18 | .B cp_db_connection_prepare_statement 19 | creates a prepared statement with 20 | .I prm_count 21 | parameters of the types given by 22 | .I prm_types 23 | for the query 24 | .I query 25 | on the connection \fIconnection\fP. Parameters are specified as '?' in the 26 | query string; implementations may support other formats in addition. See 27 | .BR cp_db_connection_select (3) 28 | for a list of the parameter types that may be used in the 29 | .I prm_type 30 | parameter type specification vector. 31 | .SH RETURN VALUE 32 | a 33 | .B cp_db_statement 34 | representing the prepared statement on success or NULL on failure. 35 | .SH SEE ALSO 36 | .BR cp_db_statement_set_binary (3), 37 | .BR cp_db_connection_execute_statement (3), 38 | .BR cp_db_connection_close_statement (3) 39 | -------------------------------------------------------------------------------- /man3/cp_db_connection_rollback.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_connection_commit.3 -------------------------------------------------------------------------------- /man3/cp_db_connection_set_autocommit.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_set_autocommit \- set a connection's autocommit behavior 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "void cp_db_connection_set_autocommit(cp_db_connection *" conn ", int " state "); 9 | .SH DESCRIPTION 10 | .B cp_db_connection_set_autocommit 11 | sets autocommit off if 12 | .I state 13 | is zero or on if it is non-zero. 14 | -------------------------------------------------------------------------------- /man3/cp_db_connection_set_fetch_metadata.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_set_fetch_metadata \- set connection to request query result 4 | meta data 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "void cp_db_connection_set_fetch_metadata(cp_db_connection *" connection ", 10 | .ti +41n 11 | .BI "int " mode "); 12 | .SH DESCRIPTION 13 | .B cp_db_connection_set_fetch_metadata 14 | sets the connection to fetch result set meta data for SELECT queries. 15 | -------------------------------------------------------------------------------- /man3/cp_db_connection_set_fetch_size.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_set_fetch_size \- set number of rows to be retrieved at a time 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "void cp_db_connection_set_fetch_size(cp_db_connection *" connection ", 9 | .ti +37n 10 | .BI "int " fetch_size "); 11 | .SH DESCRIPTION 12 | .B cp_db_connection_set_fetch_size 13 | sets the number of result rows to be read at a time. If this value is zero, the 14 | complete result set is read at once. 15 | .SH SEE ALSO 16 | .BR cp_result_set_next (3) 17 | -------------------------------------------------------------------------------- /man3/cp_db_connection_set_read_result_set_at_once.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_set_read_result_set_at_once \- set connection to fetch 4 | complete query results upon execution. 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "void cp_db_connection_set_fetch_metadata(cp_db_connection *" connection ", 10 | .ti +41n 11 | .BI "int " mode "); 12 | .SH DESCRIPTION 13 | calling 14 | .B cp_db_connection_set_read_result_set_at_once 15 | with a non-zero 16 | .I mode 17 | value causes subsequent queries returning result sets to retrieve the complete 18 | set of results at the time the query is executed. This would not be recommended 19 | if the size of the results is very large. If set not to retrieve results at 20 | once, the number of rows retrieved at a time may be controlled with 21 | .BR cp_db_connection_set_fetch_size (3). 22 | .SH SEE ALSO 23 | .BR cp_db_connection_set_fetch_size (3), 24 | .BR cp_result_set_next (3) 25 | -------------------------------------------------------------------------------- /man3/cp_db_connection_unescape_binary.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_connection_escape_string.3 -------------------------------------------------------------------------------- /man3/cp_db_connection_update.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_connection_update \- send an SQL command on a database connection 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "int cp_db_connection_update(cp_db_connection *" connection ", char *" query "); 9 | .SH DESCRIPTION 10 | .B cp_db_connection_update 11 | performs the query 12 | .I query 13 | on the connection described by 14 | .I connection 15 | and returns an integer value representing the query result status. Return codes 16 | depend on the underlying implementation. 17 | .SH RETURN VALUE 18 | actual return codes depend on the underlying implementation. As a rule zero 19 | indicates success and non-zero indicates an error condition. 20 | -------------------------------------------------------------------------------- /man3/cp_db_init.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_init, cp_db_shutdown \- initialize / shut down db abstraction layer 4 | .SH SYNOPSIS 5 | #include 6 | .BI "int cp_db_init(); 7 | .br 8 | .BI "int cp_db_shutdown();" 9 | .SH DESCRIPTION 10 | .B cp_db_init 11 | initializes the internal data structures used by the data base abstraction 12 | layer. 13 | .sp 14 | .B cp_db_shutdown 15 | releases the memory allocated by the data base abstraction layers and invokes 16 | implementation shutdown calls. 17 | .SH RETURN VALUE 18 | .B cp_db_init 19 | returns zero on success or non zero if already initialized. 20 | .br 21 | .B cp_db_shutdown 22 | returns zero on success or non zero if not initialized. 23 | 24 | -------------------------------------------------------------------------------- /man3/cp_db_mysql.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_mysql, cp_mysql_data_source \- cp_dbms mysql driver 4 | .SH SYNOPSIS 5 | #include 6 | #include 7 | 8 | .BI "cp_data_source * 9 | .ti +5n 10 | .BI "cp_mysql_data_source(char *" host ", 11 | .ti +26n 12 | .BI "int " port ", 13 | .ti +26n 14 | .BI "char *" login ", 15 | .ti +26n 16 | .BI "char *" password ", 17 | .ti +26n 18 | .BI "char *" db_name ", 19 | .ti +26n 20 | .BI "char *" unix_socket ", 21 | .ti +26n 22 | .BI "unsigned long " client_flag "); 23 | .SH DESCRIPTION 24 | If configured --with-mysql, cprops provides a driver to access mysql databases 25 | through the cp_dbms api. To use this api, create a data source 26 | with 27 | .B "mysql" 28 | as the driver name. 29 | .sp 30 | In addition to the basic connection parameters, the mysql driver recognizes 31 | the following parameters if inserted as keys on the 32 | .I prm 33 | table parameter to 34 | .BR cp_dbms_get_data_source_prm (3): 35 | .sp 36 | 37 | .RS +3n 38 | .nf 39 | unix_socket -- specifies the socket or named pipe that should be used. 40 | client_flag -- a combination of flags to enable features such as compression, 41 | timeout handling and others. 42 | .fi 43 | .RE 44 | 45 | For more on these options, see the mysql libmysqlclient documentation for 46 | mysql_real_connect(). 47 | .sp 48 | If cprops was configured to link cp_dbms drivers statically, 49 | the mysql driver need not be loaded dynamically and 50 | .B cp_mysql_data_source 51 | may be called directly to obtain connections. 52 | .SH SEE ALSO 53 | .BR cp_dbms_get_data_source (3), 54 | .BR cp_dbms_get_data_source_prm (3) 55 | -------------------------------------------------------------------------------- /man3/cp_db_shutdown.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_init.3 -------------------------------------------------------------------------------- /man3/cp_db_statement_set_binary.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_db_statement_set_binary \- request statement results in binary/text format 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "void cp_db_statement_set_binary(cp_db_statement *" stmt ", int " binary "); 9 | .SH DESCRIPTION 10 | .B cp_db_statement_set_binary 11 | sets the 12 | .I binary 13 | flag on a prepared statement, indicating that results should be returned in 14 | text format if 15 | .I binary 16 | is zero or binary format if 17 | .I binary 18 | is non-zero. Driver implementations may ignore this flag - e.g. the 19 | .B mysql 20 | driver always returns prepared statement results in binary format. 21 | -------------------------------------------------------------------------------- /man3/cp_dbms_get_data_source.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_dbms_get_data_source, cp_dbms_get_data_source_prm \- obtain a database 4 | connection factory 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "cp_data_source *" 9 | .ti +5n 10 | .BI "cp_dbms_get_data_source(char *" driver ", char *" host ", int " port ", 11 | .ti +29n 12 | .BI "char *" user ", char *" passwd ", char *" db_name "); 13 | .br 14 | .BI "cp_data_source *" 15 | .ti +5n 16 | .BI "cp_dbms_get_data_source_prm(char *" driver ", char *" host ", int " port ", 17 | .ti +33n 18 | .BI "char *" user ", char *" passwd ", 19 | .ti +33n 20 | .BI "char *" db_name ", cp_hashtable *" prm "); 21 | .br 22 | .SH DESCRIPTION 23 | .B cp_dbms_get_data_source 24 | attempts to obtain a connection factory for the given 25 | .I driver 26 | name to the given database 27 | .I db_name 28 | at the given 29 | .I host 30 | and 31 | .I port 32 | with the user name 33 | .I user 34 | and password \fIpasswd\fP. 35 | .sp 36 | .B cp_dbms_get_data_source_prm 37 | allows passing additional implementation specific parameters in the hash table 38 | \fIprm\fP. For the key names and values available see the man pages for 39 | specific implementations. 40 | .sp 41 | Implementation specific functions returning a data source object may be 42 | available if cprops was configured to link dbms driver modules statically. See 43 | the driver implementation man pages for details. 44 | .SH RETURN VALUE 45 | a 46 | .B cp_data_source 47 | connection factory object for the given parameters on success or NULL on 48 | failure. 49 | .SH SEE ALSO 50 | .BR cp_db_postgres (3), 51 | .BR cp_db_mysql (3) 52 | -------------------------------------------------------------------------------- /man3/cp_dbms_get_data_source_prm.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_dbms_get_data_source.3 -------------------------------------------------------------------------------- /man3/cp_dbms_load_driver.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_dbms_load_driver \- load a dbms driver implementation 4 | .SH SYNOPSIS 5 | #include 6 | .BI "int cp_dbms_load_driver(char *" name "); 7 | .SH DESCRIPTION 8 | .B cp_dbms_load_driver 9 | attempts to load the dbms driver implementation for the given \fIname\fP. 10 | Driver implementations are compiled into shared object files and follow the 11 | pattern 'libcp_dbms_NAME.so' where NAME is the dbms name. 12 | .SH RETURN VALUE 13 | zero on success or non-zero if the requested driver could not be loaded. 14 | 15 | -------------------------------------------------------------------------------- /man3/cp_hashlist_append.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_insert.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_append_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_insert.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_callback.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashlist 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashlist" 2 | .SH NAME 3 | cp_hashlist_callback \- invoke a callback on hashlist mappings 4 | .SH SYNOPSIS 5 | 6 | .B #include 7 | 8 | .BI "int cp_hashlist_callback(cp_hashlist *" list ", 9 | .ti +25n 10 | .BI "int (*" cb ")(void *key, void *value, void *id), 11 | .ti +25n 12 | .BI "void *" id "); 13 | 14 | .SH DESCRIPTION 15 | .B cp_hashlist_callback 16 | iterates over all entries in a hashlist, invoking the callback function 17 | .I cb 18 | on each key / value pair in the list. In addition the 19 | .I id 20 | parameter is passed to the callback function with no change. 21 | .sp 22 | Iteration stops if the callback returns non-zero or after the callback has been 23 | invoked on all mappings. 24 | .SH RETURN VALUE 25 | .B cp_hashlist_callback 26 | returns 0 on success or -1 on locking failure. 27 | -------------------------------------------------------------------------------- /man3/cp_hashlist_contains.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashlist 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashlist" 2 | .SH NAME 3 | cp_hashlist_contains \- test a hashlist for the existence of a mapping 4 | .SH SYNOPSIS 5 | .B #include 6 | 7 | .BI "int cp_hashlist_contains(cp_hashlist *" list ", void *" key "); 8 | .SH DESCRIPTION 9 | \fBcp_hashlist_contains\fP tests if the hashlist \fIlist\fP contains a 10 | mapping for the key \fIkey\fP. 11 | .SH RETURN VALUE 12 | non-zero if a mapping for \fIkey\fP is found, zero if not. 13 | .SH "SEE ALSO" 14 | .BR cp_hashlist_get (3) 15 | -------------------------------------------------------------------------------- /man3/cp_hashlist_create_by_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_create_iterator.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_destroy.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashlist 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashlist" 2 | .SH NAME 3 | cp_hashlist_destroy, cp_hashlist_destroy_by_option, 4 | cp_hashlist_destroy_custom \- hashlist destructor functions 5 | .SH SYNOPSIS 6 | 7 | .B #include 8 | 9 | .BI "void cp_hashlist_destroy(cp_hashlist *" list "); 10 | .br 11 | .BI "void cp_hashlist_destroy_deep(cp_hashlist *" list "); 12 | .br 13 | .BI "void cp_hashlist_destroy_custom(cp_hashlist *" list ", 14 | .ti +32n 15 | .BI "cp_destructor_fn " key_destructor ", 16 | .ti +32n 17 | .BI "cp_destructor_fn " value_destructor "); 18 | 19 | .SH DESCRIPTION 20 | .B cp_hashlist_destroy 21 | iterates over all entries in a hashlist, invoking the destructor functions 22 | specified for keys and values if not null and if the list mode has the 23 | .B COLLECTION_MODE_DEEP 24 | bit set, and finally deallocates internal storage and the 25 | .B cp_hashlist 26 | structure itself. 27 | .B cp_hashlist_destroy_by_option 28 | allows specifying a different 29 | .I mode 30 | than the list mode to perform finalization and 31 | .B cp_hashlist_destroy_custom 32 | allows specifying custom finalization functions for keys (\fIkey_destructor\fP) 33 | and values(\fIvalue_destructor\fP). 34 | 35 | .SH "SEE ALSO" 36 | .BR cp_hashlist (3), 37 | .BR cp_hashlist_create (3) 38 | -------------------------------------------------------------------------------- /man3/cp_hashlist_destroy_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_destroy.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_destroy.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_entry_get_key.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_entry_get_value.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_get_head.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_get.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_get_mode.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashlist 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashlist" 2 | .SH NAME 3 | cp_hashlist_get_mode \- get hashlist mode bit settings 4 | .SH SYNOPSIS 5 | .B #include 6 | 7 | .BI "int cp_hashlist_get_mode(cp_hashlist *" list "); 8 | .SH DESCRIPTION 9 | .B cp_hashlist_get_mode 10 | returns the current mode bit settings for hashlist \fIlist\fP. For more on the 11 | effect of specific mode bits, see \fBcp_hashlist_set_mode\fP (3). 12 | .SH RETURN VALUE 13 | the current mode settings for hashlist \fIlist\fP. 14 | .SH "SEE ALSO" 15 | .BR cp_hashlist_set_mode (3) 16 | -------------------------------------------------------------------------------- /man3/cp_hashlist_get_tail.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_get.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_insert_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_insert.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_is_empty.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashlist 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashlist" 2 | .SH NAME 3 | cp_hashlist_is_empty \- test if a hashlist is empty 4 | .SH SYNOPSIS 5 | .B #include 6 | 7 | .BI "cp_hashlist_is_empty(cp_hashlist *" table "); 8 | .SH DESCRIPTION 9 | \fBcp_hashlist_is_empty\fP tests if a hashlist is empty. 10 | .SH RETURN VALUE 11 | non-zero if the hashlist is empty, zero if it is. 12 | .SH "SEE ALSO" 13 | .BR cp_hashlist_count (3) 14 | -------------------------------------------------------------------------------- /man3/cp_hashlist_item_count.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashlist 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashlist" 2 | .SH NAME 3 | cp_hashlist_count \- hashlist item count 4 | .SH SYNOPSIS 5 | .B #include 6 | 7 | .BI "unsigned long cp_hashlist_item_count(cp_hashlist *" list "); 8 | .SH DESCRIPTION 9 | \fBcp_hashlist_count\fP returns the number of mappings in a hashlist. 10 | .SH RETURN VALUE 11 | the number of mappings in the hashlist as a long integer. 12 | .SH SEE ALSO 13 | cp_hashlist_is_empty (3) 14 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_append.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_curr.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_curr_key.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_curr_value.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_head.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_init.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_init_tail.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_insert.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_next.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_next_key.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_next_value.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_prev.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_prev_key.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_prev_value.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_release.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_remove.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_tail.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_iterator_to_key.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_remove_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_remove.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_remove_deep.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_remove.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_remove_head.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_remove.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_remove_head_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_remove.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_remove_tail.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_remove.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_remove_tail_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_remove.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_set_max_fill_factor.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_set_min_fill_factor.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_set_min_fill_factor.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashlist 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashlist" 2 | .SH NAME 3 | cp_hashlist_set_min_fill_factor, cp_hashlist_set_max_fill_factor \- set 4 | minimal/maximal fill factors for internal table resizing 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "int cp_hashlist_set_min_fill_factor(cp_hashlist *" list ", int " factor "); 9 | .br 10 | .BI "int cp_hashlist_set_max_fill_factor(cp_hashlist *" list ", int " factor "); 11 | .SH DESCRIPTION 12 | \fIfactor\fP is the fill factor in percent beyond which an internal table 13 | resize will be triggered upon entry removal 14 | (\fBcp_hashlist_set_min_fill_factor\fP) or insertion 15 | (\fBcp_hashlist_set_max_fill_factor\fP). The default values are 5 and 70 16 | respectively. 17 | .sp 18 | Resizing may be disabled completely by setting the 19 | .B COLLECTION_MODE_NORESIZE 20 | bit on the list's mode. 21 | .SH RETURN VALUE 22 | .B cp_hashlist_set_min_fill_factor 23 | and 24 | .B cp_hashlist_set_max_fill_factor 25 | return 0 on success or -1 on locking failure. 26 | .SH SEE ALSO 27 | .BR cp_hashlist_set_min_size (3), 28 | .BR cp_hashlist_set_mode (3) 29 | -------------------------------------------------------------------------------- /man3/cp_hashlist_set_min_size.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashlist 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashlist" 2 | .SH NAME 3 | cp_hashlist_set_min_size \- set the minimal internal table size on a 4 | cp_hashlist 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "void cp_hashlist_set_min_size(cp_hashlist *" list ", 10 | .ti +30n 11 | .BI "unsigned long " min_size "); 12 | .SH DESCRIPTION 13 | .B cp_hashlist_set_min_size 14 | sets the minimal size of internal lookup table to \fImin_size\fP. On creation, 15 | this value is set to the size hint given to the constructor function. This is 16 | to prevent tables from resizing upon entry removal shortly after creation if 17 | the table contains few items. 18 | .SH SEE ALSO 19 | .BR cp_hashlist_create (3), 20 | .BR cp_hashlist_set_min_fill_factor (3) 21 | -------------------------------------------------------------------------------- /man3/cp_hashlist_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_set_mode.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashlist_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashlist_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_contains.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashtable 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashtable" 2 | .SH NAME 3 | cp_hashtable_contains \- test a hashtable for the existence of a mapping 4 | .SH SYNOPSIS 5 | .B #include 6 | 7 | .BI "int cp_hashtable_contains(cp_hashtable *" table ", void *" key "); 8 | .SH DESCRIPTION 9 | \fBcp_hashtable_contains\fP tests if the hashtable \fItable\fP contains a 10 | mapping for the key \fIkey\fP. 11 | .SH RETURN VALUE 12 | non-zero if a mapping for \fIkey\fP is found, zero if not. 13 | .SH "SEE ALSO" 14 | .BR cp_hashtable_get (3) 15 | -------------------------------------------------------------------------------- /man3/cp_hashtable_count.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashtable 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashtable" 2 | .SH NAME 3 | cp_hashtable_count \- hashtable item count 4 | .SH SYNOPSIS 5 | .B #include 6 | 7 | .BI "unsigned long cp_hashtable_count(cp_hashtable *" table "); 8 | .SH DESCRIPTION 9 | \fBcp_hashtable_count\fP returns the number of mappings in a hashtable. 10 | .SH RETURN VALUE 11 | the number of mappings in the hashtable as an unsigned long integer. 12 | .SH SEE ALSO 13 | cp_hashtable_is_empty (3) 14 | -------------------------------------------------------------------------------- /man3/cp_hashtable_create_by_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_create_copy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_create_copy_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_destroy.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashtable 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashtable" 2 | .SH NAME 3 | cp_hashtable_destroy, 4 | cp_hashtable_destroy_shallow, 5 | cp_hashtable_destroy_deep, 6 | cp_hashtable_destroy_custom \- hashtable destructor functions 7 | .SH SYNOPSIS 8 | 9 | .B #include 10 | 11 | .BI "void cp_hashtable_destroy(cp_hashtable *" table "); 12 | .br 13 | .BI "void cp_hashtable_destroy_shallow(cp_hashtable *" table "); 14 | .br 15 | .BI "void cp_hashtable_destroy_deep(cp_hashtable *" table "); 16 | .br 17 | .BI "void cp_hashtable_destroy_custom(cp_hashtable *" table ", 18 | .ti +33n 19 | .BI "cp_destructor_fn " key_destructor ", 20 | .ti +33n 21 | .BI "cp_destructor_fn " value_destructor "); 22 | 23 | .SH DESCRIPTION 24 | .B cp_hashtable_destroy 25 | removes all entries from a hashtable, invoking the destructor functions 26 | specified for keys and values if not null and if the table mode has the 27 | .B COLLECTION_MODE_DEEP 28 | bit set, and finally deallocates internal storage and the 29 | .B cp_hashtable 30 | structure itself. Regardless of table mode, 31 | .B cp_hashtable_destroy_shallow 32 | never invokes key and item destructor functions, 33 | .B cp_hashtable_destroy_deep 34 | always invokes (non-null) key and item destructor functions, and 35 | .B cp_hashtable_destroy_custom 36 | always invokes the specified non-null \fIkey_destructor\fP and 37 | \fIvalue_destructor\fP functions on keys and values respectively. 38 | 39 | .SH "SEE ALSO" 40 | .BR cp_hashtable (3), 41 | .BR cp_hashtable_create (3) 42 | -------------------------------------------------------------------------------- /man3/cp_hashtable_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_destroy.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_destroy_deep.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_destroy.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_destroy_shallow.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_destroy.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_get_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_get.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_get_keys.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashtable 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashtable" 2 | .SH NAME 3 | cp_hashtable_get_keys, cp_hashtable_get_values \- retrieve hashtable keys / 4 | values 5 | .SH SYNOPSIS 6 | 7 | .B #include 8 | 9 | .BI "void **cp_hashtable_get_keys(cp_hashtable *" table "); 10 | .br 11 | .BI "void **cp_hashtable_get_values(cp_hashtable *" table "); 12 | .SH DESCRIPTION 13 | \fBcp_hashtable_get_keys\fP and \fBcp_hashtable_get_values\fP return an array 14 | containing all keys and values in the table respectively. The newly allocated 15 | array's size may be determined by calling \fBcp_hashtable_count\fP. 16 | .SH RETURN VALUE 17 | An array of void pointers to the keys / values or NULL on failure. 18 | .SH ERRORS 19 | .TP 20 | .B EINVAL 21 | .I table 22 | is NULL. 23 | .br 24 | .TP 25 | .B ENOMEM 26 | the return array could not be allocated. 27 | .SH "SEE ALSO" 28 | .BR cp_hashtable (3), 29 | .BR cp_hashtable_count (3) 30 | -------------------------------------------------------------------------------- /man3/cp_hashtable_get_values.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_get_keys.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_is_empty.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashtable 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashtable" 2 | .SH NAME 3 | cp_hashtable_is_empty \- test if a hashtable is empty 4 | .SH SYNOPSIS 5 | .B #include 6 | 7 | .BI "cp_hashtable_is_empty(cp_hashtable *" table "); 8 | .SH DESCRIPTION 9 | \fBcp_hashtable_is_empty\fP tests if a hashtable is empty. 10 | .SH RETURN VALUE 11 | non-zero if the hashtable is empty, zero if it is. 12 | .SH "SEE ALSO" 13 | .BR cp_hashtable_count (3) 14 | -------------------------------------------------------------------------------- /man3/cp_hashtable_put_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_put.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_put_copy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_put.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_put_safe.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_put.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_remove.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashtable 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashtable" 2 | .SH NAME 3 | cp_hashtable_remove, cp_hashtable_remove_deep, cp_hashtable_remove_all \- 4 | remove mappings from a hashtable 5 | .SH SYNOPSIS 6 | 7 | .B #include 8 | 9 | .BI "void *cp_hashtable_remove(cp_hashtable *" table ", void *" key "); 10 | .br 11 | .BI "int cp_hashtable_remove_deep(cp_hashtable *" table ", void *" key "); 12 | .br 13 | .BI "int cp_hashtable_remove_all(cp_hashtable *" table "); 14 | .SH DESCRIPTION 15 | .B cp_hashtable_remove 16 | attempts to remove the mapping for 17 | .I key 18 | from hashtable \fItable\fP. If 19 | .B COLLECTION_MODE_MULTIPLE_VALUES 20 | is set all mappings for this key are removed. If 21 | .B COLLECTION_MODE_DEEP 22 | is set the finalization functions set at table initialization are invoked upon 23 | the key and value being removed. 24 | .sp 25 | .B cp_hashtable_remove_deep 26 | is the same as 27 | .B cp_hashtable_remove 28 | with the 29 | .B COLLECTION_MODE_DEEP 30 | bit set. 31 | .sp 32 | .B cp_hashtable_remove_all 33 | removes all mappings from the table. 34 | .SH RETURN VALUE 35 | .B cp_hashtable_remove 36 | and 37 | .B cp_hashtable_remove_deep 38 | return a pointer to the last removed value - which may no longer be valid if 39 | the memory it points to is released by the finalization function, or 40 | .B NULL 41 | if no mapping was found for \fIkey\fP. 42 | .br 43 | .B cp_hashtable_remove_all 44 | returns 0 on success or non-zero on locking failure. 45 | .SH "SEE ALSO" 46 | .BR cp_hashtable_create (3), 47 | .BR cp_hashtable_set_mode (3) 48 | -------------------------------------------------------------------------------- /man3/cp_hashtable_remove_all.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_remove.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_remove_deep.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_remove.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_set_max_fill_factor.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_set_min_fill_factor.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_set_min_fill_factor.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashtable 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashtable" 2 | .SH NAME 3 | cp_hashtable_set_min_fill_factor, cp_hashtable_set_max_fill_factor \- set 4 | minimal/maximal fill factors for table resizing 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "int cp_hashtable_set_min_fill_factor(cp_hashtable *" table ", int " factor "); 9 | .br 10 | .BI "int cp_hashtable_set_max_fill_factor(cp_hashtable *" table ", int " factor "); 11 | .SH DESCRIPTION 12 | \fIfactor\fP is the fill factor in percent beyond which a table resize will be 13 | triggered upon entry removal (\fBcp_hashtable_set_min_fill_factor\fP) or 14 | insertion (\fBcp_hashtable_set_max_fill_factor\fP). The default values are 5 15 | and 70 respectively. 16 | .sp 17 | Resizing may be disabled completely by setting the 18 | .B COLLECTION_MODE_NORESIZE 19 | bit on a table's mode. 20 | .SH RETURN VALUE 21 | .B cp_hashtable_set_max_fill_factor 22 | and 23 | .B cp_hashtable_set_min_fill_factor 24 | return 0 on success or -1 if a locking error occurs. 25 | .SH SEE ALSO 26 | .BR cp_hashtable_set_min_size (3), 27 | .BR cp_hashtable_set_mode (3) 28 | -------------------------------------------------------------------------------- /man3/cp_hashtable_set_min_size.3: -------------------------------------------------------------------------------- 1 | .TH cp_hashtable 3 "OCTOBER 2005" libcprops.0.0.3 "libcprops - cp_hashtable" 2 | .SH NAME 3 | cp_hashtable_set_min_size \- set the minimal internal table size on a 4 | cp_hashtable 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "void cp_hashtable_set_min_size(cp_hashtable *" table ", int " min_size "); 10 | .SH DESCRIPTION 11 | .B cp_hashtable_set_min_size 12 | sets the minimal size of internal storage to \fImin_size\fP. On creation, this 13 | value is set to the size hint given to the constructor function. This is to 14 | prevent tables from resizing upon entry removal shortly after creation if the 15 | table contains few items. 16 | .SH SEE ALSO 17 | .BR cp_hashtable_create (3), 18 | .BR cp_hashtable_set_min_fill_factor (3) 19 | -------------------------------------------------------------------------------- /man3/cp_hashtable_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_set_mode.3 2 | -------------------------------------------------------------------------------- /man3/cp_hashtable_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_hashtable_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_heap_callback.3: -------------------------------------------------------------------------------- 1 | .TH cp_heap 3 "JULY 2006" libcprops.0.1.5 "libcprops - cp_heap" 2 | .SH NAME 3 | cp_heap_callback \- run a callback on all items in a heap 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "void cp_heap_callback(cp_heap *" heap ", cp_callback_fn " cb ", void *" prm "); 9 | 10 | .SH DESCRIPTION 11 | cp_heap_callback locks the heap unless the COLLECTION_MODE_NOSYNC bit is set, 12 | iterates over heap items and invokes the callback function \fIcb\fP. The 13 | callback function should follow this prototype: 14 | 15 | .RS 16 | .nf 17 | int cb(void *item, void *prm); 18 | .fi 19 | .RE 20 | 21 | The callback function is invoked on each heap item. The \fIprm\fP parameter is 22 | set to the value given in the call to cp_heap_callback. The callback iteration 23 | is stopped if the callback invocation returns non-zero. 24 | .sp 25 | 26 | -------------------------------------------------------------------------------- /man3/cp_heap_contract.3: -------------------------------------------------------------------------------- 1 | .TH cp_heap 3 "JULY 2006" libcprops.0.1.5 "libcprops - cp_heap" 2 | .SH NAME 3 | cp_heap_contract \- reduce allocated heap size to accomodate for the current 4 | number of items 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "int cp_heap_contract(cp_heap *" heap "); 10 | 11 | .SH DESCRIPTION 12 | cp_heap represents a heap data structure internally using a pointer array which 13 | is resized when it becomes full. After removing items, the internal array 14 | remains at the maximal size required during operation. To adapt the internal 15 | array size for the current heap usage, call cp_heap_contract. 16 | 17 | .SH RETURN VALUE 18 | cp_heap_contract returns 0 on success, non-zero if reallocation fails. 19 | -------------------------------------------------------------------------------- /man3/cp_heap_count.3: -------------------------------------------------------------------------------- 1 | .TH cp_heap 3 "JULY 2006" libcprops.0.1.5 "libcprops - cp_heap" 2 | .SH NAME 3 | cp_heap_count \- return the number of items stored in a heap 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "int cp_heap_count(cp_heap *" heap "); 9 | 10 | .SH DESCRIPTION 11 | cp_heap_count returns the number of items currently stored in a heap. 12 | -------------------------------------------------------------------------------- /man3/cp_heap_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_heap_create.3 -------------------------------------------------------------------------------- /man3/cp_heap_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_heap_create.3 -------------------------------------------------------------------------------- /man3/cp_heap_get_mode.3: -------------------------------------------------------------------------------- 1 | .TH cp_heap 3 "JULY 2006" libcprops.0.1.5 "libcprops - cp_heap" 2 | .SH NAME 3 | cp_heap_get_mode, cp_heap_set_mode, cp_heap_unset_mode \- retrieve or change 4 | heap mode settings 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "int cp_heap_get_mode(cp_heap *" heap "); 10 | .br 11 | .BI "void cp_heap_set_mode(cp_heap *" heap ", int " mode "); 12 | .br 13 | .BI "void cp_heap_unset_mode(cp_heap *" heap ", int " mode "); 14 | 15 | .SH DESCRIPTION 16 | The following mode bits affect heap function behavior: 17 | .sp 18 | .B COLLECTION_MODE_COPY 19 | - if the heap was initialized with a non-null copy function, this function is 20 | invoked by cp_heap_push (3) when inserting items in the heap. 21 | .br 22 | .B COLLECTION_MODE_DEEP 23 | - if the heap was initialized with a non-null item destructor function, this 24 | function is invoked by cp_heap_pop (3) when removing items and by 25 | cp_heap_destroy (3) when deallocating the heap. 26 | .br 27 | .B COLLECTION_MODE_NOSYNC 28 | - if set, heap operations do not perform locking. 29 | .sp 30 | cp_heap_set_mode may be used to set the specified \fImode\fP bits. 31 | .br 32 | cp_heap_unset_mode may be used to unset the specified \fImode\fP bits. 33 | 34 | .SH RETURN VALUE 35 | cp_heap_get_mode returns the current heap mode settings. 36 | 37 | .SH SEE ALSO 38 | .BR cp_heap_create (3), 39 | .BR cp_heap_push (3), 40 | .BR cp_heap_lock (3) 41 | -------------------------------------------------------------------------------- /man3/cp_heap_lock.3: -------------------------------------------------------------------------------- 1 | .TH cp_heap 3 "JULY 2006" libcprops.0.1.5 "libcprops - cp_heap" 2 | .SH NAME 3 | cp_heap_lock, cp_heap_unlock \- lock / unlock a heap for transaction like 4 | access 5 | 6 | .SH SYNOPSIS 7 | #include 8 | 9 | .BI "int cp_heap_lock(cp_heap *" heap ", int " type "); 10 | .br 11 | .BI "int cp_heap_unlock(cp_heap *" heap "); 12 | 13 | .SH DESCRIPTION 14 | Unless the mode bit COLLECTION_MODE_NOSYNC is set, heap operation are 15 | synchronized, i.e. prevent simultaneous access from multiple threads. 16 | cp_heap_lock is needed to perform a transaction-like operation consisting 17 | multiple heap operations that must complete before other threads are allowed 18 | access. cp_heap_lock locks the heap so that only the current thread can perform 19 | heap operations, and cp_heap_unlock releases the lock. 20 | 21 | .SH RETURN VALUE 22 | cp_heap_lock and cp_heap_unlock return 0 on success or non-zero on failure. 23 | 24 | .SH SEE ALSO 25 | -------------------------------------------------------------------------------- /man3/cp_heap_peek.3: -------------------------------------------------------------------------------- 1 | .TH cp_heap 3 "JULY 2006" libcprops.0.1.5 "libcprops - cp_heap" 2 | .SH NAME 3 | cp_heap_peek \- retrieve the item on the top of the heap 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "void *cp_heap_peek(cp_heap *" heap "); 9 | 10 | .SH DESCRIPTION 11 | cp_heap_peek returns the item at the top of the heap. 12 | 13 | .SH RETURN VALUE 14 | the minimum item or NULL if the heap is empty. 15 | -------------------------------------------------------------------------------- /man3/cp_heap_pop.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_heap_push.3 -------------------------------------------------------------------------------- /man3/cp_heap_push.3: -------------------------------------------------------------------------------- 1 | .TH cp_heap 3 "JULY 2006" libcprops.0.1.5 "libcprops - cp_heap" 2 | .SH NAME 3 | cp_heap_push, cp_heap_pop \- push / pop an item on / from a heap 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "void *cp_heap_push(cp_heap *" heap ", void *" item "); 9 | .br 10 | .BI "void *cp_heap_pop(cp_heap *" heap "); 11 | 12 | .SH DESCRIPTION 13 | cp_heap_push inserts the given \fIitem\fP to the \fIheap\fP. If 14 | COLLECTION_MODE_COPY is set and the heap was initialized with a non-null copy 15 | function, the copy of the item obtained by invoking the copy function is 16 | inserted rather than the item itself. 17 | .sp 18 | cp_heap_pop returns the minimum item from the heap as determined using the heap 19 | compare function set at initialization. If the COLLECTION_MODE_DEEP mode bit is 20 | set and the heap was initialized with a non-null item destructor function, the 21 | destructor function in called on the item being removed. 22 | 23 | .SH RETURN VALUE 24 | cp_heap_push returns the affected item on success or NULL on allocation failure. 25 | .sp 26 | cp_heap_pop returns the minimum item or NULL if the heap is empty. 27 | 28 | .SH SEE ALSO 29 | .BR cp_heap_create (3), 30 | .BR cp_heap_set_mode (3) 31 | -------------------------------------------------------------------------------- /man3/cp_heap_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_heap_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_heap_size.3: -------------------------------------------------------------------------------- 1 | .TH cp_heap 3 "JULY 2006" libcprops.0.1.5 "libcprops - cp_heap" 2 | .SH NAME 3 | cp_heap_size \- return the current heap capacity 4 | 5 | .SH SYNOPSIS 6 | #include 7 | 8 | .BI "int cp_heap_size(cp_heap *" heap "); 9 | 10 | .SH DESCRIPTION 11 | cp_heap_count returns the current heap capacity, which is approximately the 12 | number of items that may be stored in the heap before the heap is resized, 13 | including the current content. If this number is much higher than the number of 14 | items currently stored, cp_heap_contract (3) may be called to decrease the 15 | heap capacity. 16 | 17 | .SH SEE ALSO 18 | .BR cp_heap_count (3), 19 | .BR cp_heap_contract (3) 20 | -------------------------------------------------------------------------------- /man3/cp_heap_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_heap_lock.3 -------------------------------------------------------------------------------- /man3/cp_heap_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_heap_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_http_init.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_request.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "OCTOBER 2005" "libcprops" "cp_socket" 2 | .SH NAME 3 | cp_http_request \- http request descriptor 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "char *cp_http_request_get_header(cp_http_request *" req ", char *" name "); 8 | .sp 9 | .BI "char *cp_http_request_get_parameter(cp_http_request *" req ", char *" name "); 10 | .sp 11 | .BI "cp_http_session *" 12 | .ti +5n 13 | .BI "cp_http_request_get_session(cp_http_request *" request ", 14 | .ti +33n 15 | .BI "int " create "); 16 | .sp 17 | .BI "void cp_http_request_dump(cp_http_request *" req "); 18 | .SH DESCRIPTION 19 | When a cp_httpsocket receives a request for a certain service, the request 20 | headers and GET or POST variables issued by the remote client are parsed into a 21 | request descriptor that is passed to the service handler. 22 | .sp 23 | .B cp_http_request_get_header 24 | retrieves the value of an HTTP header from the request descriptor. 25 | .sp 26 | .B cp_http_request_get_parameter 27 | retrieves the value of a GET or POST CGI variable. 28 | .sp 29 | .B cp_http_request_get_session 30 | returns a cp_http_session object for the given request if one exists. If no 31 | active session exists and the 32 | .I create 33 | parameter is non-zero, a new session is created. See 34 | .BR cp_http_session (3) 35 | for details of session creation and initialization. 36 | .sp 37 | .B cp_http_request_dump 38 | dumps the request content to the standard output stream. 39 | .SH RETURN VALUE 40 | .B cp_http_request_get_header 41 | and 42 | .B cp_http_request_get_parameter 43 | return the value set for the 44 | .I name 45 | parameter or header or NULL if no value is set. 46 | .SH SEE ALSO 47 | .BR cp_httpsocket (3), 48 | .BR cp_http_response (3), 49 | .BR cp_http_service (3), 50 | .BR cp_http_session (3) 51 | 52 | -------------------------------------------------------------------------------- /man3/cp_http_request_dump.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_request.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_request_get_header.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_request.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_request_get_parameter.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_request.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_request_get_session.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_request.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_response_set_body.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_response.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_response_set_connection_policy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_response.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_response_set_content.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_response.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_response_set_content_type.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_response.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_response_set_content_type_string.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_response.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_response_set_cookie.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_response.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_response_set_header.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_response.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_response_set_status.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_response.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_service.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "OCTOBER 2005" "libcprops" "cp_socket" 2 | .SH NAME 3 | cp_http_service \- http service descriptor 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_http_service * 8 | .ti +5n 9 | .BR "cp_http_service_create(char *" name ", char *" path ", 10 | .ti +28n 11 | .BI "cp_http_service_callback " service "); 12 | .sp 13 | .BI "void cp_http_service_delete(cp_http_service *" service "); 14 | .sp 15 | .SH DESCRIPTION 16 | With the libcprops http server socket api, defining services is done by 17 | wrapping handler functions for specific uri prefixes in a 18 | .B cp_http_service 19 | struct and registered with a cp_httpsocket. The service function should follow 20 | this prototype: 21 | 22 | .RS 23 | .nf 24 | int service(cp_http_request *request, cp_http_response *response); 25 | .fi 26 | .RE 27 | 28 | and return one of the integer values 29 | .B HTTP_CONNECTION_POLICY_CLOSE 30 | or 31 | .B HTTP_CONNECTION_POLICY_KEEP_ALIVE 32 | as required per request. For each request the service function registered to 33 | handle the request uri prefix is invoked with a 34 | .I request 35 | wrapper describing the request and an empty 36 | .I response 37 | wrapper which will be written to the remote client when the service handler 38 | returns. 39 | .sp 40 | .B cp_http_service_create 41 | creates a service with the name \fIname\fP, uri prefix 42 | .I path 43 | and service handler \fIservice\fP. 44 | .B cp_http_service_delete 45 | finalizes a service descriptor struct. 46 | .sp 47 | .B cp_httpsocket_register_service 48 | associates a service with a cp_httpsocket. Services may be associated with 49 | multiple socket instances. 50 | .SH SEE ALSO 51 | .BR cp_httpsocket (3), 52 | .BR cp_http_request (3), 53 | .BR cp_http_response (3) 54 | 55 | -------------------------------------------------------------------------------- /man3/cp_http_service_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_service.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_service_delete.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_service.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_session_get.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_session.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_session_is_fresh.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_session.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_session_set.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_session.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_session_set_dtr.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_session.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_session_set_validity.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_http_session.3 2 | -------------------------------------------------------------------------------- /man3/cp_http_shutdown.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_allow_redirects.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_create_proxy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_create_proxy_ssl.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_create_ssl.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_ctl_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_ctl.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_ctl_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_ctl.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_ctl_get_pollfds.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_ctl.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_ctl_get_read_fd_set.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_ctl.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_ctl_get_write_fd_set.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_ctl.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_drop_headers.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_drop_parameters.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_fetch_ctl.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_fetch.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_fetch_ctl_exec.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_fetch.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_fetch_nb.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_fetch.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_fetch_nb_exec.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_fetch.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_init.3: -------------------------------------------------------------------------------- 1 | .TH "cp_socket" 3 "MAY 2006" "libcprops" "cp_httpclient" 2 | .SH NAME 3 | cp_httpclient_init, cp_httpclient_shutdown \- initialize / finalize http client api 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "int cp_httpclient_init(); 8 | .br 9 | .BI "int cp_httpclient_shutdown(); 10 | .SH DESCRIPTION 11 | .B cp_httpclient_init 12 | initializes the services provided by the cp_httpclient api and must be called 13 | before processing any HTTP requests. 14 | .br 15 | .B cp_httpclient_shutdown 16 | stops any background threads started to service HTTP requests and performs 17 | cleanup. 18 | .SH RETURN VALUE 19 | .B cp_httpclient_init 20 | returns 0 on success, -1 on error or 1 if already initialized. Initialization 21 | may fail if memory for the internal structures cannot be allocated. 22 | .br 23 | .B cp_httpclient_shutdown 24 | returns 0 on success or 1 if already initialized. 25 | -------------------------------------------------------------------------------- /man3/cp_httpclient_reopen.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_auto_drop_headers.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_auto_drop_parameters.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_cookie_jar.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_http_version.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_max_redirects.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_paremeter.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_request_type.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_retry.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_timeout.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_set_user_agent.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_set_header.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpclient_shutdown.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpclient_init.3 -------------------------------------------------------------------------------- /man3/cp_httpsocket_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpsocket_create_ssl.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpsocket_delete.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpsocket_listen.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpsocket_register_service.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpsocket_stop_all.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_httpsocket_unregister_service.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_httpsocket.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_append.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_callback.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_create_iterator.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_create_list.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_create_nosync.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_destroy_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_get_head.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_get_tail.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_insert.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_insert_after.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_insert_before.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_is_empty.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_item_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_append.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_curr.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_head.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_init.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_init_tail.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_insert.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_next.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_prev.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_release.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_remove.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_iterator_tail.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list_iterator.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_lock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_remove.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_remove_head.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_remove_tail.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_search.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_list_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_mempool.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_mempool \- a memory pool implementation 4 | 5 | .SH DESCRIPTION 6 | cp_mempool is a memory pool for fixed allocation sizes. 7 | .sp 8 | .BR cp_shared_mempool (3) 9 | is a shareable memory pool implementation based on cp_mempool. Both cp_mempool 10 | and cp_shared_mempool represent a trade off of memory for speed and should not 11 | be used if memory is tight or if the total allocation may exceed the amount of 12 | physical memory available to the program, so as to prevent swapping. Note that 13 | even if using the provided cp_mempool_free or cp_shared_mempool_free 14 | functions, the memory returned to the pool is kept for future requests and is 15 | ultimately released back to the general "malloc" library only when the memory 16 | pool is destroyed. 17 | 18 | .SH INTERFACE 19 | the following is a summary of functions provided by \fI\fP. 20 | .sp 21 | .BI "cp_mempool *cp_mempool_create_by_option(const int " mode ", 22 | .ti +40 23 | .BI "const size_t " chunksize ", 24 | .ti +40 25 | .BI "size_t " multiple "); 26 | .br 27 | .BI "cp_mempool *cp_mempool_create(const size_t " chunksize "); 28 | .br 29 | .BI "int cp_mempool_inc_refcount(cp_mempool *" pool "); 30 | .br 31 | .BI "void *cp_mempool_alloc(cp_mempool * const " pool "); 32 | .br 33 | .BI "void *cp_mempool_calloc(cp_mempool * const " pool "); 34 | .br 35 | .BI "int cp_mempool_free(cp_mempool * const " pool ", void *" data "); 36 | .br 37 | .BI "void cp_mempool_destroy(cp_mempool *" pool "); 38 | 39 | .SH AUTHOR 40 | cp_mempool was contributed to libcprops by Kyle Wheeler. 41 | 42 | .SH SEE ALSO 43 | .BR cp_mempool_create (3), 44 | .BR cp_mempool_alloc (3), 45 | .BR cp_mempool_free (3), 46 | .BR cp_mempool_destroy (3), 47 | .BR cp_shared_mempool (3) 48 | -------------------------------------------------------------------------------- /man3/cp_mempool_alloc.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_mempool_alloc, cp_mempool_calloc \- obtain memory block from a memory pool 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "void *cp_mempool_alloc(cp_mempool * const " pool "); 9 | .br 10 | .BI "void *cp_mempool_calloc(cp_mempool * const " pool "); 11 | 12 | .SH DESCRIPTION 13 | .B cp_mempool_alloc 14 | returns an uninitialized memory block of the size defined at pool creation time 15 | from the memory pool. 16 | .sp 17 | .B cp_mempool_calloc 18 | returns a memory block of the size defined at pool creation time, initialized 19 | to contain zeros. 20 | 21 | .SH RETURN VALUE 22 | a pointer to a memory block of the requested size or NULL if no more memory is 23 | available. 24 | .B cp_mempool 25 | will expand automatically if the internal allocation is exhausted, but may fail if the internal expansion operation fails. 26 | 27 | .SH SEE ALSO 28 | .BR cp_mempool_create (3), 29 | .BR cp_mempool_free (3), 30 | .BR cp_mempool_destroy (3), 31 | .BR cp_shared_mempool (3) 32 | -------------------------------------------------------------------------------- /man3/cp_mempool_calloc.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_mempool_alloc.3 -------------------------------------------------------------------------------- /man3/cp_mempool_create.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_mempool_create, cp_mempool_create_by_option \- create a memory pool 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "cp_mempool *cp_mempool_create(const size_t " chunksize "); 9 | .br 10 | .BI "cp_mempool *cp_mempool_create_by_option(const int " mode ", 11 | .ti +40 12 | .BI "const size_t " chunksize ", 13 | .ti +40 14 | .BI "size_t " multiple "); 15 | 16 | .SH DESCRIPTION 17 | .B cp_mempool_create 18 | instiantiates a memory pool serving 19 | .I chunksize 20 | byte items. Internally the memory pool allocates several pages at a time, and 21 | serves pointers to 22 | .I chunksize 23 | memory areas inside these blocks. 24 | .sp 25 | .B cp_mempool_create_by_option 26 | allows setting mode bit flags and the number of 27 | .I chunksize 28 | items to fit in an internal allocation block. 29 | .sp 30 | When creating a pool with 31 | .BR cp_mempool_create, 32 | allocation and deallocation operations, i.e. 33 | .BR cp_mempool_alloc (3) 34 | and 35 | .BR cp_mempool_free (3), 36 | are not synchronized by default. If you choose to share a memory pool between 37 | different threads, unset the 38 | .B COLLECTION_MODE_NOSYNC 39 | mode bit or create the pool using 40 | .BR cp_mempool_create_by_mode. 41 | 42 | .SH RETURN VALUE 43 | a pointer to a newly allocated 44 | .B cp_mempool 45 | object or NULL on failure. 46 | 47 | .SH SEE ALSO 48 | .BR cp_mempool_inc_refcount (3), 49 | .BR cp_mempool_alloc (3), 50 | .BR cp_mempool_free (3), 51 | .BR cp_mempool_destroy (3), 52 | .BR cp_shared_mempool (3) 53 | -------------------------------------------------------------------------------- /man3/cp_mempool_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_mempool_create.3 -------------------------------------------------------------------------------- /man3/cp_mempool_destroy.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_mempool_destroy \- deallocate a memory pool 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "void cp_mempool_destroy(cp_mempool *" pool "); 9 | 10 | .SH DESCRIPTION 11 | .B cp_mempool_destroy 12 | decreases the reference count on a memory pool created with 13 | .BR cp_mempool_create(3) 14 | or 15 | .BR cp_mempool_create_by_option (3). 16 | When the reference count reaches zero, the pool and all memory associated with 17 | it are deallocated. 18 | 19 | .SH SEE ALSO 20 | .BR cp_mempool_create (3), 21 | .BR cp_mempool_alloc (3), 22 | .BR cp_mempool_free (3), 23 | .BR cp_shared_mempool (3) 24 | -------------------------------------------------------------------------------- /man3/cp_mempool_free.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_mempool_free \- return memory block to a memory pool 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "int cp_mempool_free(cp_mempool * const " pool ", void *" data "); 9 | 10 | .SH DESCRIPTION 11 | .B cp_mempool_free 12 | returns a memory chunk obtained from 13 | .B cp_mempool_alloc 14 | or 15 | .B cp_mempool_calloc 16 | to the memory pool for reuse. Note that this does not actually release the 17 | memory block to the operating system. Memory allocated by cp_mempool is only 18 | returned to the operating system on pool destruction. 19 | 20 | .SH RETURN VALUE 21 | zero on success or non-zero on locking failure if 22 | .B COLLECTION_MODE_NOSYNC 23 | is not set. 24 | 25 | .SH SEE ALSO 26 | .BR cp_mempool_create (3), 27 | .BR cp_mempool_alloc (3), 28 | .BR cp_mempool_destroy (3), 29 | .BR cp_shared_mempool (3) 30 | -------------------------------------------------------------------------------- /man3/cp_mempool_inc_refcount.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_mempool_inc_refcount \- increase the reference count on a memory pool 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "int cp_mempool_inc_refcount(cp_mempool *" pool "); 9 | 10 | .SH DESCRIPTION 11 | .B cp_mempool_inc_refcount 12 | increases the reference count on a memory pool. This is used internally by 13 | .BR cp_shared_mempool (3) 14 | to coordinate the sharing of a memory pool between otherwise uncoordinated 15 | clients. 16 | 17 | .SH RETURN VALUE 18 | zero on success or non-zero on locking failure if 19 | .B COLLECTION_MODE_NOSYNC 20 | is not set. 21 | 22 | .SH SEE ALSO 23 | .BR cp_mempool_create (3), 24 | .BR cp_mempool_alloc (3), 25 | .BR cp_mempool_free (3), 26 | .BR cp_mempool_destroy (3), 27 | .BR cp_shared_mempool (3) 28 | -------------------------------------------------------------------------------- /man3/cp_multimap_callback_by_index.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_callback.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_callback_postorder.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_callback.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_callback_preorder.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_callback.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_contains.3: -------------------------------------------------------------------------------- 1 | .TH cp_multimap 3 "OCT 2007" libcprops.0.1.7 "libcprops - cp_multimap" 2 | .SH NAME 3 | cp_multimap_contains \- check whether an entry exists on any index 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "int cp_multimap_contains(cp_multimap *" tree ", void *" entry "); 9 | 10 | .SH DESCRIPTION 11 | .B cp_multimap_contains 12 | returns non-zero if the given entry could be found using any of the indices defined on the given \fItree\fP. 13 | .br 14 | .SH SEE ALSO 15 | .BR cp_multimap_create_index (3), 16 | .BR cp_multimap_get (3) 17 | -------------------------------------------------------------------------------- /man3/cp_multimap_count.3: -------------------------------------------------------------------------------- 1 | .TH cp_multimap 3 "OCT 2007" libcprops.0.1.7 "libcprops - cp_multimap" 2 | .SH NAME 3 | cp_multimap_count, cp_multimap_size \- return the number of items in a multimap 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "int cp_multimap_count(cp_multimap *" tree "); 9 | 10 | .SH DESCRIPTION 11 | .B cp_multimap_count 12 | returns the number of items in a multi-map. 13 | .B cp_multimap_size 14 | is a synonym for \fBcp_multimap_count\fP. 15 | -------------------------------------------------------------------------------- /man3/cp_multimap_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_create_index.3: -------------------------------------------------------------------------------- 1 | .TH cp_multimap 3 "OCT 2007" libcprops.0.1.7 "libcprops - cp_multimap" 2 | .SH NAME 3 | cp_multimap_create_index \- add an index on a multimap 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "cp_index *cp_multimap_create_index(cp_multimap *" map ", 9 | .ti +35n 10 | .BI "cp_index_type " type ", 11 | .ti +35n 12 | .BI "cp_key_fn " key ", 13 | .ti +35n 14 | .BI "cp_compare_fn " cmp ", 15 | .ti +35n 16 | .BI "int *" err "); 17 | .br 18 | 19 | .SH DESCRIPTION 20 | .B cp_multimap_create_index 21 | creates an index on an existing multimap. 22 | .sp 23 | .I type 24 | may be one of 25 | .B CP_UNIQUE 26 | or \fBCP_MULTIPLE\fP. 27 | 28 | .SH RETURN VALUE 29 | .B cp_multimap_create_index 30 | returns the newly created index or NULL on error. If the 31 | .I err 32 | parameter is not NULL, the integer it points to is set to 33 | .B CP_MEMORY_ALLOCATION_FAILURE 34 | on allocation failure, or 35 | .B CP_EXISTS 36 | if an index with the same key and comparison functions already exists. 37 | 38 | -------------------------------------------------------------------------------- /man3/cp_multimap_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_find.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_get.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_find_by_index.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_get.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_get_by_index.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_get.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_get_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_set_mode.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_lock.3: -------------------------------------------------------------------------------- 1 | .TH cp_multimap 3 "OCT 2007" libcprops.0.1.7 "libcprops - cp_multimap" 2 | .SH NAME 3 | cp_multimap_lock, cp_multimap_rdlock, cp_multimap_wrlock, cp_multimap_unlock \- multimap locking functions 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "int cp_multimap_lock(cp_multimap *" tree ", int " type "); 9 | .br 10 | .BI "int cp_multimap_rdlock(cp_multimap *" tree "); 11 | .br 12 | .BI "int cp_multimap_wrlock(cp_multimap *" tree "); 13 | .br 14 | .BI "int cp_multimap_unlock(cp_multimap *" tree "); 15 | .sp 16 | .SH DESCRIPTION 17 | .B cp_multimap_lock 18 | and 19 | .B cp_multimap_unlock 20 | provide locking for maps not initialized with the 21 | .I COLLECTION_MODE_NOSYNC 22 | mode bit set. 23 | .B cp_multimap_rdlock 24 | and 25 | .B cp_multimap_wrlock 26 | are aliases for 27 | .B cp_multimap_lock 28 | with a 29 | .I type 30 | parameter of 31 | .B COLLECTION_LOCK_READ 32 | and 33 | .B COLLECTION_LOCK_WRITE 34 | respectively. 35 | .sp 36 | .SH RETURN VALUE 37 | locking functions return 0 on success, non-zero on error. 38 | -------------------------------------------------------------------------------- /man3/cp_multimap_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_reindex.3: -------------------------------------------------------------------------------- 1 | .TH cp_multimap 3 "OCT 2007" libcprops.0.1.7 "libcprops - cp_multimap" 2 | .SH NAME 3 | cp_multimap_reindex \- reposition an entry in a multimap after changing key field values 4 | .sp 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "int cp_multimap_reindex(cp_multimap *" map ", void *" before ", void *" after "); 9 | .sp 10 | .SH DESCRIPTION 11 | .B cp_multimap_reindex 12 | must be called to correctly reposition an entry when changing fields that 13 | affect entry placement with reference to map indices. This requires creating a 14 | new entry with the modified value. Reindexing removes the old entry from the 15 | map and inserts the new entry instead. 16 | .sp 17 | .SH RETURN VALUE 18 | .B cp_multimap_reindex 19 | return zero on success or non-zero on error. Possible error codes are 20 | .B CP_LOCK_FAILED 21 | on locking failure or 22 | .B CP_UNIQUE_INDEX_VIOLATION 23 | if the modified value can not be reconciled with existing index constraints. 24 | .SH SEE ALSO 25 | .BR cp_multimap_insert (3), 26 | .BR cp_multimap_contains (3), 27 | .BR cp_multimap_remove (3) 28 | -------------------------------------------------------------------------------- /man3/cp_multimap_remove.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_insert.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_remove_by_index.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_insert.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_set_mode.3: -------------------------------------------------------------------------------- 1 | .TH cp_multimap 3 "OCT 2007" libcprops.0.1.7 "libcprops - cp_multimap" 2 | .SH NAME 3 | cp_multimap_set_mode, cp_multimap_unset_mode, cp_multimap_get_mode \- manage multimap mode setting 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "int cp_multimap_get_mode(cp_multimap *" tree "); 9 | .br 10 | .BI "int cp_multimap_set_mode(cp_multimap *" tree ", int " mode "); 11 | .br 12 | .BI "int cp_multimap_unset_mode(cp_multimap *" tree ", int " mode "); 13 | .sp 14 | .SH DESCRIPTION 15 | .B cp_multimap_get_mode 16 | returns the current map mode. 17 | .sp 18 | .B cp_multimap_set_mode 19 | and 20 | .B cp_multimap_unset_mode 21 | set or unset the requested mode bits respectively. Note that 22 | .B CP_COLLECTION_MODE_MULTIPLE_VALUES 23 | determines whether the default index for the given mapping is unique and may 24 | only be set at creation time. 25 | .sp 26 | .SH RETURN VALUE 27 | All functions return zero on success. 28 | .B cp_multimap_set_mode 29 | returns 30 | .B EINVAL 31 | if attempting to set 32 | .B COLLECTION_MODE_MULTIPLE_VALUES 33 | or attempting to set 34 | .B COLLECTION_MODE_NOSYNC 35 | during a transaction. 36 | .br 37 | .B cp_multimap_unset_mode 38 | returns 39 | .B EINVAL 40 | if attempting to unset \fBCOLLECTION_MODE_MULTIPLE_VALUES\fP. 41 | -------------------------------------------------------------------------------- /man3/cp_multimap_share_mempool.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_use_mempool.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_size.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_count.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_set_mode.3 2 | -------------------------------------------------------------------------------- /man3/cp_multimap_use_mempool.3: -------------------------------------------------------------------------------- 1 | .TH cp_multimap 3 "OCT 2007" libcprops.0.1.7 "libcprops - cp_multimap" 2 | .SH NAME 3 | cp_multimap_use_mempool, cp_multimap_share_mempool \- use a memory pool for internal multimap allocations 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "int cp_multimap_use_mempool(cp_multimap *" tree ", cp_mempool *" pool "); 9 | .br 10 | .BI "int cp_multimap_share_mempool(cp_multimap *" tree ", 11 | .ti +30n 12 | .BI "cp_shared_mempool *" pool "); 13 | .sp 14 | .SH DESCRIPTION 15 | .B cp_multimap_use_mempool 16 | sets the map to use given mempool or allocate a new one if pool is NULL. 17 | .sp 18 | .B cp_multimap_share_mempool 19 | sets the map to use a shared memory pool. 20 | .sp 21 | .SH RETURN VALUE 22 | .B cp_multimap_use_mempool 23 | and 24 | .B cp_multimap_share_mempool 25 | return zero on success or non-zero on failure. Faliures may be due to locking 26 | errors, memory allocation failure, or if the map is not empty when attempting 27 | to assign a mempool. 28 | -------------------------------------------------------------------------------- /man3/cp_multimap_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_multimap_lock.3 2 | -------------------------------------------------------------------------------- /man3/cp_mysql_data_source.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_mysql.3 -------------------------------------------------------------------------------- /man3/cp_narytree_callback.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_narytree_contains.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_narytree_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_narytree_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_create.3 -------------------------------------------------------------------------------- /man3/cp_narytree_delete.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_narytree_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_create.3 -------------------------------------------------------------------------------- /man3/cp_narytree_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_create.3 -------------------------------------------------------------------------------- /man3/cp_narytree_get.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_narytree_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_lock.3 -------------------------------------------------------------------------------- /man3/cp_narytree_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_narytree_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_lock.3 -------------------------------------------------------------------------------- /man3/cp_narytree_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_narytree_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_narytree_lock.3 -------------------------------------------------------------------------------- /man3/cp_pooled_thread_client_interface_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_client_interface.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_client_interface_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_client_interface.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_client_interface_get.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_client_interface.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_client_interface_get_nb.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_client_interface.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_client_interface_get_stoppable.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_client_interface.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_client_interface_get_stoppable_nb.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_client_interface.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_client_negociate.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_client_interface.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_scheduler_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_scheduler.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_scheduler_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_scheduler.3 2 | -------------------------------------------------------------------------------- /man3/cp_pooled_thread_scheduler_register_client.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_pooled_thread_scheduler.3 2 | -------------------------------------------------------------------------------- /man3/cp_postgres_data_source.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_db_postgres.3 -------------------------------------------------------------------------------- /man3/cp_priority_list_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_destroy_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_get_next.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_get_next_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_insert.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_insert_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_is_empty.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_item_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_lock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_priority_list_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_priority_list.3 2 | -------------------------------------------------------------------------------- /man3/cp_rbtree_callback.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_insert.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_callback_postorder.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_insert.3 2 | -------------------------------------------------------------------------------- /man3/cp_rbtree_callback_preorder.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_insert.3 2 | -------------------------------------------------------------------------------- /man3/cp_rbtree_contains.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_insert.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_insert.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_create.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_delete.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_insert.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_create.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_create.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_get.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_insert.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_lock.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_lock.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_rbtree_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rbtree_lock.3 -------------------------------------------------------------------------------- /man3/cp_result_set_autodispose.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_field_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_get_field_type.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_get_field_types.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_get_header.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_get_headers.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_is_binary.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_next.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_release_row.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_result_set_row_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_result_set.3 -------------------------------------------------------------------------------- /man3/cp_rtrie_add.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_create_trie.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_exact_match.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_fetch_matches.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_get_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_lock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_prefix_match.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_remove.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_rtrie_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_rtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_shared_mempool_alloc.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_shared_mempool_alloc, cp_shared_mempool_calloc \- obtain memory block from 4 | a shareable memory pool 5 | 6 | .SH SYNOPSIS 7 | #include 8 | .sp 9 | .BI "void *cp_shared_mempool_alloc(cp_shared_mempool *" pool ", size_t " size "); 10 | .br 11 | .BI "void *cp_shared_mempool_calloc(cp_shared_mempool *" pool ", size_t " size "); 12 | 13 | .SH DESCRIPTION 14 | .B cp_shared_mempool_alloc 15 | attempts to obtain a memory block of at least 16 | .I size 17 | bytes from the shared memory pool \fIpool\fP. 18 | .B cp_shared_mempool_calloc 19 | is the same, but also sets the content of the returned memory block to zeros. 20 | .sp 21 | For best results, use cp_shared_mempool to allocate fixed size blocks and 22 | register these sizes with the pool with 23 | .BR cp_shared_mempool_register (3) 24 | in advance. cp_shared_mempool may also be used for arbitrary sized allocations, 25 | but this entails a larger allocation overhead and may be slower than native 26 | malloc/ free on some platforms. 27 | 28 | .SH RETURN VALUE 29 | A memory block of at least 30 | .I size 31 | bytes on success or NULL on failure. 32 | .SH SEE ALSO 33 | .BR cp_shared_mempool_register (3), 34 | .BR cp_shared_mempool_free (3), 35 | .BR cp_mempool (3) 36 | -------------------------------------------------------------------------------- /man3/cp_shared_mempool_calloc.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_shared_mempool_alloc.3 -------------------------------------------------------------------------------- /man3/cp_shared_mempool_create.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_shared_mempool_create, cp_shared_mempool_create_by_option \- create a 4 | shareable memory pool instance 5 | 6 | .SH SYNOPSIS 7 | #include 8 | .sp 9 | .BI "cp_shared_mempool *cp_shared_mempool_create(); 10 | .br 11 | .BI "cp_shared_mempool * 12 | .ti +5n 13 | .BI "cp_shared_mempool_create_by_option(int " mode ", 14 | .ti +40n 15 | .BI "int " size_hint ", 16 | .ti +40n 17 | .BI "int " page_count "); 18 | 19 | .SH DESCRIPTION 20 | .B cp_shared_mempool_create 21 | instantiates a non-synchronized shared memory pool object. 22 | .B cp_shared_mempool_create_by_option 23 | allows specifying a mode flag, a size hint for the number of pools to use 24 | internally, and the number of pages to allocate at a time in the internal 25 | pools. 26 | 27 | .SH RETURN VALUE 28 | a newly allocated cp_shared_mempool object on success, or NULL on failure. 29 | 30 | .SH SEE ALSO 31 | .BR cp_shared_mempool_destroy (3), 32 | .BR cp_shared_mempool_register (3), 33 | .BR cp_shared_mempool_alloc (3), 34 | .BR cp_shared_mempool_free (3), 35 | .BR cp_mempool (3) 36 | -------------------------------------------------------------------------------- /man3/cp_shared_mempool_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_shared_mempool_create.3 -------------------------------------------------------------------------------- /man3/cp_shared_mempool_destroy.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_shared_mempool_destroy \- deallocate a shareable memory pool 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "void cp_shared_mempool_destroy(cp_shared_mempool *" pool "); 9 | 10 | .SH DESCRIPTION 11 | .B cp_shared_mempool_destroy 12 | deallocates a shared memory pool created with 13 | .BR cp_shared_mempool_create (3) 14 | or 15 | .BR cp_shared_mempool_create_by_option (3), 16 | its internal memory pools and all associated memory. 17 | 18 | .SH SEE ALSO 19 | .BR cp_shared_mempool_create (3), 20 | .BR cp_mempool (3) 21 | -------------------------------------------------------------------------------- /man3/cp_shared_mempool_free.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_shared_mempool_free \- return memory block to a shared memory pool 4 | 5 | .SH SYNOPSIS 6 | #include 7 | .sp 8 | .BI "void cp_shared_mempool_free(cp_shared_mempool *" pool ", void *" p "); 9 | 10 | .SH DESCRIPTION 11 | .B cp_shared_mempool_free 12 | returns a memory chunk obtained from 13 | .BR cp_shared_mempool_alloc (3) 14 | or 15 | .BR cp_mempool_calloc (3) 16 | to the memory pool for reuse. Note that this does not actually release the 17 | memory block to the operating system. Memory allocated by cp_shared_mempool is 18 | only returned to the operating system on pool destruction. 19 | 20 | .SH RETURN VALUE 21 | zero on success or non-zero on locking failure if COLLECTION_MODE_NOSYNC is 22 | not set. 23 | 24 | .SH SEE ALSO 25 | .BR cp_shared_mempool_alloc (3), 26 | .BR cp_mempool (3) 27 | -------------------------------------------------------------------------------- /man3/cp_shared_mempool_register.3: -------------------------------------------------------------------------------- 1 | .TH cp_mempool 3 "SEPTEMBER 2006" libcprops.0.1.6 "libcprops - cp_mempool" 2 | .SH NAME 3 | cp_shared_mempool_register \- register an allocation size with a shared memory 4 | pool 5 | 6 | .SH SYNOPSIS 7 | #include 8 | .sp 9 | .BI "cp_mempool *cp_shared_mempool_register(cp_shared_mempool *" pool ", 10 | .ti +39n 11 | .BI "size_t " size "); 12 | 13 | .SH DESCRIPTION 14 | .B cp_shared_mempool_register 15 | registers the block size 16 | .I size 17 | with the pool \fIpool\fP. Although not strictly necessary, this will usually 18 | result in better performance both in terms of speed and allocation overhead 19 | than when using cp_shared_mempool for aribitrary (i.e. unregistered) size 20 | allocations. 21 | 22 | .SH RETURN VALUE 23 | the 24 | 25 | .SH SEE ALSO 26 | .BR cp_shared_mempool_create (3), 27 | .BR cp_shared_mempool_destroy (3), 28 | .BR cp_shared_mempool_register (3), 29 | .BR cp_shared_mempool_alloc (3), 30 | .BR cp_shared_mempool_free (3), 31 | .BR cp_mempool (3) 32 | -------------------------------------------------------------------------------- /man3/cp_socket_connection_close.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_create_ssl.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_delete.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_init.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_listen.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_select.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_set_backlog.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_set_delay.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_set_delay_sec.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_set_delay_usec.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_set_owner.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_set_poolsize_max.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_set_poolsize_min.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_shutdown.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_socket_stop_all.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_socket.3 2 | -------------------------------------------------------------------------------- /man3/cp_sorted_hash_callback.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_insert.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_contains.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_insert.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_insert.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_create_by_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_create.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_delete.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_insert.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_create.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_create.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_get.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_insert.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_lock.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_lock.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_sorted_hash_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_sorted_hash_lock.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_callback.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_contains.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_count.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_splaytree_delete.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_create.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_create.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_get.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_insert.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_lock.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_lock.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_get_mode.3 -------------------------------------------------------------------------------- /man3/cp_splaytree_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_splaytree_lock.3 -------------------------------------------------------------------------------- /man3/cp_string.3: -------------------------------------------------------------------------------- 1 | .TH cp_string 3 "MARCH 2006" libcprops.0.0.11 "libcprops - cp_string" 2 | .SH NAME 3 | cp_string \- a string wrapper 4 | .SH INTERFACE 5 | the following is a summary of functions provided by \fI\fP. 6 | 7 | .BI "cp_string *cp_string_create(char *" data ", int " len "); 8 | .br 9 | .BI "void cp_string_delete(cp_string *" str "); 10 | .br 11 | .BI "void cp_string_reset(cp_string *" str "); 12 | .br 13 | .BI "cp_string *cp_string_cstrcpy(cp_string *" str ", char *" cstr "); 14 | .br 15 | .BI "cp_string *cp_string_cpy(cp_string *" dst ", cp_string *" src "); 16 | .br 17 | .BI "cp_string *cp_string_dup(cp_string *" src "); 18 | .br 19 | .BI "cp_string *cp_string_cstrdup(char *" src "); 20 | .br 21 | .BI "cp_string *cp_string_cat(cp_string *" str ", cp_string *" appendum "); 22 | .br 23 | .BI "cp_string *cp_string_cat_bin(cp_string *" str ", void *" bin ", int " len "); 24 | .br 25 | .BI "cp_string *cp_string_cstrcat(cp_string *" str ", char *" cstr "); 26 | .br 27 | .BI "int cp_string_cmp(cp_string *" s1 ", cp_string *" s2 "); 28 | .br 29 | .BI "int cp_string_len(cp_string *" str "); 30 | .br 31 | .BI "char *cp_string_tocstr(cp_string *" str "); 32 | .br 33 | .BI "cp_string *cp_string_read(int " fd ", int " len "); 34 | .br 35 | .BI "int cp_string_write(cp_string *" str ", int " fd "); 36 | .br 37 | .BI "void cp_string_dump(cp_string *" str "); 38 | .br 39 | .BI "void cp_string_flip(cp_string *" str ")"; 40 | .SH DESCRIPTION 41 | .B cp_string 42 | is a generalized string implementation. The string length is managed by the 43 | wrapper thereby making string length lookup trivial and more importantly, 44 | allowing null bytes and therefor binary data. 45 | .sp 46 | For more detailed descriptions see the man pages for the individual functions. 47 | -------------------------------------------------------------------------------- /man3/cp_string_cat.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_cat \- concatenate cp_strings 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_cat(cp_string *" str ", cp_string *" appendum "); 8 | .SH DESCRIPTION 9 | .B cp_string_cat 10 | copies the string represented by 11 | .I src 12 | to the end of \fIdst\fP. If necessary the internal buffer of the destination 13 | string is reallocated to accomodate for the source string. 14 | 15 | .SH RETURN VALUE 16 | the 17 | .I dst 18 | parameter on success or 19 | .B NULL 20 | on failure. 21 | .SH SEE ALSO 22 | .BR cp_string_cstrcat (3), 23 | .BR cp_string_cat_bin (3) 24 | -------------------------------------------------------------------------------- /man3/cp_string_cat_bin.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_cat_bin \- concatenate a buffer to a cp_string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_cat(cp_string *" str ", void *" bin ", int " len "); 8 | .SH DESCRIPTION 9 | .B cp_string_cat 10 | copies 11 | .I len 12 | bytes from 13 | .I bin 14 | to the end of 15 | \fIdst\fP. 16 | .SH RETURN VALUE 17 | the 18 | .I dst 19 | parameter on success or 20 | .B NULL 21 | on failure. 22 | .SH SEE ALSO 23 | .BR cp_string_cat (3), 24 | .BR cp_string_cstrcat (3) 25 | -------------------------------------------------------------------------------- /man3/cp_string_cmp.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_cmp \- string comparison function 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "int cp_string_cmp(cp_string *" s1 ", cp_string *" s2 "); 8 | .SH DESCRIPTION 9 | .B cp_string_cmp 10 | compares the internal buffers of 11 | .I s1 12 | and \fIs2\fP and returns less than, equal to, or greater than zero if 13 | .I s1 14 | is less than, matches, or is greater than 15 | .I s2 16 | respectively. 17 | 18 | .SH RETURN VALUE 19 | 0 if the strings are identical 20 | .br 21 | < 0 if 22 | .I s1 23 | is less than 24 | .I s2 25 | .br 26 | > 0 if 27 | .I s1 28 | is greater than \fIs2\fP. 29 | -------------------------------------------------------------------------------- /man3/cp_string_cpy.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_cpy \- copy a cp_string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_cpy(cp_string *" dst ", cp_string *" src "); 8 | .SH DESCRIPTION 9 | .B cp_string_cpy 10 | copies the string represented by 11 | .I src 12 | onto \fIdst\fP. If necessary the internal buffer of the destination string is 13 | reallocated to accomodate for the source string. 14 | 15 | .SH RETURN VALUE 16 | the 17 | .I dst 18 | parameter on success or 19 | .B NULL 20 | on failure. 21 | .SH SEE ALSO 22 | .BR cp_string_cstrcpy (3) 23 | -------------------------------------------------------------------------------- /man3/cp_string_create.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_create \- string constructor function 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_create(char *" data ", int " len "); 8 | .SH DESCRIPTION 9 | .B cp_string_create 10 | creates a new 11 | .B cp_string 12 | by allocating ( 13 | .I len 14 | + 1) bytes and copying the first 15 | .I len 16 | bytes of 17 | .I data 18 | on to the 19 | .B cp_string 20 | structure. 21 | 22 | .SH RETURN VALUE 23 | the newly allocated 24 | .B cp_string 25 | structure on success or 26 | .B NULL 27 | on failure. 28 | .B cp_string_create 29 | may fail on systems where 30 | .BR malloc (3) 31 | might fail. 32 | .SH SEE ALSO 33 | .BR cp_string_dup (3), 34 | .BR cp_string_cstrdup (3), 35 | .BR cp_string_delete (3), 36 | .BR malloc (3) 37 | -------------------------------------------------------------------------------- /man3/cp_string_cstrcat.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_cstrcat \- concatenate a null terminated string to a cp_string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_cstrcat(cp_string *" str ", char *" appendum "); 8 | .SH DESCRIPTION 9 | .B cp_string_cstrcat 10 | copies the string represented by 11 | .I src 12 | to the end of \fIdst\fP. If necessary the internal buffer of the destination 13 | string is reallocated to accomodate for the source string. 14 | 15 | .SH RETURN VALUE 16 | the 17 | .I dst 18 | parameter on success or 19 | .B NULL 20 | on failure. 21 | .SH SEE ALSO 22 | .BR cp_string_cat (3), 23 | .BR cp_string_cat_bin (3) 24 | -------------------------------------------------------------------------------- /man3/cp_string_cstrcpy.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_cstrcpy \- copy a null terminated string to a cp_string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_cstrcpy(cp_string *" dst ", char *" src "); 8 | .SH DESCRIPTION 9 | .B cp_string_cstrcpy 10 | copies the null terminated string pointed at by 11 | .I src 12 | onto \fIdst\fP. If necessary the internal buffer of the destination string is 13 | reallocated to accomodate for the source string including the terminating null. 14 | 15 | .SH RETURN VALUE 16 | the 17 | .I dst 18 | parameter on success or 19 | .B NULL 20 | on failure. 21 | .SH SEE ALSO 22 | .BR cp_string_cpy (3), 23 | .BR cp_string_cstrdup (3) 24 | -------------------------------------------------------------------------------- /man3/cp_string_cstrdup.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_cstrdup \- duplicate a null terminated string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_cstrdup(char *" src "); 8 | .SH DESCRIPTION 9 | .B cp_string_cstrdup 10 | creates a \fBcp_string\fP, copies the content of the 11 | .I src 12 | string and returns the resulting string. 13 | .SH RETURN VALUE 14 | the newly allocated 15 | .B cp_string 16 | structure on success or 17 | .B NULL 18 | on failure. 19 | .B cp_string_cstrdup 20 | may fail on systems where 21 | .BR malloc (3) 22 | might fail. 23 | .SH SEE ALSO 24 | .BR cp_string_dup (3), 25 | .BR malloc (3) 26 | -------------------------------------------------------------------------------- /man3/cp_string_delete.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_delete \- string destructor function 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void cp_string_delete(cp_string *" str "); 8 | .SH DESCRIPTION 9 | .B cp_string_delete 10 | deallocates a cp_string object. 11 | -------------------------------------------------------------------------------- /man3/cp_string_dump.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_dump \- write a hex dump of a cp_string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void cp_string_dump(cp_string *" str "); 8 | .SH DESCRIPTION 9 | .B cp_string_dump 10 | writes a hex dump of the given string 11 | .I str 12 | to the standard output. 13 | -------------------------------------------------------------------------------- /man3/cp_string_dup.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_dup \- duplicate a cp_string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_dup(cp_string *" src "); 8 | .SH DESCRIPTION 9 | .B cp_string_dup 10 | creates a \fBcp_string\fP, copies the content of the 11 | .I src 12 | string and returns the resulting string. 13 | .SH RETURN VALUE 14 | the newly allocated 15 | .B cp_string 16 | structure on success or 17 | .B NULL 18 | on failure. 19 | .B cp_string_dup 20 | may fail on systems where 21 | .BR malloc (3) 22 | might fail. 23 | .SH SEE ALSO 24 | .BR cp_string_cstrdup (3), 25 | .BR malloc (3) 26 | -------------------------------------------------------------------------------- /man3/cp_string_len.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_len \- return the length of a cp_string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "int cp_string_len(cp_string *" str "); 8 | .SH DESCRIPTION 9 | returns the length of the given string. Since the 10 | .B cp_string 11 | structure keeps track of the internal buffer's used length, this is an O(1) 12 | operation. 13 | .SH RETURN VALUE 14 | the length of the given string. 15 | -------------------------------------------------------------------------------- /man3/cp_string_read.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_read \- read a string from an open file descriptor 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_string *cp_string_read(int " fd ", int " len "); 8 | .SH DESCRIPTION 9 | .B cp_string_read 10 | creates a new 11 | .B cp_string 12 | and reads up to 13 | .I len 14 | bytes from the open file descriptor \fIfd\fP, or if 15 | .I len 16 | is 0, reading continues until EOF is encountered. 17 | .br 18 | .B cp_string_read 19 | returns on any error, regardless of the number of bytes read. 20 | .SH RETURN VALUE 21 | a newly allocated 22 | .B cp_string 23 | structure or 24 | .B NULL 25 | if the read failed or the string could not be allocated. 26 | .SH SEE ALSO 27 | .BR cp_string_write (3) 28 | -------------------------------------------------------------------------------- /man3/cp_string_reset.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_reset \- reset a cp_string structure 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void cp_string_reset(cp_string *" str "); 8 | .SH DESCRIPTION 9 | .B cp_string_reset 10 | reallocates memory in a cp_string's internal buffer to an empty string and 11 | resets the length to zero. 12 | -------------------------------------------------------------------------------- /man3/cp_string_tocstr.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_tocstr \- retrieve the underlying character pointer from a cp_string 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "char *cp_string_tocstr(cp_string *" str "); 8 | .SH DESCRIPTION 9 | .B cp_string 10 | objects allocate a buffer at least one byte bigger than required to hold the 11 | length of the data they contain. 12 | .B cp_string_tocstr 13 | sets this extra byte to '\\0' 14 | and returns a pointer to the internal buffer. 15 | 16 | .SH RETURN VALUE 17 | a pointer to the internal buffer, which is guaranteed to be null terminated. 18 | -------------------------------------------------------------------------------- /man3/cp_string_write.3: -------------------------------------------------------------------------------- 1 | .TH "cp_string" 3 "MARCH 2006" "libcprops" "cp_string" 2 | .SH NAME 3 | cp_string_write \- write a string to an open file descriptor 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "int cp_string_write(cp_string *" str ", int " fd "); 8 | .SH DESCRIPTION 9 | .B cp_string_writes 10 | the internal buffer of the string 11 | .I str 12 | to the open file descriptor \fIfd\fP. 13 | .SH RETURN VALUE 14 | the number of bytes actually written. 15 | .SH SEE ALSO 16 | .BR cp_string_read (3) 17 | -------------------------------------------------------------------------------- /man3/cp_thread.3: -------------------------------------------------------------------------------- 1 | .TH "cp_thread" 3 "OCTOBER 2005" "libcprops" "libcprops - cp_thread" 2 | .ad l 3 | .nh 4 | .SH NAME 5 | cp_thread \- cprops thread framework 6 | .SH DESCRIPTION 7 | defines the cprops thread framework, offering thread 8 | pooling and load balancing. The current implementation is based on the POSIX 9 | thread api. In particular the 10 | .B cp_thread 11 | structure is a mnemonic for \fBpthread_t\fP, and the \fBcp_thread_create\fP(), 12 | \fBcp_thread_join\fP and \fBcp_thread_detach\fP functions are mnemonics for the 13 | pthread_* counterparts. The main intended usage is through the 14 | .BR cp_thread_pool (3) 15 | structure so that threads would normally be created in the 16 | process of the pool initialization rather than with an explicit function call. 17 | .sp 18 | The prototype for client thread functions should match 19 | 20 | .RS +5n 21 | .nf 22 | void *thread_fn(void *prm); 23 | .fi 24 | .RE 25 | 26 | .sp 27 | Load balancing is done by creating multiple thread pools sharing the same 28 | .BR cp_pooled_thread_scheduler (3) 29 | object. 30 | 31 | .SH SEE ALSO 32 | .BR cp_thread_pool (3), 33 | .BR cp_pooled_thread_scheduler (3), 34 | .BR cp_pooled_thread_client_interface (3), 35 | .BR pthread_create (3), 36 | .BR pthread_join (3), 37 | .BR pthread_detach (3) 38 | -------------------------------------------------------------------------------- /man3/cp_thread_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_detach.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_join.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_pool_count_available.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread_pool.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_pool_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread_pool.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_pool_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread_pool.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_pool_get.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread_pool.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_pool_get_nb.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread_pool.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_pool_get_stoppable.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread_pool.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_pool_get_stoppable_nb.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread_pool.3 2 | -------------------------------------------------------------------------------- /man3/cp_thread_pool_stop.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_thread_pool.3 2 | -------------------------------------------------------------------------------- /man3/cp_timestampz.3: -------------------------------------------------------------------------------- 1 | .TH "cp_dbms" 3 "MARCH 2006" "libcprops" "cp_dbms" 2 | .SH NAME 3 | cp_timestampz, cp_timestampz_create, cp_timestampz_create_prm, 4 | cp_timestampz_destroy, cp_timestampz_localtime \- an object to represent time 5 | and time zone 6 | 7 | .SH SYNOPSIS 8 | #include 9 | #include 10 | #include 11 | 12 | .BI "cp_timestampz *cp_timestampz_create(struct timeval *" tm ", 13 | .ti +37n 14 | .BI "int " minuteswest "); 15 | .br 16 | .BI "cp_timestampz * 17 | .ti +5n 18 | .BI "cp_timestampz_create_prm(int " sec_since_epoch ", int " microsec ", 19 | .ti +37n 20 | .BI "int " minwest "); 21 | .br 22 | .BI "void cp_timestampz_destroy(cp_timestampz *" tmz "); 23 | .br 24 | .BI "struct tm *cp_timestampz_localtime(cp_timestampz *" tmz ", struct tm *" res "); 25 | .SH DESCRIPTION 26 | .B cp_timestampz 27 | represents time as with a 28 | .B struct timeval 29 | and an integer describing the time zone as the number of minutes west of UTC. 30 | .br 31 | .B cp_timestampz_create 32 | and 33 | .B cp_timestampz_create_prm 34 | create a new time stamp structure. 35 | .br 36 | .B cp_timestampz_destroy 37 | deallocates a time stamp object. 38 | .br 39 | .B cp_timestampz_localtime 40 | returns broken-down time in a \fBstruct tm\fP. 41 | .SH RETURN VALUE 42 | .B cp_timestampz_create 43 | and 44 | .B cp_timestampz_create_prm 45 | return a newly allocated 46 | .B cp_timestampz 47 | structure on success or NULL if memory for the new structure could not be 48 | allocated. 49 | .B cp_timestampz_localtime 50 | returns a 51 | .B struct tm * 52 | representing the localtime for the given timestamp and time zone. 53 | .SH SEE ALSO 54 | .BR localtime (3) 55 | -------------------------------------------------------------------------------- /man3/cp_timestampz_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_timestampz.3 -------------------------------------------------------------------------------- /man3/cp_timestampz_create_prm.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_timestampz.3 -------------------------------------------------------------------------------- /man3/cp_timestampz_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_timestampz.3 -------------------------------------------------------------------------------- /man3/cp_timestampz_localtime.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_timestampz.3 -------------------------------------------------------------------------------- /man3/cp_trie_add.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_exact_match.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_get_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_lock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_match.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_remove.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_trie_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_trie.3 2 | -------------------------------------------------------------------------------- /man3/cp_vector.3: -------------------------------------------------------------------------------- 1 | .TH cp_vector 3 "MARCH 2006" libcprops.0.0.12 "libcprops - cp_vector" 2 | .SH NAME 3 | cp_vector \- a managed array type 4 | .SH INTERFACE 5 | the following is a summary of functions provided by \fI\fP. 6 | 7 | .BI "cp_vector *cp_vector_create_by_option(int " size ", 8 | .ti +38n 9 | .BI "int " mode ", 10 | .ti +38n 11 | .BI "cp_copy_fn " copy_item ", 12 | .ti +38n 13 | .BI "cp_destructor_fn " free_item "); 14 | .br 15 | .BI "cp_vector *cp_vector_create(int " size "); 16 | .br 17 | .BI "cp_vector *cp_vector_wrap(void **" data ", int " len ", int " mode "); 18 | .br 19 | .BI "void cp_vector_destroy(cp_vector *" v "); 20 | .br 21 | .BI "void cp_vector_destroy_custom(cp_vector *" v ", cp_destructor_fn " dtr "); 22 | .br 23 | .BI "void *cp_vector_add_element(cp_vector *" v ", void *" element "); 24 | .br 25 | .BI "void *cp_vector_set_element(cp_vector *" v ", int " index ", void *" element "); 26 | .br 27 | .BI "void *cp_vector_element_at(cp_vector *" v ", int " index "); 28 | .br 29 | .BI "int cp_vector_size(cp_vector *" v "); 30 | .SH DESCRIPTION 31 | .B cp_vector 32 | is a managed array type. 33 | .sp 34 | For more detailed descriptions see the man pages for the individual functions. 35 | -------------------------------------------------------------------------------- /man3/cp_vector_add_element.3: -------------------------------------------------------------------------------- 1 | .TH cp_vector 3 "MARCH 2006" libcprops-0.0.12 "libcprops - cp_vector" 2 | .SH NAME 3 | cp_vector_add_element, cp_vector_set_element \- add / set an element in a vector 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void *cp_vector_add_element(cp_vector *" vector ", void * " element "); 8 | .sp 9 | .BI "void *cp_vector_set_element(cp_vector *" vector ", int " index ", 10 | .ti +28n 11 | .BI "void * " element "); 12 | .SH DESCRIPTION 13 | .B cp_vector_add_element 14 | appends the entry 15 | .I element 16 | to the given \fIvector\fP, extending the internal storage size if necessary. 17 | .sp 18 | .B cp_vector_set_element 19 | sets the element at the given 20 | .I index 21 | to the given value, allocating additional internal storage if 22 | .I index 23 | is greater than the current vector size. If an entry already exists at the 24 | specified index, the 25 | .I COLLECTION_MODE_DEEP 26 | mode bit is set and the item destructor function is not NULL, the item 27 | destructor function is called upon the existing entry. 28 | .SH RETURN VALUE 29 | the inserted item on success or NULL on failure. 30 | -------------------------------------------------------------------------------- /man3/cp_vector_create.3: -------------------------------------------------------------------------------- 1 | .TH cp_vector 3 "MARCH 2006" libcprops.0.0.12 "libcprops - cp_vector" 2 | .SH NAME 3 | cp_vector_create, cp_vector_create_by_option \- create a vector object 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "cp_vector *cp_vector_create(int " size "); 8 | .sp 9 | .BI "cp_vector *cp_vector_create_by_option(int " size ", 10 | .ti +38n 11 | .BI "int " mode ", 12 | .ti +38n 13 | .BI "cp_copy_fn " copy_item ", 14 | .ti +38n 15 | .BI "cp_destructor_fn " free_item "); 16 | .sp 17 | .BI "cp_vector *cp_vector_wrap(void **" data ", int " len ", int " mode "); 18 | .SH DESCRIPTION 19 | .B cp_vector_create_by_option 20 | creates a vector with initial storage for 21 | .I size 22 | items 23 | with the given \fImode\fP, using 24 | .I copy_item 25 | to copy items on insertion if 26 | .I mode 27 | has the 28 | .B COLLECTION_MODE_COPY 29 | bit set, and 30 | .I free_item 31 | to release items if 32 | .I mode 33 | has the 34 | .B COLLECTION_MODE_DEEP 35 | bit set. 36 | .sp 37 | .B cp_vector_create 38 | is equivalent to 39 | 40 | .RS +3n 41 | .nf 42 | cp_vector_create_by_mode(size, COLLECTION_MODE_MULTIPLE_VALUES, 43 | NULL, NULL) 44 | .fi 45 | .RE 46 | 47 | .B cp_vector_wrap 48 | creates a cp_vector object with the given 49 | .I data 50 | parameter as its content, setting the initial size to 51 | .I size 52 | and the operation mode to \fImode\fP. 53 | .SH RETURN VALUE 54 | a newly created 55 | .B cp_vector 56 | on success or 57 | NULL 58 | on failure. 59 | .SH SEE ALSO 60 | .BR cp_vector_destroy (3), 61 | .BR cp_vector_destroy_custom (3) 62 | -------------------------------------------------------------------------------- /man3/cp_vector_create_by_option.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_vector_create.3 2 | -------------------------------------------------------------------------------- /man3/cp_vector_destroy.3: -------------------------------------------------------------------------------- 1 | .TH cp_vector 3 "MARCH 2006" libcprops.0.0.12 "libcprops - cp_vector" 2 | .SH NAME 3 | cp_vector_destroy, cp_vector_destroy_custom \- delete a vector object 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void cp_vector_destroy(cp_vector *" vector "); 8 | .sp 9 | .BI "void cp_vector_destroy_custom(cp_vector *" vector ", 10 | .ti +30n 11 | .BI "cp_destructor_fn " dtr "); 12 | .SH DESCRIPTION 13 | .B cp_vector_destroy 14 | deallocates a vector object. 15 | .B cp_vector_destroy_custom 16 | does the same, but also allows specifying a destructor function \fIdtr\fP, 17 | which, if not is, is called on each item stored in the vector. 18 | -------------------------------------------------------------------------------- /man3/cp_vector_destroy_custom.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_vector_destroy.3 -------------------------------------------------------------------------------- /man3/cp_vector_element_at.3: -------------------------------------------------------------------------------- 1 | .TH cp_vector 3 "MARCH 2006" libcprops-0.0.12 "libcprops - cp_vector" 2 | .SH NAME 3 | cp_vector_element_at \- return the element at the given position 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "void *cp_vector_element_at(cp_vector *" vector ", int " index "); 8 | .SH DESCRIPTION 9 | .B cp_vector_element_at 10 | returns the element set at the given \fIindex\fP. Index ranges from 0 to 11 | cp_vector_size() - 1. 12 | .SH RETURN VALUE 13 | the element at the given position or NULL if no element is set or the index is 14 | out of range. 15 | .SH SEE ALSO 16 | .BR cp_vector_size (3) 17 | -------------------------------------------------------------------------------- /man3/cp_vector_set_element.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_vector_add_element.3 -------------------------------------------------------------------------------- /man3/cp_vector_size.3: -------------------------------------------------------------------------------- 1 | .TH cp_vector 3 "MARCH 2006" libcprops-0.0.12 "libcprops - cp_vector" 2 | .SH NAME 3 | cp_vector_size \- return the length of a vector 4 | .SH SYNOPSIS 5 | #include 6 | 7 | .BI "int cp_vector_size(cp_vector *" vector "); 8 | .SH DESCRIPTION 9 | .B cp_vector_size 10 | returns the current length of the given \fIvector\fP. 11 | -------------------------------------------------------------------------------- /man3/cp_wtrie_add.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_create.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_create_trie.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_destroy.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_exact_match.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_fetch_matches.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_get_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_lock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_prefix_match.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_rdlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_remove.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_set_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_unlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_unset_mode.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cp_wtrie_wrlock.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_wtrie.3 2 | -------------------------------------------------------------------------------- /man3/cstr_to_bstr.3: -------------------------------------------------------------------------------- 1 | .so man3/cp_bstr.3 2 | -------------------------------------------------------------------------------- /man3/libcprops.3: -------------------------------------------------------------------------------- 1 | .so cprops.3 -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.1.1.1 2005/12/27 08:44:50 iaelion Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /mtab.h: -------------------------------------------------------------------------------- 1 | #ifndef _CP_MTAB_H 2 | #define _CP_MTAB_H 3 | 4 | #include "common.h" 5 | #include "collection.h" 6 | 7 | __BEGIN_DECLS 8 | 9 | #include "config.h" 10 | 11 | /* 12 | * table entry descriptor. mtab entries map a character to a value, and in 13 | * addition allow specifying an attribute for the mapping. this is used by 14 | * cp_trie to collapse multiple single child trie edges into a single node. 15 | */ 16 | typedef struct _mtab_node 17 | { 18 | unsigned char key; 19 | void *value; 20 | void *attr; 21 | struct _mtab_node *next; 22 | } mtab_node; 23 | 24 | mtab_node *mtab_node_new(unsigned char key, void *value, void *attr); 25 | 26 | /* 27 | * the 'owner' parameter is for use by the enclosing data structure. cp_trie 28 | * uses this to recursively delete a sub-tree. 29 | */ 30 | typedef void *(*mtab_dtr)(void *owner, mtab_node *node); 31 | 32 | /* 33 | * mtab is a hash table implementation specialized for use as a holder for 34 | * cp_trie edges. 35 | */ 36 | typedef struct _mtab 37 | { 38 | int size; 39 | int items; 40 | mtab_node **table; 41 | } mtab; 42 | 43 | mtab *mtab_new(int size); 44 | 45 | void mtab_delete(mtab *t); 46 | void mtab_delete_custom(mtab *t, 47 | void *owner, 48 | mtab_dtr dtr); 49 | mtab_node *mtab_put(mtab *t, unsigned char key, void *value, void *attr); 50 | mtab_node *mtab_get(mtab *t, unsigned char key); 51 | void *mtab_remove(mtab *t, unsigned char key); 52 | 53 | int mtab_count(mtab *t); 54 | 55 | int mtab_callback(mtab *t, cp_callback_fn fn, void *prm); 56 | 57 | __END_DECLS 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /str.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sabit/libcprops/62a73ca84d6e53fc966b3ad994f7467c33b48532/str.c -------------------------------------------------------------------------------- /svc/Makefile.vc: -------------------------------------------------------------------------------- 1 | # cpsvc - an http server - Makefile 2 | # 3 | # This is the Makefile for cpsvc on windows. 4 | # 5 | # Copyright (c) 2005-2007 by Ilan Aelion 6 | # iaelion@users.sourceforge.net 7 | # 8 | # 2007-11-30 V 0.1.7 beta 9 | # 10 | ############################################################################ 11 | 12 | CC=CL 13 | LD=LINK 14 | RM=DEL /Q 15 | 16 | CFLAGS=/I. /DWIN32 /D_WINDOWS 17 | LDFLAGS=/incremental:no /subsystem:console ..\libcprops.lib 18 | LIBS=WS2_32.lib 19 | 20 | !INCLUDE win.mak 21 | 22 | !IF "$(CPSP_SOURCES)" != "" 23 | CPSP_WORKER=cpsp_worker.obj cpsp_worker.exe 24 | !ENDIF 25 | 26 | SVC_SRC = file.c cgi.c $(CPSP_SOURCES) 27 | SVC_HDR = $(SVC_SRC:.c=.h) 28 | SVC_OBJ = $(SVC_SRC:.c=.obj) cpsvc.obj 29 | 30 | all: linkdir cpsvc.exe 31 | 32 | linkdir: 33 | @IF not exist cprops\config.h mkdir cprops 34 | @copy /y ..\*.h cprops > nul: 2>&1 35 | 36 | cpsvc.exe: $(SVC_OBJ) $(CPSP_WORKER) 37 | $(LD) $(LDFLAGS) $(SVC_OBJ) /out:$@ $(LIBS) 38 | 39 | !IF "$(CPSP_SOURCES)" != "" 40 | cpsp_worker.exe: 41 | $(LD) $(LDFLAGS) cpsp.obj cpsp_invoker.obj cpsp_worker.obj /out:$@ $(LIBS) 42 | !ENDIF 43 | 44 | %.obj : %.c %.h 45 | $(CC) $(CFLAGS) -c $< /out:$@ 46 | 47 | .PHONY: all clean install uninstall linkdir 48 | 49 | clean: 50 | $(RM) $(SVC_OBJ) cpsvc.exe $(CPSP_WORKER) *.log 51 | -------------------------------------------------------------------------------- /svc/cgi.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CP_SVC_CGI_H 3 | #define _CP_SVC_CGI_H 4 | 5 | #include "cprops/common.h" 6 | #include "cprops/http.h" 7 | 8 | __BEGIN_DECLS 9 | 10 | /** initialized cgi service */ 11 | int init_cgi(char *path, char *uri_prefix); 12 | /** stop cgi service */ 13 | void shutdown_cgi(void *dummy); 14 | 15 | /** cgi service function */ 16 | int cgi(cp_http_request *request, cp_http_response *response); 17 | 18 | __END_DECLS 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /svc/cprops: -------------------------------------------------------------------------------- 1 | .. -------------------------------------------------------------------------------- /svc/cpsp.h: -------------------------------------------------------------------------------- 1 | #ifndef _CP_CPSP_H 2 | #define _CP_CPSP_H 3 | 4 | #include "cprops/config.h" 5 | #include "cprops/common.h" 6 | #include "cprops/http.h" 7 | 8 | __BEGIN_DECLS 9 | 10 | void cpsp_init(int separate, char *bin_path, char *doc_root); 11 | void cpsp_shutdown(void *dummy); 12 | 13 | void *cpsp_add_shutdown_callback(void (*cb)(void *), void *prm); 14 | 15 | typedef struct _cpsp_rec 16 | { 17 | void *lib; 18 | int (*svc)(cp_http_request *, cp_http_response *); 19 | char *path; 20 | } cpsp_rec; 21 | 22 | cpsp_rec *cpsp_rec_new(char *path); 23 | 24 | void cpsp_rec_dispose(cpsp_rec *rec); 25 | 26 | int cpsp_gen(cp_http_request *request, cp_http_response *response); 27 | 28 | __END_DECLS 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /svc/cpsp/Makefile.cpsp.vc: -------------------------------------------------------------------------------- 1 | # cpsp - a server page compiler - Makefile 2 | # 3 | # This is the Makefile for cpsp pages on windows. 4 | # It requires MSVC 6.0 and NMAKE. 5 | # 6 | # Copyright (c) 2005-2007 by Ilan Aelion 7 | # iaelion@users.sourceforge.net 8 | # 9 | # 2007-11-30 V 0.1.7 beta 10 | # 11 | ############################################### 12 | 13 | CC=CL 14 | LD=LINK 15 | CFLAGS = /I $(PREF) /I $(incdir) $(CFLAGS) 16 | LDFLAGS = /libpath:$(PREF)..\.. $(LDFLAGS) 17 | LIBS = libcprops.lib $(LIBS) 18 | 19 | !IF defined(libdir) 20 | !IF not "$(libdir)" == "" 21 | LDFLAGS=$(LDFLAGS) /libpath:$(libdir) 22 | !ENDIF 23 | !ENDIF 24 | 25 | !INCLUDE win.cpsp.mak 26 | 27 | LDFLAGS = $(LDFLAGS) /libpath:$(top_builddir) 28 | 29 | all: 30 | @echo cpsp page makefile - don't invoke directly; call cpsp-gen.bat instead 31 | 32 | cpsp-page: $(CPSP_TARGET) 33 | @echo compiling $(CPSP_TARGET) 34 | $(CC) $(CFLAGS) $(CPSPCFLAGS) /c $(CPSP_TARGET) \ 35 | /Fo$(CPSP_TARGET:.c=.obj) 36 | $(LD) /dll $(LDFLAGS) $(CPSP_TARGET:.c=.obj) $(CPSPLDFLAGS) \ 37 | /out:$(CPSP_TARGET_DLL) $(LIBS) $(CPSPLIBS) 38 | 39 | $(CPSP_TARGET): $(CPSP_SRC) 40 | $(EXECPREF)cpsp < $(CPSP_SRC) > $(CPSP_TARGET) 41 | 42 | clean: 43 | $(RM) *.obj *.dll _cpsp_* 44 | 45 | -------------------------------------------------------------------------------- /svc/cpsp/Makefile.vc: -------------------------------------------------------------------------------- 1 | # cpsp - a server page compiler - Makefile 2 | # 3 | # This is the Makefile for cpsp on windows. It 4 | # requires MSVC 6.0 and NMAKE. 5 | # 6 | # Copyright (c) 2005-2007 by Ilan Aelion 7 | # iaelion@users.sourceforge.net 8 | # 9 | # 2007-11-30 V 0.1.7 beta 10 | # 11 | ############################################### 12 | 13 | 14 | CC=CL 15 | LD=LINK 16 | RM=DEL /Q 17 | CFLAGS = /I.. /DWIN32 /D_WINDOWS $(CFLAGS) 18 | LDFLAGS = /incremental:no /subsystem:console $(top_builddir)\libcprops.lib 19 | LIBS = WS2_32.lib 20 | 21 | INSTALL=copy 22 | # INSTALL_PROGRAM = @INSTALL_PROGRAM@ 23 | # INSTALL_DATA = @INSTALL_DATA@ 24 | 25 | !INCLUDE win.cpsp.mak 26 | 27 | # CPSPCFLAGS=$(shell grep 'CPSPCFLAGS=' $(CPSP_SRC) | sed 's/.*=//'|sed 's/%>//') 28 | # CPSPLDFLAGS=$(shell grep 'CPSPLDFLAGS=' $(CPSP_SRC)|sed 's/.*=//'|sed 's/%>//') 29 | # CPSPLIBS=$(shell grep 'CPSPLIBS=' $(CPSP_SRC) | sed 's/.*=//'|sed 's/%>//') 30 | 31 | all: linkdir cpsp.exe 32 | 33 | .PHONY: all linkdir clean install uninstall 34 | 35 | linkdir: 36 | @if not exist cprops mkdir cprops 37 | @copy /y ..\..\*.h cprops > nul: 2>&1 38 | 39 | cpsp.exe: lex.yy.c y.tab.c 40 | $(CC) /c /O2 $(CFLAGS) /DMSDOS lex.yy.c y.tab.c 41 | $(LD) $(LDFLAGS) lex.yy.obj y.tab.obj /out:$@ $(LIBS) 42 | 43 | lex.yy.c: cpsp.l 44 | $(LEX) cpsp.l 45 | 46 | y.tab.c: cpsp.y 47 | $(YACC) -o y.tab.c -d cpsp.y 48 | 49 | clean: 50 | $(RM) core* cpsp.obj cpsp.exe lex.yy.c y.tab.c y.tab.h *.obj *.dll _cpsp_* 51 | 52 | install: all 53 | $(INSTALL) cpsp $(bindir) 54 | $(INSTALL) cpsp-gen.bat $(bindir) 55 | $(INSTALL) Makefile.cpsp $(bindir) 56 | 57 | uninstall: 58 | $(RM) $(bindir)/cpsp 59 | $(RM) $(bindir)/cpsp-gen.sh 60 | $(RM) $(bindir)/Makefile.cpsp 61 | 62 | -------------------------------------------------------------------------------- /svc/cpsp/cprops: -------------------------------------------------------------------------------- 1 | ../.. -------------------------------------------------------------------------------- /svc/cpsp/cpsp-gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MAKE=make 4 | if [ "x$MAKE" = "x" ] ; then 5 | MAKE=make 6 | fi 7 | 8 | cwd=$PWD 9 | logfile="$cwd/cpsp-gen.log" 10 | 11 | makefile=Makefile.cpsp 12 | if test "$2" ; then 13 | makefile="$2/$makefile" 14 | fi 15 | 16 | echo >> $logfile 17 | echo `date` $0 starting >> $logfile 18 | 19 | filename=`echo $1 | sed 's|\.\/||'` 20 | echo compiling $filename >> $logfile 21 | 22 | if [ ! -r $filename ] ; 23 | then 24 | echo $filename not found >> $logfile 25 | exit -1 26 | fi 27 | 28 | CPSP_SRC_lit=$filename 29 | 30 | x=`echo $1 | sed 's|\(.*\)\/.*|\1|'` 31 | y=`echo $1 | sed 's|.*\/||'` 32 | 33 | if [ "$1" = "$x" ] ; then 34 | prefix="" 35 | fname=$1 36 | cpsp_target=_cpsp_$fname 37 | gen_target=`echo gen_cpsp_$fname | sed 's|\.cpsp$|\.so|'` 38 | else 39 | prefix=$x 40 | fname=$y 41 | cpsp_target=$prefix/_cpsp_$fname 42 | gen_target=`echo $prefix/gen_cpsp_$fname | sed 's|\.cpsp$|\.so|'` 43 | fi 44 | 45 | CPSP_TARGET_lit=`echo $cpsp_target | sed 's|psp$||'` 46 | 47 | # if the c file exists but is 0 bytes long, delete it 48 | if [ -r $CPSP_TARGET_lit -a ! -s $CPSP_TARGET_lit ] ; then 49 | rm -f $CPSP_TARGET_lit 50 | fi 51 | 52 | CPSP_TARGET=$CPSP_TARGET_lit CPSP_SRC=$CPSP_SRC_lit \ 53 | $MAKE -f $makefile cpsp-page >> $logfile 2>&1 54 | 55 | if [ $? -ne 0 ] ; then exit $? ; fi 56 | 57 | target=`echo $cpsp_target | sed 's|\.cpsp$|\.so|'` 58 | echo target: $target >> $logfile 59 | if [ -r $target ] ; 60 | then 61 | cp -f $target $target~ >& /dev/null 62 | fi 63 | 64 | mv -f $gen_target $target >> $logfile 2>&1 65 | 66 | -------------------------------------------------------------------------------- /svc/cpsp/cpsp-gen.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MAKE=@gnu_make@ 4 | if [ "x$MAKE" = "x" ] ; then 5 | MAKE=make 6 | fi 7 | 8 | cwd=$PWD 9 | logfile="$cwd/cpsp-gen.log" 10 | 11 | makefile=Makefile.cpsp 12 | if test "$2" ; then 13 | makefile="$2/$makefile" 14 | fi 15 | 16 | echo >> $logfile 17 | echo `date` $0 starting >> $logfile 18 | 19 | filename=`echo $1 | sed 's|\.\/||'` 20 | echo compiling $filename >> $logfile 21 | 22 | if [ ! -r $filename ] ; 23 | then 24 | echo $filename not found >> $logfile 25 | exit -1 26 | fi 27 | 28 | CPSP_SRC_lit=$filename 29 | 30 | x=`echo $1 | sed 's|\(.*\)\/.*|\1|'` 31 | y=`echo $1 | sed 's|.*\/||'` 32 | 33 | if [ "$1" = "$x" ] ; then 34 | prefix="" 35 | fname=$1 36 | cpsp_target=_cpsp_$fname 37 | gen_target=`echo gen_cpsp_$fname | sed 's|\.cpsp$|\.so|'` 38 | else 39 | prefix=$x 40 | fname=$y 41 | cpsp_target=$prefix/_cpsp_$fname 42 | gen_target=`echo $prefix/gen_cpsp_$fname | sed 's|\.cpsp$|\.so|'` 43 | fi 44 | 45 | CPSP_TARGET_lit=`echo $cpsp_target | sed 's|psp$||'` 46 | 47 | # if the c file exists but is 0 bytes long, delete it 48 | if [ -r $CPSP_TARGET_lit -a ! -s $CPSP_TARGET_lit ] ; then 49 | rm -f $CPSP_TARGET_lit 50 | fi 51 | 52 | CPSP_TARGET=$CPSP_TARGET_lit CPSP_SRC=$CPSP_SRC_lit \ 53 | $MAKE -f $makefile cpsp-page >> $logfile 2>&1 54 | 55 | if [ $? -ne 0 ] ; then exit $? ; fi 56 | 57 | target=`echo $cpsp_target | sed 's|\.cpsp$|\.so|'` 58 | echo target: $target >> $logfile 59 | if [ -r $target ] ; 60 | then 61 | cp -f $target $target~ >& /dev/null 62 | fi 63 | 64 | mv -f $gen_target $target >> $logfile 2>&1 65 | 66 | -------------------------------------------------------------------------------- /svc/cpsp/cpsp.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | #define YYSTYPE char * 5 | #include "y.tab.h" 6 | 7 | extern YYSTYPE yylval; 8 | 9 | %} 10 | %% 11 | \r /* suppress CR */ 12 | "<%@" return OPENPAGEBLOCK; 13 | "<%!" return OPENGLOBALBLOCK; 14 | "<%" return OPENSVCBLOCK; 15 | "<%=" return OPENVALBLOCK; 16 | "%>" return CLOSEBLOCK; 17 | \n yylval = strdup(yytext); return CODE; 18 | \%/[^>] yylval = strdup(yytext); return CODE; 19 | \ 9 | #include 10 | #include "cpsp.h" 11 | #include "cpsp_invoker.h" 12 | 13 | #define CPSP_BIN "CPSP_BIN" 14 | #define DOC_ROOT "DOC_ROOT" 15 | #define PATH "PATH" 16 | 17 | static char *bin_path = ""; 18 | static char *doc_root = "."; 19 | static char *path = ""; 20 | 21 | int main(int argc, char *argv[], char **env) 22 | { 23 | int i; 24 | char *p; 25 | 26 | HANDLE in, out; 27 | int fd_in = atoi(argv[1]); 28 | int fd_out = atoi(argv[2]); 29 | 30 | in = (void *) fd_in; 31 | out = (void *) fd_out; 32 | 33 | for (i = 0; p = env[i]; i++) 34 | { 35 | int len; 36 | 37 | len = strlen(CPSP_BIN); 38 | if (strncmp(p, CPSP_BIN, len) == 0) 39 | { 40 | bin_path = &p[len + 1]; 41 | continue; 42 | } 43 | 44 | len = strlen(DOC_ROOT); 45 | if (strncmp(p, DOC_ROOT, len) == 0) 46 | { 47 | doc_root = &p[len + 1]; 48 | continue; 49 | } 50 | 51 | len = strlen(PATH); 52 | if (strncmp(p, PATH, len) == 0) 53 | { 54 | path = &p[len + 1]; 55 | continue; 56 | } 57 | } 58 | 59 | if (path) _putenv(path); 60 | 61 | cpsp_init(1, bin_path, doc_root); 62 | 63 | cpsp_worker_run(in, out); /* dummy file descriptor */ 64 | } 65 | 66 | -------------------------------------------------------------------------------- /svc/file.h: -------------------------------------------------------------------------------- 1 | #ifndef _CP_SVC_FILE_H 2 | #define _CP_SVC_FILE_H 3 | 4 | #include "cprops/http.h" 5 | 6 | /** initialize file service */ 7 | int init_file_service(char *mimetypes_filename, char *doc_path); 8 | /** register service by file extension (ie .cpsp) */ 9 | void *register_ext_svc(char *ext, cp_http_service *svc); 10 | 11 | /** file service function */ 12 | int file_service(cp_http_request *request, cp_http_response *response); 13 | 14 | #endif /* _CP_SVC_FILE_H */ 15 | -------------------------------------------------------------------------------- /test/README: -------------------------------------------------------------------------------- 1 | ================================================= 2 | cert.pem, key.pem, cacert.pem - test certificates 3 | ================================================= 4 | 5 | o in the main build directory, compile the testhttpsrv program with 6 | 7 | $ make test 8 | 9 | o run the test program: 10 | 11 | $ LD_LIBRARY_PATH=. ./testhttpsrv -s -c test/cert.pem -k test/key.pem 12 | 13 | on some systems you might need to add the path to the openssl libraries 14 | to the LD_LIBRARY_PATH setting. 15 | 16 | o load the cacert.pem certificate in the client (eg browser) 17 | 18 | o test by connecting to https://localhost:5000. to use a different port 19 | invoke testhttpsrv with -p [port] 20 | 21 | -------------------------------------------------------------------------------- /test/cacert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIID5TCCA06gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBrjETMBEGA1UEChMKQUNN 3 | RSBDb3JwLjEVMBMGA1UECxMMSW5uZXIgQ2lyY2xlMTMwMQYJKoZIhvcNAQkBFiRj 4 | cHJvcHMtZ2VuZXJhbEBsaXN0cy5zb3VyY2Vmb3JnZS5uZXQxFzAVBgNVBAcTDkhR 5 | LCBBQ01FIENvcnAuMREwDwYDVQQIEwhEZWxhd2FyZTELMAkGA1UEBhMCVVMxEjAQ 6 | BgNVBAMTCWxvY2FsaG9zdDAeFw0wNjAzMDkwMDI0NTFaFw0xNjAzMDgwMDI0NTFa 7 | MIGuMRMwEQYDVQQKEwpBQ01FIENvcnAuMRUwEwYDVQQLEwxJbm5lciBDaXJjbGUx 8 | MzAxBgkqhkiG9w0BCQEWJGNwcm9wcy1nZW5lcmFsQGxpc3RzLnNvdXJjZWZvcmdl 9 | Lm5ldDEXMBUGA1UEBxMOSFEsIEFDTUUgQ29ycC4xETAPBgNVBAgTCERlbGF3YXJl 10 | MQswCQYDVQQGEwJVUzESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEB 11 | AQUAA4GNADCBiQKBgQDBkxdPL4Pgx2P7zDmmOpvX/6EZAVhFHszguqiRVgS6pOrZ 12 | p85BBOFzLCRm8QCoJo5h+L5LAoVE0u4b7/8pqx7LFFKBrA3hrLNn5+Og7N+8H2VB 13 | EFw2O+MeD55hmuHDgCaZVD8CFldINDZMmQYUvmYbE+lPi7mGcJJ+Tdo8zlYh1wID 14 | AQABo4IBDzCCAQswDAYDVR0TBAUwAwEB/zAdBgNVHQ4EFgQUQZ0A/DAatxAlAkU3 15 | NrQH/CwaNTwwgdsGA1UdIwSB0zCB0IAUQZ0A/DAatxAlAkU3NrQH/CwaNTyhgbSk 16 | gbEwga4xEzARBgNVBAoTCkFDTUUgQ29ycC4xFTATBgNVBAsTDElubmVyIENpcmNs 17 | ZTEzMDEGCSqGSIb3DQEJARYkY3Byb3BzLWdlbmVyYWxAbGlzdHMuc291cmNlZm9y 18 | Z2UubmV0MRcwFQYDVQQHEw5IUSwgQUNNRSBDb3JwLjERMA8GA1UECBMIRGVsYXdh 19 | cmUxCzAJBgNVBAYTAlVTMRIwEAYDVQQDEwlsb2NhbGhvc3SCAQAwDQYJKoZIhvcN 20 | AQEEBQADgYEAb+RXQLHFgm5iChF/rdarfBslZV3EA5+dYIx9TReWlPDfyO9hBi7+ 21 | tN+avrLytbxli4Zf3oKbsrfcVjrZbpbaO17hW17Tr9aJvkNo0kr9YtukhUYymlMF 22 | pbtVsbfrkH080wgDHCsXhsXAXR4bXdweIrN/rkKqdPMEI6YY3l7iXhw= 23 | -----END CERTIFICATE----- 24 | -------------------------------------------------------------------------------- /test/key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXgIBAAKBgQCrOPxtw4OXVfXoB4RcKI3G+/FkVWYXQBEaK9aeCI5YRMRGt19x 3 | azDrF6e+FxmdnIJB4EqYSDZXPMhGo/FIUHRu/5663B4daroCBx9IJoxp1ey6aYRt 4 | t/ITjqwAWqi6KrB1W8imDCxG5wMuGp6yMMYylc9OVGIfsyP3o/z6qEPipQIDAQAB 5 | AoGAJjZHj6+MlJ+oi6nxzid2zKu5iazNZe70YiTadtZt/iEKtMWD1WoYtr7GvtOk 6 | 8dnV8CHARBAJoJp+D9XSqVLbSPS6ZSOO5m5HEmPP2dTT2itNZ6yUjIlP05ghWXMA 7 | W+pzP9U6zxdU7rmFJ+Xdl5MPUgaPD9HtUvwSwMwPvgkVDtkCQQDfVOEdNpiRiOao 8 | tShhQSoQArRDGDDILvByK73HEcEdqakVF/rTQjIFb5IUljiULI8948b7Pz7TtQgU 9 | nlQxclizAkEAxETG6clGGMWOaycO/ajNmQsxWRKjQxIPZ1PhLupXac62kF3onuML 10 | Wf/2tOXUKUYzC7pEttPjeUo77eB8gygTRwJBAJGRRK4C8Q0jW50pf2lszRrkeFSn 11 | RtykY8s3IZrIwsQv2urJ146tveb3IxNSGwzRwogHmKIZRj096UdvL9eO/asCQQCU 12 | o8XFTnJw1kUqr3Tx9EJo0oo3/B568BWMWoEix8UV08B9izFeC3MQYQKVM62+6HRG 13 | QHZDxCr1M5w5ZhbGObaHAkEAgpvNNhRmiKCj038sXrypbv8TCvOGc3xEqY1nndsZ 14 | dC/tgPOiq7xEtYpqnJTnpm6JYzNz1NRAGMbh/WdVGthF1A== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /vector.h: -------------------------------------------------------------------------------- 1 | #ifndef _CP_VECTOR_H 2 | #define _CP_VECTOR_H 3 | 4 | #include "common.h" 5 | 6 | __BEGIN_DECLS 7 | 8 | #include "config.h" 9 | #include "collection.h" 10 | 11 | /** 12 | * A simple 'safe array' implementation. 13 | */ 14 | typedef CPROPS_DLL struct _cp_vector 15 | { 16 | void **mem; /**< Pointer to memory */ 17 | int size; /**< size of vector (element count) */ 18 | int head; /**< index of 1st element */ 19 | int tail; /**< index of Nth element */ 20 | 21 | int mode; /**< collection mode */ 22 | cp_copy_fn copy_item; /**< item copy function */ 23 | cp_destructor_fn free_item; /**< item destructor function */ 24 | cp_lock *lock; /**< rwlock */ 25 | } cp_vector; 26 | 27 | CPROPS_DLL 28 | cp_vector *cp_vector_create_by_option(int size, 29 | int mode, 30 | cp_copy_fn copy_item, 31 | cp_destructor_fn free_item); 32 | CPROPS_DLL 33 | cp_vector *cp_vector_create(int size); 34 | CPROPS_DLL 35 | cp_vector *cp_vector_wrap(void **data, int len, int mode); 36 | CPROPS_DLL 37 | void cp_vector_destroy(cp_vector *v); 38 | CPROPS_DLL 39 | void cp_vector_destroy_custom(cp_vector *v, cp_destructor_fn dtr); 40 | CPROPS_DLL 41 | void *cp_vector_add_element(cp_vector *v, void *element); 42 | CPROPS_DLL 43 | void *cp_vector_element_at(cp_vector *v, int index); 44 | CPROPS_DLL 45 | void *cp_vector_set_element(cp_vector *v, int index, void *element); 46 | CPROPS_DLL 47 | void *cp_vector_remove_element_at(cp_vector *v, int index); 48 | CPROPS_DLL 49 | int cp_vector_size(cp_vector *v); 50 | 51 | /* ----------------------------------------------------------------- */ 52 | 53 | __END_DECLS 54 | 55 | /** @} */ 56 | 57 | #endif /* _COLLECTION_VECTOR_H */ 58 | 59 | -------------------------------------------------------------------------------- /wtab.h: -------------------------------------------------------------------------------- 1 | #ifndef _CP_WTAB_H 2 | #define _CP_WTAB_H 3 | 4 | #include "common.h" 5 | #include "collection.h" 6 | 7 | __BEGIN_DECLS 8 | 9 | #include "config.h" 10 | 11 | #include 12 | 13 | /* 14 | * table entry descriptor. wtab entries map a character to a value, and in 15 | * addition allow specifying an attribute for the mapping. this is used by 16 | * cp_trie to collapse multiple single child trie edges into a single node. 17 | */ 18 | typedef struct _wtab_node 19 | { 20 | wchar_t key; 21 | void *value; 22 | void *attr; 23 | struct _wtab_node *next; 24 | } wtab_node; 25 | 26 | wtab_node *wtab_node_new(wchar_t key, void *value, void *attr); 27 | 28 | /* 29 | * the 'owner' parameter is for use by the enclosing data structure. cp_trie 30 | * uses this to recursively delete a sub-tree. 31 | */ 32 | typedef void *(*wtab_dtr)(void *owner, wtab_node *node); 33 | 34 | /* 35 | * wtab is a hash table implementation specialized for use as a holder for 36 | * cp_trie edges. 37 | */ 38 | typedef struct _wtab 39 | { 40 | int size; 41 | int items; 42 | wtab_node **table; 43 | } wtab; 44 | 45 | wtab *wtab_new(int size); 46 | 47 | void wtab_delete(wtab *t); 48 | void wtab_delete_custom(wtab *t, 49 | void *owner, 50 | wtab_dtr dtr); 51 | wtab_node *wtab_put(wtab *t, wchar_t key, void *value, void *attr); 52 | wtab_node *wtab_get(wtab *t, wchar_t key); 53 | void *wtab_remove(wtab *t, wchar_t key); 54 | 55 | int wtab_count(wtab *t); 56 | 57 | int wtab_callback(wtab *t, cp_callback_fn fn, void *prm); 58 | 59 | __END_DECLS 60 | 61 | #endif 62 | --------------------------------------------------------------------------------