common.bmx 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ' Copyright 2019-2020 Bruce A Henderson
  2. '
  3. ' Licensed under the Apache License, Version 2.0 (the "License");
  4. ' you may not use this file except in compliance with the License.
  5. ' You may obtain a copy of the License at
  6. '
  7. ' http://www.apache.org/licenses/LICENSE-2.0
  8. '
  9. ' Unless required by applicable law or agreed to in writing, software
  10. ' distributed under the License is distributed on an "AS IS" BASIS,
  11. ' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. ' See the License for the specific language governing permissions and
  13. ' limitations under the License.
  14. '
  15. SuperStrict
  16. Import Text.mxml
  17. Import BRL.Stream
  18. Import BRL.LinkedList
  19. Import BRL.StringBuilder
  20. Import "glue.c"
  21. Extern
  22. Function bmx_mxmlLoadStream:Byte Ptr(stream:TStream)
  23. Function bmx_mxmlNewXML:Byte Ptr(version:String)
  24. Function bmx_mxmlNewElement:Byte Ptr(parent:Byte Ptr, name:String)
  25. Function bmx_mxmlDelete(handle:Byte Ptr)
  26. Function bmx_mxmlLoadString:Byte Ptr(txt:String)
  27. Function bmx_mxmlSetRootElement:Byte Ptr(handle:Byte Ptr, root:Byte Ptr)
  28. Function bmx_mxmlAdd(parent:Byte Ptr, _where:Int, child:Byte Ptr, node:Byte Ptr)
  29. Function bmx_mxmlGetElement:String(handle:Byte Ptr)
  30. Function bmx_mxmlSetContent(handle:Byte Ptr, content:String)
  31. Function bmx_mxmlElementSetAttr(handle:Byte Ptr, name:String, value:String)
  32. Function bmx_mxmlElementGetAttr:String(handle:Byte Ptr, name:String)
  33. Function bmx_mxmlElementDeleteAttr(handle:Byte Ptr, name:String)
  34. Function bmx_mxmlElementHasAttr:Int(handle:Byte Ptr, name:String)
  35. Function bmx_mxmlSetElement(handle:Byte Ptr, name:String)
  36. Function bmx_mxmlElementGetAttrCount:Int(handle:Byte Ptr)
  37. Function bmx_mxmlElementGetAttrByIndex:String(handle:Byte Ptr, index:Int, name:String Var)
  38. Function bmx_mxmlGetRootElement:Byte Ptr(handle:Byte Ptr)
  39. Function bmx_mxmlWalkNext:Byte Ptr(node:Byte Ptr, top:Byte Ptr, descend:Int)
  40. Function bmx_mxmlGetType:Int(handle:Byte Ptr)
  41. Function bmx_mxmlAddContent(handle:Byte Ptr, content:String)
  42. Function bmx_mxmlGetParent:Byte Ptr(handle:Byte Ptr)
  43. Function bmx_mxmlGetFirstChild:Byte Ptr(handle:Byte Ptr)
  44. Function bmx_mxmlGetLastChild:Byte Ptr(handle:Byte Ptr)
  45. Function bmx_mxmlGetNextSibling:Byte Ptr(handle:Byte Ptr)
  46. Function bmx_mxmlGetPrevSibling:Byte Ptr(handle:Byte Ptr)
  47. Function bmx_mxmlFindElement:Byte Ptr(handle:Byte Ptr, element:String, attr:String, value:String, descend:Int)
  48. Function bmx_mxmlSaveStdout:Int(handle:Byte Ptr, format:Int)
  49. Function bmx_mxmlSaveString:String(handle:Byte Ptr, format:Int)
  50. Function bmx_mxmlSaveStream:Int(handle:Byte Ptr, stream:TStream, format:Int)
  51. Function bmx_mxmlSetWrapMargin(column:Int)
  52. Function bmx_mxmlGetContent:String(handle:Byte Ptr)
  53. Function bmx_mxmlGetCDATA:String(handle:Byte Ptr)
  54. Function bmx_mxmlSetErrorCallback(callback(message:Byte Ptr))
  55. End Extern
  56. Rem
  57. bbdoc: Descend when finding/walking.
  58. End Rem
  59. Const MXML_DESCEND:Int = 1
  60. Rem
  61. bbdoc: Don't descend when finding/walking.
  62. End Rem
  63. Const MXML_NO_DESCEND:Int = 0
  64. Rem
  65. bbdoc: Descend for first find.
  66. End Rem
  67. Const MXML_DESCEND_FIRST:Int = -1
  68. Const MXML_IGNORE:Int = -1
  69. Const MXML_ELEMENT:Int = 0
  70. Const MXML_INTEGER:Int = 1
  71. Const MXML_OPAQUE:Int = 2
  72. Const MXML_REAL:Int = 3
  73. Const MXML_TEXT:Int = 4
  74. Const MXML_CUSTOM:Int = 5
  75. Const BOM_UTF8:String = Chr(239) + Chr(187) + Chr(191)