boxed.h   boxed.h 
skipping to change at line 60 skipping to change at line 60
JSObject* gjs_lookup_boxed_prototype (JSContext *context, JSObject* gjs_lookup_boxed_prototype (JSContext *context,
GIBoxedInfo *info); GIBoxedInfo *info);
JSClass* gjs_lookup_boxed_class (JSContext *context, JSClass* gjs_lookup_boxed_class (JSContext *context,
GIBoxedInfo *info); GIBoxedInfo *info);
void* gjs_c_struct_from_boxed (JSContext *context, void* gjs_c_struct_from_boxed (JSContext *context,
JSObject *obj); JSObject *obj);
JSObject* gjs_boxed_from_c_struct (JSContext *context, JSObject* gjs_boxed_from_c_struct (JSContext *context,
GIStructInfo *info, GIStructInfo *info,
void *gboxed, void *gboxed,
GjsBoxedCreationFlags flags); GjsBoxedCreationFlags flags);
JSBool gjs_typecheck_boxed (JSContext *context,
JSObject *obj,
GIStructInfo *expected_inf
o,
GType expected_typ
e,
JSBool throw);
G_END_DECLS G_END_DECLS
#endif /* __GJS_BOXED_H__ */ #endif /* __GJS_BOXED_H__ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 7 lines changed or added


 gerror.h   gerror.h 
