browse.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 1993 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include "wish.h"
#include "token.h"
#include "slk.h"
#include "actrec.h"
#include "terror.h"
#include "ctl.h"
#include "moremacros.h"
#define BROWSE 1
#define PROMPT 2
/*
* Caution: MAX_ARGS is defined in other files and should ultimately reside
* in wish.h
*/
#define MAX_ARGS 25
extern int Arg_count;
extern char *Args[];
extern char *tok_to_cmd(); /* abs k16 */
struct slk *Pending_slks;
int Pending_type;
static char name_string[] = "Enter the new object name: ";
static char desc_string[] = "Enter the new description: ";
int Browse_mode = 0;
{
Browse_mode++;
mess_temp("Open or navigate to the destination folder and press SELECT");
}
{
get_string(namevalid, strCcmp(Pending_op, "redescribe") ? name_string : desc_string, "", 0, FALSE, Pending_op, Pending_op);
}
static token
namevalid(s, t)
char *s;
token t;
{
register int i;
char *errstr;
if (t == TOK_CANCEL) {
if ( Browse_mode )
else
Pending_op = NULL;
return TOK_NOP;
}
return TOK_NOP;
}
return TOK_NOP;
}
}
/*
* Notice that redescribe falls thru the above if block without ever
* calling namecheck!
*/
for (i = 0; Pending_argv[i]; i++)
;
Pending_argv[i] = strsave(s);
glob_select();
return(TOK_NOP);
}
{
register int i, prevtype = Pending_type;
bool canselect;
if (Pending_type == BROWSE) {
if (ar_ctl(ar_get_current(), CTISDEST, &canselect, NULL, NULL, NULL, NULL, NULL) == FAIL || !canselect) {
mess_temp("This frame can not be used as a destination");
return;
}
for (i = 0; Pending_argv[i]; i++)
;
}
redescribe(&Pending_argv[0]);
Create_create(&Pending_argv[0]);
} else {
}
if (Pending_type == prevtype)
}
int
{
Browse_mode = 0;
if (Pending_op) {
register int i;
Pending_op = NULL;
if (Pending_objtype) {
}
for (i = 0; Pending_argv[i]; i++) {
free(Pending_argv[i]);
Pending_argv[i] = NULL;
}
}
}
token t;
{
if (cmd_name) /* abs k16 */
else
beep(); /* abs k16 */
return(t);
}
static
{
register int i;
for (i = 0; argv[i]; i++)
Pending_argv[i] = NULL;
}