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 r

⟦030cf0935⟧ TextFile

    Length: 3512 (0xdb8)
    Types: TextFile
    Names: »recipstate.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/Lib/qmgr/recipstate.c« 

TextFile

/* recipstate.c: support for qmgr responses */

# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/qmgr/RCS/recipstate.c,v 5.0 90/09/20 16:22:25 pp Exp Locker: pp $";
# endif

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Lib/qmgr/RCS/recipstate.c,v 5.0 90/09/20 16:22:25 pp Exp Locker: pp $
 *
 * $Log:	recipstate.c,v $
 * Revision 5.0  90/09/20  16:22:25  pp
 * rcsforce : 5.0 public release
 * 
 */



#include "util.h"
#include "qmgr.h"

#define STR2QB(s)	str2qb((s), strlen((s)), 1)

struct type_Qmgr_DeliveryStatus *deliverystate;

struct type_Qmgr_DeliveryStatus *delivery_setstate (rno, val, msg)
int     rno, val;
char	*msg;
{
	struct type_Qmgr_DeliveryStatus *ds;

	PP_DBG (("delivery_setstate (%d, %d)", rno, val));

	for (ds = deliverystate; ds; ds = ds -> next) {
		if (ds -> IndividualDeliveryStatus -> recipient -> parm == rno) {
			ds -> IndividualDeliveryStatus -> status = val;
			if (msg) {
				if (ds -> IndividualDeliveryStatus -> info)
					qb_free (ds ->
						 IndividualDeliveryStatus ->
						 info);
				ds -> IndividualDeliveryStatus -> info =
					STR2QB (msg);
			}
		}
	}
	return deliverystate;
}

struct type_Qmgr_DeliveryStatus *delivery_init (users)
struct type_Qmgr_UserList *users;
{
	struct type_Qmgr_DeliveryStatus **ds;
	struct type_Qmgr_IndividualDeliveryStatus *ids;

	PP_DBG (("delivery_init (users)"));

	if (deliverystate) {
		free_Qmgr_DeliveryStatus (deliverystate);
		deliverystate = NULL;
	}

	for (ds = & deliverystate; users; users = users -> next,
	     ds = &(*ds)->next) {
		*ds = (struct type_Qmgr_DeliveryStatus *)
			calloc (1, sizeof (**ds));
		ids = (*ds) -> IndividualDeliveryStatus =
			(struct type_Qmgr_IndividualDeliveryStatus *)
				calloc (1, sizeof (struct type_Qmgr_IndividualDeliveryStatus));
		ids -> recipient = (struct type_Qmgr_RecipientId *)
			calloc (1, sizeof *ids -> recipient);
		ids -> recipient -> parm = users -> RecipientId -> parm;
		ids -> status = -1;
		ids -> info = NULL;
	}
	return deliverystate;
}

struct type_Qmgr_DeliveryStatus *delivery_setallstate (val, msg)
int     val;
char	*msg;
{
	struct type_Qmgr_DeliveryStatus *ds;
	int	first = 1;

	PP_DBG (("delivery_setallstate (%d)", val));

	if (deliverystate == NULL)
		return deliverystate;

	for (ds = deliverystate; ds; ds = ds -> next) {
		switch (ds -> IndividualDeliveryStatus -> status) {
		    case int_Qmgr_status_negativeDR:
		    case int_Qmgr_status_positiveDR:
		    case int_Qmgr_status_successSharedDR:
		    case int_Qmgr_status_failureSharedDR:
			break;
		    default:
			ds -> IndividualDeliveryStatus -> status = val;
			if (msg && val == int_Qmgr_status_mtaFailure &&
			    first) {
				if (ds -> IndividualDeliveryStatus -> info)
					qb_free (ds -> IndividualDeliveryStatus
						 -> info);
				ds -> IndividualDeliveryStatus -> info =
					STR2QB (msg);
				first = 0;
			}
			break;
		}
	}
	return deliverystate;
}

struct type_Qmgr_DeliveryStatus *delivery_resetDRs (val)
int     val;
{
	struct type_Qmgr_DeliveryStatus *ds;

	PP_DBG (("delivery_resetDRs (%d)", val));

	if (deliverystate == NULL)
		return deliverystate;

	for (ds = deliverystate; ds; ds = ds -> next) {
		switch (ds -> IndividualDeliveryStatus -> status) {
		    case int_Qmgr_status_negativeDR:
		    case int_Qmgr_status_positiveDR:
		    case int_Qmgr_status_successSharedDR:
		    case int_Qmgr_status_failureSharedDR:
			ds -> IndividualDeliveryStatus -> status = val;
			break;
		    default:
			break;
		}
	}
	return deliverystate;
}