actrec.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
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include "wish.h"
#include "token.h"
#include "slk.h"
#include "actrec.h"
#include "menudefs.h"
#include "ctl.h"
#include "terror.h"
#include "message.h"
#include "moremacros.h"
/* Functions for manipulating activation records */
static int AR_serial = 0;
void ar_dump();
/* LES: becoming a MACRO
struct actrec *
ar_get_current()
{
return(AR_cur);
}
*/
struct actrec *
{
/* link the new record right after the current record */
/* nobody has been made yet, so make a degenerate list */
}
else {
}
return(newrec);
}
struct actrec *
{
return ret;
}
int
{
int ret; /* abs k15 */
return ret;
}
struct actrec *
bool logout;
{
struct actrec *ar_cur_prev();
{
return(rec);
}
/* don't allow recursive closes! */
return(rec); /* abs k17 */
/* re-evaluate lifetime - if immortal, don't close */
{
mess_temp("Can't close this frame\n");
return rec;
}
else
/* close the internals of the record */
{
return(AR_cur);
}
/* if closing current record and not exiting fmli, choose a new one */
else {
if ( logout )
}
/* relink the lists */
else
{
{
{
break;
}
{
/* rec = NULL; causes core dump. abs k14 */
break;
}
}
}
else if (new_cur)
{
register struct actrec *old_AR_cur;
void ar_cur_end();
else /* abs k17 */
{
old_AR_cur = AR_cur;
}
}
#ifdef _DEBUG
#endif
if (rec)
#ifdef _DEBUG5
ar_dump("AFTER ar_close");
#endif
return AR_cur;
}
struct actrec *
{
struct actrec *ar_current();
break;
return ap;
}
struct actrec *
{
struct actrec *ar_current();
break;
return ap;
}
/*
* front end for ar_current and ar_backup
* cleans up previously current actrec and calls reinit on new current one
*/
static void
bool do_reinit;
{
/*
* if there is a current record, and that record is not the same
* as the one we are making current, then either close it or make
* it non-current, depending on its lifetime.
* (call ar_ctl with CTSETLIFE to determine whether
* the current object's "lifetime" has changed)
* NOTE: lifetime can not change for initial objects
*/
/* bug 1138884 - this code is not in the SVR3 version so...
if (AR_cur->lifetime != AR_INITIAL)
(void) ar_ctl(AR_cur, CTSETLIFE, 0, NULL, NULL, NULL, NULL, NULL);
*/
mess_lock(); /* don't ask ... */
mess_unlock();
}
}
}
/*
* back end for ar_current and ar_backup
* calls current function and sets slks
* "ap" is actrec to make current if it fails
*/
static void
{
{
else
{
}
}
else
#ifdef _DEBUG5
ar_dump("at end of ar_current");
#endif
}
struct actrec *
{
register struct actrec *old_AR_cur;
old_AR_cur = AR_cur;
return AR_cur;
}
struct actrec *
bool do_reinit; /* abs k15 */
{
/* do not make rec current if it's closing. abs k17 */
return(AR_cur); /* abs k17 */
/*
* backup is a circularly linked list
*/
/* produce degenerate list */
/* traverse entire list */
/*
* if rec is in list and is not where we want it
* unlink it from list
*/
}
/* if rec is not where we want it, link it in befre cur */
}
}
return AR_cur;
}
/* a minimal version of ar_current for use when the frame is
* made current only for internal purposes. for example, used
* when doing a reread from ar_checkworld. The user doesn't
* see a change in what frame is current but internally we
* make the frame current so we can update it.
*/
int
{
/* do not make rec current if it's closing. abs k17 */
return(FAIL); /* abs k17 */
/* produce degenerate list */
{
else
{
return FAIL;
}
}
return SUCCESS;
}
ar_setslks(s, flags)
struct slk *s;
int flags;
{
return SUCCESS;
}
token t;
{
}
/* find an activation record via its window number */
struct actrec *
int wdw;
{
struct actrec *p;
return p;
return NULL;
return NULL;
}
/* find an activation record via its path */
struct actrec *
path_to_ar(s)
char *s;
{
struct actrec *p;
return p;
return NULL;
return NULL;
}
bool
char *s, *op;
bool exact; /* if TRUE, don't allow exact match */
{
struct actrec *p;
" an open object, close it first", NULL));
return(TRUE);
" a folder with open sub-folders, close them first", NULL));
return(TRUE);
break;
}
return FALSE;
}
/* find the activation record past the argument given with a certain path */
struct actrec *
{
register struct actrec *p;
return(p);
return(p);
}
return(NULL);
}
struct actrec *
register int life;
{
register bool logout;
/* p = AR_head miked k17+ */;
do
{
/* p = p->nextrec; miked k17+ */
p = nextp; /* miked k17+ */
return(AR_cur);
}
{
}
void
bool force; /* if TRUE, forced check */
{
extern long Mail_check;
{
return;
}
/* for (rec = AR_head; rec; rec = rec->nextrec) miked k17+ */
{
/* if (rec->nextrec == AR_head) miked k17+ */
break;
}
(void) ar_cur_temp(sav_cur);
}
{
register struct actrec *p;
if (p == ar1)
return(TRUE);
else if (p == ar2)
return(FALSE);
}
return(TRUE); /* should not get this far */
}
struct actrec *
int n;
{
register int i;
register struct actrec *p;
/* records with NULL path fields are not listed */
if (p->path) {
if (++i == n)
return(p);
}
break;
}
return NULL;
}
struct menu_line
ar_menudisp(n, ptr)
register int n;
register char *ptr;
{
register struct actrec *p;
struct menu_line m;
m.description = NULL;
m.flags = 0;
if (p = menline_to_ar(n))
else
return m;
}
int /* >>>>>> NONPORTABLE!!! change to "char *" <<<<<<< */
int cmd;
{
return(FAIL);
/* if (cmd == CTSETLIFE && arg1 != 0)
{
rec->lifetime = arg1;
return(SUCCESS);
}
else
return((*(rec->fcntbl[AR_CTL]))
(rec, cmd, arg1, arg2, arg3, arg4, arg5, arg6));
abs */
switch (cmd)
{
case CTSETLIFE:
if (arg1 != 0)
{
return(SUCCESS);
}
else
break;
case CTSETINTR: /* >>> ADD FREE STR CODE <<< */
else
return(SUCCESS);
case CTGETINTR:
case CTSETONINTR: /* >>> ADD FREE STR CODE <<< */
else
return(SUCCESS);
case CTGETONINTR:
return((int)rec->oninterrupt);
default:
}
}
#ifdef _DEBUG5
/* for debugging - print out activation record info */
void
ar_dump(s)
char *s;
{
struct actrec *p;
break;
}
}
#endif