From 0a796ed9c73e8cfadcdf3bc810123dc2bce4300e Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 4 Oct 1995 23:29:14 +0000 Subject: Initial revision --- trans/fwd.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 trans/fwd.c (limited to 'trans/fwd.c') diff --git a/trans/fwd.c b/trans/fwd.c new file mode 100644 index 00000000..6b90d333 --- /dev/null +++ b/trans/fwd.c @@ -0,0 +1,51 @@ +/* A translator to start up a central translation server + + Note: most translators that use a central server will look for the server + and forward the request to the server if they find one, otherwise doing + the translation themselves. + + Copyright (C) 1995 Free Software Foundation, Inc. + + Written by Miles Bader + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#include +#include +#include + +void +main (int argc, char **argv) +{ + error_t err; + mach_port_t bootstrap; + + if (argc < 2 || *argv[1] == '-') + { + fprintf(stderr, "Usage: %s SERVER [TRANS_NAME [TRANS_ARG...]]", + program_invocation_name); + exit(1); + } + + task_get_bootstrap_port (mach_task_self (), &bootstrap); + if (bootstrap == MACH_PORT_NULL) + error(2, 0, "must be started as a translator"); + + err = fshelp_delegate_translation (argv[1], bootstrap, argv + 2); + if (err) + error (3, err, "%s", argv[1]); + + exit (0); +} -- cgit v1.2.3