src/util/formatting.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef FORMATTING_H
7#define FORMATTING_H
8
9#include "util/common.h"
10
11#include "locale.h"
12
13#if defined(__APPLE__) || defined(__FreeBSD__)
14#include "xlocale.h"
15#elif !defined(HAVE_LOCALE)
16typedef const char* locale_t;
17#endif
18
19int ftostr_l(char* restrict str, size_t size, float f, locale_t locale);
20
21#ifndef HAVE_STRTOF_L
22float strtof_l(const char* restrict str, char** restrict end, locale_t locale);
23#endif
24
25int ftostr_u(char* restrict str, size_t size, float f);
26float strtof_u(const char* restrict str, char** restrict end);
27
28#ifndef HAVE_LOCALTIME_R
29struct tm* localtime_r(const time_t* timep, struct tm* result);
30#endif
31
32#endif