/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
/*
* imount: generic interface to Ifs internet service
*
*/
#include "mnt_imount.h"
#include <ctype.h>
int im_mount();
int im_mount_help();
int im_umount();
int im_umount_help();
int im_restart();
int im_restart_help();
int im_vcs_main();
int im_vcs_help();
int im_list();
int im_list_help();
int im_touch();
int im_touch_help();
int im_help();
int im_help_help();
int im_bye();
int im_system();
typedef int (*func_t)();
struct command_t
{
int len;
char* name;
char* man;
};
{
};
{
-1, /* fd */
NULL, /* hash table */
};
int argc;
char** argv;
{
register char* cmd;
register int i;
register char* s;
int ret;
int nlist;
int n;
int fd;
int len;
int xjade = 0;
{
for (i=0; i < CMD_MAX; i++)
{
{
}
}
}
switch (n)
{
case 'h':
break;
case 's':
printf("cannot connect cs server %s\n", s);
else
{
}
break;
case 'x':
xjade = 1;
break;
case '?':
case ':':
printf("im [-s server]\n");
break;
}
if (error_info.errors)
#define PROMPT() {printf("[%s]> ", (istate.fd > 0 ? istate.cs_svc : "IM")); if (xjade) printf("\n"); fflush(stdout);}
PROMPT();
{
if (*s == '\0')
{
PROMPT();
continue;
}
for (i=0; i < CMD_MAX; i++)
{
{
break;
}
}
if (i == CMD_MAX)
printf("command not found\n");
PROMPT();
}
}
int mkargv(s, w, n)
register char* s;
char** w;
int n;
{
register int i;
for(i = 0; i < n && *s; )
{
while (*s && isspace(*s))
s++;
if (!*s)
break;
w[i++] = s;
while (*s && !isspace(*s))
s++;
if(!*s)
break;
*s++ = '\0';
}
while (i < n)
w[--n] = s;
return i;
}
char* cmd;
{
return (0);
}
int argc;
char** argv;
{
register int i;
register char* s;
int len;
if (argc == 1)
{
for (i=0; i < CMD_MAX; i++)
{
else
}
return (0);
}
while((--argc) > 0)
{
s = *(++argv);
for (i=0; i < CMD_MAX; i++)
{
{
else
break;
}
}
if (i==CMD_MAX)
printf("command %s not undefined\n", s);
}
return (0);
}
/* chop(s,w,n,c) - break string into fields
* a common usage:
* elist[num=chop(s, elist, MAXDEPTH, '/')] = NULL;
* s is modified in place with '\0' replacing occurrences of separator char c.
* w is an array of n char pointers to receive addresses of the fields. The
* return value gives the number of fields actually found; additional entries
* in w are given the address of a null string.
*/
int chop(s,w,n,c)
register char *s;
char *w[];
int n;
char c;
{
register int i;
for (i = 0; i < n && *s;)
{
w[i++] = s;
while (*s && *s != c)
s++;
if (!*s)
break;
*s++ = '\0';
}
while (i < n)
w[--n] = s;
return i;
}
int argc;
char** argv;
{
exit(0);
return -1;
}
/*
* skip(w,n)
* skip empty string in w;
*
*/
int skip(w, n)
char *w[];
register int n;
{
register int i;
register int j;
for (i = 0, j = 0; i < n; i++)
if (w[i][0]) w[j++] = w[i];
return (j);
}
int argc;
register char** argv;
{
register char* s;
int len;
s = *argv;
s++;
if (*s != '\0')
{
}
else
s = buf;
argc--;
argv++;
if (argc > 0)
{
}
}
register char *s;
char *arr[];
char c;
{
register int i;
register char* t;
for (i=0; arr[i]; i++)
{
if (i) *s++ = c;
for (t = arr[i]; *t; t++, s++)
*s = *t;
}
*s = '\0';
return(0);
}