home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume28
/
m0
/
part01
/
o_string.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-05
|
1KB
|
47 lines
/*
o_string.c
*/
/* Copyright (c) 1994 Christian F. Tschudin. All rights reserved.
Distributed under the terms of the GNU General Public License
version 2 of june 1991 as published by the Free Software
Foundation, Inc.
This file is part of M0.
M0 is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY. No author or distributor accepts responsibility to anyone for
the consequences of using it or for whether it serves any particular
purpose or works at all, unless he says so in writing. Refer to the GNU
General Public License for full details.
Everyone is granted permission to copy, modify and redistribute M0, but
only under the conditions described in the GNU General Public License.
A copy of this license is supposed to have been given to you along with
M0 so you can know your rights and responsibilities. It should be in a
file named LICENSE. Among other things, the copyright notice and this
notice must be preserved on all copies. */
#include "l_proto.h"
#include "o_proto.h"
retcode
o_string()
{
eindex s;
load_1_arg(ei, ep);
if (eptype(ep) != T_INT)
return ERR_TYPE_CHECK;
if (ep->V.i < 0)
return ERR_RANGE_CHECK;
s = new_string(current, ep->V.i);
if (!s)
return ERR_IMPLEMENTATION_LIMIT;
decrefp(current, ei, ep);
current->os[current->osp-1] = s;
return OK;
}