gettxt.c revision e53d4db11f7999d0e42405e94c04e1c2e54be0b5
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#include "synonyms.h"
#include "libc.h"
#include <mtlib.h>
#include <ctype.h>
#include <string.h>
#include <locale.h>
#include <fcntl.h>
#include <pfmt.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <thread.h>
#include "../i18n/_locale.h"
#include "../i18n/_loc_path.h"
#define MESSAGES "/LC_MESSAGES/"
#define DB_NAME_LEN 15
#define handle_return(s) \
extern char cur_cat[];
extern rwlock_t _rw_cur_cat;
static const char *not_found = "Message not found!!\n";
static const char *loc_C = "C";
struct db_list {
};
struct db_cache {
char *loc;
};
char *
{
int msgnum; /* message number */
int fd;
void *addr;
char *tokp;
char *curloc;
return (handle_return(dflt_str));
}
/* parse msg_id */
return (handle_return(dflt_str));
return (handle_return(dflt_str));
if (name_len > 0) {
} else {
return (handle_return(dflt_str));
}
/*
* We know the following strcpy is safe.
*/
}
while (*++tokp) {
return (handle_return(dflt_str));
}
while (dbc) {
while (dbl) {
/* msgfile found */
goto msgfile_found;
}
}
/* not found */
break;
}
}
/* new locale */
return (handle_return(dflt_str));
}
return (handle_return(dflt_str));
}
/* connect dbc to the dbc list */
}
return (handle_return(dflt_str));
}
sizeof (pathname)) {
return (handle_return(dflt_str));
}
fd, 0L)) == MAP_FAILED) {
if (fd != -1)
return (handle_return(dflt_str));
}
/* Change locale to C */
goto try_C;
}
/* save file name, memory address, fd and size */
/* connect dbl to the dbc->info list */
/* check if msgnum out of domain */
return (handle_return(dflt_str));
/* return pointer to message */
}