+Sat Nov 25 02:48:47 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu>
+
+ * assert/assert-perr.c, assert/assert.c, inet/rcmd.c,
+ malloc/mcheck.c, malloc/vm-limit.c, posix/getconf.c, posix/id.c,
+ resolv/herror.c, sunrpc/auth_unix.c, sunrpc/clnt_perr.c,
+ sunrpc/clnt_raw.c, sunrpc/get_myaddr.c, sunrpc/pmap_clnt.c,
+ sunrpc/pmap_rmt.c, sunrpc/portmap.c, sunrpc/rpc_main.c,
+ sunrpc/rpc_parse.c, sunrpc/rpc_scan.c, sunrpc/rpc_util.c,
+ sunrpc/rpcinfo.c, sunrpc/svc_simple.c, sunrpc/svc_tcp.c,
+ sunrpc/svc_udp.c, time/zdump.c, time/zic.c: Mark translatable
+ strings.
+
Sun Nov 26 02:00:02 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu>
* misc/syslog.c (vsyslog) [USE_IN_LIBIO]: Adapted for libio.
#endif
/* Print the message. */
- (void) fprintf (stderr, "%s%s%s:%u: %s%sUnexpected error: %s.\n",
+ (void) fprintf (stderr, _("%s%s%s:%u: %s%sUnexpected error: %s.\n"),
__assert_program_name ? __assert_program_name : "",
__assert_program_name ? ": " : "",
file, line,
void
DEFUN(__assert_fail, (assertion, file, line, function),
CONST char *assertion AND
- CONST char *file AND unsigned int line AND CONST char *function)
+ CONST char *file AND unsigned int line AND CONST char *function)
{
#ifdef FATAL_PREPARE
FATAL_PREPARE;
#endif
/* Print the message. */
- (void) fprintf (stderr, "%s%s%s:%u: %s%sAssertion `%s' failed.\n",
+ (void) fprintf (stderr, _("%s%s%s:%u: %s%sAssertion `%s' failed.\n"),
__assert_program_name ? __assert_program_name : "",
__assert_program_name ? ": " : "",
file, line,
if (s < 0) {
if (errno == EAGAIN)
(void)fprintf(stderr,
- "rcmd: socket: All ports in use\n");
+ _("rcmd: socket: All ports in use\n"));
else
(void)fprintf(stderr, "rcmd: socket: %s\n",
strerror(errno));
if (hp->h_addr_list[1] != NULL) {
int oerrno = errno;
- (void)fprintf(stderr, "connect to address %s: ",
+ (void)fprintf(stderr, _("connect to address %s: "),
inet_ntoa(sin.sin_addr));
errno = oerrno;
perror(0);
hp->h_addr_list++;
bcopy(hp->h_addr_list[0], &sin.sin_addr, hp->h_length);
- (void)fprintf(stderr, "Trying %s...\n",
+ (void)fprintf(stderr, _("Trying %s...\n"),
inet_ntoa(sin.sin_addr));
continue;
}
(void)snprintf(num, sizeof(num), "%d", lport);
if (write(s, num, strlen(num)+1) != strlen(num)+1) {
(void)fprintf(stderr,
- "rcmd: write (setting up stderr): %s\n",
+ _("rcmd: write (setting up stderr): %s\n"),
strerror(errno));
(void)close(s2);
goto bad;
!FD_ISSET(s2, &reads)) {
if (errno != 0)
(void)fprintf(stderr,
- "rcmd: select (setting up stderr): %s\n",
- strerror(errno));
+ _("rcmd: select (setting up stderr): %s\n"),
+ strerror(errno));
else
(void)fprintf(stderr,
- "select: protocol failure in circuit setup\n");
+ _("select: protocol failure in circuit setup\n"));
(void)close(s2);
goto bad;
}
from.sin_port >= IPPORT_RESERVED ||
from.sin_port < IPPORT_RESERVED / 2) {
(void)fprintf(stderr,
- "socket: protocol failure in circuit setup.\n");
+ _("socket: protocol failure in circuit setup.\n"));
goto bad2;
}
}
*/
cp = NULL;
if (lstat(pbuf, &sbuf) < 0)
- cp = ".rhosts lstat failed";
+ cp = _(".rhosts lstat failed");
else if (!S_ISREG(sbuf.st_mode))
- cp = ".rhosts not regular file";
+ cp = _(".rhosts not regular file");
else if (fstat(fileno(hostf), &sbuf) < 0)
- cp = ".rhosts fstat failed";
+ cp = _(".rhosts fstat failed");
else if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid)
- cp = "bad .rhosts owner";
+ cp = _("bad .rhosts owner");
else if (sbuf.st_mode & (S_IWGRP|S_IWOTH))
- cp = ".rhosts writeable by other than owner";
+ cp = _(".rhosts writeable by other than owner");
/* If there were any problems, quit. */
if (cp) {
__rcmd_errstr = cp;
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
static void
DEFUN_VOID(usage)
{
- fprintf (stderr, "Usage: %s variable_name [pathname]\n", program);
+ fprintf (stderr, _("Usage: %s variable_name [pathname]\n"), program);
exit (2);
}
}
}
- fprintf (stderr, "%s: Unrecognized variable `%s'\n", program, argv[1]);
+ fprintf (stderr, _("%s: Unrecognized variable `%s'\n"), program, argv[1]);
exit (2);
}
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
return;
else
{
- fprintf(stderr, "Couldn't find name for group %d\n", id);
+ fprintf(stderr, _("Couldn't find name for group %d\n"), id);
exit(EXIT_FAILURE);
}
}
return;
else
{
- fprintf(stderr, "Couldn't find name for user %d\n", (int) id);
+ fprintf(stderr, _("Couldn't find name for user %d\n"), (int) id);
exit(EXIT_FAILURE);
}
}
if (error || argc != optind)
{
- fputs("Usage: id [-gurn]\n", stderr);
+ fputs(_("Usage: id [-gurn]\n"), stderr);
exit(EXIT_FAILURE);
}
* -
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* SUCH DAMAGE.
* -
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
- *
+ *
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
#endif
const char *h_errlist[] = {
- "Resolver Error 0 (no error)",
- "Unknown host", /* 1 HOST_NOT_FOUND */
- "Host name lookup failure", /* 2 TRY_AGAIN */
- "Unknown server error", /* 3 NO_RECOVERY */
- "No address associated with name", /* 4 NO_ADDRESS */
+ N_("Resolver Error 0 (no error)"),
+ N_("Unknown host"), /* 1 HOST_NOT_FOUND */
+ N_("Host name lookup failure"), /* 2 TRY_AGAIN */
+ N_("Unknown server error"), /* 3 NO_RECOVERY */
+ N_("No address associated with name"), /* 4 NO_ADDRESS */
};
int h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
int err;
{
if (err < 0)
- return ("Resolver internal error");
+ return _("Resolver internal error");
else if (err < h_nerr)
- return (h_errlist[err]);
- return ("Unknown resolver error");
+ return _(h_errlist[err]);
+ return _("Unknown resolver error");
}
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
#endif
/*
- * auth_unix.c, Implements UNIX style authentication parameters.
- *
+ * auth_unix.c, Implements UNIX style authentication parameters.
+ *
* Copyright (C) 1984, Sun Microsystems, Inc.
*
* The system is very weak. The client uses no encryption for it's
* Serialize the parameters into origcred
*/
xdrmem_create(&xdrs, mymem, MAX_AUTH_BYTES, XDR_ENCODE);
- if (! xdr_authunix_parms(&xdrs, &aup))
+ if (! xdr_authunix_parms(&xdrs, &aup))
abort();
au->au_origcred.oa_length = len = XDR_GETPOS(&xdrs);
au->au_origcred.oa_flavor = AUTH_UNIX;
xdrmem_create(&xdrs, au->au_origcred.oa_base,
au->au_origcred.oa_length, XDR_DECODE);
stat = xdr_authunix_parms(&xdrs, &aup);
- if (! stat)
+ if (! stat)
goto done;
/* update the time and serialize in place */
xdrmem_create(xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE);
if ((! xdr_opaque_auth(xdrs, &(auth->ah_cred))) ||
(! xdr_opaque_auth(xdrs, &(auth->ah_verf)))) {
- perror("auth_none.c - Fatal marshalling problem");
+ perror(_("auth_none.c - Fatal marshalling problem"));
} else {
au->au_mpos = XDR_GETPOS(xdrs);
}
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
return (0);
CLNT_GETERR(rpch, &e);
- (void) sprintf(str, "%s: ", s);
+ (void) sprintf(str, "%s: ", s);
str += strlen(str);
- (void) strcpy(str, clnt_sperrno(e.re_status));
+ (void) strcpy(str, clnt_sperrno(e.re_status));
str += strlen(str);
switch (e.re_status) {
case RPC_SUCCESS:
case RPC_CANTENCODEARGS:
case RPC_CANTDECODERES:
- case RPC_TIMEDOUT:
+ case RPC_TIMEDOUT:
case RPC_PROGUNAVAIL:
case RPC_PROCUNAVAIL:
case RPC_CANTDECODEARGS:
case RPC_CANTSEND:
case RPC_CANTRECV:
(void) sprintf(str, "; errno = %s",
- sys_errlist[e.re_errno]);
+ sys_errlist[e.re_errno]);
str += strlen(str);
break;
case RPC_VERSMISMATCH:
(void) sprintf(str,
- "; low version = %lu, high version = %lu",
+ _("; low version = %lu, high version = %lu"),
e.re_vers.low, e.re_vers.high);
str += strlen(str);
break;
case RPC_AUTHERROR:
err = auth_errmsg(e.re_why);
- (void) sprintf(str,"; why = ");
+ (void) sprintf(str,_("; why = "));
str += strlen(str);
if (err != NULL) {
(void) sprintf(str, "%s",err);
} else {
(void) sprintf(str,
- "(unknown authentication error - %d)",
+ _("(unknown authentication error - %d)"),
(int) e.re_why);
}
str += strlen(str);
break;
case RPC_PROGVERSMISMATCH:
- (void) sprintf(str,
- "; low version = %lu, high version = %lu",
+ (void) sprintf(str,
+ _("; low version = %lu, high version = %lu"),
e.re_vers.low, e.re_vers.high);
str += strlen(str);
break;
default: /* unknown */
- (void) sprintf(str,
- "; s1 = %lu, s2 = %lu",
+ (void) sprintf(str,
+ "; s1 = %lu, s2 = %lu",
e.re_lb.s1, e.re_lb.s2);
str += strlen(str);
break;
};
static struct rpc_errtab rpc_errlist[] = {
- { RPC_SUCCESS,
- "RPC: Success" },
- { RPC_CANTENCODEARGS,
- "RPC: Can't encode arguments" },
- { RPC_CANTDECODERES,
- "RPC: Can't decode result" },
- { RPC_CANTSEND,
- "RPC: Unable to send" },
- { RPC_CANTRECV,
- "RPC: Unable to receive" },
- { RPC_TIMEDOUT,
- "RPC: Timed out" },
- { RPC_VERSMISMATCH,
- "RPC: Incompatible versions of RPC" },
- { RPC_AUTHERROR,
- "RPC: Authentication error" },
- { RPC_PROGUNAVAIL,
- "RPC: Program unavailable" },
- { RPC_PROGVERSMISMATCH,
- "RPC: Program/version mismatch" },
- { RPC_PROCUNAVAIL,
- "RPC: Procedure unavailable" },
- { RPC_CANTDECODEARGS,
- "RPC: Server can't decode arguments" },
- { RPC_SYSTEMERROR,
- "RPC: Remote system error" },
- { RPC_UNKNOWNHOST,
- "RPC: Unknown host" },
+ { RPC_SUCCESS,
+ N_("RPC: Success") },
+ { RPC_CANTENCODEARGS,
+ N_("RPC: Can't encode arguments") },
+ { RPC_CANTDECODERES,
+ N_("RPC: Can't decode result") },
+ { RPC_CANTSEND,
+ N_("RPC: Unable to send") },
+ { RPC_CANTRECV,
+ N_("RPC: Unable to receive") },
+ { RPC_TIMEDOUT,
+ N_("RPC: Timed out") },
+ { RPC_VERSMISMATCH,
+ N_("RPC: Incompatible versions of RPC") },
+ { RPC_AUTHERROR,
+ N_("RPC: Authentication error") },
+ { RPC_PROGUNAVAIL,
+ N_("RPC: Program unavailable") },
+ { RPC_PROGVERSMISMATCH,
+ N_("RPC: Program/version mismatch") },
+ { RPC_PROCUNAVAIL,
+ N_("RPC: Procedure unavailable") },
+ { RPC_CANTDECODEARGS,
+ N_("RPC: Server can't decode arguments") },
+ { RPC_SYSTEMERROR,
+ N_("RPC: Remote system error") },
+ { RPC_UNKNOWNHOST,
+ N_("RPC: Unknown host") },
{ RPC_UNKNOWNPROTO,
- "RPC: Unknown protocol" },
- { RPC_PMAPFAILURE,
- "RPC: Port mapper failure" },
- { RPC_PROGNOTREGISTERED,
- "RPC: Program not registered"},
- { RPC_FAILED,
- "RPC: Failed (unspecified error)"}
+ N_("RPC: Unknown protocol") },
+ { RPC_PMAPFAILURE,
+ N_("RPC: Port mapper failure") },
+ { RPC_PROGNOTREGISTERED,
+ N_("RPC: Program not registered") },
+ { RPC_FAILED,
+ N_("RPC: Failed (unspecified error)") }
};
for (i = 0; i < sizeof(rpc_errlist)/sizeof(struct rpc_errtab); i++) {
if (rpc_errlist[i].status == stat) {
- return (rpc_errlist[i].message);
+ return _(rpc_errlist[i].message);
}
}
- return ("RPC: (unknown error code)");
+ return _("RPC: (unknown error code)");
}
void
(void) strcat(str,
sys_errlist[rpc_createerr.cf_error.re_errno]);
else
- (void) sprintf(&str[strlen(str)], "Error %d",
+ (void) sprintf(&str[strlen(str)], _("Error %d"),
rpc_createerr.cf_error.re_errno);
break;
}
}
struct auth_errtab {
- enum auth_stat status;
+ enum auth_stat status;
char *message;
};
static struct auth_errtab auth_errlist[] = {
{ AUTH_OK,
- "Authentication OK" },
+ N_("Authentication OK") },
{ AUTH_BADCRED,
- "Invalid client credential" },
+ N_("Invalid client credential") },
{ AUTH_REJECTEDCRED,
- "Server rejected credential" },
+ N_("Server rejected credential") },
{ AUTH_BADVERF,
- "Invalid client verifier" },
+ N_("Invalid client verifier") },
{ AUTH_REJECTEDVERF,
- "Server rejected verifier" },
+ N_("Server rejected verifier") },
{ AUTH_TOOWEAK,
- "Client credential too weak" },
+ N_("Client credential too weak") },
{ AUTH_INVALIDRESP,
- "Invalid server verifier" },
+ N_("Invalid server verifier") },
{ AUTH_FAILED,
- "Failed (unspecified error)" },
+ N_("Failed (unspecified error)") },
};
static char *
for (i = 0; i < sizeof(auth_errlist)/sizeof(struct auth_errtab); i++) {
if (auth_errlist[i].status == stat) {
- return(auth_errlist[i].message);
+ return _(auth_errlist[i].message);
}
}
return(NULL);
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
call_msg.rm_call.cb_rpcvers = RPC_MSG_VERSION;
call_msg.rm_call.cb_prog = prog;
call_msg.rm_call.cb_vers = vers;
- xdrmem_create(xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE);
+ xdrmem_create(xdrs, clp->mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE);
if (! xdr_callhdr(xdrs, &call_msg)) {
- perror("clnt_raw.c - Fatal header serialization error.");
+ perror(_("clnt_raw.c - Fatal header serialization error."));
}
clp->mcnt = XDR_GETPOS(xdrs);
XDR_DESTROY(xdrs);
return (client);
}
-static enum clnt_stat
+static enum clnt_stat
clntraw_call(h, proc, xargs, argsp, xresults, resultsp, timeout)
CLIENT *h;
u_long proc;
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
#include <netinet/in.h>
#include <arpa/inet.h>
-/*
+/*
* don't use gethostbyname, which would invoke yellow pages
*/
get_myaddress(addr)
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
- perror("get_myaddress: ioctl (get interface configuration)");
+ perror(
+ _("get_myaddress: ioctl (get interface configuration)"));
exit(1);
}
ifr = ifc.ifc_req;
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
parms.pm_port = port;
if (CLNT_CALL(client, PMAPPROC_SET, xdr_pmap, &parms, xdr_bool, &rslt,
tottimeout) != RPC_SUCCESS) {
- clnt_perror(client, "Cannot register service");
+ clnt_perror(client, _("Cannot register service"));
return (FALSE);
}
CLNT_DESTROY(client);
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
/*
* The following is kludged-up support for simple rpc broadcasts.
- * Someday a large, complicated system will replace these trivial
+ * Someday a large, complicated system will replace these trivial
* routines which only support udp/ip .
*/
ifc.ifc_len = UDPMSGSIZE;
ifc.ifc_buf = buf;
if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
- perror("broadcast: ioctl (get interface configuration)");
+ perror(_("broadcast: ioctl (get interface configuration)"));
return (0);
}
ifr = ifc.ifc_req;
for (i = 0, n = ifc.ifc_len/sizeof (struct ifreq); n > 0; n--, ifr++) {
ifreq = *ifr;
if (ioctl(sock, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
- perror("broadcast: ioctl (get interface flags)");
+ perror(_("broadcast: ioctl (get interface flags)"));
continue;
}
if ((ifreq.ifr_flags & IFF_BROADCAST) &&
typedef bool_t (*resultproc_t)();
-enum clnt_stat
+enum clnt_stat
clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
u_long prog; /* program number */
u_long vers; /* version number */
struct rmtcallargs a;
struct rmtcallres r;
struct rpc_msg msg;
- struct timeval t;
+ struct timeval t;
char outbuf[MAX_BROADCAST_SIZE], inbuf[UDPMSGSIZE];
/*
* preserialize the arguments into a send buffer.
*/
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
- perror("Cannot create socket for broadcast rpc");
+ perror(_("Cannot create socket for broadcast rpc"));
stat = RPC_CANTSEND;
goto done_broad;
}
#ifdef SO_BROADCAST
if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &on, sizeof (on)) < 0) {
- perror("Cannot set socket option SO_BROADCAST");
+ perror(_("Cannot set socket option SO_BROADCAST"));
stat = RPC_CANTSEND;
goto done_broad;
}
if (sendto(sock, outbuf, outlen, 0,
(struct sockaddr *)&baddr,
sizeof (struct sockaddr)) != outlen) {
- perror("Cannot send broadcast packet");
+ perror(_("Cannot send broadcast packet"));
stat = RPC_CANTSEND;
goto done_broad;
}
msg.acpted_rply.ar_results.where = (caddr_t)&r;
msg.acpted_rply.ar_results.proc = xdr_rmtcallres;
readfds = mask;
- switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
+ switch (select(_rpc_dtablesize(), &readfds, (int *)NULL,
(int *)NULL, &t)) {
case 0: /* timed out */
case -1: /* some kind of error */
if (errno == EINTR)
goto recv_again;
- perror("Broadcast select problem");
+ perror(_("Broadcast select problem"));
stat = RPC_CANTRECV;
goto done_broad;
if (inlen < 0) {
if (errno == EINTR)
goto try_again;
- perror("Cannot receive reply to broadcast");
+ perror(_("Cannot receive reply to broadcast"));
stat = RPC_CANTRECV;
goto done_broad;
}
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
}
#endif
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
- perror("portmap cannot create socket");
+ perror(_("portmap cannot create socket"));
exit(1);
}
addr.sin_family = AF_INET;
addr.sin_port = htons(PMAPPORT);
if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
- perror("portmap cannot bind");
+ perror(_("portmap cannot bind"));
exit(1);
}
if ((xprt = svcudp_create(sock)) == (SVCXPRT *)NULL) {
- fprintf(stderr, "couldn't do udp_create\n");
+ fprintf(stderr, _("couldn't do udp_create\n"));
exit(1);
}
/* make an entry for ourself */
pmaplist = pml;
if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
- perror("portmap cannot create socket");
+ perror(_("portmap cannot create socket"));
exit(1);
}
if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
- perror("portmap cannot bind");
+ perror(_("portmap cannot bind"));
exit(1);
}
if ((xprt = svctcp_create(sock, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE))
== (SVCXPRT *)NULL) {
- fprintf(stderr, "couldn't do tcp_create\n");
+ fprintf(stderr, _("couldn't do tcp_create\n"));
exit(1);
}
/* make an entry for ourself */
(void)signal(SIGCHLD, reap);
svc_run();
- fprintf(stderr, "run_svc returned unexpectedly\n");
+ fprintf(stderr, _("run_svc returned unexpectedly\n"));
abort();
}
return (hit);
}
-/*
+/*
* 1 OK, 0 not
*/
reg_service(rqstp, xprt)
struct pmaplist *pml, *prevpml, *fnd;
int ans, port;
caddr_t t;
-
+
#ifdef DEBUG
fprintf(stderr, "server: about do a switch\n");
#endif
goto done;
}
} else {
- /*
+ /*
* add to END of list
*/
pml = (struct pmaplist *)
* Calls a procedure on the local machine. If the requested
* procedure is not registered this procedure does not return
* error information!!
- * This procedure is only supported on rpc/udp and calls via
+ * This procedure is only supported on rpc/udp and calls via
* rpc/udp. It passes null authentication parameters.
*/
callit(rqstp, xprt);
* a machine should shut-up instead of complain, less the requestor be
* overrun with complaints at the expense of not hearing a valid reply ...
*
- * This now forks so that the program & process that it calls can call
+ * This now forks so that the program & process that it calls can call
* back to the portmapper.
*/
static
*/
if ((pid = fork()) != 0) {
if (debugging && (pid < 0)) {
- fprintf(stderr, "portmap CALLIT: cannot fork.\n");
+ fprintf(stderr, _("portmap CALLIT: cannot fork.\n"));
}
return;
}
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
#endif
/*
- * rpc_main.c, Top level of the RPC protocol compiler.
- * Copyright (C) 1987, Sun Microsystems, Inc.
+ * rpc_main.c, Top level of the RPC protocol compiler.
+ * Copyright (C) 1987, Sun Microsystems, Inc.
*/
#include <stdio.h>
if (!parseargs(argc, argv, &cmd)) {
f_print(stderr,
- "usage: %s infile\n", cmdname);
+ _("usage: %s infile\n"), cmdname);
f_print(stderr,
- " %s [-c | -h | -l | -m] [-o outfile] [infile]\n",
+ _(" %s [-c | -h | -l | -m] [-o outfile] [infile]\n"),
cmdname);
f_print(stderr,
- " %s [-s udp|tcp]* [-o outfile] [infile]\n",
+ _(" %s [-s udp|tcp]* [-o outfile] [infile]\n"),
cmdname);
exit(1);
}
}
/*
- * add extension to filename
+ * add extension to filename
*/
static char *
extendfile(file, ext)
}
/*
- * Open output file with given extension
+ * Open output file with given extension
*/
static
open_output(infile, outfile)
return;
}
if (infile != NULL && streq(outfile, infile)) {
- f_print(stderr, "%s: output would overwrite %s\n", cmdname,
+ f_print(stderr, _("%s: output would overwrite %s\n"), cmdname,
infile);
crash();
}
fout = fopen(outfile, "w");
if (fout == NULL) {
- f_print(stderr, "%s: unable to open ", cmdname);
+ f_print(stderr, _("%s: unable to open "), cmdname);
perror(outfile);
crash();
}
}
/*
- * Open input file with given define for C-preprocessor
+ * Open input file with given define for C-preprocessor
*/
static
open_input(infile, define)
char *outfilename;
long tell;
- open_input(infile, define);
+ open_input(infile, define);
outfilename = extend ? extendfile(infile, outfile) : outfile;
open_output(infile, outfilename);
f_print(fout, "#include <rpc/rpc.h>\n");
}
/*
- * Perform registrations for service output
+ * Perform registrations for service output
*/
static
do_registers(argc, argv)
}
/*
- * Parse command line arguments
+ * Parse command line arguments
*/
static
parseargs(argc, argv, cmd)
break;
case 'o':
case 's':
- if (argv[i][j - 1] != '-' ||
+ if (argv[i][j - 1] != '-' ||
argv[i][j + 1] != 0) {
return (0);
}
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
#endif
/*
- * rpc_parse.c, Parser for the RPC protocol compiler
+ * rpc_parse.c, Parser for the RPC protocol compiler
* Copyright (C) 1987 Sun Microsystems, Inc.
*/
#include <stdio.h>
return (NULL);
break;
default:
- error("definition keyword expected");
+ error(_("definition keyword expected"));
}
scan(TOK_SEMICOLON, &tok);
isdefined(defp);
plist = ALLOC(proc_list);
get_type(&plist->res_prefix, &plist->res_type, DEF_PROGRAM);
if (streq(plist->res_type, "opaque")) {
- error("illegal result type");
+ error(_("illegal result type"));
}
scan(TOK_IDENT, &tok);
plist->proc_name = tok.str;
dec->name = tok.str;
if (peekscan(TOK_LBRACKET, &tok)) {
if (dec->rel == REL_POINTER) {
- error("no array-of-pointer declarations -- use typedef");
+ error(_("no array-of-pointer declarations -- use typedef"));
}
dec->rel = REL_VECTOR;
scan_num(&tok);
scan(TOK_RBRACKET, &tok);
} else if (peekscan(TOK_LANGLE, &tok)) {
if (dec->rel == REL_POINTER) {
- error("no array-of-pointer declarations -- use typedef");
+ error(_("no array-of-pointer declarations -- use typedef"));
}
dec->rel = REL_ARRAY;
if (peekscan(TOK_RANGLE, &tok)) {
}
if (streq(dec->type, "opaque")) {
if (dec->rel != REL_ARRAY && dec->rel != REL_VECTOR) {
- error("array declaration expected");
+ error(_("array declaration expected"));
}
} else if (streq(dec->type, "string")) {
if (dec->rel != REL_ARRAY) {
- error("variable-length array declaration expected");
+ error(_("variable-length array declaration expected"));
}
}
}
break;
case TOK_VOID:
if (dkind != DEF_UNION && dkind != DEF_PROGRAM) {
- error("voids allowed only inside union and program definitions");
+ error(_("voids allowed only inside union and program definitions"));
}
*typep = tok.str;
break;
*typep = tok.str;
break;
default:
- error("expected type specifier");
+ error(_("expected type specifier"));
}
}
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
#endif
/*
- * rpc_scan.c, Scanner for the RPC protocol compiler
- * Copyright (C) 1987, Sun Microsystems, Inc.
+ * rpc_scan.c, Scanner for the RPC protocol compiler
+ * Copyright (C) 1987, Sun Microsystems, Inc.
*/
#include <stdio.h>
#include <ctype.h>
static token lasttok; /* last token, if pushed */
/*
- * scan expecting 1 given token
+ * scan expecting 1 given token
*/
void
scan(expect, tokp)
}
/*
- * scan expecting 2 given tokens
+ * scan expecting 2 given tokens
*/
void
scan2(expect1, expect2, tokp)
}
/*
- * scan expecting 3 given token
+ * scan expecting 3 given token
*/
void
scan3(expect1, expect2, expect3, tokp)
/*
- * scan expecting a constant, possibly symbolic
+ * scan expecting a constant, possibly symbolic
*/
void
scan_num(tokp)
case TOK_IDENT:
break;
default:
- error("constant or identifier expected");
+ error(_("constant or identifier expected"));
}
}
/*
- * Peek at the next token
+ * Peek at the next token
*/
void
peek(tokp)
/*
- * Peek at the next token and scan it if it matches what you expect
+ * Peek at the next token and scan it if it matches what you expect
*/
int
peekscan(expect, tokp)
/*
- * Get the next token, printing out any directive that are encountered.
+ * Get the next token, printing out any directive that are encountered.
*/
void
get_token(tokp)
if (commenting) {
break;
} else if (cppline(curline)) {
- docppline(curline, &linenum,
+ docppline(curline, &linenum,
&infilename);
} else if (directive(curline)) {
printdirective(curline);
}
/*
- * 'where' is not whitespace, comment or directive Must be a token!
+ * 'where' is not whitespace, comment or directive Must be a token!
*/
switch (*where) {
case ':':
char buf[100];
char *p;
- s_print(buf, "illegal character in file: ");
+ s_print(buf, _("illegal character in file: "));
p = buf + strlen(buf);
if (isprint(*where)) {
s_print(p, "%c", *where);
*p++;
} while (*p && *p != '"');
if (*p == 0) {
- error("unterminated string constant");
+ error(_("unterminated string constant"));
}
p++;
size = p - *str;
line++;
}
if (*line != '"') {
- error("preprocessor error");
+ error(_("preprocessor error"));
}
line++;
p = file = alloc(strlen(line) + 1);
*p++ = *line++;
}
if (*line == 0) {
- error("preprocessor error");
+ error(_("preprocessor error"));
}
*p = 0;
if (*file == 0) {
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
#endif
/*
- * rpc_util.c, Utility routines for the RPC protocol compiler
- * Copyright (C) 1987, Sun Microsystems, Inc.
+ * rpc_util.c, Utility routines for the RPC protocol compiler
+ * Copyright (C) 1987, Sun Microsystems, Inc.
*/
#include <stdio.h>
#include "rpc_scan.h"
list *defined; /* list of defined things */
/*
- * Reinitialize the world
+ * Reinitialize the world
*/
reinitialize()
{
}
/*
- * string equality
+ * string equality
*/
streq(a, b)
char *a;
}
/*
- * find a value in a list
+ * find a value in a list
*/
char *
findval(lst, val, cmp)
}
/*
- * store a value in a list
+ * store a value in a list
*/
void
storeval(lstp, val)
/*
- * print a useful (?) error message, and then die
+ * print a useful (?) error message, and then die
*/
void
error(msg)
char *msg;
{
printwhere();
- f_print(stderr, "%s, line %d: ", infilename, linenum);
+ f_print(stderr, _("%s, line %d: "), infilename, linenum);
f_print(stderr, "%s\n", msg);
crash();
}
/*
* Something went wrong, unlink any files that we may have created and then
- * die.
+ * die.
*/
crash()
{
if (nfiles < NFILES) {
outfiles[nfiles++] = file;
} else {
- f_print(stderr, "too many files!\n");
+ f_print(stderr, _("too many files!\n"));
crash();
}
}
static char *toktostr();
/*
- * error, token encountered was not the expected one
+ * error, token encountered was not the expected one
*/
void
expected1(exp1)
tok_kind exp1;
{
- s_print(expectbuf, "expected '%s'",
+ s_print(expectbuf, _("expected '%s'"),
toktostr(exp1));
error(expectbuf);
}
/*
- * error, token encountered was not one of two expected ones
+ * error, token encountered was not one of two expected ones
*/
void
expected2(exp1, exp2)
tok_kind exp1, exp2;
{
- s_print(expectbuf, "expected '%s' or '%s'",
+ s_print(expectbuf, _("expected '%s' or '%s'"),
toktostr(exp1),
toktostr(exp2));
error(expectbuf);
}
/*
- * error, token encountered was not one of 3 expected ones
+ * error, token encountered was not one of 3 expected ones
*/
void
expected3(exp1, exp2, exp3)
tok_kind exp1, exp2, exp3;
{
- s_print(expectbuf, "expected '%s', '%s' or '%s'",
+ s_print(expectbuf, _("expected '%s', '%s' or '%s'"),
toktostr(exp1),
toktostr(exp2),
toktostr(exp3));
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
return (0);
}
-
+
static void
udpping(portnum, argc, argv)
u_short portnum;
int sock = RPC_ANYSOCK;
struct rpc_err rpcerr;
int failure;
-
+
if (argc < 2 || argc > 3) {
usage();
exit(1);
if ((client = clntudp_create(&addr, prognum, (u_long)0,
to, &sock)) == NULL) {
clnt_pcreateerror("rpcinfo");
- printf("program %lu is not available\n",
+ printf(_("program %lu is not available\n"),
prognum);
exit(1);
}
if ((client = clntudp_create(&addr, prognum, MAX_VERS,
to, &sock)) == NULL) {
clnt_pcreateerror("rpcinfo");
- printf("program %lu version %lu is not available\n",
+ printf(_("program %lu version %lu is not available\n"),
prognum, MAX_VERS);
exit(1);
}
if ((client = clntudp_create(&addr, prognum, vers,
to, &sock)) == NULL) {
clnt_pcreateerror("rpcinfo");
- printf("program %lu version %lu is not available\n",
+ printf(_("program %lu version %lu is not available\n"),
prognum, vers);
exit(1);
}
if ((client = clnttcp_create(&addr, prognum, MIN_VERS,
&sock, 0, 0)) == NULL) {
clnt_pcreateerror("rpcinfo");
- printf("program %lu is not available\n",
+ printf(_("program %lu is not available\n"),
prognum);
exit(1);
}
if ((client = clnttcp_create(&addr, prognum, MAX_VERS,
&sock, 0, 0)) == NULL) {
clnt_pcreateerror("rpcinfo");
- printf("program %lu version %lu is not available\n",
+ printf(_("program %lu version %lu is not available\n"),
prognum, MAX_VERS);
exit(1);
}
if ((client = clnttcp_create(&addr, prognum, vers,
&sock, 0, 0)) == NULL) {
clnt_pcreateerror("rpcinfo");
- printf("program %lu version %lu is not available\n",
+ printf(_("program %lu version %lu is not available\n"),
prognum, vers);
exit(1);
}
if ((client = clnttcp_create(&addr, prognum, vers, &sock,
0, 0)) == NULL) {
clnt_pcreateerror("rpcinfo");
- printf("program %lu version %lu is not available\n",
+ printf(_("program %lu version %lu is not available\n"),
prognum, vers);
exit(1);
}
clnt_geterr(client, &rpcerr);
if (rpcerr.re_status != RPC_SUCCESS) {
clnt_perror(client, "rpcinfo");
- printf("program %lu version %lu is not available\n",
+ printf(_("program %lu version %lu is not available\n"),
prognum, vers);
return (-1);
} else {
- printf("program %lu version %lu ready and waiting\n",
+ printf(_("program %lu version %lu ready and waiting\n"),
prognum, vers);
return (0);
}
struct timeval minutetimeout;
register CLIENT *client;
struct rpcent *rpc;
-
+
if (argc > 1) {
usage();
exit(1);
server_addr.sin_port = htons(PMAPPORT);
if ((client = clnttcp_create(&server_addr, PMAPPROG,
PMAPVERS, &socket, 50, 500)) == NULL) {
- clnt_pcreateerror("rpcinfo: can't contact portmapper");
+ clnt_pcreateerror(_("rpcinfo: can't contact portmapper"));
exit(1);
}
if (clnt_call(client, PMAPPROC_DUMP, xdr_void, NULL,
xdr_pmaplist, &head, minutetimeout) != RPC_SUCCESS) {
- fprintf(stderr, "rpcinfo: can't contact portmapper: ");
+ fprintf(stderr, _("rpcinfo: can't contact portmapper: "));
clnt_perror(client, "rpcinfo");
exit(1);
}
if (head == NULL) {
- printf("No remote programs registered.\n");
+ printf(_("No remote programs registered.\n"));
} else {
- printf(" program vers proto port\n");
+ printf(_(" program vers proto port\n"));
for (; head != NULL; head = head->pml_next) {
printf("%10ld%5ld",
head->pml_map.pm_prog,
}
}
-/*
- * reply_proc collects replies from the broadcast.
+/*
+ * reply_proc collects replies from the broadcast.
* to get a unique list of responses the output of rpcinfo should
* be piped through sort(1) and then uniq(1).
*/
hp = gethostbyaddr((char *) &who->sin_addr, sizeof who->sin_addr,
AF_INET);
printf("%s %s\n", inet_ntoa(who->sin_addr),
- (hp == NULL) ? "(unknown)" : hp->h_name);
+ (hp == NULL) ? _("(unknown)") : hp->h_name);
return(FALSE);
}
rpc_stat = clnt_broadcast(prognum, vers, NULLPROC, xdr_void,
(char *)NULL, xdr_void, (char *)NULL, reply_proc);
if ((rpc_stat != RPC_SUCCESS) && (rpc_stat != RPC_TIMEDOUT)) {
- fprintf(stderr, "rpcinfo: broadcast failed: %s\n",
+ fprintf(stderr, _("rpcinfo: broadcast failed: %s\n"),
clnt_sperrno(rpc_stat));
exit(1);
}
prog_num = getprognum(argv[0]);
version_num = getvers(argv[1]);
if ((pmap_unset(prog_num, version_num)) == 0) {
- fprintf(stderr, "rpcinfo: Could not delete registration for prog %s version %s\n",
+ fprintf(stderr, _("rpcinfo: Could not delete registration for prog %s version %s\n"),
argv[0], argv[1]) ;
exit(1) ;
}
static void
usage()
{
- fprintf(stderr, "Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n");
- fprintf(stderr, " rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n");
- fprintf(stderr, " rpcinfo -p [ host ]\n");
- fprintf(stderr, " rpcinfo -b prognum versnum\n");
- fprintf(stderr, " rpcinfo -d prognum versnum\n") ;
+ fprintf(stderr, _("Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n"));
+ fprintf(stderr, _(" rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n"));
+ fprintf(stderr, _(" rpcinfo -p [ host ]\n"));
+ fprintf(stderr, _(" rpcinfo -b prognum versnum\n"));
+ fprintf(stderr, _(" rpcinfo -d prognum versnum\n")) ;
}
static u_long
if (isalpha(*arg)) {
rpc = getrpcbyname(arg);
if (rpc == NULL) {
- fprintf(stderr, "rpcinfo: %s is unknown service\n",
+ fprintf(stderr, _("rpcinfo: %s is unknown service\n"),
arg);
exit(1);
}
addr->sin_addr.s_addr = (u_long) inet_addr(host);
if (addr->sin_addr.s_addr == -1 || addr->sin_addr.s_addr == 0) {
if ((hp = gethostbyname(host)) == NULL) {
- fprintf(stderr, "rpcinfo: %s is unknown host\n", host);
+ fprintf(stderr, _("rpcinfo: %s is unknown host\n"),
+ host);
exit(1);
}
bcopy(hp->h_addr, (char *)&addr->sin_addr, hp->h_length);
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
static char sccsid[] = "@(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";
#endif
-/*
+/*
* svc_simple.c
* Simplified front end to rpc.
*
char *(*progname)();
xdrproc_t inproc, outproc;
{
-
+
if (procnum == NULLPROC) {
(void) fprintf(stderr,
- "can't reassign procedure number %d\n", NULLPROC);
+ _("can't reassign procedure number %d\n"), NULLPROC);
return (-1);
}
if (transp == 0) {
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
- (void) fprintf(stderr, "couldn't create an rpc server\n");
+ (void) fprintf(stderr, _("couldn't create an rpc server\n"));
return (-1);
}
}
(void) pmap_unset((u_long)prognum, (u_long)versnum);
- if (!svc_register(transp, (u_long)prognum, (u_long)versnum,
+ if (!svc_register(transp, (u_long)prognum, (u_long)versnum,
universal, IPPROTO_UDP)) {
- (void) fprintf(stderr, "couldn't register prog %d vers %d\n",
+ (void) fprintf(stderr, _("couldn't register prog %d vers %d\n"),
prognum, versnum);
return (-1);
}
pl = (struct proglst *)malloc(sizeof(struct proglst));
if (pl == NULL) {
- (void) fprintf(stderr, "registerrpc: out of memory\n");
+ (void) fprintf(stderr, _("registerrpc: out of memory\n"));
return (-1);
}
pl->p_progname = progname;
char xdrbuf[UDPMSGSIZE];
struct proglst *pl;
- /*
+ /*
* enforce "procnum 0 is echo" convention
*/
if (rqstp->rq_proc == NULLPROC) {
return;
if (!svc_sendreply(transp, pl->p_outproc, outdata)) {
(void) fprintf(stderr,
- "trouble replying to prog %d\n",
+ _("trouble replying to prog %d\n"),
pl->p_prognum);
exit(1);
}
(void)svc_freeargs(transp, pl->p_inproc, xdrbuf);
return;
}
- (void) fprintf(stderr, "never registered prog %d\n", prog);
+ (void) fprintf(stderr, _("never registered prog %d\n"), prog);
exit(1);
}
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
#endif
/*
- * svc_tcp.c, Server side for TCP/IP based RPC.
+ * svc_tcp.c, Server side for TCP/IP based RPC.
*
* Copyright (C) 1984, Sun Microsystems, Inc.
*
if (sock == RPC_ANYSOCK) {
if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
- perror("svctcp_.c - udp socket creation problem");
+ perror(_("svctcp_.c - udp socket creation problem"));
return ((SVCXPRT *)NULL);
}
madesock = TRUE;
}
if ((getsockname(sock, (struct sockaddr *)&addr, &len) != 0) ||
(listen(sock, 2) != 0)) {
- perror("svctcp_.c - cannot getsockname or listen");
+ perror(_("svctcp_.c - cannot getsockname or listen"));
if (madesock)
(void)close(sock);
return ((SVCXPRT *)NULL);
}
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
if (r == NULL) {
- (void) fprintf(stderr, "svctcp_create: out of memory\n");
+ (void) fprintf(stderr, _("svctcp_create: out of memory\n"));
return (NULL);
}
r->sendsize = sendsize;
r->recvsize = recvsize;
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
if (xprt == NULL) {
- (void) fprintf(stderr, "svctcp_create: out of memory\n");
+ (void) fprintf(stderr, _("svctcp_create: out of memory\n"));
return (NULL);
}
xprt->xp_p2 = NULL;
{
register SVCXPRT *xprt;
register struct tcp_conn *cd;
-
+
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
if (xprt == (SVCXPRT *)NULL) {
- (void) fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n");
+ (void) fprintf(stderr, _("svc_tcp: makefd_xprt: out of memory\n"));
goto done;
}
cd = (struct tcp_conn *)mem_alloc(sizeof(struct tcp_conn));
if (cd == (struct tcp_conn *)NULL) {
- (void) fprintf(stderr, "svc_tcp: makefd_xprt: out of memory\n");
+ (void) fprintf(stderr, _("svc_tcp: makefd_xprt: out of memory\n"));
mem_free((char *) xprt, sizeof(SVCXPRT));
xprt = (SVCXPRT *)NULL;
goto done;
#endif /* def FD_SETSIZE */
do {
readfds = mask;
- if (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL,
+ if (select(_rpc_dtablesize(), &readfds, (int*)NULL, (int*)NULL,
&wait_per_try) <= 0) {
if (errno == EINTR) {
continue;
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
if (sock == RPC_ANYSOCK) {
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
- perror("svcudp_create: socket creation problem");
+ perror(_("svcudp_create: socket creation problem"));
return ((SVCXPRT *)NULL);
}
madesock = TRUE;
(void)bind(sock, (struct sockaddr *)&addr, len);
}
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
- perror("svcudp_create - cannot getsockname");
+ perror(_("svcudp_create - cannot getsockname"));
if (madesock)
(void)close(sock);
return ((SVCXPRT *)NULL);
SVCXPRT *xprt;
{
- return (XPRT_IDLE);
+ return (XPRT_IDLE);
}
static bool_t
static bool_t
svcudp_reply(xprt, msg)
- register SVCXPRT *xprt;
- struct rpc_msg *msg;
+ register SVCXPRT *xprt;
+ struct rpc_msg *msg;
{
register struct svcudp_data *su = su_data(xprt);
register XDR *xdrs = &(su->su_xdrs);
(type *) mem_alloc((unsigned) (sizeof(type) * (size)))
#define BZERO(addr, type, size) \
- bzero((char *) addr, sizeof(type) * (int) (size))
+ bzero((char *) addr, sizeof(type) * (int) (size))
/*
* An entry in the cache
/*
* Next node on the list, if there is a collision
*/
- cache_ptr cache_next;
+ cache_ptr cache_next;
};
* the hashing function
*/
#define CACHE_LOC(transp, xid) \
- (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size))
+ (xid % (SPARSENESS*((struct udp_cache *) su_data(transp)->su_cache)->uc_size))
/*
- * Enable use of the cache.
+ * Enable use of the cache.
* Note: there is no disable.
*/
svcudp_enablecache(transp, size)
struct udp_cache *uc;
if (su->su_cache != NULL) {
- CACHE_PERROR("enablecache: cache already enabled");
- return(0);
+ CACHE_PERROR(_("enablecache: cache already enabled"));
+ return(0);
}
uc = ALLOC(struct udp_cache, 1);
if (uc == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache");
+ CACHE_PERROR(_("enablecache: could not allocate cache"));
return(0);
}
uc->uc_size = size;
uc->uc_nextvictim = 0;
uc->uc_entries = ALLOC(cache_ptr, size * SPARSENESS);
if (uc->uc_entries == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache data");
+ CACHE_PERROR(_("enablecache: could not allocate cache data"));
return(0);
}
BZERO(uc->uc_entries, cache_ptr, size * SPARSENESS);
uc->uc_fifo = ALLOC(cache_ptr, size);
if (uc->uc_fifo == NULL) {
- CACHE_PERROR("enablecache: could not allocate cache fifo");
+ CACHE_PERROR(_("enablecache: could not allocate cache fifo"));
return(0);
}
BZERO(uc->uc_fifo, cache_ptr, size);
static
cache_set(xprt, replylen)
SVCXPRT *xprt;
- u_long replylen;
+ u_long replylen;
{
- register cache_ptr victim;
+ register cache_ptr victim;
register cache_ptr *vicp;
register struct svcudp_data *su = su_data(xprt);
struct udp_cache *uc = (struct udp_cache *) su->su_cache;
victim = uc->uc_fifo[uc->uc_nextvictim];
if (victim != NULL) {
loc = CACHE_LOC(xprt, victim->cache_xid);
- for (vicp = &uc->uc_entries[loc];
- *vicp != NULL && *vicp != victim;
- vicp = &(*vicp)->cache_next)
+ for (vicp = &uc->uc_entries[loc];
+ *vicp != NULL && *vicp != victim;
+ vicp = &(*vicp)->cache_next)
;
if (*vicp == NULL) {
- CACHE_PERROR("cache_set: victim not found");
+ CACHE_PERROR(_("cache_set: victim not found"));
return;
}
*vicp = victim->cache_next; /* remote from cache */
victim->cache_prog = uc->uc_prog;
victim->cache_addr = uc->uc_addr;
loc = CACHE_LOC(xprt, victim->cache_xid);
- victim->cache_next = uc->uc_entries[loc];
+ victim->cache_next = uc->uc_entries[loc];
uc->uc_entries[loc] = victim;
uc->uc_fifo[uc->uc_nextvictim++] = victim;
uc->uc_nextvictim %= uc->uc_size;
if (c != EOF ||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
(void) fprintf(stderr,
-"%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n",
+_("%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n"),
argv[0], argv[0]);
(void) exit(EXIT_FAILURE);
}
show(argv[i], t, TRUE);
}
if (fflush(stdout) || ferror(stdout)) {
- (void) fprintf(stderr, "%s: Error writing standard output ",
+ (void) fprintf(stderr, _("%s: Error writing standard output "),
argv[0]);
- (void) perror("standard output");
+ (void) perror(_("standard output"));
(void) exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
** zic ... 2>&1 | error -t "*" -v
** on BSD systems.
*/
- (void) fprintf(stderr, "\"%s\", line %d: %s",
+ (void) fprintf(stderr, _("\"%s\", line %d: %s"),
filename, linenum, string);
if (rfilename != NULL)
- (void) fprintf(stderr, " (rule from \"%s\", line %d)",
+ (void) fprintf(stderr, _(" (rule from \"%s\", line %d)"),
rfilename, rlinenum);
(void) fprintf(stderr, "\n");
++errors;
static void
usage P((void))
{
- (void) fprintf(stderr, "%s: usage is %s \
+ (void) fprintf(stderr, _("%s: usage is %s \
[ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] [ -d directory ]\n\
-\t[ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n",
+\t[ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"),
progname, progname);
(void) exit(EXIT_FAILURE);
}
directory = optarg;
else {
(void) fprintf(stderr,
-"%s: More than one -d option specified\n",
+_("%s: More than one -d option specified\n"),
progname);
(void) exit(EXIT_FAILURE);
}
lcltime = optarg;
else {
(void) fprintf(stderr,
-"%s: More than one -l option specified\n",
+_("%s: More than one -l option specified\n"),
progname);
(void) exit(EXIT_FAILURE);
}
psxrules = optarg;
else {
(void) fprintf(stderr,
-"%s: More than one -p option specified\n",
+_("%s: More than one -p option specified\n"),
progname);
(void) exit(EXIT_FAILURE);
}
yitcommand = optarg;
else {
(void) fprintf(stderr,
-"%s: More than one -y option specified\n",
+_("%s: More than one -y option specified\n"),
progname);
(void) exit(EXIT_FAILURE);
}
leapsec = optarg;
else {
(void) fprintf(stderr,
-"%s: More than one -L option specified\n",
+_("%s: More than one -L option specified\n"),
progname);
(void) exit(EXIT_FAILURE);
}
if (mkdirs(toname) != 0)
(void) exit(EXIT_FAILURE);
if (link(fromname, toname) != 0) {
- (void) fprintf(stderr, "%s: Can't link from %s to ",
+ (void) fprintf(stderr, _("%s: Can't link from %s to "),
progname, fromname);
(void) perror(toname);
(void) exit(EXIT_FAILURE);
** a '%s' in the format is a bad thing.
*/
if (strchr(zp->z_format, '%') != 0)
- error("%s in ruleless zone");
+ error(_("%s in ruleless zone"));
}
}
if (errors)
char buf[BUFSIZ];
if (strcmp(name, "-") == 0) {
- name = "standard input";
+ name = _("standard input");
fp = stdin;
} else if ((fp = fopen(name, "r")) == NULL) {
- (void) fprintf(stderr, "%s: Can't open ", progname);
+ (void) fprintf(stderr, _("%s: Can't open "), progname);
(void) perror(name);
(void) exit(EXIT_FAILURE);
}
break;
cp = strchr(buf, '\n');
if (cp == NULL) {
- error("line too long");
+ error(_("line too long"));
(void) exit(EXIT_FAILURE);
}
*cp = '\0';
} else {
lp = byword(fields[0], line_codes);
if (lp == NULL)
- error("input line of unknown type");
+ error(_("input line of unknown type"));
else switch ((int) (lp->l_value)) {
case LC_RULE:
inrule(fields, nfields);
case LC_LEAP:
if (name != leapsec)
(void) fprintf(stderr,
-"%s: Leap line in non leap seconds file %s\n",
+_("%s: Leap line in non leap seconds file %s\n"),
progname, name);
else inleap(fields, nfields);
wantcont = FALSE;
break;
default: /* "cannot happen" */
(void) fprintf(stderr,
-"%s: panic: Invalid l_value %d\n",
+_("%s: panic: Invalid l_value %d\n"),
progname, lp->l_value);
(void) exit(EXIT_FAILURE);
}
ifree((char *) fields);
}
if (ferror(fp)) {
- (void) fprintf(stderr, "%s: Error reading ", progname);
+ (void) fprintf(stderr, _("%s: Error reading "), progname);
(void) perror(filename);
(void) exit(EXIT_FAILURE);
}
if (fp != stdin && fclose(fp)) {
- (void) fprintf(stderr, "%s: Error closing ", progname);
+ (void) fprintf(stderr, _("%s: Error closing "), progname);
(void) perror(filename);
(void) exit(EXIT_FAILURE);
}
if (wantcont)
- error("expected continuation line not found");
+ error(_("expected continuation line not found"));
}
/*
static struct rule r;
if (nfields != RULE_FIELDS) {
- error("wrong number of fields on Rule line");
+ error(_("wrong number of fields on Rule line"));
return;
}
if (*fields[RF_NAME] == '\0') {
- error("nameless rule");
+ error(_("nameless rule"));
return;
}
r.r_filename = filename;
r.r_linenum = linenum;
- r.r_stdoff = gethms(fields[RF_STDOFF], "invalid saved time", TRUE);
+ r.r_stdoff = gethms(fields[RF_STDOFF], _("invalid saved time"), TRUE);
rulesub(&r, fields[RF_LOYEAR], fields[RF_HIYEAR], fields[RF_COMMAND],
fields[RF_MONTH], fields[RF_DAY], fields[RF_TOD]);
r.r_name = ecpyalloc(fields[RF_NAME]);
static char * buf;
if (nfields < ZONE_MINFIELDS || nfields > ZONE_MAXFIELDS) {
- error("wrong number of fields on Zone line");
+ error(_("wrong number of fields on Zone line"));
return FALSE;
}
if (strcmp(fields[ZF_NAME], TZDEFAULT) == 0 && lcltime != NULL) {
buf = erealloc(buf, (int) (132 + strlen(TZDEFAULT)));
(void) sprintf(buf,
-"\"Zone %s\" line and -l option are mutually exclusive",
+_("\"Zone %s\" line and -l option are mutually exclusive"),
TZDEFAULT);
error(buf);
return FALSE;
if (strcmp(fields[ZF_NAME], TZDEFRULES) == 0 && psxrules != NULL) {
buf = erealloc(buf, (int) (132 + strlen(TZDEFRULES)));
(void) sprintf(buf,
-"\"Zone %s\" line and -p option are mutually exclusive",
+_("\"Zone %s\" line and -p option are mutually exclusive"),
TZDEFRULES);
error(buf);
return FALSE;
strlen(fields[ZF_NAME]) +
strlen(zones[i].z_filename)));
(void) sprintf(buf,
-"duplicate zone name %s (file \"%s\", line %d)",
+_("duplicate zone name %s (file \"%s\", line %d)"),
fields[ZF_NAME],
zones[i].z_filename,
zones[i].z_linenum);
const int nfields;
{
if (nfields < ZONEC_MINFIELDS || nfields > ZONEC_MAXFIELDS) {
- error("wrong number of fields on Zone continuation line");
+ error(_("wrong number of fields on Zone continuation line"));
return FALSE;
}
return inzsub(fields, nfields, TRUE);
}
z.z_filename = filename;
z.z_linenum = linenum;
- z.z_gmtoff = gethms(fields[i_gmtoff], "invalid GMT offset", TRUE);
+ z.z_gmtoff = gethms(fields[i_gmtoff], _("invalid GMT offset"), TRUE);
if ((cp = strchr(fields[i_format], '%')) != 0) {
if (*++cp != 's' || strchr(cp, '%') != 0) {
- error("invalid abbreviation format");
+ error(_("invalid abbreviation format"));
return FALSE;
}
}
zones[nzones - 1].z_untiltime > min_time &&
zones[nzones - 1].z_untiltime < max_time &&
zones[nzones - 1].z_untiltime >= z.z_untiltime) {
- error("Zone continuation line end time is not \
-after end time of previous line");
+ error(_("Zone continuation line end time is \
+not after end time of previous line"));
return FALSE;
}
}
time_t t;
if (nfields != LEAP_FIELDS) {
- error("wrong number of fields on Leap line");
+ error(_("wrong number of fields on Leap line"));
return;
}
dayoff = 0;
/*
* Leapin' Lizards!
*/
- error("invalid leaping year");
+ error(_("invalid leaping year"));
return;
}
j = EPOCH_YEAR;
dayoff = oadd(dayoff, eitol(i));
}
if ((lp = byword(fields[LP_MONTH], mon_names)) == NULL) {
- error("invalid month name");
+ error(_("invalid month name"));
return;
}
month = lp->l_value;
cp = fields[LP_DAY];
if (sscanf(cp, scheck(cp, "%d"), &day) != 1 ||
day <= 0 || day > len_months[isleap(year)][month]) {
- error("invalid day of month");
+ error(_("invalid day of month"));
return;
}
dayoff = oadd(dayoff, eitol(day - 1));
if (dayoff < 0 && !tt_signed) {
- error("time before zero");
+ error(_("time before zero"));
return;
}
t = (time_t) dayoff * SECSPERDAY;
** Cheap overflow check.
*/
if (t / SECSPERDAY != dayoff) {
- error("time overflow");
+ error(_("time overflow"));
return;
}
tod = gethms(fields[LP_TIME], "invalid time of day", FALSE);
positive = TRUE;
count = 2;
} else {
- error("illegal CORRECTION field on Leap line");
+ error(_("illegal CORRECTION field on Leap line"));
return;
}
if ((lp = byword(fields[LP_ROLL], leap_types)) == NULL) {
- error("illegal Rolling/Stationary field on Leap line");
+ error(_("illegal Rolling/Stationary field on Leap line"));
return;
}
leapadd(tadd(t, tod), positive, lp->l_value, count);
struct link l;
if (nfields != LINK_FIELDS) {
- error("wrong number of fields on Link line");
+ error(_("wrong number of fields on Link line"));
return;
}
if (*fields[LF_FROM] == '\0') {
- error("blank FROM field on Link line");
+ error(_("blank FROM field on Link line"));
return;
}
if (*fields[LF_TO] == '\0') {
- error("blank TO field on Link line");
+ error(_("blank TO field on Link line"));
return;
}
l.l_filename = filename;
register char * ep;
if ((lp = byword(monthp, mon_names)) == NULL) {
- error("invalid month name");
+ error(_("invalid month name"));
return;
}
rp->r_month = lp->l_value;
break;
default: /* "cannot happen" */
(void) fprintf(stderr,
- "%s: panic: Invalid l_value %d\n",
+ _("%s: panic: Invalid l_value %d\n"),
progname, lp->l_value);
(void) exit(EXIT_FAILURE);
} else if (sscanf(cp, scheck(cp, "%d"), &rp->r_loyear) != 1) {
- error("invalid starting year");
+ error(_("invalid starting year"));
return;
}
cp = hiyearp;
break;
default: /* "cannot happen" */
(void) fprintf(stderr,
- "%s: panic: Invalid l_value %d\n",
+ _("%s: panic: Invalid l_value %d\n"),
progname, lp->l_value);
(void) exit(EXIT_FAILURE);
} else if (sscanf(cp, scheck(cp, "%d"), &rp->r_hiyear) != 1) {
- error("invalid ending year");
+ error(_("invalid ending year"));
return;
}
if (rp->r_loyear > rp->r_hiyear) {
- error("starting year greater than ending year");
+ error(_("starting year greater than ending year"));
return;
}
if (*typep == '\0')
rp->r_yrtype = NULL;
else {
if (rp->r_loyear == rp->r_hiyear) {
- error("typed single year");
+ error(_("typed single year"));
return;
}
rp->r_yrtype = ecpyalloc(typep);
if (rp->r_dycode != DC_DOM) {
*ep++ = 0;
if (*ep++ != '=') {
- error("invalid day of month");
+ error(_("invalid day of month"));
ifree(dp);
return;
}
if ((lp = byword(dp, wday_names)) == NULL) {
- error("invalid weekday name");
+ error(_("invalid weekday name"));
ifree(dp);
return;
}
if (sscanf(ep, scheck(ep, "%d"), &rp->r_dayofmonth) != 1 ||
rp->r_dayofmonth <= 0 ||
(rp->r_dayofmonth > len_months[1][rp->r_month])) {
- error("invalid day of month");
+ error(_("invalid day of month"));
ifree(dp);
return;
}
if (mkdirs(fullname) != 0)
(void) exit(EXIT_FAILURE);
if ((fp = fopen(fullname, "wb")) == NULL) {
- (void) fprintf(stderr, "%s: Can't create ", progname);
+ (void) fprintf(stderr, _("%s: Can't create "),
+ progname);
(void) perror(fullname);
(void) exit(EXIT_FAILURE);
}
for (i = 0; i < typecnt; ++i)
(void) putc(ttisgmts[i], fp);
if (ferror(fp) || fclose(fp)) {
- (void) fprintf(stderr, "%s: Write error on ", progname);
+ (void) fprintf(stderr, _("%s: Write error on "), progname);
(void) perror(fullname);
(void) exit(EXIT_FAILURE);
}
if (timecnt == 0 && type == 0 && isdsts[0] == 0)
return; /* handled by default rule */
if (timecnt >= TZ_MAX_TIMES) {
- error("too many transitions?!");
+ error(_("too many transitions?!"));
(void) exit(EXIT_FAILURE);
}
ats[timecnt] = starttime;
** many.
*/
if (typecnt >= TZ_MAX_TYPES) {
- error("too many local time types");
+ error(_("too many local time types"));
(void) exit(EXIT_FAILURE);
}
gmtoffs[i] = gmtoff;
register int i, j;
if (leapcnt + (positive ? count : 1) > TZ_MAX_LEAPS) {
- error("too many leap seconds");
+ error(_("too many leap seconds"));
(void) exit(EXIT_FAILURE);
}
for (i = 0; i < leapcnt; ++i)
if (t <= trans[i]) {
if (t == trans[i]) {
- error("repeated leap second moment");
+ error(_("repeated leap second moment"));
(void) exit(EXIT_FAILURE);
}
break;
return TRUE;
if (result == (1 << 8))
return FALSE;
- error("Wild result from command execution");
- (void) fprintf(stderr, "%s: command was '%s', result was %d\n",
+ error(_("Wild result from command execution"));
+ (void) fprintf(stderr, _("%s: command was '%s', result was %d\n"),
progname, buf, result);
for ( ; ; )
(void) exit(EXIT_FAILURE);
else while ((*dp = *cp++) != '"')
if (*dp != '\0')
++dp;
- else error("Odd number of quotation marks");
+ else error(_("Odd number of quotation marks"));
} while (*cp != '\0' && *cp != '#' &&
(!isascii(*cp) || !isspace(*cp)));
if (isascii(*cp) && isspace(*cp))
t = t1 + t2;
if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) {
- error("time overflow");
+ error(_("time overflow"));
(void) exit(EXIT_FAILURE);
}
return t;
return min_time;
t = t1 + t2;
if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) {
- error("time overflow");
+ error(_("time overflow"));
(void) exit(EXIT_FAILURE);
}
return t;
if (rp->r_dycode == DC_DOWLEQ)
--i;
else {
- error("use of 2/29 in non leap-year");
+ error(_("use of 2/29 in non leap-year"));
(void) exit(EXIT_FAILURE);
}
}
--i;
}
if (i < 0 || i >= len_months[isleap(y)][m]) {
- error("no day in month matches rule");
+ error(_("no day in month matches rule"));
(void) exit(EXIT_FAILURE);
}
}
i = strlen(string) + 1;
if (charcnt + i > TZ_MAX_CHARS) {
- error("too many, or too long, time zone abbreviations");
+ error(_("too many, or too long, time zone abbreviations"));
(void) exit(EXIT_FAILURE);
}
(void) strcpy(&chars[charcnt], string);
*/
if (mkdir(name, 0755) != 0) {
(void) fprintf(stderr,
- "%s: Can't create directory ",
+ _("%s: Can't create directory "),
progname);
(void) perror(name);
ifree(name);
l = i;
if ((i < 0 && l >= 0) || (i == 0 && l != 0) || (i > 0 && l <= 0)) {
(void) fprintf(stderr,
- "%s: %d did not sign extend correctly\n",
+ _("%s: %d did not sign extend correctly\n"),
progname, i);
(void) exit(EXIT_FAILURE);
}