* SUCH DAMAGE.
*/
+#define _POSIX_SOURCE 1
+#define _MINIX 1
+
#if 0
#ifndef lint
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#include <stdlib.h>
#include <limits.h>
#include <minix/paths.h>
+
+#include <sys/types.h>
+#include <string.h>
+#include <strings.h>
+#include <unistd.h>
+
+
#include "pax.h"
#include "options.h"
#include "cpio.h"
return(num);
}
-char *
+char *fgetln(FILE *f, size_t *);
+
+static char *
getline(FILE *f)
{
char *name, *temp;
* print the usage summary to the user
*/
-void
+static void
pax_usage(void)
{
(void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr);
* print the usage summary to the user
*/
-void
+static void
tar_usage(void)
{
(void)fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ",
* print the usage summary to the user
*/
-void
+static void
cpio_usage(void)
{
(void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);
/* According to POSIX, getopt should be in unistd.h. What do we do with
* this?
*/
-_PROTOTYPE(int getopt, (int _argc, char **_argv, char *_opts));
+_PROTOTYPE(int getopt, (int _argc, char * const _argv[], const char *_opts));
extern char *optarg;
extern int optind, opterr, optopt;
#endif /* _MINIX */
_PROTOTYPE( int strcasecmp, (const char *_s1, const char *_s2) );
_PROTOTYPE( int strncasecmp, (const char *_s1, const char *_s2,
size_t _len) );
+_PROTOTYPE( int ffs, (int i) );
/* Open Group Base Specifications Issue 6 (not complete) */
_PROTOTYPE( int symlink, (const char *path1, const char *path2) );
_PROTOTYPE( int readlink, (const char *, char *, size_t) );
-_PROTOTYPE( int getopt, (int _argc, char **_argv, char *_opts) );
+_PROTOTYPE( int getopt, (int _argc, char * const _argv[], char const *_opts) );
extern char *optarg;
extern int optind, opterr, optopt;
_PROTOTYPE( int usleep, (useconds_t _useconds) );
* Parse argc/argv argument vector.
*/
int
-getopt(int nargc, char **nargv, char *ostr)
+getopt(int nargc, char * const nargv[], const char *ostr)
{
static char *place = EMSG; /* option letter processing */
char *oli; /* option letter list index */