/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21#include "FEATURE/uwin"2223#if !_UWIN || _lib_a64l2425void _STUB_a64l(){}2627#else2829#define a64l ______a64l30#define l64a ______l64a3132#include <stdlib.h>33#include <string.h>3435#undef a64l36#undef l64a3738#if defined(__EXPORT__)39#define extern __EXPORT__40#endif4142static char letter[65] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";4344extern long a64l(const char *str)45{46register unsigned long ul = 0;47register int n = 6;48register int c;49register char *cp;50for(n=0; n <6; n++)51{52if((c= *str++)==0)53break;54if(!(cp=strchr(letter,c)))55break;56ul |= (cp-letter)<< (6*n);57}58return((long)ul);59}6061extern char *l64a(long l)62{63static char buff[7];64unsigned ul = ((unsigned long)l & 0xffffffff);65register char *cp = buff;66while(ul>0)67{68*cp++ = letter[ul&077];69ul >>= 6;70}71*cp = 0;72return(buff);73}7475#endif767778