Library.h (975B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- 2 */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef ctypes_Library_h 8 #define ctypes_Library_h 9 10 #include "js/TypeDecls.h" 11 12 namespace JS { 13 struct CTypesCallbacks; 14 } // namespace JS 15 16 struct PRLibrary; 17 18 namespace js { 19 namespace ctypes { 20 21 enum LibrarySlot { SLOT_LIBRARY = 0, LIBRARY_SLOTS }; 22 23 namespace Library { 24 [[nodiscard]] bool Name(JSContext* cx, unsigned argc, JS::Value* vp); 25 26 JSObject* Create(JSContext* cx, JS::HandleValue path, 27 const JS::CTypesCallbacks* callbacks); 28 29 bool IsLibrary(JSObject* obj); 30 PRLibrary* GetLibrary(JSObject* obj); 31 32 [[nodiscard]] bool Open(JSContext* cx, unsigned argc, JS::Value* vp); 33 } // namespace Library 34 35 } // namespace ctypes 36 } // namespace js 37 38 #endif /* ctypes_Library_h */