summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port/gen/catgets.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libc/port/gen/catgets.c')
-rw-r--r--usr/src/lib/libc/port/gen/catgets.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/usr/src/lib/libc/port/gen/catgets.c b/usr/src/lib/libc/port/gen/catgets.c
index a0bdf7b9fb..d9f5a970e5 100644
--- a/usr/src/lib/libc/port/gen/catgets.c
+++ b/usr/src/lib/libc/port/gen/catgets.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * 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
* or http://www.opensolaris.org/os/licensing.
@@ -19,8 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -30,16 +30,16 @@
* catgets.c
*/
-#pragma weak catgets = _catgets
+#pragma weak _catgets = catgets
-#include "synonyms.h"
+#include "lint.h"
#include <sys/types.h>
#include <nl_types.h>
#include <errno.h>
#include "nlspath_checks.h"
char *
-_catgets(nl_catd catd_st, int set_id, int msg_id, const char *def_str)
+catgets(nl_catd catd_st, int set_id, int msg_id, const char *def_str)
{
int hi, lo, mid;
struct _cat_hdr *p;
@@ -54,7 +54,7 @@ _catgets(nl_catd catd_st, int set_id, int msg_id, const char *def_str)
}
if ((catd_st->__content == NULL) &&
- (catd_st->__size == 0) && (catd_st->__trust == 1)) {
+ (catd_st->__size == 0) && (catd_st->__trust == 1)) {
/* special message catalog descriptor for C locale */
return ((char *)def_str);
} else if ((catd_st->__content == NULL) || (catd_st->__size == 0)) {
@@ -75,33 +75,33 @@ _catgets(nl_catd catd_st, int set_id, int msg_id, const char *def_str)
while (hi >= lo) {
mid = (hi + lo) / 2;
q = (struct _cat_set_hdr *)
- ((uintptr_t)catd
- + _CAT_HDR_SIZE
- + _CAT_SET_HDR_SIZE * mid);
+ ((uintptr_t)catd
+ + _CAT_HDR_SIZE
+ + _CAT_SET_HDR_SIZE * mid);
if (q->__set_no == set_id) {
lo = q->__first_msg_hdr;
hi = lo + q->__nmsgs - 1;
while (hi >= lo) {
mid = (hi + lo) / 2;
r = (struct _cat_msg_hdr *)
- ((uintptr_t)catd
- + _CAT_HDR_SIZE
- + p->__msg_hdr_offset
- + _CAT_MSG_HDR_SIZE * mid);
+ ((uintptr_t)catd
+ + _CAT_HDR_SIZE
+ + p->__msg_hdr_offset
+ + _CAT_MSG_HDR_SIZE * mid);
if (r->__msg_no == msg_id) {
char *msg = (char *)catd
- + _CAT_HDR_SIZE
- + p->__msg_text_offset
- + r->__msg_offset;
+ + _CAT_HDR_SIZE
+ + p->__msg_text_offset
+ + r->__msg_offset;
if (!catd_st->__trust) {
- int errno_save = errno;
- char *cmsg = check_format(
- def_str, msg, 0);
+ int errno_save = errno;
+ char *cmsg = check_format(
+ def_str, msg, 0);
if (cmsg == def_str) {
/* security */
return ((char *)
- def_str);
+ def_str);
} else {
errno = errno_save;
return (msg);