/* pdm.c - preferred delivery method handling */
static char *rcsid
= "$Header: /f/osi/dsap/common/RCS/pdm.c,v 7.1 91/02/22 09:19:54 mrose Interim $";
* $Header: /f/osi/dsap/common/RCS/pdm.c,v 7.1 91/02/22 09:19:54 mrose Interim $
* Revision 7.1 91/02/22 09:19:54 mrose
* Revision 7.0 89/11/23 21:42:37 mrose
* 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
pdm = <pdm_component> | <pdm_component> '$' <pdm>
pdm_component = 'any' | 'mhs' | 'physical' | 'telex' | 'teletex' |
'g3fax' | 'g4fax' | 'ia5' | 'videotex' | 'telephone'
mhs $ physical $ telex $ telephone
#include "quipu/attrvalue.h"
#include "quipu/syntaxes.h"
static CMD_TABLE pdm_table
[] = {
for (; pdm
!= (struct pref_deliv
*) NULL
; pdm
= next
) {
struct pref_deliv
* a
, *b
;
/* matching here is a bit dubious !!! */
for (; (a
!= (struct pref_deliv
*) NULL
) && (b
!= (struct pref_deliv
*) NULL
) ;
a
= a
->pd_next
, b
=b
->pd_next
)
if ( a
->deliv
!= b
->deliv
)
return (a
->deliv
> b
->deliv
? 1 : -1);
return ( a
> b
? 1 : -1 );
static struct pref_deliv
* pdmcpy (a
)
struct pref_deliv
* b
, *c
, *result
= (struct pref_deliv
*) NULL
;
c
= result
; /* to keep lint happy */
for (; a
!= (struct pref_deliv
*) NULL
; a
= a
->pd_next
) {
b
= (struct pref_deliv
*) smalloc (sizeof (struct pref_deliv
));
if (result
== (struct pref_deliv
*) NULL
)
b
->pd_next
= (struct pref_deliv
*) NULL
;
static struct pref_deliv
* pdmparse (str
)
struct pref_deliv
* result
= (struct pref_deliv
*) NULL
;
struct pref_deliv
* a
, *b
;
b
= result
; /* to keep lint happy */
a
= (struct pref_deliv
*) smalloc (sizeof (struct pref_deliv
));
if ( (ptr
=index (str
,'$')) != NULLCP
) {
if ((a
-> deliv
= cmd_srch (str
,pdm_table
)) == -1) {
parse_error ("Unknown method %s",str
);
return ((struct pref_deliv
*) NULL
);
if (result
== (struct pref_deliv
*) NULL
)
a
-> pd_next
= (struct pref_deliv
*) NULL
;
static pdmprint (ps
,pdm
,format
)
for (; pdm
!= (struct pref_deliv
*) NULL
; pdm
= pdm
->pd_next
) {
ps_print (ps
,rcmd_srch (pdm
->deliv
,pdm_table
));
(void) encode_SA_PreferredDeliveryMethod (&ret_pe
,0,0,NULLCP
,m
);
static struct pref_deliv
* pdmdec (pe
)
if (decode_SA_PreferredDeliveryMethod (pe
,1,NULLIP
,NULLVP
,&m
) == NOTOK
)
return ((struct pref_deliv
*) NULL
);
(void) add_attribute_syntax ("DeliveryMethod",
(IFP
) pdmenc
, (IFP
) pdmdec
,