README.txt 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. ===============
  2. = SlideScript =
  3. ===============
  4. A simple, user friendly scripting language for the average person. SS is meant to
  5. be simple, and work as its documented as. SS is a bin tool to say the
  6. least and is a helpful *nix userland tool in the CLI. Not only is SS a box full
  7. of useful tools, it can also be used as a fully functional shell in a *nix like
  8. environment!
  9. ===============
  10. = Compiling =
  11. ===============
  12. First, clone the repository:
  13. $ git clone https://notabug.org/Pentium44/SlideScript
  14. Next, time to compile slidescript. Out the box, slidescript will compile on GNU/Linux
  15. distributions. ***NOTE*** If compiling on OSX/BSD/Android (and GNU/linux using clang),
  16. please uncomment "#define BSD" in src/inc/config.h
  17. $ make
  18. And install to the system
  19. $ sudo make install
  20. Testing SlideScript is very easy, you will find a nice test script in docs/examples
  21. of the source tree. Execute functions.ss (./functions.ss from command line) and make sure
  22. SS processes the script!
  23. ===============
  24. =Documentation=
  25. ===============
  26. Here is a list of functions and features that SlideScript comes with
  27. at this moment!
  28. Commenting! Examples:
  29. * # Comment is real in this one
  30. Comp, loop, if, and ifn functions:
  31. * comp: "1" "1" -> compares integer 1 and 1 -> returns true
  32. * comp: "true" "false" -> compares string true and false -> returns false
  33. * loop: 3; print "Hello world!" -> Will loop print "Hello world!" 3 times.
  34. * if: true; print "True!" -> Prints "True!"
  35. * ifn: false; print "False!" -> Prints "False!"
  36. Read, write, and cat(enate) functions. Examples:
  37. * write "file.txt" "This will be written to file.txt"
  38. * read "file.txt"
  39. * cat "file.txt" "Data to write to end of file.txt"
  40. Basic math expressions
  41. * calc "45 / 5" or calc "255.3 * 442.77"
  42. * Of course addition and subtraction as well
  43. Time example:
  44. * time
  45. Isdir and isfile function, example:
  46. * isdir "examples/" -> returns 0 for not, 1 for is
  47. * isfile "examples/functions.ss" -> returns 1, its there
  48. File manipulation functions
  49. * move "file1" "file2" -> Renames/moves file1 to file2 (mv alias)
  50. * chdir "/home/user" -> Changes directory to /home/user (cd alias)
  51. * backdir -> Moves you back one directory (..)
  52. * showpath -> Returns current working directory (pwd alias)
  53. * showdir -> Lists current directory (ls alias)
  54. * showdir "/" -> lists '/'
  55. * mkfile "file.txt" -> creates empty 'file.txt' (touch alias)
  56. * mkdir "testing/" -> creates directory 'testing'
  57. * mkfile "testing/file.txt" -> creates directory 'testing', and creates 'file.txt'
  58. Slidescript compression functions, example:
  59. * compress "filename" -> compresses "filename" into "filename.lz"
  60. * decompress "filename.lz" -> decompresses 'filename.lz'
  61. Print example:
  62. * print "Hi everyone!"
  63. Sleep (Zzz) example (sleeps for 2 seconds):
  64. * sleep 2
  65. Search functions (similar to grep, not as powerful), example:
  66. * search "README.txt" "SlideScript" -> returns each line that 'SlideScript' is found on
  67. Variable setting and passing
  68. * filename=file.txt -> filename
  69. * filedata=File '%filename%' is being moved to moo -> %filename% is populated as file.txt
  70. * write "%filename%" "%filedata%" -> writes filedata contents to file.txt as expected.
  71. * unset "filename" -> Removes variable data from session memory to be redefinied / reused.
  72. Decoding and encoding strings
  73. * encode "Regular string" -> Converts to encrypted string 'Uhjvqds#xuulqj'
  74. * decode "Uhjvqds#xuulqj" -> Converts back to 'Regular string'
  75. MD5 file checking
  76. * md5 "file.txt" -> outputs filename and md5 hash
  77. Layered piping
  78. * md5 "file.txt" | encrypt "%PIPE%" | write "file.txt.md5.enc" "%PIPE%" -> writes output of md5 to file.txt.md5
  79. Networking functions
  80. * netlisten "<port>" "<search>" "<respond>" -> listens on <port> and replies <respond> on <search> found from outside
  81. * nettoss "<address>" "<port>" "<data>" -> binds to outside server at <address>:<port> and pushes <data> thus, disconnecting
  82. * nethttp "<port>" "<forkval>" -> throws up a web server on <port> in the current working directory,
  83. forkval (0 or 1, 0 don't fork into background / 1 do).
  84. Backquoted function parsing within variables, also works within most major functions
  85. * curtime=`time` -> Will set curtime value to return of time at the time of parse.
  86. * print "%curtime%" -> Prints the variable value of curtime, same operation as function time, but good for timing scripts
  87. This will change rapidly as of currently, slidescript is in beavy development! To get the feel of the scripting,
  88. the best bet is to take a look at some of the slidescript examples in 'examples/'
  89. functions.ss -> displays most basic functions
  90. net-http.ss -> displays built in http web server
  91. net-listen.ss -> displays slidescript's raw listen socket
  92. net-toss.ss -> displays the 'client side' networking function.
  93. ===============
  94. = Todo list =
  95. ===============
  96. This section will obviously expand and adapt to the direction of the language. This is going to change rapidly.
  97. - More networking function flexibility
  98. - Micro text editor
  99. - IRC server, bot, and client built in <--- in progress, will be possible with network functions
  100. - Probably more stuff!
  101. ===============
  102. = Done =
  103. ===============
  104. List of finished features, in a rough summary.
  105. - Added help, and version functions
  106. - Simple syntax checking and error reporting, its a lazy language, syntax can sway.
  107. - Most syntax errors will produce warnings instead of terminating process
  108. - Up to 32 layer function piping
  109. - Support for linux system calls
  110. - Network listen socket, toss function
  111. - Builtin HTTP server for disposeable use, can be ran in the foreground or forked into the background
  112. - Read and write from file
  113. - Lots of simple but useful functions
  114. - Shebang handling
  115. - Variable support
  116. - If, ifn, loop, and comp statements
  117. - PATH variable support
  118. - Calls system executables if not known as a SS function! (its a shell too!)
  119. - Web server additions (pulled from chttpd)
  120. ===============
  121. = Changelog =
  122. ===============
  123. Changes between version bumps in SlideScript. Hoping to have a lightweight top-down scripting language
  124. by V1.0.0 release! From there it will be molding and preserving the art.
  125. V0.7.2
  126. * Bug fixes
  127. * Integrated PATH variables into slidescript for the sake of a useable shell
  128. * Allow for external programs to be ran from slidescript if no functions found (shell)
  129. V0.7.1
  130. * Removed tar sources from SlideScript, does it need to create tar packages. (You can use system utils)
  131. * Reworked compress / decompress for single file operations. Great for resources FOR slidescript (assets)
  132. * Working on the lexer engine for line parsing and cleaner syntax.
  133. V0.7.0
  134. * Ditched old LZ77 example code, and went with a more polished LZ78 ()
  135. * Converted dynamic memory management layer into LZ78 engine and tar code.
  136. * Compress & Decompress are both fully functioning.
  137. * Tidies, and polishing (pushing more for that full lenguage)
  138. V0.6.0
  139. * Multiple dynamic memory bug fixes, SlideScript is 99% dynamic on memory use
  140. * Included if, and ifn functions for comp, isfile, isdir, etc return values.
  141. * Incorporated unset function to wipe variable data within the same session.
  142. * Additions to help command
  143. * Code cleanup
  144. * Fixed large bug when attempting to use multiple variables within one function.
  145. * Fixed compile warnings on some systems
  146. * Fixed system uncompatibility for Windows systems, should work cross-compiled!
  147. V0.5.4
  148. * Added memory management framework for dynamic memory handling
  149. * tar.c cleanup
  150. * fflush additions for telnet usage of SS.
  151. V0.5.3
  152. * Added version, and help command
  153. V0.5.2
  154. * Bugfixes and tweaks
  155. * Added loop and comp(are) statements
  156. V0.5.1
  157. * Compression and decompression bugfixes
  158. * System working functions (move, chdir, and showpath)
  159. * General clean, removed bins/ until language stabilizes
  160. V0.5.0
  161. * Interactive mode gives users prompt on call to slidescript (Thanks OldCoder!)
  162. * Added showdir (alias ls)
  163. * Added compress / decompress functions (WIP, slow LZ77 algorithm)
  164. * Multiple bug fixes
  165. * Shell like interactive behavior
  166. V0.4.5
  167. * Multiple bug fixes in not setting null byte to dynamic mem before strcat is used
  168. * Function isfile, as well as mkfile and mkdir are added
  169. * Added grep like function, search!
  170. * Cleanup code
  171. V0.4.4
  172. * Softened the kill program errors, added warn functions behind the scenes
  173. * Added backquote function processing in variables
  174. * Fixed bug in read not displaying multi-line files
  175. * Fixed bug in write not finding first quote syntax
  176. * Added function isdir, and cat(enate) function. NOT cat as in linux env.
  177. * Code clean-up
  178. V0.4.0
  179. * Added calc function for floating math equations
  180. * Cleaned up some more syntax handling, as well as bugs
  181. * Added structured and savable multi-layer piping up to 32 functions deep
  182. V0.3.3
  183. * Added first networking functions: netlisten, nettoss, nethttp.
  184. * Embedded web server functionality
  185. * Cleaned up code
  186. * Improved syntax handling on functions
  187. V0.3.0
  188. * Added simple 2 layer function piping for more useful tasks
  189. * Fixed a couple core dump bugs
  190. * Now reads files into memory, and then forces text files through SS, allows for in file variables
  191. * Added "md5" functionality
  192. * Multi-formal working syntax
  193. V0.2.1
  194. * Added "decrypt" decode function
  195. * Added "encrypt" encode function
  196. * Added system "exec" function
  197. * Added basic syntax handling, for a more uniform language
  198. V0.2.0
  199. * Added "delete" function
  200. * Added embedded variable handling to SS functions (variables can be used like everywhere!)
  201. * Added linux system calls via exec
  202. * Some cleaning up.
  203. V0.1.1
  204. * Added variable handling with a buffer size of 2KB per variable, and cap of 2048 variables.
  205. * Now operates under the shebang!
  206. ===============
  207. =Contributions=
  208. ===============
  209. Robert (OldCoder) Kiraly -> shebang support, string manipulation, and memory management
  210. (C) Copyright 2014-2022 Chris Dorman, some rights reserved (GPLv2)