Coverage Report

Created: 2026-08-31 07:43

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libevtx/libevtx/libevtx_i18n.c
Line
Count
Source
1
/*
2
 * Internationalization (i18n) functions
3
 *
4
 * Copyright (C) 2011-2026, Joachim Metz <joachim.metz@gmail.com>
5
 *
6
 * Refer to AUTHORS for acknowledgements.
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Lesser General Public License as published by
10
 * the Free Software Foundation, either version 3 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Lesser General Public License
19
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
 */
21
22
#include <common.h>
23
#include <types.h>
24
25
#if defined( HAVE_LIBINTL_H )
26
#include <libintl.h>
27
#endif
28
29
#include "libevtx_i18n.h"
30
#include "libevtx_libcerror.h"
31
32
static int libevtx_i18n_initialized = 0;
33
34
/* Initializes library internationalization functions
35
 */
36
int libevtx_i18n_initialize(
37
     libcerror_error_t **error )
38
3.21k
{
39
3.21k
  static char *function = "libevtx_i18n_initialize";
40
41
3.21k
  if( libevtx_i18n_initialized == 0 )
42
2
  {
43
2
#if defined( ENABLE_NLS ) && !defined( WINAPI )
44
2
#if defined( HAVE_BINDTEXTDOMAIN ) && defined( LOCALEDIR )
45
2
    if( bindtextdomain(
46
2
         "libevtx",
47
2
         LOCALEDIR ) == NULL )
48
0
    {
49
0
      libcerror_error_set(
50
0
       error,
51
0
       LIBCERROR_ERROR_DOMAIN_RUNTIME,
52
0
       LIBCERROR_RUNTIME_ERROR_SET_FAILED,
53
0
       "%s: unable to bind text domain.",
54
0
       function );
55
56
0
      return( -1 );
57
0
    }
58
2
#endif /* defined( HAVE_BINDTEXTDOMAIN ) && defined( LOCALEDIR ) */
59
2
#endif /* defined( ENABLE_NLS ) && !defined( WINAPI ) */
60
61
2
    libevtx_i18n_initialized = 1;
62
2
  }
63
3.21k
  return( 1 );
64
3.21k
}
65