version 1.20, 2015/08/06 10:01:53 |
version 1.23, 2017/02/07 08:30:31 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/parse/pvar.c,v 1.19 2014/08/09 06:08:11 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/pvar.c,v 1.22 2015/08/14 13:51:56 fujimoto Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 298 int getpvar(VS pvs,char *str,int searchonly) |
|
Line 298 int getpvar(VS pvs,char *str,int searchonly) |
|
if ( searchonly ) |
if ( searchonly ) |
return -1; |
return -1; |
if ( pvs->asize == pvs->n ) |
if ( pvs->asize == pvs->n ) |
reallocarray((char **)&pvs->va,(int *)&pvs->asize,(int *)&pvs->n,(int)sizeof(struct oPV)); |
asir_reallocarray((char **)&pvs->va,(int *)&pvs->asize,(int *)&pvs->n,(int)sizeof(struct oPV)); |
v = &pvs->va[pvs->n]; |
v = &pvs->va[pvs->n]; |
NAME(v) = (char *)CALLOC(strlen(str)+1,sizeof(char)); |
NAME(v) = (char *)CALLOC(strlen(str)+1,sizeof(char)); |
strcpy(NAME(v),str); v->priv = 0; |
strcpy(NAME(v),str); v->priv = 0; |
Line 306 int getpvar(VS pvs,char *str,int searchonly) |
|
Line 306 int getpvar(VS pvs,char *str,int searchonly) |
|
return i; |
return i; |
} |
} |
|
|
#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
#if defined(VISUAL) || defined(__MINGW32__) |
#define PCLOSE _pclose |
#define PCLOSE _pclose |
#else |
#else |
#define PCLOSE pclose |
#define PCLOSE pclose |
Line 317 void closecurrentinput() |
|
Line 317 void closecurrentinput() |
|
if ( asir_infile && !asir_infile->fp ) |
if ( asir_infile && !asir_infile->fp ) |
return; |
return; |
|
|
#if defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
#if defined(VISUAL) || defined(__MINGW32__) |
fclose(asir_infile->fp); |
fclose(asir_infile->fp); |
unlink(asir_infile->tname); |
unlink(asir_infile->tname); |
#else |
#else |
Line 361 void restorepvs() |
|
Line 361 void restorepvs() |
|
void storeans(pointer p) |
void storeans(pointer p) |
{ |
{ |
if ( APVS->asize == APVS->n ) |
if ( APVS->asize == APVS->n ) |
reallocarray((char **)&APVS->va,(int *)&APVS->asize,(int *)&APVS->n,(int)sizeof(struct oPV)); |
asir_reallocarray((char **)&APVS->va,(int *)&APVS->asize,(int *)&APVS->n,(int)sizeof(struct oPV)); |
APVS->va[APVS->n++].priv = p; |
APVS->va[APVS->n++].priv = p; |
} |
} |