From 86d7497768be20f5afd1972018626aeb0e11603e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9my=20GIBERT?= <burniouf@users.noreply.github.com>
Date: Sat, 22 Oct 2016 10:33:22 +0200
Subject: [PATCH] Kernel version 0.8 : Docs...

---
 _Docs/KERNEL.md   | 26 ++++++++++++++++++++++----
 _Tools/docgen.cmd | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 4 deletions(-)
 create mode 100644 _Tools/docgen.cmd

diff --git a/_Docs/KERNEL.md b/_Docs/KERNEL.md
index d0f8157c..b2dde4b9 100644
--- a/_Docs/KERNEL.md
+++ b/_Docs/KERNEL.md
@@ -1,8 +1,17 @@
-# A2osX Kernel API
+*** Auto generated by docgen.cmd ***  
+#K.PStrUprYA  
+ Convert string to UPPERCASE  
+#K.PStrLwrYA  
+ Convert string to lowercase  
+##In:  
+Y,A = PTR to String (PSTRING)  
+##Out:  
+  Uppercased/lowercased String in Buffer  
 #K.PStrFTime  
+Convert S.TIME struct to PSTR  
 ##In :   
- PULLW = Src PTR To S.Time  
- PULLW = Src PTR To Format String  
+ PUSHW = Dst PTR To PSTR Buf  
+ PUSHW = Src PTR To Format String  
   %a Abbreviated weekday name : Thu  
 %A Full weekday name : Thursday   
 %b Abbreviated month name : Aug   
@@ -17,6 +26,15 @@
 %w Weekday as a decimal number with Sunday as 0 (0-6)   
 %y Year, last two digits (00-99)  
 %Y Year four digits 2001   
- PULLW = Dst PTR To PSTR Buf  
+ PUSHW = Src PTR To S.Time  
 ##Out :  
   none. always succeed.  
+#K.PStr2StrArrayYA  
+##In :   
+ Y,A = PTR to String  
+##Out :  
+ CC : success  
+ Y,A = PTR to StrArray  
+ X = hMem  
+ CS : error  
+ A = SYS error code  
diff --git a/_Tools/docgen.cmd b/_Tools/docgen.cmd
new file mode 100644
index 00000000..7c6d93b4
--- /dev/null
+++ b/_Tools/docgen.cmd
@@ -0,0 +1,35 @@
+@echo off
+title Kernel DOC generator
+COLOR 2A
+SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
+
+set DOCFILE=%~dp0..\_Docs\KERNEL.md
+
+echo # A2osX Kernel API  >!DOCFILE!
+echo *** Auto generated by docgen.cmd ***  >!DOCFILE!
+
+
+for /f %%F in ('dir /b /ogn %~dp0..\SYS\KERNEL.S*.txt') do (
+ set FN=%%F
+ echo Filename : !FN!
+ set bInDoc=0
+ for /F "tokens=*" %%L in (%~dp0..\SYS\!FN!) do (
+  set LINE=%%L
+  if defined LINE (
+   set bOut=1
+   if "!LINE:~0,2!" EQU "*/" (
+    set bInDoc=1
+    set bOut=0
+    )
+   if "!LINE:~0,2!" EQU "*\" (
+    set bInDoc=0
+    set bOut=0
+    )
+   if !bInDoc! EQU 1 (
+    if !bOut! EQU 1 (
+     echo !LINE:~2!  >>!DOCFILE!
+     )
+    )
+   )
+  )
+ )
\ No newline at end of file