From: Michael Piotrowski <m.piotrowski@springer.de>
Subject: Re: Attachments forwarded by MS Outlook
Date: 04 Feb 2000 11:40:52 +0100 [thread overview]
Message-ID: <x6iu05s11n.fsf@viper.ntp.springer.de> (raw)
In-Reply-To: Steve Harris's message of "02 Feb 2000 09:22:16 -0800"
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
Steve Harris <sharris@primus.com> writes:
> Mark Simpson's tnef program [1] might help here. I downloaded the
> source but could not compile it on Solaris for lack of 'getopt.h'! Can
It needs GNU getopt and thus doesn't compile out of the box on UNIX.
Attached is a patch which changes it to use Standard getopt instead.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to src/main.c and src/tnef.c --]
[-- Type: text/x-patch, Size: 4005 bytes --]
*** main.c.orig Fri Feb 4 11:02:57 2000
--- main.c Fri Feb 4 11:34:53 2000
***************
*** 27,33 ****
#include <memory.h>
#include <stdio.h>
! #include <getopt.h>
#include "tnef.h"
--- 27,33 ----
#include <memory.h>
#include <stdio.h>
! #include <unistd.h>
#include "tnef.h"
***************
*** 42,54 ****
"Public License. For more information about these matters, see the file\n"
"named COPYING.";
static const char* USAGE = \
! "-f FILE, --file=FILE\tuse FILE as input ('-' == stdin)\n"
! "-d DIR, --directory=DIR\tput unpacked files in DIR\n"
! "-l, --list \tlist files, do not extract\n"
! "-n, --dry_run \tparse the file only\n"
! "-v, --verbose \tproduce verbose output\n"
! "-h, --help \tshow this message\n"
! "--version \tdisplay version and copyright\n"
"\nIf FILE is not specified standard input is used\n"
"\nReport bugs to <damned@world.std.com>\n";
--- 42,53 ----
"Public License. For more information about these matters, see the file\n"
"named COPYING.";
static const char* USAGE = \
! "-f FILE\tuse FILE as input ('-' == stdin)\n"
! "-d DIR\tput unpacked files in DIR\n"
! "-l\tlist files, do not extract\n"
! "-n\tparse the file only\n"
! "-v\tproduce verbose output\n"
! "-h\tshow this message\n"
"\nIf FILE is not specified standard input is used\n"
"\nReport bugs to <damned@world.std.com>\n";
***************
*** 72,112 ****
parse_cmdline (int argc, char **argv)
{
int i = 0;
! int option_index = 0;
! static struct option long_options[] =
! {
! {"file", required_argument, 0, 'f' },
! {"directory", required_argument, 0, 'd' },
! {"help", no_argument, 0, 'h'},
! {"verbose", no_argument, 0, 'v'},
! {"dry_run", no_argument, 0, 'n'},
! {"list", no_argument, 0, 'l'}, /* for now same as -n */
! {"version", no_argument, 0, 0},
! { 0, 0, 0, 0 }
! };
! while ((i = getopt_long (argc, argv, "f:d:vhnl",
! long_options, &option_index)) != -1)
{
switch (i)
{
- case 0: /* long options with no val field */
- if (strcmp (long_options[option_index].name,
- "version") == 0)
- {
- fprintf (stderr, "%s %s\n", PACKAGE, VERSION);
- fprintf (stderr, COPYRIGHTS);
- fprintf (stderr, "\n");
- fprintf (stderr, NO_WARRANTY, PACKAGE, PACKAGE);
- fprintf (stderr, "\n");
- exit (0);
- }
- else
- {
- abort (); /* impossible! */
- }
- break;
-
case 'v':
verbose = 1;
break;
--- 71,83 ----
parse_cmdline (int argc, char **argv)
{
int i = 0;
! extern char *optarg;
! extern int optind, optopt;
! while ((i = getopt (argc, argv, "f:d:vhnl")) != -1)
{
switch (i)
{
case 'v':
verbose = 1;
break;
*** tnef.c.orig Fri Feb 4 11:12:38 2000
--- tnef.c Fri Feb 4 11:13:40 2000
***************
*** 43,52 ****
#define GETINT16(p) (uint16)(p[0]+(p[1]<<8))
/* Program Options: */
! static int Verbose_Output = 0; /* Shall we shout it from the rooftops? */
! static int Dry_Run = 0; /* Parse file only */
! static FILE* Input_File = NULL; /* Input File */
! static char* Directory = NULL; /* Where to put output */
/* Array of days of the week for translating a date */
--- 43,52 ----
#define GETINT16(p) (uint16)(p[0]+(p[1]<<8))
/* Program Options: */
! int Verbose_Output = 0; /* Shall we shout it from the rooftops? */
! int Dry_Run = 0; /* Parse file only */
! FILE* Input_File = NULL; /* Input File */
! char* Directory = NULL; /* Where to put output */
/* Array of days of the week for translating a date */
[-- Attachment #3: Type: text/plain, Size: 109 bytes --]
--
Michael Piotrowski, M.A. <m.piotrowski@springer.de>
Electronic Technologies, Springer-Verlag Heidelberg
next prev parent reply other threads:[~2000-02-04 10:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-01-31 19:25 Graham Murray
2000-01-31 22:22 ` Kai Großjohann
2000-02-01 0:07 ` Simon Josefsson
2000-02-02 11:59 ` Nemeth Ervin
2000-02-02 17:22 ` Steve Harris
2000-02-04 10:40 ` Michael Piotrowski [this message]
2000-02-04 16:52 ` Steve Harris
2000-02-04 23:10 ` Simon Josefsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x6iu05s11n.fsf@viper.ntp.springer.de \
--to=m.piotrowski@springer.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).