naev 0.11.5
msgcat.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
7#include <stdint.h>
10typedef struct msgcat {
11 const void *map;
12 size_t map_size;
13 const char *plural_rule;
14 uint64_t nplurals;
15} msgcat_t;
16
17void msgcat_init( msgcat_t* p, const void* map, size_t map_size );
18const char* msgcat_ngettext( const msgcat_t* p, const char* msgid1, const char* msgid2, uint64_t n );
19uint32_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:101
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:59
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:169
const void * map
Definition msgcat.h:11
uint64_t nplurals
Definition msgcat.h:14
size_t map_size
Definition msgcat.h:12
const char * plural_rule
Definition msgcat.h:13