/* cilist.c - Case Ignore List */
static char *rcsid
= "$Header: /f/osi/dsap/common/RCS/cilist.c,v 7.1 91/02/22 09:18:49 mrose Interim $";
* $Header: /f/osi/dsap/common/RCS/cilist.c,v 7.1 91/02/22 09:18:49 mrose Interim $
* Revision 7.1 91/02/22 09:18:49 mrose
* Revision 7.0 90/08/24 12:10:42 mrose
* *** empty log message ***
* 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
list = <list_component> | <list_component> '$' <list>
list_component = [ '{T61}' ] <string>
An example $ of a case ignore list $ syntax attribute
#include "quipu/attrvalue.h"
#include "quipu/syntaxes.h"
static cilistfree (cilist
)
for (; cilist
!= NULLCILIST
; cilist
= next
) {
for (; (a
!= NULLCILIST
) && (b
!= NULLCILIST
) ;
a
= a
->l_next
, b
=b
->l_next
)
if ((res
= lexequ (a
->l_str
, b
->l_str
)) != 0)
return ( a
> b
? 1 : -1 );
static struct CIList
* cilistcpy (a
)
struct CIList
* b
, *c
, *result
= NULLCILIST
;
c
= result
; /* to keep lint quiet ! */
for (; a
!= NULLCILIST
; a
= a
->l_next
) {
b
= (struct CIList
*) smalloc (sizeof (struct CIList
));
b
-> l_str
= strdup (a
->l_str
);
if (result
== NULLCILIST
)
static struct CIList
* cilistparse (str
)
struct CIList
* result
= NULLCILIST
;
b
= result
; /* to keep lint quiet */
t61_flag
= FALSE
; /* indicate recognition */
ptr
= str
= SkipSpace(str
);
a
= (struct CIList
*) smalloc (sizeof (struct CIList
));
if ( (ptr
=index (str
,'$')) != NULLCP
) {
parse_error ("Null string not allowed",NULLCP
);
if ((t61_str
) || (! check_print_string(str
))) {
if ((a
-> l_str
= octparse (str
)) == NULLCP
)
a
-> l_str
= strdup(str
);
if (result
== NULLCILIST
)
if (( str
= index (ptr
,'}')) == 0) {
parse_error ("close bracket missing '%s'",--ptr
);
if (lexequ ("T.61",ptr
) != 0) {
parse_error ("{T.61} expected '%s'",--ptr
);
a
-> l_next
= NULLCILIST
;
static cilistprint (ps
,cilist
,format
)
for (; cilist
!= NULLCILIST
; cilist
= cilist
->l_next
) {
if (cilist
->l_type
== 1) {
octprint (ps
,cilist
->l_str
,format
);
ps_print (ps
,cilist
->l_str
);
(void) encode_SA_CaseIgnoreList (&ret_pe
,0,0,NULLCP
,m
);
static struct CIList
* cilistdec (pe
)
if (decode_SA_CaseIgnoreList (pe
,1,NULLIP
,NULLVP
,&m
) == NOTOK
)
(void) add_attribute_syntax ("CaseIgnoreList",
(IFP
) cilistenc
, (IFP
) cilistdec
,
(IFP
) cilistparse
, cilistprint
,
(IFP
) cilistcpy
, cilistcmp
,