/* $RCSfile: str.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:26 $
*
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999,
* 2001, 2002, by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
*
* $Log: str.c,v $
*/
#include "EXTERN.h"
#include "a2p.h"
#include "util.h"
void
{
}
char *
{
register char *s;
if (!str)
return "";
while (*s) s++;
}
*s = '\0';
#ifdef DEBUGGING
if (debug & 32)
#endif
}
double
{
if (!str)
return 0.0;
else
#ifdef DEBUGGING
if (debug & 32)
#endif
}
void
{
if (!sstr)
else
}
void
{
}
void
{
register int len;
if (!ptr)
ptr = "";
}
void
{
}
void
{
}
void
{
if (sstr)
}
void
{
register int len;
if (!ptr)
return;
}
char *
{
register char *to;
register int len;
if (!from)
return Nullch;
if (!keeplist) {
from++;
else
}
else
from++;
}
break;
}
*to = '\0';
return from;
}
STR *
{
if (freestrroot) {
str = freestrroot;
}
else {
}
if (len)
return str;
}
void
{
}
/* make str point to what nstr did */
void
{
}
void
{
if (!str)
return;
freestrroot = str;
}
int
{
if (!str)
return 0;
else
return 0;
}
char *
{
/* Here is some breathtakingly efficient cheating */
int i;
int bpx;
#if defined(VMS)
/* An ungetc()d char is handled separately from the regular
* buffer, so we getc() it back out and stuff it in the buffer.
*/
#endif
for (;;) {
while (--cnt >= 0) {
goto thats_all_folks;
else {
line++;
bp -= 2;
}
}
}
if (i == newline) { /* all done for now? */
*bp++ = i;
goto thats_all_folks;
}
else if (i == EOF) /* all done for ever? */
goto thats_all_folks;
*bp++ = i; /* now go back to screaming loop */
}
*bp = '\0';
#else /* USE_STDIO_PTR && STDIO_PTR_LVALUE && STDIO_CNT_LVALUE */
/* The big, slow, and stupid way */
static char buf[4192];
else
#endif /* USE_STDIO_PTR && STDIO_PTR_LVALUE && STDIO_CNT_LVALUE */
}
void
{
register char *d;
if (!str)
return;
return;
}
return;
}
d--;
return;
}
if (++*d <= '9')
return;
*(d--) = '0';
}
/* oh,oh, the number grew */
*d = d[-1];
*d = '1';
}
void
{
register char *d;
if (!str)
return;
return;
}
return;
}
d--;
return;
}
if (--*d >= '0')
return;
*(d--) = '9';
}
}
/* make a string that will exist for the duration of the expression eval */
STR *
{
if (!(tmps_size & 127)) {
if (tmps_size)
else
}
}
return str;
}
STR *
str_make(char *s)
{
return str;
}
STR *
str_nmake(double n)
{
str_numset(str,n);
return str;
}