#include "ficl.h"
/*
* a l i g n P t r
* Aligns the given pointer to FICL_ALIGN address units.
* Returns the aligned pointer value.
*/
void *
{
#if FICL_PLATFORM_ALIGNMENT > 1
if (p & (FICL_PLATFORM_ALIGNMENT - 1))
#endif
return (ptr);
}
/*
* s t r r e v
*/
char *
{
char c;
if (i > 1) {
c = *p2;
*p1 = c;
}
}
return (string);
}
/*
* d i g i t _ t o _ c h a r
*/
char
{
}
/*
* i s P o w e r O f T w o
* Tests whether supplied argument is an integer power of 2 (2**n)
* where 32 > n > 1, and returns n if so. Otherwise returns zero.
*/
int
{
int i = 1;
ficlUnsigned t = 2;
for (; ((t <= u) && (t != 0)); i++, t <<= 1) {
if (u == t)
return (i);
}
return (0);
}
/*
* l t o a
*/
char *
{
int pwr;
if (sign)
if (value == 0)
*cp++ = '0';
else if (pwr != 0) {
while (v) {
v >>= pwr;
}
} else {
while (FICL_2UNSIGNED_NOT_ZERO(v)) {
}
}
if (sign)
*cp++ = '-';
*cp++ = '\0';
return (ficlStringReverse(string));
}
/*
* u l t o a
*/
char *
{
if (value == 0)
*cp++ = '0';
else {
while (FICL_2UNSIGNED_NOT_ZERO(ud)) {
}
}
*cp++ = '\0';
return (ficlStringReverse(string));
}
/*
* c a s e F o l d
* Case folds a NULL terminated string in place. All characters
* get converted to lower case.
*/
char *
{
while (*cp) {
cp++;
}
return (oldCp);
}
/*
* s t r i n c m p
* (jws) simplified the code a bit in hopes of appeasing Purify
*/
int
{
int i = 0;
if (i != 0)
return (i);
else if (*cp1 == '\0')
return (0);
}
return (0);
}
/*
* s k i p S p a c e
* Given a string pointer, returns a pointer to the first non-space
* char of the string, or to the NULL terminator if no such char found.
* If the pointer reaches "end" first, stop there. Pass NULL to
* suppress this behavior.
*/
char *
{
cp++;
return (cp);
}
void
{
return;
}
while (*text) {
switch (*text) {
/* throw away \r */
case '\r':
text++;
continue;
case '\n':
text++;
newline = !0 /* true */;
break;
default:
break;
}
}
*trace = 0;
}
}