/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21#pragma prototyped2223/*24* machine independent binary message catalog interface25*26* file layout27* all numbers are sfputu() format28*29* 4 char magic (^M^S^G0)30* <method locale YYYY-MM-DD>\031* (<optional strings>\0)*32* \033* string table size34* #msgs total35* #max set number36* #set-id 137* #msgs in set 138* ...39* #set-id #sets40* #msgs in set #sets41* end of sets (0)42* msg(1,1) size43* ...44* msg(#sets,#msgs) size45* string table46*/4748#ifndef _MC_H49#define _MC_H5051#include <ast.h>5253#define MC_MAGIC "\015\023\007\000"54#define MC_MAGIC_SIZE 45556#define MC_SET_MAX 102357#define MC_NUM_MAX 327675859#define MC_NLS (1<<10)6061#define MC_MESSAGE_SET(s) mcindex(s,NiL,NiL,NiL)6263typedef struct Mcset_s64{65char** msg;66int num;67int gen;68} Mcset_t;6970typedef struct Mc_s71{72Mcset_t* set;73int num;74int gen;75char* translation;76#ifdef _MC_PRIVATE_77_MC_PRIVATE_78#endif79} Mc_t;8081#if _BLD_ast && defined(__EXPORT__)82#define extern __EXPORT__83#endif8485extern char* mcfind(const char*, const char*, int, int, char*, size_t);86extern Mc_t* mcopen(Sfio_t*);87extern char* mcget(Mc_t*, int, int, const char*);88extern int mcput(Mc_t*, int, int, const char*);89extern int mcdump(Mc_t*, Sfio_t*);90extern int mcindex(const char*, char**, int*, int*);91extern int mcclose(Mc_t*);9293#undef extern9495#endif969798