skipping to change at line 51 skipping to change at line 51
GIEnumInfo *info); GIEnumInfo *info);
JSObject* gjs_lookup_error_prototype (JSContext *context, JSObject* gjs_lookup_error_prototype (JSContext *context,
GIEnumInfo *info); GIEnumInfo *info);
JSClass* gjs_lookup_error_class (JSContext *context, JSClass* gjs_lookup_error_class (JSContext *context,
GIEnumInfo *info); GIEnumInfo *info);
GError* gjs_gerror_from_error (JSContext *context, GError* gjs_gerror_from_error (JSContext *context,
JSObject *obj); JSObject *obj);
JSObject* gjs_error_from_gerror (JSContext *context, JSObject* gjs_error_from_gerror (JSContext *context,
GError *gerror, GError *gerror,
gboolean add_stack); gboolean add_stack);
JSBool gjs_typecheck_gerror (JSContext *context,
JSObject *obj,
JSBool throw);
G_END_DECLS G_END_DECLS
#endif /* __GJS_ERROR_H__ */ #endif /* __GJS_ERROR_H__ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 jsapi-util.h   jsapi-util.h 
skipping to change at line 58 skipping to change at line 58
/* Flags that should be set on properties exported from native code modules . /* Flags that should be set on properties exported from native code modules .
* Basically set these on API, but do NOT set them on data. * Basically set these on API, but do NOT set them on data.
* *
* READONLY: forbid setting prop to another value * READONLY: forbid setting prop to another value
* PERMANENT: forbid deleting the prop * PERMANENT: forbid deleting the prop
* ENUMERATE: allows copyProperties to work among other reasons to have it * ENUMERATE: allows copyProperties to work among other reasons to have it
*/ */
#define GJS_MODULE_PROP_FLAGS (JSPROP_PERMANENT | JSPROP_ENUMERATE) #define GJS_MODULE_PROP_FLAGS (JSPROP_PERMANENT | JSPROP_ENUMERATE)
/* priv_from_js_with_typecheck checks that the object is in fact an /*
* instance of the specified class before accessing its private data. * Helper methods to access private data:
* Keep in mind that the function can return JS_TRUE and still fill the *
* out parameter with NULL if the object is the prototype for a class * do_base_typecheck: checks that object has the right JSClass, and possibl
* without the JSCLASS_CONSTRUCT_PROTOTYPE flag or if it the class simply y
* does not have any private data. * throw a TypeError exception if the check fails
* priv_from_js: accesses the object private field; as a debug measure,
* it also checks that the object is of a compatible
* JSClass, but it doesn't raise an exception (it
* wouldn't be of much use, if subsequent code crashes on
* NULL)
* priv_from_js_with_typecheck: a convenience function to call
* do_base_typecheck and priv_from_js
*/ */
#define GJS_DEFINE_PRIV_FROM_JS(type, class) \ #define GJS_DEFINE_PRIV_FROM_JS(type, class) \
__attribute__((unused)) static JSBool \ __attribute__((unused)) static inline JSBool \
priv_from_js_with_typecheck(JSContext *context, \ do_base_typecheck(JSContext *context, \
JSObject *object, \ JSObject *object, \
type **out) \ JSBool throw) \
{\ { \
if (!out) \ return gjs_typecheck_static_instance(context, object, &class, throw
return JS_FALSE; \ ); \
if (!JS_InstanceOf(context, object, &class, NULL)) \ } \
return JS_FALSE; \ static inline type* \
*out = JS_GetInstancePrivate(context, object, &class, NULL); \ priv_from_js(JSContext *context, \
return JS_TRUE; \ JSObject *object) \
}\ { \
static type*\ return JS_GetInstancePrivate(context, object, &class, NULL); \
priv_from_js(JSContext *context, \ } \
JSObject *object) \ __attribute__((unused)) static JSBool \
{\ priv_from_js_with_typecheck(JSContext *context, \
return JS_GetInstancePrivate(context, object, &class, NULL); \ JSObject *object, \
type **out) \
{ \
if (!do_base_typecheck(context, object, JS_FALSE)) \
return JS_FALSE; \
*out = priv_from_js(context, object); \
return JS_TRUE; \
} }
#define GJS_DEFINE_DYNAMIC_PRIV_FROM_JS(type, class) \ #define GJS_DEFINE_DYNAMIC_PRIV_FROM_JS(type, class) \
__attribute__((unused)) static JSBool\ __attribute__((unused)) static inline JSBool \
priv_from_js_with_typecheck(JSContext *context, \ do_base_typecheck(JSContext *context, \
JSObject *object, \ JSObject *object, \
type **out) \ JSBool throw) \
{\ { \
type *result; \ return gjs_typecheck_dynamic_instance(context, object, &class, thro
if (!out) \ w); \
return JS_FALSE; \ } \
result = gjs_get_instance_private_dynamic_with_typecheck(context, o static inline type* \
bject, &class, NULL); \ priv_from_js(JSContext *context, \
if (result == NULL) \ JSObject *object) \
return JS_FALSE; \ { \
*out = result; \ return JS_GetPrivate(context, object); \
return JS_TRUE; \ } \
}\ __attribute__((unused)) static JSBool \
static type*\ priv_from_js_with_typecheck(JSContext *context, \
priv_from_js(JSContext *context, \ JSObject *object, \
JSObject *object) \ type **out) \
{\ { \
return gjs_get_instance_private_dynamic(context, object, &class, NU if (!do_base_typecheck(context, object, JS_FALSE)) \
LL); \ return JS_FALSE; \
*out = priv_from_js(context, object); \
return JS_TRUE; \
} }
/** /**
* GJS_DEFINE_PROTO: * GJS_DEFINE_PROTO:
* @tn: The name of the prototype, as a string * @tn: The name of the prototype, as a string
* @cn: The name of the prototype, separated by _ * @cn: The name of the prototype, separated by _
* *
* A convenience macro for prototype implementations. * A convenience macro for prototype implementations.
*/ */
#define GJS_DEFINE_PROTO(tn, cn) \ #define GJS_DEFINE_PROTO(tn, cn) \
skipping to change at line 229 skipping to change at line 243
const char *class_name, const char *class_name,
JSClass *clasp, JSClass *clasp,
JSNative constructor, JSNative constructor,
uintN nargs, uintN nargs,
JSPropertySpec *ps, JSPropertySpec *ps,
JSFunctionSpec *fs, JSFunctionSpec *fs,
JSPropertySpec *static_ps, JSPropertySpec *static_ps,
JSFunctionSpec *static_fs); JSFunctionSpec *static_fs);
void gjs_throw_constructor_error (JSContext *context); void gjs_throw_constructor_error (JSContext *context);
void* gjs_get_instance_private_dynamic (JSContext *context, JSBool gjs_typecheck_static_instance (JSContext *context,
JSObject *obj, JSObject *obj,
JSClass *static_c JSClass *static_clasp,
lasp, JSBool _throw);
jsval *argv); JSBool gjs_typecheck_dynamic_instance (JSContext *context,
void* gjs_get_instance_private_dynamic_with_typecheck (JSContext *context, JSObject *obj,
JSObject *obj, JSClass *static_clasp,
JSClass *static_c JSBool _throw);
lasp,
jsval *argv);
JSObject* gjs_construct_object_dynamic (JSContext *context, JSObject* gjs_construct_object_dynamic (JSContext *context,
JSObject *proto, JSObject *proto,
uintN argc, uintN argc,
jsval *argv); jsval *argv);
JSObject* gjs_define_string_array (JSContext *context, JSObject* gjs_define_string_array (JSContext *context,
JSObject *obj, JSObject *obj,
const char *array_name, const char *array_name,
gssize array_length , gssize array_length ,
const char **array_values , const char **array_values ,
uintN attrs); uintN attrs);
void gjs_throw (JSContext *context, void gjs_throw (JSContext *context,
const char *format, const char *format,
...) G_GNUC_PRINTF (2, 3); ...) G_GNUC_PRINTF (2, 3);
void gjs_throw_custom (JSContext *context,
const char *error_class,
const char *format,
...) G_GNUC_PRINTF (3, 4);
void gjs_throw_literal (JSContext *context, void gjs_throw_literal (JSContext *context,
const char *string); const char *string);
void gjs_throw_g_error (JSContext *context, void gjs_throw_g_error (JSContext *context,
GError *error); GError *error);
JSBool gjs_log_exception (JSContext *context, JSBool gjs_log_exception (JSContext *context,
char **message_p); char **message_p);
JSBool gjs_log_and_keep_exception (JSContext *context, JSBool gjs_log_and_keep_exception (JSContext *context,
char **message_p); char **message_p);
JSBool gjs_move_exception (JSContext *src_context, JSBool gjs_move_exception (JSContext *src_context,
JSContext *dest_context ); JSContext *dest_context );
 End of changes. 5 change blocks. 
