naev 0.12.6
msgcat.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
7#include <stddef.h>
8#include <stdint.h>
10
11typedef struct msgcat {
12 const void
13 *map;
14 size_t map_size;
15 const char *plural_rule;
17 uint64_t nplurals;
19} msgcat_t;
20
21void msgcat_init( msgcat_t *p, const void *map, size_t map_size );
22const char *msgcat_ngettext( const msgcat_t *p, const char *msgid1,
23 const char *msgid2, uint64_t n );
24uint32_t msgcat_nstringsFromHeader( const char buf[12] );
const char * msgcat_ngettext(const msgcat_t *p, const char *msgid1, const char *msgid2, uint64_t n)
Return a translation, if present, from the given message catalog.
Definition msgcat.c:98
void msgcat_init(msgcat_t *p, const void *map, size_t map_size)
Initialize a msgcat_t, given the contents and content-length of a .mo file.
Definition msgcat.c:56
uint32_t msgcat_nstringsFromHeader(const char buf[12])
Return the number of strings in a message catalog, given its first 12 bytes.
Definition msgcat.c:166
const void * map
Definition msgcat.h:13
uint64_t nplurals
Definition msgcat.h:17
size_t map_size
Definition msgcat.h:14
const char * plural_rule
Definition msgcat.h:15