new function to be added to the thotlib

Stephane Bonhomme (Stephane.Bonhomme@inrialpes.fr)
Tue, 20 Oct 1998 14:24:31 +0200

I post this mail because the author is not yet registered to the thot mailing
list.

Cécile

- ------- Forwarded Message

Return-Path: owner-thot@imag.fr
Received: from imag.imag.fr (imag.imag.fr [129.88.30.1])
by palmier.inrialpes.fr (8.8.5/8.8.5) with ESMTP id JAA22741
for <roisin@palmier.inrialpes.fr>; Tue, 20 Oct 1998 09:22:29 +0200 (MET DST)
Received: (from daemon@localhost)
by imag.imag.fr (8.8.5/8.8.5) id JAA05640;
Tue, 20 Oct 1998 09:22:28 +0200 (MET DST)
Date: Tue, 20 Oct 1998 09:22:28 +0200 (MET DST)
Message-Id: <199810200722.JAA05640@imag.imag.fr>
To: owner-thot@imag.imag.fr
From: owner-thot@imag.imag.fr
Subject: BOUNCE thot@imag.imag.fr: Non-member submission from
[emt@dcs.fmph.uniba.sk (Euromath System)]
Content-Type: text
Content-Length: 3093

>From owner-thot-imag@imag.imag.fr Tue Oct 20 09:21:54 1998
Received: from atlantis.dcs.fmph.uniba.sk (atlantis.dcs.fmph.uniba.sk
[158.195.18.163])
by imag.imag.fr (8.8.5/8.8.5) with ESMTP id JAA05602
for <thot@imag.fr>; Tue, 20 Oct 1998 09:21:48 +0200 (MET DST)
Received: from hermes.indcs (hermes.dcs.fmph.uniba.sk [158.195.87.2])
by atlantis.dcs.fmph.uniba.sk (8.8.8/8.8.8) with SMTP id IAA08196
for <thot@imag.fr>; Tue, 20 Oct 1998 08:11:18 GMT
Received: by hermes.indcs (SMI-8.6/SMI-SVR4)
id JAA21731; Tue, 20 Oct 1998 09:16:17 +0200
From: emt@dcs.fmph.uniba.sk (Euromath System)
Message-Id: <199810200716.JAA21731@hermes.indcs>
Subject: New API function. :-) f
To: thot@imag.fr
Date: Tue, 20 Oct 1998 09:16:17 +0200 (MET DST)
X-Mailer: ELM [version 2.4ME+ PL19 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Good morning,afternoon,evening.

Problem is with accessing enumerate types of attribute by name.

I would like have some function like this

/* ----------------------------------------------------------------------
TtaGiveEnumValueFromOriginalName

---------------------------------------------------------------------- */

#ifdef __STDC__
void TtaGiveEnumValueFromOriginalName (char *name,
Attribute attr, int *attrvalue)

#else /* __STDC__ */
void TtaGiveEnumValueFromOriginalName (name, attr, attrvalue)
char *name;
Attribute attr;
int *attrvalue;

#endif /* __STDC__ */

{
int i,found;
TtAttribute *pAttr;

if( name!=NULL && *name) {
pAttr=&(((PtrAttribute)attr)->AeAttrSSchema->SsAttribute[((PtrAttribute)att
r)->AeAttrNum - 1]);

for(i=0,found=0;!found && i<(pAttr->AttrNEnumValues);i++) {
found=!strcmp(name,pAttr->AttrEnumOrigValue[i]);
/*
printf("Enum %d=%s",i,pAttr->AttrEnumOrigValue[i]);
printf("\n");
*/
}

if(found) *attrvalue=i;
else *attrvalue=-2;
}
else *attrvalue=-1;
}

If you have noticed I added new record into structure TtAttribute.
It is same like AttrEnumValue[] but saves original names of enumerated type.
:-)
I must changed function ReadAttribute() of course. I added just this line on
right place:
strcpy(pAttr->AttrEnumOrigValue[j],pAttr->AttrEnumValue[j]);

:-)

Can it be included into next version of Thot library?

Thank you

Marek Nagy.

***************************************************
* Euromath Support Center *
* Department of Computer Science *
* Faculty of Mathematics and Physics *
* Comenius University *
* Mlynska dolina *
* 842 15 Bratislava *
* Slovak Republic *
* *
* Tel: +421-7-654 26 635 Fax: +421-7-654 27 041 *
* e-mail: emt@fmph.uniba.sk *
* http://www.dcs.fmph.uniba.sk/~emt *
***************************************************

Cecile

- ----------------------------------------------------------
Cecile Roisin
EMAIL: Cecile.Roisin@inrialpes.fr
- ----------------------------
Unite de Recherche INRIA Rhone-Alpes -
projet OPERA ( http://opera.inrialpes.fr/OPERA/ )
655 avenue de l'Europe
F-38330 Montbonnot Saint-Martin
TEL: (33) 04 76 61 53 60 FAX: (33) 04 76 61 52 07
- -----------------------------------------------------------

Stéphane.
-----------------------------------------
Stéphane BONHOMME - PhD Student
Projet Opéra

Unité de Recherche INRIA Rhône-Alpes
655 avenue de l'Europe
38330 Montbonnot Saint-Martin

email: Stephane.Bonhomme@inrialpes.fr
Phone: (33)76.61.53.81 Fax: (33) 76.61.52.52

-----------------------------------------

----------------------------------------------------------------------------
thot@imag.fr is archived at http://opera.inrialpes.fr/thot/messages/