Deleted Added
full compact
msgcat.c (65323) msgcat.c (65324)
1/* $FreeBSD: head/lib/libc/nls/msgcat.c 65323 2000-09-01 11:56:31Z phantom $ */
1/* $FreeBSD: head/lib/libc/nls/msgcat.c 65324 2000-09-01 12:10:59Z phantom $ */
2
3/***********************************************************
4Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
5
6 All Rights Reserved
7
8Permission to use, copy, modify, and distribute this software and its
9documentation for any purpose and without fee is hereby granted,

--- 68 unchanged lines hidden (view full) ---

78#define FD_CLOEXEC 1
79#endif
80
81#define NLERR ((nl_catd) -1)
82
83static nl_catd loadCat();
84static int loadSet();
85
2
3/***********************************************************
4Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
5
6 All Rights Reserved
7
8Permission to use, copy, modify, and distribute this software and its
9documentation for any purpose and without fee is hereby granted,

--- 68 unchanged lines hidden (view full) ---

78#define FD_CLOEXEC 1
79#endif
80
81#define NLERR ((nl_catd) -1)
82
83static nl_catd loadCat();
84static int loadSet();
85
86nl_catd _catopen( name, type)
86nl_catd catopen( name, type)
87__const char *name;
88int type;
89{
90 char path[MAXPATHLEN];
91 __const char *catpath = NULL;
92 char *nlspath;
93 char *lang;
94 char *base, *cptr, *pathP;

--- 164 unchanged lines hidden (view full) ---

259 }
260 if (lo >= hi) return(NULL);
261 if (hi - lo == 1) cur += dir;
262 else cur += ((hi - lo) / 2) * dir;
263 }
264 return(msg);
265}
266
87__const char *name;
88int type;
89{
90 char path[MAXPATHLEN];
91 __const char *catpath = NULL;
92 char *nlspath;
93 char *lang;
94 char *base, *cptr, *pathP;

--- 164 unchanged lines hidden (view full) ---

259 }
260 if (lo >= hi) return(NULL);
261 if (hi - lo == 1) cur += dir;
262 else cur += ((hi - lo) / 2) * dir;
263 }
264 return(msg);
265}
266
267char *_catgets( catd, setId, msgId, dflt)
267char *catgets( catd, setId, msgId, dflt)
268nl_catd catd;
269int setId;
270int msgId;
271__const char *dflt;
272{
273 MCMsgT *msg;
274 MCCatT *cat = (MCCatT *) catd;
275 __const char *cptr;
276
277 if (catd == NULL || catd == NLERR)
278 return((char *)dflt);
279 msg = MCGetMsg(MCGetSet(cat, setId), msgId);
280 if (msg) cptr = msg->msg.str;
281 else cptr = dflt;
282 return((char *)cptr);
283}
284
285
268nl_catd catd;
269int setId;
270int msgId;
271__const char *dflt;
272{
273 MCMsgT *msg;
274 MCCatT *cat = (MCCatT *) catd;
275 __const char *cptr;
276
277 if (catd == NULL || catd == NLERR)
278 return((char *)dflt);
279 msg = MCGetMsg(MCGetSet(cat, setId), msgId);
280 if (msg) cptr = msg->msg.str;
281 else cptr = dflt;
282 return((char *)cptr);
283}
284
285
286int _catclose( catd)
286int catclose( catd)
287nl_catd catd;
288{
289 MCCatT *cat = (MCCatT *) catd;
290 MCSetT *set;
291 int i;
292
293 if (catd == NULL || catd == NLERR) {
294 errno = EBADF;

--- 168 unchanged lines hidden ---
287nl_catd catd;
288{
289 MCCatT *cat = (MCCatT *) catd;
290 MCSetT *set;
291 int i;
292
293 if (catd == NULL || catd == NLERR) {
294 errno = EBADF;

--- 168 unchanged lines hidden ---