Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 854738
Collapse All | Expand All

(-)a/codeblocks/libsphinx.cbp (-1 / +1 lines)
Lines 74-80 Link Here
74
		<Unit filename="../src/sphinxstemcz.cpp" />
74
		<Unit filename="../src/sphinxstemcz.cpp" />
75
		<Unit filename="../src/sphinxstemen.cpp" />
75
		<Unit filename="../src/sphinxstemen.cpp" />
76
		<Unit filename="../src/sphinxstemru.cpp" />
76
		<Unit filename="../src/sphinxstemru.cpp" />
77
		<Unit filename="../src/sphinxudf.c">
77
		<Unit filename="../src/sphinxudf.cpp">
78
			<Option compilerVar="CC" />
78
			<Option compilerVar="CC" />
79
		</Unit>
79
		</Unit>
80
		<Unit filename="../src/sphinxutils.cpp" />
80
		<Unit filename="../src/sphinxutils.cpp" />
(-)a/doc/sphinx.html (-4 / +4 lines)
Lines 3665-3676 header file definitions of a few UDF related structures and types. For most Link Here
3665
UDFs and plugins, a mere <code class="code">#include "sphinxudf.h"</code>, like in the example,
3665
UDFs and plugins, a mere <code class="code">#include "sphinxudf.h"</code>, like in the example,
3666
should be completely sufficient, too. However, if you're writing a ranking function and
3666
should be completely sufficient, too. However, if you're writing a ranking function and
3667
need to access the ranking signals (factors) data from within the UDF, you will
3667
need to access the ranking signals (factors) data from within the UDF, you will
3668
also need to compile and link with <code class="filename">src/sphinxudf.c</code> (also
3668
also need to compile and link with <code class="filename">src/sphinxudf.cpp</code> (also
3669
available in our source code), because the <span class="emphasis"><em>implementations</em></span>
3669
available in our source code), because the <span class="emphasis"><em>implementations</em></span>
3670
of the fuctions that let you access the signal data from within the UDF reside
3670
of the fuctions that let you access the signal data from within the UDF reside
3671
in that file.
3671
in that file.
3672
</p><p>
3672
</p><p>
3673
Both <code class="filename">sphinxudf.h</code> header and <code class="filename">sphinxudf.c</code>
3673
Both <code class="filename">sphinxudf.h</code> header and <code class="filename">sphinxudf.cpp</code>
3674
are standalone. So you can copy around those files only; they do not depend
3674
are standalone. So you can copy around those files only; they do not depend
3675
on any other bits of Sphinx source code.
3675
on any other bits of Sphinx source code.
3676
</p><p>
3676
</p><p>
Lines 3888-3895 Just as with UDFs, you want to include <code class="filename">src/sphinxudf.h</c Link Here
3888
header file. At the very least, you will need the SPH_UDF_VERSION
3888
header file. At the very least, you will need the SPH_UDF_VERSION
3889
constant to implement a proper version function. Depending on the specific
3889
constant to implement a proper version function. Depending on the specific
3890
plugin type, you might or might not need to link your plugin with
3890
plugin type, you might or might not need to link your plugin with
3891
<code class="filename">src/sphinxudf.c</code>. However, as of 2.2.2-beta all
3891
<code class="filename">src/sphinxudf.cpp</code>. However, as of 2.2.2-beta all
3892
the functions implemented in <code class="filename">sphinxudf.c</code> are about
3892
the functions implemented in <code class="filename">sphinxudf.cpp</code> are about
3893
unpacking the PACKEDFACTORS() blob, and no plugin types are exposed to that
3893
unpacking the PACKEDFACTORS() blob, and no plugin types are exposed to that
3894
kind of data. So currently, you would never need to link with the C-file,
3894
kind of data. So currently, you would never need to link with the C-file,
3895
just the header would be sufficient. (In fact, if you copy over the
3895
just the header would be sufficient. (In fact, if you copy over the
(-)a/doc/sphinx.txt (-4 / +4 lines)
Lines 4280-4290 related structures and types. For most UDFs and plugins, a mere #include Link Here
4280
"sphinxudf.h", like in the example, should be completely sufficient, too.
4280
"sphinxudf.h", like in the example, should be completely sufficient, too.
4281
However, if you're writing a ranking function and need to access the
4281
However, if you're writing a ranking function and need to access the
4282
ranking signals (factors) data from within the UDF, you will also need to
4282
ranking signals (factors) data from within the UDF, you will also need to
4283
compile and link with src/sphinxudf.c (also available in our source code),
4283
compile and link with src/sphinxudf.cpp (also available in our source code),
4284
because the implementations of the fuctions that let you access the signal
4284
because the implementations of the fuctions that let you access the signal
4285
data from within the UDF reside in that file.
4285
data from within the UDF reside in that file.
4286
4286
4287
Both sphinxudf.h header and sphinxudf.c are standalone. So you can copy
4287
Both sphinxudf.h header and sphinxudf.cpp are standalone. So you can copy
4288
around those files only; they do not depend on any other bits of Sphinx
4288
around those files only; they do not depend on any other bits of Sphinx
4289
source code.
4289
source code.
4290
4290
Lines 4490-4497 and plugin; that is up to you. Link Here
4490
Just as with UDFs, you want to include src/sphinxudf.h header file. At the
4490
Just as with UDFs, you want to include src/sphinxudf.h header file. At the
4491
very least, you will need the SPH_UDF_VERSION constant to implement
4491
very least, you will need the SPH_UDF_VERSION constant to implement
4492
a proper version function. Depending on the specific plugin type, you might
4492
a proper version function. Depending on the specific plugin type, you might
4493
or might not need to link your plugin with src/sphinxudf.c. However, as of
4493
or might not need to link your plugin with src/sphinxudf.cpp. However, as of
4494
2.2.2-beta all the functions implemented in sphinxudf.c are about unpacking
4494
2.2.2-beta all the functions implemented in sphinxudf.cpp are about unpacking
4495
the PACKEDFACTORS() blob, and no plugin types are exposed to that kind of
4495
the PACKEDFACTORS() blob, and no plugin types are exposed to that kind of
4496
data. So currently, you would never need to link with the C-file, just the
4496
data. So currently, you would never need to link with the C-file, just the
4497
header would be sufficient. (In fact, if you copy over the UDF version
4497
header would be sufficient. (In fact, if you copy over the UDF version
(-)a/doc/sphinx.xml (-4 / +4 lines)
Lines 4094-4106 header file definitions of a few UDF related structures and types. For most Link Here
4094
UDFs and plugins, a mere <code>#include "sphinxudf.h"</code>, like in the example,
4094
UDFs and plugins, a mere <code>#include "sphinxudf.h"</code>, like in the example,
4095
should be completely sufficient, too. However, if you're writing a ranking function and
4095
should be completely sufficient, too. However, if you're writing a ranking function and
4096
need to access the ranking signals (factors) data from within the UDF, you will
4096
need to access the ranking signals (factors) data from within the UDF, you will
4097
also need to compile and link with <filename>src/sphinxudf.c</filename> (also
4097
also need to compile and link with <filename>src/sphinxudf.cpp</filename> (also
4098
available in our source code), because the <emphasis>implementations</emphasis>
4098
available in our source code), because the <emphasis>implementations</emphasis>
4099
of the fuctions that let you access the signal data from within the UDF reside
4099
of the fuctions that let you access the signal data from within the UDF reside
4100
in that file.
4100
in that file.
4101
</para>
4101
</para>
4102
<para>
4102
<para>
4103
Both <filename>sphinxudf.h</filename> header and <filename>sphinxudf.c</filename>
4103
Both <filename>sphinxudf.h</filename> header and <filename>sphinxudf.cpp</filename>
4104
are standalone. So you can copy around those files only; they do not depend
4104
are standalone. So you can copy around those files only; they do not depend
4105
on any other bits of Sphinx source code.
4105
on any other bits of Sphinx source code.
4106
</para>
4106
</para>
Lines 4336-4343 Just as with UDFs, you want to include <filename>src/sphinxudf.h</filename> Link Here
4336
header file. At the very least, you will need the SPH_UDF_VERSION
4336
header file. At the very least, you will need the SPH_UDF_VERSION
4337
constant to implement a proper version function. Depending on the specific
4337
constant to implement a proper version function. Depending on the specific
4338
plugin type, you might or might not need to link your plugin with
4338
plugin type, you might or might not need to link your plugin with
4339
<filename>src/sphinxudf.c</filename>. However, as of 2.2.2-beta all
4339
<filename>src/sphinxudf.cpp</filename>. However, as of 2.2.2-beta all
4340
the functions implemented in <filename>sphinxudf.c</filename> are about
4340
the functions implemented in <filename>sphinxudf.cpp</filename> are about
4341
unpacking the PACKEDFACTORS() blob, and no plugin types are exposed to that
4341
unpacking the PACKEDFACTORS() blob, and no plugin types are exposed to that
4342
kind of data. So currently, you would never need to link with the C-file,
4342
kind of data. So currently, you would never need to link with the C-file,
4343
just the header would be sufficient. (In fact, if you copy over the
4343
just the header would be sufficient. (In fact, if you copy over the
(-)a/src/CMakeLists.txt (-1 / +1 lines)
Lines 8-14 set (LIBSPHINX_SRCS sphinx.cpp sphinxexcerpt.cpp Link Here
8
		sphinxsort.cpp sphinxexpr.cpp sphinxfilter.cpp
8
		sphinxsort.cpp sphinxexpr.cpp sphinxfilter.cpp
9
		sphinxsearch.cpp sphinxrt.cpp sphinxjson.cpp
9
		sphinxsearch.cpp sphinxrt.cpp sphinxjson.cpp
10
		sphinxaot.cpp sphinxplugin.cpp
10
		sphinxaot.cpp sphinxplugin.cpp
11
		sphinxudf.c)
11
		sphinxudf.cpp)
12
set (INDEXER_SRCS indexer.cpp)
12
set (INDEXER_SRCS indexer.cpp)
13
set (INDEXTOOL_SRCS indextool.cpp)
13
set (INDEXTOOL_SRCS indextool.cpp)
14
set (SEARCHD_SRCS searchd.cpp)
14
set (SEARCHD_SRCS searchd.cpp)
(-)a/src/Makefile.am (-1 / +1 lines)
Lines 1-7 Link Here
1
SRC_SPHINX = sphinx.cpp sphinxexcerpt.cpp sphinxquery.cpp \
1
SRC_SPHINX = sphinx.cpp sphinxexcerpt.cpp sphinxquery.cpp \
2
	sphinxsoundex.cpp sphinxmetaphone.cpp sphinxstemen.cpp sphinxstemru.cpp sphinxstemcz.cpp sphinxstemar.cpp \
2
	sphinxsoundex.cpp sphinxmetaphone.cpp sphinxstemen.cpp sphinxstemru.cpp sphinxstemcz.cpp sphinxstemar.cpp \
3
	sphinxutils.cpp sphinxstd.cpp sphinxsort.cpp sphinxexpr.cpp sphinxfilter.cpp \
3
	sphinxutils.cpp sphinxstd.cpp sphinxsort.cpp sphinxexpr.cpp sphinxfilter.cpp \
4
	sphinxsearch.cpp sphinxrt.cpp sphinxjson.cpp sphinxudf.c sphinxaot.cpp sphinxplugin.cpp
4
	sphinxsearch.cpp sphinxrt.cpp sphinxjson.cpp sphinxudf.cpp sphinxaot.cpp sphinxplugin.cpp
5
5
6
noinst_LIBRARIES = libsphinx.a
6
noinst_LIBRARIES = libsphinx.a
7
libsphinx_a_SOURCES = $(SRC_SPHINX)
7
libsphinx_a_SOURCES = $(SRC_SPHINX)
(-)a/src/Makefile.in (-1 / +1 lines)
Lines 222-228 top_srcdir = @top_srcdir@ Link Here
222
SRC_SPHINX = sphinx.cpp sphinxexcerpt.cpp sphinxquery.cpp \
222
SRC_SPHINX = sphinx.cpp sphinxexcerpt.cpp sphinxquery.cpp \
223
	sphinxsoundex.cpp sphinxmetaphone.cpp sphinxstemen.cpp sphinxstemru.cpp sphinxstemcz.cpp sphinxstemar.cpp \
223
	sphinxsoundex.cpp sphinxmetaphone.cpp sphinxstemen.cpp sphinxstemru.cpp sphinxstemcz.cpp sphinxstemar.cpp \
224
	sphinxutils.cpp sphinxstd.cpp sphinxsort.cpp sphinxexpr.cpp sphinxfilter.cpp \
224
	sphinxutils.cpp sphinxstd.cpp sphinxsort.cpp sphinxexpr.cpp sphinxfilter.cpp \
225
	sphinxsearch.cpp sphinxrt.cpp sphinxjson.cpp sphinxudf.c sphinxaot.cpp sphinxplugin.cpp
225
	sphinxsearch.cpp sphinxrt.cpp sphinxjson.cpp sphinxudf.cpp sphinxaot.cpp sphinxplugin.cpp
226
226
227
noinst_LIBRARIES = libsphinx.a
227
noinst_LIBRARIES = libsphinx.a
228
libsphinx_a_SOURCES = $(SRC_SPHINX)
228
libsphinx_a_SOURCES = $(SRC_SPHINX)
(-)a/src/sphinxudf.c (-2 / +2 lines)
Lines 302-315 int sphinx_get_term_factor_int ( const unsigned int * in, enum sphinx_term_facto Link Here
302
float sphinx_get_field_factor_float ( const unsigned int * in, enum sphinx_field_factor f )
302
float sphinx_get_field_factor_float ( const unsigned int * in, enum sphinx_field_factor f )
303
{
303
{
304
	int r = sphinx_get_field_factor_int ( in, f );
304
	int r = sphinx_get_field_factor_int ( in, f );
305
	return *(float*)&r;
305
	return *reinterpret_cast<float*>(&r);
306
}
306
}
307
307
308
308
309
float sphinx_get_term_factor_float ( const unsigned int * in, enum sphinx_term_factor f )
309
float sphinx_get_term_factor_float ( const unsigned int * in, enum sphinx_term_factor f )
310
{
310
{
311
	int r = sphinx_get_term_factor_int ( in, f );
311
	int r = sphinx_get_term_factor_int ( in, f );
312
	return *(float*)&r;
312
	return *reinterpret_cast<float*>(&r);
313
}
313
}
314
314
315
//
315
//
(-)a/win/libsphinx12.vcxproj (-1 / +1 lines)
Lines 155-161 Link Here
155
    <ClCompile Include="..\src\sphinxstemcz.cpp" />
155
    <ClCompile Include="..\src\sphinxstemcz.cpp" />
156
    <ClCompile Include="..\src\sphinxstemen.cpp" />
156
    <ClCompile Include="..\src\sphinxstemen.cpp" />
157
    <ClCompile Include="..\src\sphinxstemru.cpp" />
157
    <ClCompile Include="..\src\sphinxstemru.cpp" />
158
    <ClCompile Include="..\src\sphinxudf.c" />
158
    <ClCompile Include="..\src\sphinxudf.cpp" />
159
    <ClCompile Include="..\src\sphinxutils.cpp" />
159
    <ClCompile Include="..\src\sphinxutils.cpp" />
160
  </ItemGroup>
160
  </ItemGroup>
161
  <ItemGroup>
161
  <ItemGroup>
(-)a/win/libsphinx13.vcxproj (-2 / +1 lines)
Lines 177-183 Link Here
177
    <ClCompile Include="..\src\sphinxstemcz.cpp" />
177
    <ClCompile Include="..\src\sphinxstemcz.cpp" />
178
    <ClCompile Include="..\src\sphinxstemen.cpp" />
178
    <ClCompile Include="..\src\sphinxstemen.cpp" />
179
    <ClCompile Include="..\src\sphinxstemru.cpp" />
179
    <ClCompile Include="..\src\sphinxstemru.cpp" />
180
    <ClCompile Include="..\src\sphinxudf.c" />
180
    <ClCompile Include="..\src\sphinxudf.cpp" />
181
    <ClCompile Include="..\src\sphinxutils.cpp" />
181
    <ClCompile Include="..\src\sphinxutils.cpp" />
182
  </ItemGroup>
182
  </ItemGroup>
183
  <ItemGroup>
183
  <ItemGroup>
184
- 

Return to bug 854738