Commit ffa6fb2d authored by deuce's avatar deuce
Browse files

Use the new request wrappers everywhere. Fix a couple request related

bugs.
parent 8c100589
......@@ -37,6 +37,7 @@
#include "sbbs.h"
#include "cmdshell.h"
#include "js_request.h"
char ** sbbs_t::getstrvar(csi_t *bin, int32_t name)
{
......@@ -594,6 +595,7 @@ long sbbs_t::js_execfile(const char *cmd)
return(-1);
}
JS_BEGINREQUEST(js_cx);
js_scope=JS_NewObject(js_cx, NULL, NULL, js_glob);
if(js_scope!=NULL) {
......@@ -655,6 +657,7 @@ long sbbs_t::js_execfile(const char *cmd)
if(rval!=JSVAL_VOID)
JS_ValueToInt32(js_cx,rval,&result);
JS_ENDREQUEST(js_cx);
return(result);
}
......
......@@ -52,6 +52,7 @@
#include "ftpsrvr.h"
#include "telnet.h"
#include "js_rtpool.h"
#include "js_request.h"
/* Constants */
......@@ -396,9 +397,9 @@ js_write(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
str = JS_ValueToString(cx, argv[i]);
if (!str)
return JS_FALSE;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
fprintf(fp,"%s",JS_GetStringBytes(str));
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
}
if(str==NULL)
......@@ -418,9 +419,9 @@ js_writeln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return(JS_FALSE);
js_write(cx,obj,argc,argv,rval);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
fprintf(fp,"\r\n");
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -483,7 +484,7 @@ js_initcx(JSRuntime* runtime, SOCKET sock, JSObject** glob, JSObject** ftp)
if((js_cx = JS_NewContext(runtime, startup->js.cx_stack))==NULL)
return(NULL);
JS_BeginRequest(js_cx);
JS_BEGINREQUEST(js_cx);
lprintf(LOG_DEBUG,"%04d JavaScript: Context created",sock);
......@@ -517,7 +518,7 @@ js_initcx(JSRuntime* runtime, SOCKET sock, JSObject** glob, JSObject** ftp)
} while(0);
if(!success) {
JS_EndRequest(js_cx);
JS_ENDREQUEST(js_cx);
JS_DestroyContext(js_cx);
return(NULL);
}
......@@ -667,7 +668,7 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
break;
}
rc=JS_SuspendRequest(js_cx);
rc=JS_SUSPENDREQUEST(js_cx);
if(strcspn(startup->html_index_script,"/\\")==strlen(startup->html_index_script)) {
sprintf(spath,"%s%s",scfg.mods_dir,startup->html_index_script);
if(scfg.mods_dir[0]==0 || !fexist(spath))
......@@ -682,7 +683,7 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
lprintf(LOG_ERR,"%04d !HTML JavaScript (%s) doesn't exist",sock,spath);
break;
}
JS_ResumeRequest(js_cx, rc);
JS_RESUMEREQUEST(js_cx, rc);
if((js_str=JS_NewStringCopyZ(js_cx, startup->html_index_file))==NULL)
break;
......@@ -785,7 +786,7 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
if(lib<0) { /* root dir */
rc=JS_SuspendRequest(js_cx);
rc=JS_SUSPENDREQUEST(js_cx);
/* File Aliases */
sprintf(path,"%sftpalias.cfg",scfg.ctrl_dir);
if((alias_fp=fopen(path,"r"))!=NULL) {
......@@ -845,7 +846,7 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
SAFEPRINTF2(vpath,"/%s/%s",p,startup->html_index_file);
} else
SAFECOPY(vpath,p);
JS_ResumeRequest(js_cx, rc);
JS_RESUMEREQUEST(js_cx, rc);
js_add_file(js_cx
,alias_dir ? dir_array : file_array
,p /* filename */
......@@ -861,12 +862,12 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
,scfg.sys_id /* uploader */
,vpath /* link */
);
rc=JS_SuspendRequest(js_cx);
rc=JS_SUSPENDREQUEST(js_cx);
}
fclose(alias_fp);
}
JS_ResumeRequest(js_cx, rc);
JS_RESUMEREQUEST(js_cx, rc);
/* QWK Packet */
if(startup->options&FTP_OPT_ALLOW_QWK /* && fexist(qwkfile) */) {
......@@ -931,7 +932,7 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
}
} else if(chk_ar(&scfg,scfg.dir[dir]->ar,user)){
SAFEPRINTF(path,"%s*",scfg.dir[dir]->path);
rc=JS_SuspendRequest(js_cx);
rc=JS_SUSPENDREQUEST(js_cx);
glob(path,0,NULL,&g);
for(i=0;i<(int)g.gl_pathc;i++) {
if(isdir(g.gl_pathv[i]))
......@@ -956,7 +957,7 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
,scfg.lib[scfg.dir[dir]->lib]->sname
,scfg.dir[dir]->code_suffix
,getfname(g.gl_pathv[i]));
JS_ResumeRequest(js_cx, rc);
JS_RESUMEREQUEST(js_cx, rc);
js_add_file(js_cx
,file_array
,getfname(g.gl_pathv[i]) /* filename */
......@@ -972,11 +973,11 @@ BOOL js_generate_index(JSContext* js_cx, JSObject* parent,
,f.uler /* uploader */
,getfname(g.gl_pathv[i]) /* link */
);
rc=JS_SuspendRequest(js_cx);
rc=JS_SUSPENDREQUEST(js_cx);
}
}
globfree(&g);
JS_ResumeRequest(js_cx, rc);
JS_RESUMEREQUEST(js_cx, rc);
}
......@@ -3911,7 +3912,7 @@ static void ctrl_thread(void* arg)
lprintf(LOG_ERR,"%04d !JavaScript ERROR creating file area object",sock);
}
else
JS_BeginRequest(js_cx);
JS_BEGINREQUEST(js_cx);
if((js_str=JS_NewStringCopyZ(js_cx, "name"))!=NULL) {
js_val=STRING_TO_JSVAL(js_str);
......@@ -3955,7 +3956,7 @@ static void ctrl_thread(void* arg)
js_val=BOOLEAN_TO_JSVAL(INT_TO_BOOL(user.misc&EXTDESC));
JS_SetProperty(js_cx, js_ftp, "extended_descriptions", &js_val);
JS_EndRequest(js_cx);
JS_ENDREQUEST(js_cx);
#endif
if((fp=fopen(ftp_tmpfname(fname,"html",sock),"w+b"))==NULL) {
lprintf(LOG_ERR,"%04d !ERROR %d opening %s",sock,errno,fname);
......@@ -3970,12 +3971,12 @@ static void ctrl_thread(void* arg)
tmpfile=TRUE;
delfile=TRUE;
#ifdef JAVASCRIPT
JS_BeginRequest(js_cx);
JS_BEGINREQUEST(js_cx);
js_val=INT_TO_JSVAL(timeleft);
if(!JS_SetProperty(js_cx, js_ftp, "time_left", &js_val))
lprintf(LOG_ERR,"%04d !JavaScript ERROR setting user.time_left",sock);
js_generate_index(js_cx, js_ftp, sock, fp, lib, dir, &user);
JS_EndRequest(js_cx);
JS_ENDREQUEST(js_cx);
#endif
fclose(fp);
}
......
This diff is collapsed.
......@@ -41,6 +41,7 @@
#include "sbbs.h"
#include "ciolib.h"
#include "js_request.h"
/* Properties */
enum {
......@@ -77,7 +78,7 @@ static JSBool js_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
tiny = JSVAL_TO_INT(id);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
switch(tiny) {
case PROP_WSCROLL:
*vp=BOOLEAN_TO_JSVAL(_wscroll);
......@@ -152,7 +153,7 @@ static JSBool js_get(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
*vp=BOOLEAN_TO_JSVAL(!(cio_textinfo.attribute & 0x8));
break;
}
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -185,39 +186,39 @@ static JSBool js_set(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
break;
case PROP_TEXTATTR:
JS_ValueToInt32(cx, *vp, &i);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
textattr(i);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
break;
case PROP_WHEREX:
JS_ValueToInt32(cx, *vp, &i);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
gotoxy(i, cio_textinfo.cury);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
break;
case PROP_WHEREY:
JS_ValueToInt32(cx, *vp, &i);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
gotoxy(cio_textinfo.curx, i);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
break;
case PROP_TEXTMODE:
JS_ValueToInt32(cx, *vp, &i);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
textmode(i);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
break;
case PROP_TEXTBACKGROUND:
JS_ValueToInt32(cx, *vp, &i);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
textbackground(i);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
break;
case PROP_TEXTCOLOR:
JS_ValueToInt32(cx, *vp, &i);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
textcolor(i);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
break;
case PROP_CLIPBOARD:
{
......@@ -225,28 +226,28 @@ static JSBool js_set(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
char *bytes;
bytes=js_ValueToStringBytes(cx, *vp, &len);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
copytext(bytes, len+1);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
}
break;
case PROP_HIGHVIDEO:
JS_ValueToBoolean(cx, *vp, &b);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
if(b)
highvideo();
else
lowvideo();
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
break;
case PROP_LOWVIDEO:
JS_ValueToBoolean(cx, *vp, &b);
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
if(b)
lowvideo();
else
highvideo();
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
break;
}
......@@ -307,14 +308,14 @@ js_conio_init(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
ciolib_mode=CIOLIB_MODE_CONIO;
}
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
if(initciolib(ciolib_mode)) {
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -323,10 +324,10 @@ js_conio_suspend(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
suspendciolib();
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -335,10 +336,10 @@ js_conio_clreol(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
clreol();
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -347,10 +348,10 @@ js_conio_clrscr(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
clrscr();
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -359,10 +360,10 @@ js_conio_wscroll(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
wscroll();
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -371,10 +372,10 @@ js_conio_delline(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
delline();
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -383,10 +384,10 @@ js_conio_insline(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
insline();
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -395,10 +396,10 @@ js_conio_normvideo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
normvideo();
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -407,9 +408,9 @@ js_conio_getch(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval = INT_TO_JSVAL(getch());
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -418,9 +419,9 @@ js_conio_getche(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval = INT_TO_JSVAL(getche());
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -429,9 +430,9 @@ js_conio_beep(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval = INT_TO_JSVAL(beep());
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -440,9 +441,9 @@ js_conio_getfont(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval = INT_TO_JSVAL(getfont());
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -451,9 +452,9 @@ js_conio_hidemouse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval = INT_TO_JSVAL(hidemouse());
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -462,9 +463,9 @@ js_conio_showmouse(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
{
jsrefcount rc;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval = INT_TO_JSVAL(showmouse());
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -475,10 +476,10 @@ js_conio_setcursortype(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, js
jsrefcount rc;
if(argc==1 && JSVAL_IS_NUMBER(argv[0]) && JS_ValueToInt32(cx,argv[0],&type)) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
_setcursortype(type);
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -493,10 +494,10 @@ js_conio_gotoxy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
if(argc==2 && JSVAL_IS_NUMBER(argv[0]) && JS_ValueToInt32(cx,argv[0],&x)
&& JSVAL_IS_NUMBER(argv[1]) && JS_ValueToInt32(cx,argv[1],&y)) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
gotoxy(x,y);
*rval = JSVAL_TRUE;
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -510,9 +511,9 @@ js_conio_putch(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
jsrefcount rc;
if(argc==1 && JSVAL_IS_NUMBER(argv[0]) && JS_ValueToInt32(cx,argv[0],&ch)) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval=INT_TO_JSVAL(putch(ch));
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -526,9 +527,9 @@ js_conio_ungetch(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
jsrefcount rc;
if(argc==1 && JSVAL_IS_NUMBER(argv[0]) && JS_ValueToInt32(cx,argv[0],&ch)) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval=INT_TO_JSVAL(ungetch(ch));
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -542,9 +543,9 @@ js_conio_loadfont(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
jsrefcount rc;
if(argc==1 && (str=js_ValueToStringBytes(cx,argv[0],NULL))!=NULL) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval=INT_TO_JSVAL(loadfont(str));
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -558,9 +559,9 @@ js_conio_settitle(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
jsrefcount rc;
if(argc==1 && (str=js_ValueToStringBytes(cx,argv[0],NULL))!=NULL) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
settitle(str);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
*rval=JSVAL_TRUE;
return(JS_TRUE);
}
......@@ -575,9 +576,9 @@ js_conio_setname(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
jsrefcount rc;
if(argc==1 && (str=js_ValueToStringBytes(cx,argv[0],NULL))!=NULL) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
setname(str);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
*rval=JSVAL_TRUE;
return(JS_TRUE);
}
......@@ -592,9 +593,9 @@ js_conio_cputs(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
jsrefcount rc;
if(argc==1 && (str=js_ValueToStringBytes(cx,argv[0],NULL))!=NULL) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval=INT_TO_JSVAL(cputs(str));
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -618,9 +619,9 @@ js_conio_setfont(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
if(!JS_ValueToBoolean(cx, argv[1], &force))
return(JS_FALSE);
}
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval=INT_TO_JSVAL(setfont(font, force));
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -635,9 +636,9 @@ js_conio_getpass(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
jsrefcount rc;
if(argc==1 && (str=js_ValueToStringBytes(cx,argv[0],NULL))!=NULL) {
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
pwd=getpass(str);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
*rval=STRING_TO_JSVAL(JS_NewStringCopyZ(cx,pwd));
return(JS_TRUE);
}
......@@ -682,9 +683,9 @@ js_conio_window(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv
return(JS_FALSE);
}
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
window(left, top, right, bottom);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
if(cio_textinfo.winleft == left
&& cio_textinfo.winright==right
&& cio_textinfo.wintop==top
......@@ -716,9 +717,9 @@ js_conio_cgets(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva
return(JS_FALSE);
}
buf[0]=maxlen;
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
ret=cgets(buf);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
if(ret==NULL)
*rval=JSVAL_NULL;
else {
......@@ -760,9 +761,9 @@ js_conio_movetext(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
if(!JS_ValueToInt32(cx, argv[i], &args[i]))
return(JS_FALSE);
}
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval=BOOLEAN_TO_JSVAL(movetext(args[0], args[1], args[2], args[3], args[4], args[5]));
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -823,10 +824,10 @@ js_conio_puttext(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r
buffer[i]=j;
}
rc=JS_SuspendRequest(cx);
rc=JS_SUSPENDREQUEST(cx);
*rval=BOOLEAN_TO_JSVAL(puttext(args[0], args[1], args[2], args[3], buffer));
free(buffer);
JS_ResumeRequest(cx, rc);
JS_RESUMEREQUEST(cx, rc);