'OXYGENAPIDECLARE.INC

  '12:43 18/03/2017
  '23:23 29/07/2022
  '15:12 07/02/2025
  '21:42 17/04/2026

  '====================================
  'OXYGEN COMPILER API FOR 32BIT BASICS
  '====================================

  'ABST
  '====
  'compile source code string and return intermediate code string
  declare  function o2_abst lib "oxygen.dll" alias "o2_abst" ( byval s as string ) as string


  'BASIC
  '=====
  'compile source code string to binary code, and return pointer
  declare  function o2_basic lib "oxygen.dll" alias "o2_basic" ( byval s as string ) as dword


  'BUF
  '===
  'select current binary code buffer and return pointer
  declare  function o2_buf lib "oxygen.dll" alias "o2_buf" ( byval n as dword ) as dword


  'ERRNO
  '=====
  'return error number, if any
  declare  function o2_errno lib "oxygen.dll" alias "o2_errno" () as dword


  'ERROR
  '=====
  'return compiling error string, if any
  declare  function o2_error lib "oxygen.dll" alias "o2_error" () as string


  'EXEC
  '====
  'execute inary code in current buffer  lib "oxygen.dll" alias "" (or from location specified by pointer
  declare  function o2_exec lib "oxygen.dll" alias "o2_exec" ( optional byval p as dword )  as dword


  'LEN
  '===
  'return length of code in current binary code buffer
  declare  function o2_len lib "oxygen.dll" alias "o2_len" () as dword


  'LIB
  '===
  'return base location of o2 runtime function table
  declare  function o2_lib lib "oxygen.dll" alias "o2_lib" () as dword


  'LINK
  '====
  'compile o2 machine script to binary and return pointer
  declare  function o2_link lib "oxygen.dll" alias "o2_link" ( byval string src ) as dword

	
  'STATS
  '=====
  'return set of compilation metrics
  declare  function o2_stats lib "oxygen.dll" alias "o2_stats" () as string


  'MODE
  '====
  'specify string mode for various o2 API functions
  '0 ascii char*
  '1 ascii char*
  '2 unicode wchar*
  '8 ole bstring ascii
  '9 ole bstring ascii
  '10 ole bstring unicode
  declare  sub o2_mode lib "oxygen.dll" alias "o2_mode" ( byval m as dword )


  'PATHCALL
  'set callback to obtain hosted oxygenBasic path string
  declare  sub o2_pathcall lib "oxygen.dll" alias "o2path" ( byval p as dwod )


  'PREP
  '====
  'compile source code string and return assembly code string
  declare  function o2_prep lib "oxygen.dll" alias "o2_prep" ( byval s as string ) as string


  'VARCALL
  '=======
  'set callback to obtain host variable location, by name
  declare  function o2_varcall lib "oxygen.dll" alias "o2_varcall" ( byval p as dword )


  'VERSION
  '=======
  'return version string, include time/datestamp
  declare  function o2_version lib "oxygen.dll" alias "o2_version" () as string


  'VIEW
  '====
  'compile source code string and return o2 machine script string
  declare  function o2_view lib "oxygen.dll" alias "o2_view" ( byval s as string ) as string



  o2_mode 9 'for oxygenBasic ascii strings