56 lines changed or deleted 73 lines changed or added


 mem.h   mem.h 
skipping to change at line 37 skipping to change at line 37
#if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION) #if !defined (__GJS_GJS_MODULE_H__) && !defined (GJS_COMPILATION)
#error "Only <gjs/gjs-module.h> can be included directly." #error "Only <gjs/gjs-module.h> can be included directly."
#endif #endif
#include <glib.h> #include <glib.h>
#include <jsapi.h> #include <jsapi.h>
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct { typedef struct {
int value; unsigned int value;
const char *name; const char *name;
} GjsMemCounter; } GjsMemCounter;
#define GJS_DECLARE_COUNTER(name) \ #define GJS_DECLARE_COUNTER(name) \
extern GjsMemCounter gjs_counter_ ## name ; extern GjsMemCounter gjs_counter_ ## name ;
GJS_DECLARE_COUNTER(everything) GJS_DECLARE_COUNTER(everything)
GJS_DECLARE_COUNTER(boxed) GJS_DECLARE_COUNTER(boxed)
GJS_DECLARE_COUNTER(gerror) GJS_DECLARE_COUNTER(gerror)
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 object.h   object.h 
skipping to change at line 46 skipping to change at line 46
JSObject *in_object, JSObject *in_object,
GType gtype, GType gtype,
JSObject **constructor_p, JSObject **constructor_p,
JSObject **prototype_p); JSObject **prototype_p);
JSObject* gjs_lookup_object_prototype (JSContext *context, JSObject* gjs_lookup_object_prototype (JSContext *context,
GType gtype); GType gtype);
JSObject* gjs_object_from_g_object (JSContext *context, JSObject* gjs_object_from_g_object (JSContext *context,
GObject *gobj); GObject *gobj);
GObject* gjs_g_object_from_object (JSContext *context, GObject* gjs_g_object_from_object (JSContext *context,
JSObject *obj); JSObject *obj);
JSBool gjs_typecheck_object (JSContext *context,
JSObject *obj,
GType expected_type,
JSBool throw);
G_END_DECLS G_END_DECLS
#endif /* __GJS_OBJECT_H__ */ #endif /* __GJS_OBJECT_H__ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added


 param.h   param.h 
skipping to change at line 42 skipping to change at line 42
G_BEGIN_DECLS G_BEGIN_DECLS
JSBool gjs_define_param_class (JSContext *context, JSBool gjs_define_param_class (JSContext *context,
JSObject *in_object, JSObject *in_object,
JSObject **prototype_p); JSObject **prototype_p);
GParamSpec* gjs_g_param_from_param (JSContext *context, GParamSpec* gjs_g_param_from_param (JSContext *context,
JSObject *obj); JSObject *obj);
JSObject* gjs_param_from_g_param (JSContext *context, JSObject* gjs_param_from_g_param (JSContext *context,
GParamSpec *param); GParamSpec *param);
JSBool gjs_typecheck_param (JSContext *context,
JSObject *obj,
GType expected_type,
JSBool throw);
JSObject* gjs_lookup_param_prototype (JSContext *context); JSObject* gjs_lookup_param_prototype (JSContext *context);
G_END_DECLS G_END_DECLS
#endif /* __GJS_PARAM_H__ */ #endif /* __GJS_PARAM_H__ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added


 union.h   union.h 
skipping to change at line 51 skipping to change at line 51
GIUnionInfo *info); GIUnionInfo *info);
JSObject* gjs_lookup_union_prototype (JSContext *context, JSObject* gjs_lookup_union_prototype (JSContext *context,
GIUnionInfo *info); GIUnionInfo *info);
JSClass* gjs_lookup_union_class (JSContext *context, JSClass* gjs_lookup_union_class (JSContext *context,
GIUnionInfo *info); GIUnionInfo *info);
void* gjs_c_union_from_union (JSContext *context, void* gjs_c_union_from_union (JSContext *context,
JSObject *obj); JSObject *obj);
JSObject* gjs_union_from_c_union (JSContext *context, JSObject* gjs_union_from_c_union (JSContext *context,
GIUnionInfo *info, GIUnionInfo *info,
void *gboxed); void *gboxed);
JSBool gjs_typecheck_union (JSContext *context,
JSObject *obj,
GIStructInfo *expected_inf
o,
GType expected_typ
e,
JSBool throw);
G_END_DECLS G_END_DECLS
#endif /* __GJS_UNION_H__ */ #endif /* __GJS_UNION_H__ */
 End of changes. 1 change blocks. 
0 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/