src, test: rename s/uchardet_get_candidates/uchardet_get_n_candidates/.

This was badly named as this function does not return candidates, but
the number of candidates (to be actually used in other API).
This commit is contained in:
Jehan 2022-12-13 23:45:22 +01:00
parent a916fb1c56
commit 908f9b8ba7
5 changed files with 15 additions and 15 deletions

View File

@ -6,7 +6,7 @@ set(
uchardet_data_end
uchardet_reset
uchardet_get_charset
uchardet_get_candidates
uchardet_get_n_candidates
uchardet_get_encoding
uchardet_get_confidence
uchardet_get_language

View File

@ -67,7 +67,7 @@ static void detect(uchardet_t handle,
if (verbose)
{
size_t candidates = uchardet_get_candidates(handle);
size_t candidates = uchardet_get_n_candidates(handle);
size_t i;
printf("\n");

View File

@ -237,7 +237,7 @@ const char* uchardet_get_charset(uchardet_t ud)
return reinterpret_cast<HandleUniversalDetector*>(ud)->GetCharset(0);
}
size_t uchardet_get_candidates (uchardet_t ud)
size_t uchardet_get_n_candidates (uchardet_t ud)
{
return reinterpret_cast<HandleUniversalDetector*>(ud)->GetCandidates();
}

View File

@ -112,10 +112,10 @@ UCHARDET_INTERFACE void uchardet_reset(uchardet_t ud);
* @param ud [in] handle of an instance of uchardet
* @return name of charset on success and "" on failure.
*/
DEPRECATED("use uchardet_get_candidates() and uchardet_get_encoding() instead (since 0.1.0)")
DEPRECATED("use uchardet_get_n_candidates() and uchardet_get_encoding() instead (since 0.1.0)")
UCHARDET_INTERFACE const char * uchardet_get_charset(uchardet_t ud);
UCHARDET_INTERFACE size_t uchardet_get_candidates (uchardet_t ud);
UCHARDET_INTERFACE size_t uchardet_get_n_candidates (uchardet_t ud);
UCHARDET_INTERFACE float uchardet_get_confidence (uchardet_t ud,
size_t candidate);
UCHARDET_INTERFACE const char * uchardet_get_encoding (uchardet_t ud,

View File

@ -94,7 +94,7 @@ detect(FILE *fp,
*lang == NULL ||
strcmp(expected_lang, *lang) != 0)
{
size_t n_candidates = uchardet_get_candidates(handle);
size_t n_candidates = uchardet_get_n_candidates(handle);
*expected_confidence = 0.0f;
*expected_candidate = SIZE_MAX;