Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /* Binding to generate Console interface
  2.  *
  3.  * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
  4.  *
  5.  * This file is part of NetSurf, http://www.netsurf-browser.org/
  6.  *
  7.  * Released under the terms of the MIT License,
  8.  *         http://www.opensource.org/licenses/mit-license
  9.  */
  10.  
  11. webidlfile "console.idl";
  12.  
  13. hdrcomment "Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>";
  14. hdrcomment "This file is part of NetSurf, http://www.netsurf-browser.org/";
  15. hdrcomment "Released under the terms of the MIT License,";
  16. hdrcomment "        http://www.opensource.org/licenses/mit-license";
  17.  
  18. preamble %{
  19.  
  20. #include "utils/config.h"
  21. #include "utils/log.h"
  22. #include "javascript/jsapi.h"
  23.  
  24. #include "console.h"
  25.  
  26. %}
  27.  
  28. binding navigator {
  29.     type js_libdom; /* the binding type */
  30.  
  31.     interface Console; /* Web IDL interface to generate */
  32.  
  33. }
  34.  
  35. operation log %{
  36.         unsigned int argloop;
  37.         JSString *jsstr;
  38.         unsigned long jsstrlen;
  39.         char *txt;
  40.  
  41.         for (argloop = 0; argloop < argc; argloop++) {
  42.                 jsstr = JS_ValueToString(cx, argv[argloop]);
  43.  
  44.                 JSString_to_char(jsstr, txt, jsstrlen);
  45.                 LOG(("%s", txt));
  46.         }
  47. %}
  48.