jswrapper.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * This file is part of Espruino, a JavaScript interpreter for Microcontrollers
  3. *
  4. * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
  5. *
  6. * This Source Code Form is subject to the terms of the Mozilla Public
  7. * License, v. 2.0. If a copy of the MPL was not distributed with this
  8. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. *
  10. * ----------------------------------------------------------------------------
  11. * Header for auto-generated Wrapper functions
  12. * ----------------------------------------------------------------------------
  13. */
  14. #include "jsutils.h"
  15. #include "jsparse.h"
  16. #define JSW_HANDLEFUNCTIONCALL_UNHANDLED ((JsVar*)-1)
  17. /** If 'name' is something that belongs to an internal function, execute it. */
  18. JsVar *jswHandleFunctionCall(JsVar *parent, JsVar *parentName, const char *name);
  19. /// Given the name of an Object, see if we should set it up as a builtin or not
  20. bool jswIsBuiltInObject(const char *name);
  21. /// If we get this in 'require', should we make an object with this name?
  22. bool jswIsBuiltInLibrary(const char *name);
  23. /** Given a variable, return the basic object name of it */
  24. const char *jswGetBasicObjectName(JsVar *var);
  25. /** Given the name of a Basic Object, eg, Uint8Array, String, etc. Return the prototype object's name - or 0.
  26. * For instance jswGetBasicObjectPrototypeName("Object")==0, jswGetBasicObjectPrototypeName("Integer")=="Object",
  27. * jswGetBasicObjectPrototypeName("Uint8Array")=="ArrayBufferView"
  28. * */
  29. const char *jswGetBasicObjectPrototypeName(const char *name);