Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 9585b9d1 authored by rswindell's avatar rswindell

Eliminated unnecessary function: js_MethodsToFunctions, functions are now

always defined in the constructor, rather than in the class structure.
Created js_DescribeObject and js_DescribeConstructor functions to create the
invisible properties used by the new jsdocs.js script to create the HTML docs.
parent 91795624
......@@ -273,18 +273,28 @@ static JSClass js_method_class = {
/* Convert from Synchronet-specific jsMethodSpec to JSAPI's JSFunctionSpec */
int DLLCALL js_MethodsToFunctions(jsMethodSpec meth[], JSFunctionSpec func[])
JSBool
DLLCALL js_DescribeObject(JSContext* cx, JSObject* obj, const char* str)
{
int i;
JSString* js_str = JS_NewStringCopyZ(cx, str);
/* Convert from jsMethodSpec to JSFunctionSpec */
for(i=0;meth[i].name!=NULL;i++) {
func[i].name=meth[i].name;
func[i].call=meth[i].call;
func[i].nargs=meth[i].nargs;
}
if(js_str==NULL)
return(JS_FALSE);
return(JS_DefineProperty(cx,obj,"_description"
,STRING_TO_JSVAL(js_str),NULL,NULL,JSPROP_READONLY));
}
JSBool
DLLCALL js_DescribeConstructor(JSContext* cx, JSObject* obj, const char* str)
{
JSString* js_str = JS_NewStringCopyZ(cx, str);
if(js_str==NULL)
return(JS_FALSE);
return(i);
return(JS_DefineProperty(cx,obj,"_constructor"
,STRING_TO_JSVAL(js_str),NULL,NULL,JSPROP_READONLY));
}
#ifdef _DEBUG
......
......@@ -846,7 +846,8 @@ extern "C" {
#endif
/* main.cpp */
DLLEXPORT int DLLCALL js_MethodsToFunctions(jsMethodSpec meth[], JSFunctionSpec func[]);
DLLEXPORT JSBool DLLCALL js_DescribeObject(JSContext* cx, JSObject* obj, const char*);
DLLEXPORT JSBool DLLCALL js_DescribeConstructor(JSContext* cx, JSObject* obj, const char*);
DLLEXPORT JSBool DLLCALL js_DefineMethods(JSContext* cx, JSObject* obj, jsMethodSpec *fs);
DLLEXPORT JSBool DLLCALL js_CreateArrayOfStrings(JSContext* cx, JSObject* parent
,const char* name, char* str[], uintN flags);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment