DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T d

⟦eb0867bbc⟧ TextFile

    Length: 2998 (0xbb6)
    Types: TextFile
    Names: »ds_abandon.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/quipu/ds_abandon.c« 

TextFile

/* ds_abandon.c -  */

#ifndef lint
static char *rcsid = "$Header: /f/osi/quipu/RCS/ds_abandon.c,v 7.0 89/11/23 22:17:03 mrose Rel $";
#endif

/*
 * $Header: /f/osi/quipu/RCS/ds_abandon.c,v 7.0 89/11/23 22:17:03 mrose Rel $
 *
 *
 * $Log:	ds_abandon.c,v $
 * Revision 7.0  89/11/23  22:17:03  mrose
 * Release 6.0
 * 
 */

/*
 *                                NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


#include "quipu/util.h"
#include "quipu/attrvalue.h"
#include "quipu/abandon.h"
#include "quipu/dsp.h"
#include "quipu/ds_error.h"
#include "quipu/connection.h"

extern LLog * log_dsap;
/* ARGSUSED */

do_ds_abandon (arg, error)
    struct ds_abandon_arg       *arg;
    struct DSError              *error;
{
	DLOG (log_dsap,LLOG_TRACE,("ds_abandon"));

	error->dse_type = DSE_ABANDON_FAILED;
	error->ERR_ABANDON_FAIL.DSE_ab_problem = DSE_AB_CANNOTABANDON;
	error->ERR_ABANDON_FAIL.DSE_ab_invokeid = 0;
	return (NOTOK);
}

perform_abandon(tk)
struct task_act	* tk;
{
    struct task_act	* tk_tmp;
    struct task_act	**tk_p;
    int			  ab_id = tk->tk_req.dca_dsarg.arg_ab.aba_invokeid;
    struct DSError	* err = &(tk->tk_resp.resp_err);

    DLOG(log_dsap, LLOG_TRACE, ("perform_abandon"));

    tk_p = &(tk->tk_conn->cn_tasklist);
    for(tk_tmp = (*tk_p); tk_tmp!=NULLTASK; tk_tmp=tk_tmp->tk_next)
    {
	if(tk_tmp->tk_id == ab_id)
	    break;

	tk_p = &(tk_tmp->tk_next);
    }
    if(tk_tmp == NULLTASK)
    {
	LLOG(log_dsap, LLOG_NOTICE, ("perform_abandon - cannot find task to abandon"));
	err->dse_type = DSE_ABANDON_FAILED;
	err->ERR_ABANDON_FAIL.DSE_ab_problem = DSE_AB_NOSUCHOPERATION;
	err->ERR_ABANDON_FAIL.DSE_ab_invokeid = ab_id;
	return(NOTOK);
    }
    else
    {
	DLOG(log_dsap, LLOG_DEBUG, ("perform_abandon - found task to abandon"));

	/* Slice out task to abandon */
	(*tk_p) = tk_tmp->tk_next;

	if(task_abandon(tk_tmp) != OK)
	{
	    DLOG(log_dsap, LLOG_DEBUG, ("perform_abandon - task_abandon NOTOK"));
	    err->dse_type = DSE_ABANDON_FAILED;
	    err->ERR_ABANDON_FAIL.DSE_ab_problem = DSE_AB_CANNOTABANDON;
	    err->ERR_ABANDON_FAIL.DSE_ab_invokeid = ab_id;
	    return(NOTOK);
	}
	else
	{
	    DLOG(log_dsap, LLOG_DEBUG, ("perform_abandon - task_abandon OK"));
	    tk->tk_result = &(tk->tk_resp.resp_res);
	    tk->tk_result->dcr_dsres.result_type = OP_ABANDON;
	    return(OK);
	}
    }
}

task_abandon(tk)
struct task_act	* tk;
{
    struct oper_act	* on;

    DLOG(log_dsap, LLOG_TRACE, ("task_abandon"));

    for(on = tk->tk_operlist; on != NULLOPER; on = on->on_next_task)
    {
	on->on_state = ON_ABANDONED;
	on->on_task = NULLTASK;
    }

    tk->tk_type = ACT_TYPE_RESP;
    tk->tk_resp.resp_type = RESP_TYPE_RET;
    tk->tk_resp.ret_type = RET_TYPE_ERR;
    tk->tk_resp.resp_err.dse_type = DSE_ABANDONED;
    task_error(tk);

    return(OK);
}