diff --git a/glue.rs b/glue.rs index aa48d9433..c0683ea94 100644 --- a/glue.rs +++ b/glue.rs @@ -13,35 +13,35 @@ use jsval::JSVal; type c_bool = libc::c_int; pub struct ProxyTraps { - getPropertyDescriptor: extern "C" fn(*JSContext, *JSObject, jsid, c_bool, *mut JSPropertyDescriptor) -> c_bool, - getOwnPropertyDescriptor: extern "C" fn(*JSContext, *JSObject, jsid, JSBool, *mut JSPropertyDescriptor) -> JSBool, - defineProperty: extern "C" fn(*JSContext, *JSObject, jsid, *JSPropertyDescriptor) -> JSBool, - getOwnPropertyNames: *u8, - delete_: *u8, - enumerate: *u8, - - has: *u8, - hasOwn: extern "C" fn(*JSContext, *JSObject, jsid, *mut JSBool) -> JSBool, - get: extern "C" fn(*JSContext, *JSObject, *JSObject, jsid, *mut JSVal) -> JSBool, - set: *u8, - keys: *u8, - iterate: *u8, - - call: *u8, - construct: *u8, - nativeCall: *u8, - hasInstance: *u8, - typeOf: *u8, - objectClassIs: *u8, - obj_toString: extern "C" fn(*JSContext, *JSObject) -> *JSString, - fun_toString: *u8, + pub getPropertyDescriptor: extern "C" fn(*JSContext, *JSObject, jsid, c_bool, *mut JSPropertyDescriptor) -> c_bool, + pub getOwnPropertyDescriptor: extern "C" fn(*JSContext, *JSObject, jsid, JSBool, *mut JSPropertyDescriptor) -> JSBool, + pub defineProperty: extern "C" fn(*JSContext, *JSObject, jsid, *JSPropertyDescriptor) -> JSBool, + pub getOwnPropertyNames: *u8, + pub delete_: *u8, + pub enumerate: *u8, + + pub has: *u8, + pub hasOwn: extern "C" fn(*JSContext, *JSObject, jsid, *mut JSBool) -> JSBool, + pub get: extern "C" fn(*JSContext, *JSObject, *JSObject, jsid, *mut JSVal) -> JSBool, + pub set: *u8, + pub keys: *u8, + pub iterate: *u8, + + pub call: *u8, + pub construct: *u8, + pub nativeCall: *u8, + pub hasInstance: *u8, + pub typeOf: *u8, + pub objectClassIs: *u8, + pub obj_toString: extern "C" fn(*JSContext, *JSObject) -> *JSString, + pub fun_toString: *u8, //regexp_toShared: *u8, - defaultValue: *u8, - iteratorNext: *u8, - finalize: extern "C" fn(*JSFreeOp, *JSObject), - getElementIfPresent: *u8, - getPrototypeOf: *u8, - trace: Option + pub defaultValue: *u8, + pub iteratorNext: *u8, + pub finalize: extern "C" fn(*JSFreeOp, *JSObject), + pub getElementIfPresent: *u8, + pub getPrototypeOf: *u8, + pub trace: Option } #[cfg(not(target_os = "android"))] diff --git a/jsapi.rs b/jsapi.rs index 48343969f..cedfa391e 100644 --- a/jsapi.rs +++ b/jsapi.rs @@ -256,27 +256,27 @@ pub type moz_static_assert5 = c_int; pub type moz_static_assert6 = c_int; pub struct JSHandleObject { - unnamed: **JSObject, + pub unnamed: **JSObject, } pub struct JSHandleValue { - unnamed: JSVal, + pub unnamed: JSVal, } pub struct JSHandleString { - unnamed: **JSString, + pub unnamed: **JSString, } pub struct JSMutableHandleObject { - unnamed: **JSObject, + pub unnamed: **JSObject, } pub struct JSHandleId { - unnamed: *jsid, + pub unnamed: *jsid, } pub struct JSMutableHandleValue { - unnamed: *JSVal, + pub unnamed: *JSVal, } pub type JSRawObject = *JSObject; @@ -300,7 +300,7 @@ pub type JSTypeOfOp = *u8; pub type JSFreeOp = struct_JSFreeOp; pub struct struct_JSFreeOp { - runtime: *JSRuntime, + pub runtime: *JSRuntime, } pub type JSFinalizeOp = extern "C" fn(*JSFreeOp, *JSObject); @@ -308,7 +308,7 @@ pub type JSFinalizeOp = extern "C" fn(*JSFreeOp, *JSObject); pub type JSStringFinalizer = struct_JSStringFinalizer; pub struct struct_JSStringFinalizer { - finalize: *u8, + pub finalize: *u8, } //XXXjdm JSAccessMode is an enum; uint32_t may not be correct. @@ -369,9 +369,9 @@ pub static JSEXN_LIMIT: i32 = 8_i32; pub type JSExnType = enum_JSExnType; pub struct struct_JSErrorFormatString { - format: *c_char, - argCount: uint16_t, - exnType: int16_t, + pub format: *c_char, + pub argCount: uint16_t, + pub exnType: int16_t, } pub type JSErrorFormatString = struct_JSErrorFormatString; @@ -437,12 +437,12 @@ pub type JSGCRootMapFun = *u8; pub type JSTraceCallback = *u8; pub struct struct_JSTracer { - runtime: *JSRuntime, - callback: JSTraceCallback, - debugPrinter: JSTraceNamePrinter, - debugPrintArg: *c_void, - debugPrintIndex: size_t, - eagerlyTraceWeakMaps: JSBool, + pub runtime: *JSRuntime, + pub callback: JSTraceCallback, + pub debugPrinter: JSTraceNamePrinter, + pub debugPrintArg: *c_void, + pub debugPrintIndex: size_t, + pub eagerlyTraceWeakMaps: JSBool, } pub type enum_JSGCParamKey = c_uint; @@ -497,10 +497,10 @@ pub struct JSClass { } pub struct struct_JSConstDoubleSpec { - dval: c_double, - name: *c_char, - flags: uint8_t, - spare: (uint8_t,uint8_t,uint8_t), + pub dval: c_double, + pub name: *c_char, + pub flags: uint8_t, + pub spare: (uint8_t,uint8_t,uint8_t), } pub type struct_JSJitInfo = c_void; @@ -510,8 +510,8 @@ pub type struct_JSJitInfo = c_void; // FIXME: We need these Clone impls for certain operations in Servo, // but do they really make sense? pub struct JSStrictPropertyOpWrapper { - op: Option, - info: *JSJitInfo, + pub op: Option, + pub info: *JSJitInfo, } impl Clone for JSStrictPropertyOpWrapper { @@ -524,8 +524,8 @@ impl Clone for JSStrictPropertyOpWrapper { } pub struct JSPropertyOpWrapper { - op: Option, - info: *JSJitInfo, + pub op: Option, + pub info: *JSJitInfo, } impl Clone for JSPropertyOpWrapper { @@ -553,11 +553,11 @@ impl Clone for JSNativeWrapper { #[deriving(Clone)] pub struct JSPropertySpec { - name: *c_char, - tinyid: int8_t, - flags: uint8_t, - getter: JSPropertyOpWrapper, - setter: JSStrictPropertyOpWrapper, + pub name: *c_char, + pub tinyid: int8_t, + pub flags: uint8_t, + pub getter: JSPropertyOpWrapper, + pub setter: JSStrictPropertyOpWrapper, } #[deriving(Clone)] @@ -570,23 +570,23 @@ pub struct JSFunctionSpec { } pub struct struct_JSPropertyDescriptor { - obj: *JSObject, - attrs: c_uint, - shortid: c_uint, - getter: Option, - setter: Option, - value: JSVal, + pub obj: *JSObject, + pub attrs: c_uint, + pub shortid: c_uint, + pub getter: Option, + pub setter: Option, + pub value: JSVal, } pub struct struct_JSPrincipals { - refcount: c_int, + pub refcount: c_int, } pub struct struct_JSSecurityCallbacks { - checkObjectAccess: JSCheckAccessOp, - subsumePrincipals: JSSubsumePrincipalsOp, - findObjectPrincipals: JSObjectPrincipalsFinder, - contentSecurityPolicyAllows: JSCSPEvalChecker, + pub checkObjectAccess: JSCheckAccessOp, + pub subsumePrincipals: JSSubsumePrincipalsOp, + pub findObjectPrincipals: JSObjectPrincipalsFinder, + pub contentSecurityPolicyAllows: JSCSPEvalChecker, } pub type enum_JSExecPart = c_uint; @@ -598,17 +598,17 @@ pub type JSExecPart = enum_JSExecPart; pub type JSONWriteCallback = *u8; pub struct struct_JSStructuredCloneCallbacks { - read: ReadStructuredCloneOp, - write: WriteStructuredCloneOp, - reportError: StructuredCloneErrorOp, + pub read: ReadStructuredCloneOp, + pub write: WriteStructuredCloneOp, + pub reportError: StructuredCloneErrorOp, } pub struct struct_JSLocaleCallbacks { - localeToUpperCase: JSLocaleToUpperCase, - localeToLowerCase: JSLocaleToLowerCase, - localeCompare: JSLocaleCompare, - localeToUnicode: JSLocaleToUnicode, - localeGetErrorMessage: JSErrorCallback, + pub localeToUpperCase: JSLocaleToUpperCase, + pub localeToLowerCase: JSLocaleToLowerCase, + pub localeCompare: JSLocaleCompare, + pub localeToUnicode: JSLocaleToUnicode, + pub localeGetErrorMessage: JSErrorCallback, } pub struct struct_JSErrorReport { @@ -628,7 +628,7 @@ pub struct struct_JSErrorReport { } pub struct struct_unnamed1 { - payload: union_unnamed2, + pub payload: union_unnamed2, } pub type union_unnamed2 = c_void /* FIXME: union type */; diff --git a/jsfriendapi.rs b/jsfriendapi.rs index e051edcb4..3b0f30caa 100644 --- a/jsfriendapi.rs +++ b/jsfriendapi.rs @@ -5,11 +5,11 @@ pub type JSJitPropertyOp = *u8; pub struct JSJitInfo { - op: JSJitPropertyOp, - protoID: u32, - depth: u32, - isInfallible: bool, - isConstant: bool + pub op: JSJitPropertyOp, + pub protoID: u32, + pub depth: u32, + pub isInfallible: bool, + pub isConstant: bool } //pub type JSJitInfo = JSJitInfo_struct; diff --git a/jsval.rs b/jsval.rs index caf36b241..2d400c378 100644 --- a/jsval.rs +++ b/jsval.rs @@ -58,7 +58,7 @@ static JSVAL_PAYLOAD_MASK: u64 = 0x00007FFFFFFFFFFF; // now this become {u64} because of the union abi issue on ARM arch. See #398. #[deriving(Eq,Clone)] pub struct JSVal { - v: u64 + pub v: u64 } #[inline(always)] diff --git a/rust.rs b/rust.rs index 53c0ab740..204d90901 100644 --- a/rust.rs +++ b/rust.rs @@ -30,7 +30,7 @@ use green::task::GreenTask; pub type rt = rc::Rc; pub struct rt_rsrc { - ptr : *JSRuntime, + pub ptr : *JSRuntime, } impl Drop for rt_rsrc { @@ -85,8 +85,8 @@ pub fn rt() -> rt { // contexts pub struct Cx { - ptr: *JSContext, - rt: rt, + pub ptr: *JSContext, + pub rt: rt, } #[unsafe_destructor] @@ -227,8 +227,8 @@ pub extern fn reportError(_cx: *JSContext, msg: *c_char, report: *JSErrorReport) // compartment pub struct Compartment { - cx: rc::Rc, - global_obj: *JSObject, + pub cx: rc::Rc, + pub global_obj: *JSObject, } impl Compartment {