if_dir.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, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#include "wish.h"
#include "menudefs.h"
#include "vtdefs.h"
#include "token.h"
#include "slk.h"
#include "actrec.h"
#include "typetab.h"
#include "ctl.h"
#include "var_arrays.h"
#include "terror.h"
#include "moremacros.h"
#include "message.h"
#include "sizes.h"
extern menu_id folder_make();
extern char *path_to_title();
#define MAX_DIRS (16)
/* The activation record for a file folder contains the ott_tab for the
* folder in the odptr field. File folders use the menu human-interface,
* so the id field of the activation record is a menu_id.
*/
static int Dirs_open = 0; /* count how many open */
/* macro to cast the odptr field of an actrec to my struct odptr */
static struct myodptr {
};
static int
dir_close(a)
struct actrec *a;
{
extern char *Filecabinet;
extern char Opwd[];
#ifdef _DEBUG
#endif
if (a->path)
Dirs_open--;
if ( ! Dirs_open ) {
(void) chdir(Filecabinet);
}
}
static struct menu_line
int n;
{
register int i;
struct menu_line m;
char *bsd_path_to_title();
m.flags = 0;
if (n == 0 && size == 0) { /* empty! */
m.highlight = "Empty Folder";
m.description = NULL;
} else {
case 0: /* don't display anything but name */
m.description = NULL;
break;
case OTT_DMARK:
m.description = NULL;
}
}
else
break;
default:
case OTT_DOBJ: /* display description only */
break;
case OTT_DODI: /* display description with odi value */
{
char *key_val, *odi_getkey();
i = 20;
} else {
}
}
m.description = ldescr;
break;
case OTT_DMTIME: /* display long form */
{
int len, i;
char *def_display();
int lcv;
}
else
}
m.description = ldescr;
break;
}
}
return(m);
}
static int
dir_help(a)
struct actrec *a;
{
extern char *Wastebasket;
title = "Wastebasket";
}
else {
title = "File folder";
}
} else {
}
}
static int
dir_current(a)
struct actrec *a;
{
extern char Opwd[];
make_current(a->path);
menu_current(a->id);
return(SUCCESS);
}
static int
dir_reread(a)
struct actrec *a;
{
}
static int
dir_reinit(a)
struct actrec *a;
{
}
static int
struct actrec *a;
bool force;
{
#ifdef _DEBUG
#endif
return(FAIL);
#ifdef _DEBUG
#endif
}
#ifdef _DEBUG
else
#endif
return(SUCCESS);
}
/* these arguments are kludgy, but varargs wouldn't do the trick */
static int
int cmd;
{
#ifdef _DEBUG
#endif
switch (cmd)
{
case CTGETARG:
{
int line;
char *path;
char *ott_to_path();
return(FAIL);
/*if ( **((char ***)(&arg1))) */
/* free( **((char ***)(&arg1))); */ /* les 12/4 */
return(SUCCESS);
}
case CTSETMSG:
/* framemsg is always this - miked */
mess_frame("Move to an item with arrow keys and press ENTER to select the item.");
return(SUCCESS);
case CTSETLIFE:
/* lifetime of directory is always longterm */
return(SUCCESS);
case CTISDEST:
return(SUCCESS);
default:
break;
}
}
static token
register token t;
{
token menu_stream();
#ifdef _DEBUG
#endif
t = menu_stream(t);
#ifdef _DEBUG
#endif
if (t == TOK_NEXT)
t = TOK_NOP; /* filter out, see menu_stream */
return(t);
}
int
char *argv[];
{
register int i;
char *path;
char *bsd_path_to_title();
char *nstrcat();
init_modes();
amask = 0;
for (i = 0; argv[i]; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'w': /* wastebasket mode */
nmask = 0;
break;
case 'a': /* set amask only */
break;
case 'n': /* set nmask only */
break;
}
} else
}
return(SUCCESS);
}
mess_temp("Too many folders open. Close some, then try again.");
return(FAIL);
}
return(FAIL);
}
return(FAIL);
Dirs_open++;
return(SUCCESS);
}
struct actrec *a;
bool cover;
{
char *bsd_path_to_title();
/*if ( a->path )
free( a->path ); */ /* les 12/4 */
/* we will keep track of what the mod times were on the ott at the
* time we first created the window, that way we will be able to
* know when we should recreate the window to reflect the new data.
*/
#ifdef _DEBUG
#endif
/*
(void)strncpy(path_tit,path_to_title(ott->path, NULL, 0),MAX_TITLE-1);
path_tit[MAX_TITLE-1] = '\0';
*/
return(FAIL);
a->lifetime = AR_LONGTERM;
a->flags = 0;
return SUCCESS;
}
/* selection handlers are not used by wish - they are built in to the
* ODSH function
*/
int
IF_dsh()
{
}
int
IF_dvi()
{
}
int
char *argv[];
{
}
int
char *argv[];
{
}
static bool
{
extern char *Filecabinet, *Wastebasket;
err = Filecabinet;
err = Wastebasket;
if (err) {
return(TRUE);
} else
return(FALSE);
}
static int
bool mv;
char *argv[];
{
extern char *Wastebasket, Undel[];
struct ott_entry *path_to_ott();
char *bsd_path_to_title();
char *parent();
" a folder inside itself!", NULL));
return(FAIL);
}
return(FAIL);
return(FAIL);
return(FAIL);
return(FAIL);
return(FAIL);
if ( argv[2] ) {
} else {
}
/* miked k17
sprintf(msg, "%s %sed to the ",
bsd_path_to_title(argv[2] ? argv[2] : filename(argv[0]),(MESS_COLS-22)/2),
mv ? "mov" : "copi");
l = strlen(msg);
strcat(msg, bsd_path_to_title(argv[1],MESS_COLS - l - 7));
strcat(msg, " folder");
*/
return(FAIL);
/*if ( ott->odi )
free( ott->odi ); */ /* les 12/4 */
/*if ( ott->display )
free( ott->display ); */ /* les 12/4 */
(void) ott_chg_odi(ott);
} else {
}
return(ret);
}
int
char *argv[];
{
register char *p;
char *bsd_path_to_title();
return(FAIL);
return(FAIL);
return(FAIL);
return(FAIL);
} else {
mess_temp(nstrcat(bsd_path_to_title(p,(MESS_COLS - 12)/2), " renamed to ", bsd_path_to_title(argv[1],(MESS_COLS - 12)/2), NULL));
return(SUCCESS);
}
}
/*
* note: This subroutine depends on the fact that its argument is
* a legal UNIX path, i.e., slash separated strings.
*/
char *
char *str;
int width;
{
register int len;
extern char *parent();
extern char *filename();
return str; /* protect ourselves from the empty devil */
if (width <= 0)
register int flen;
} else {
}
} else if (flen) {
} else {
}
} else
} else
}