Changeset 580 for trunk/zoo-project/zoo-kernel/service_internal.c
- Timestamp:
- Feb 12, 2015, 11:18:07 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal.c
r579 r580 641 641 } 642 642 return (char*)"-1"; 643 }644 645 #endif646 647 #ifdef USE_JS648 649 JSBool650 JSUpdateStatus(JSContext *cx, uintN argc, jsval *argv1)651 {652 jsval *argv = JS_ARGV(cx,argv1);653 JS_MaybeGC(cx);654 int istatus=0;655 char *status=NULL;656 maps *conf;657 if(argc>2){658 #ifdef JS_DEBUG659 fprintf(stderr,"Number of arguments used to call the function : %i",argc);660 #endif661 return JS_FALSE;662 }663 conf=mapsFromJSObject(cx,argv[0]);664 if(JS_ValueToInt32(cx,argv[1],&istatus)==JS_TRUE){665 char tmpStatus[4];666 sprintf(tmpStatus,"%i",istatus);667 tmpStatus[3]=0;668 status=strdup(tmpStatus);669 }670 if(getMapFromMaps(conf,"lenv","status")!=NULL){671 if(status!=NULL){672 setMapInMaps(conf,"lenv","status",status);673 free(status);674 }675 else676 setMapInMaps(conf,"lenv","status","15");677 _updateStatus(conf);678 }679 freeMaps(&conf);680 free(conf);681 JS_MaybeGC(cx);682 return JS_TRUE;683 643 } 684 644
Note: See TracChangeset
for help on using the changeset viewer.