Aleksey N. Vinogradov 6aaec20052 fix build warnings před 1 rokem
..
CMakeLists.txt 6aaec20052 fix build warnings před 1 rokem
COPYING 58bda13adb License-related changes and cleanup (#1720) před 2 roky
README 77478139bf merged from rel098 upto r1371 před 17 roky
smoke.cmake 8937e93184 fix gap in list of commands před 4 roky
smoke_data.csv 9bb6305781 Fix test of sphinxclient API před 6 roky
smoke_ref.txt 6f205d2990 use 'N/A' for not actual values před 1 rokem
smoke_test.conf 9a2b1b5f3a set `stored_fields=*` by default for plain indexes; fixed related issues; fixed tests před 4 roky
smoke_test.sh 7dd3cd6b2a Clean libsphinxclient stuff před 6 roky
sphinxclient.c 0dc5f776b6 Bumped year in copyright to 2024 (#1730) před 2 roky
sphinxclient.h 58bda13adb License-related changes and cleanup (#1720) před 2 roky
test.c f3ae8bea50 add load metrics před 2 roky

README

Pure C searchd client API library
Sphinx search engine, http://sphinxsearch.com/

API notes
----------

1. API can either copy the contents of passed pointer arguments,
or rely on the application that the pointer will not become invalid.
This is controlled on per-client basis; see 'copy_args' argument
to the sphinx_create() call.

When 'copy_args' is true, API will create and manage a copy of every
string and array passed to it. This causes additional malloc() pressure,
but makes calling code easier to write.

When 'copy_args' is false, API expects that pointers passed to
sphinx_set_xxx() calls will still be valid at the time when sphinx_query()
or sphinx_add_query() are called.

Rule of thumb: when 'copy_args' is false, do not free query arguments
until you have the search result. Example code for that case:

VALID CODE:

char * my_filter_name;

my_filter_name = malloc ( 256 );
strncpy ( my_filter_name, "test", 256 );

sphinx_add_filter_range ( client, my_filter_name, 10, 20, false );
result = sphinx_query ( client );

free ( my_filter_name );
my_filter_name = NULL;

INVALID CODE:

void setup_my_filter ( sphinx_client * client )
{
char buffer[256];
strncpy ( buffer, "test", sizeof(buffer) );

// INVALID! by the time when sphinx_query() is called,
// buffer will be out of scope
sphinx_add_filter_range ( client, buffer, 10, 20, false );
}

setup_my_filter ( client );
result = sphinx_query ( client );

--eof--