mencmds.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1985 AT&T
* All Rights Reserved
*/
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.26 */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "typetab.h"
#include "wish.h"
#include "terror.h"
#include "procdefs.h"
#include "eval.h"
#include "ctl.h"
#include "moremacros.h"
#include "message.h"
#include "sizes.h"
/*
* Globals used in eval() ...
*/
extern int EV_retcode;
extern int EV_backquotes;
extern int Lasttok;
extern int Vflag;
int
int argc;
char *argv[];
{
char *path;
char *key;
char *value;
struct ott_entry *path_to_ott();
switch (argc) {
case 1:
case 2:
mess_temp("setodi: not enough arguments");
return(FAIL);
case 3:
break;
default:
mess_temp("setodi: extra args ignored");
case 4:
break;
}
ott_dirty();
}
if (value)
return(SUCCESS);
}
int
int argc;
char *argv[];
{
char *path;
char *key;
char *value;
struct ott_entry *path_to_ott();
char *odi_getkey();
switch (argc) {
case 1:
case 2:
mess_temp("putodi: not enough args");
return(FAIL);
default:
mess_temp("putodi: extra args ignored");
case 3:
break;
}
return(FAIL);
return(SUCCESS);
} else
return(FAIL);
}
int
int argc;
char *argv[];
{
register int i;
int procflags = 0;
switch (argv[i][1]) {
case 's':
break;
case 'n':
break;
case 'e':
break;
case 't':
break;
default:
break;
}
}
if (silent)
else
}
int
int argc;
char *argv[];
{
register int i;
char whichenv;
extern char *Home;
char *strchr();
char *io_string();
whichenv = '\0';
for (i = 1; argv[i]; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'l':
break;
case 'f':
break;
}
}
else {
if (whichenv == 'l')
else {
if (!file) {
}
}
whichenv = '\0';
}
}
return SUCCESS;
}
int
int argc;
char *argv[];
{
register int i;
char whichenv;
char *envbuf;
extern char *Home;
char *strchr();
char *io_string();
whichenv = '\0';
for (i = 1; argv[i]; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'l':
case 'e':
break;
case 'f':
break;
}
}
else {
dofree = 0;
/*
* Value is greater than 1K so malloc
* enough space to hold it.
*/
dofree++;
}
else {
/*
* ... otherwise, use static 1K buffer
*/
}
if (*val == '\n')
*val = '\0';
}
else
if (whichenv == 'l')
else if (whichenv == 'e')
else {
if (!file) {
}
*val++ = '\0';
}
if (dofree) {
}
whichenv = '\0';
}
}
return SUCCESS;
}
/* types of messages (temporary, permanent, frame permanent) */
#define MTEMP 0x1
#define MPERM 0x2
#define MFRAME 0x4
int
int argc;
char *argv[];
{
register char *amessage;
register int i;
register int messtype;
bool dofree;
int num;
char *ptr;
char *io_string();
messtype = 0;
for (i = 1; argv[i]; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'p':
break;
case 't':
break;
case 'f':
break;
case 'o':
break;
case 'w':
break;
case 'b':
i++;
}
else
num=1;
break;
default:
break;
}
} else {
}
}
} else
}
}
else { /* temporary message assumed */
}
if (output)
if (dofree)
if (work)
/* les */
else
doupdate();
if (bell) {
for(i = num; i > 0; i--)
beep();
}
/*
flush_output();
*/
return SUCCESS;
}
int
int argc;
char *argv[];
{
register char *amessage;
bool dofree;
int num;
char *ptr;
char *io_string();
mescol = 0;
for (i = 1; argv[i]; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'c':
i++;
break;
case 'l':
i++;
break;
case 'o':
break;
case 'w':
break;
case 'b':
i++;
}
else
num=1;
break;
default:
break;
}
} else {
}
}
} else
if (output)
if (dofree)
if (work)
else
doupdate();
if (bell) {
for(i = num; i > 0; i--)
beep();
}
return SUCCESS;
}
#define MAX_PATTERNS 32
/*
* Usage: regex [-v string] [-e] pattern [template] [pattern [template] ...]
*
* The first form takes a string and matches it against patterns until
* there is a match. Patterns are regular expression as described in
* regcmp(3X). When a match is found, the corresponding template is
* returned in the output stream. Templates may be arbitrary strings,
* but if the string $m0, $m1, ..., $m9 appear in the string, then they
* will be expanded to the corresponding pattern that matched within
* (...)$0 through (...)$9 parts of the pattern.
* For example:
* regex "0123456789" '.{2}(.{3})$0' 'hi $m0'
* would return the string: 'hi 234'.
* The default template is '$m0$m1$m2$m3$m4$m5$m6$m7$m8$m9'.
*
* The -v option causes string to be parsed instead of stdin
*
* The -e option causes the resulting template to be evaluated
*/
int argc;
char *argv[];
{
register char *p;
char *pattern[MAX_PATTERNS];
char *template[MAX_PATTERNS];
static char deftemplate[] = "$m0$m1$m2$m3$m4$m5$m6$m7$m8$m9";
register int i;
register int j;
register int numpatterns, execflag;
register bool matches;
char *regex();
char *regcmp();
char *getastr();
switch (argv[i][1]) {
case 'e': /* evaluate the matched template */
break;
case 'v': /* from a variable */
else
break;
default:
break;
}
}
if (execflag) { /* generate an intermediate IO chanel */
}
else
numpatterns = 0;
for ( ; i < argc; i += 2) {
if (argv[i + 1])
else
}
for ( ; ; ) {
if (value)
buf[i] = '\0';
}
else
break;
for (i = 0; i < numpatterns; i++) {
continue;
for (j = 0; j < 10; j++)
ret[j][0] = '\0';
for (p = template[i]; *p; p++) {
p += 2;
}
else
}
break;
}
}
if (value)
break;
}
/*
* making a recursive call to eval() ... this SHOULD
* change in the future and should not be necessary
*/
}
for (i = 0; i < numpatterns; i++)
if (pattern[i])
}
int
int argc;
char *argv[];
{
register char *delimiter;
char *itemptr;
if (argc == 1)
delimiter = "\n";
else
return(FAIL);
}
if (pending++)
}
}
return(SUCCESS);
}
int
int argc;
char *argv[];
{
register char *p;
register char *pre;
register char *input;
register int i;
register int n;
register int width;
bool fullpath;
bool show_max;
bool freeit;
char *io_string();
char *path_to_full();
char *path_to_title();
for (i = 1; i < argc; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'v':
if (argv[i][2])
i--;
}
break;
case 'l':
break;
case 'f':
break;
case 't':
break;
case 'n':
if (argv[i][2])
i--;
}
break;
default:
break;
}
}
else
}
if (!input) {
/* io_string was returning the input with tabs and newlines
and therefore input to path_to_full was not expanding the
alias. The following two lines will truncate the white space
and newlines from input. -- added 7/89 by njp. */
input[n]= '\0';
}
if (fullpath) {
free(p);
}
else {
if ( show_max )
else
}
if (freeit)
return SUCCESS;
}
int argc;
char *argv[];
{
if (argc != 5)
return(FAIL);
return(SUCCESS);
}
else {
return(FAIL);
}
}