Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: Randy Maas , djgpp-workers AT delorie DOT com Date: Fri, 5 Dec 1997 15:07:21 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: string inline code In-reply-to: <3.0.1.32.19971204082322.007d82f0@yacker.xiotech.com> Precedence: bulk Randy Maas wrote: > I also noticed that tolower and toupper use an array. I've used the > following equations before, although I'm sure if they cover all the cases > of the array... > # define my_tolower(c) (isupper(c)?('a'-1+((c)&31)):(c)) > # define my_toupper(c) (islower(c)?(((c)&31)-'a'+1):(c)) The arrays are much better to support internationalization. In fact my editor supports a lot of code pages and adjust toupper and tolower according to the code page touching the DJGPP arrays. Think in code pages like 866 (russian) where you have 32 upper and 32 lower extra characters ;-) SET ------------------------------------ 0 -------------------------------- Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013