overhaul: modular architecture, tests, doc generation, warning system, and UX improvements

- Modular block files: split into blocks-algo, blocks-data, blocks-proc
- New modules: sections.js (labelled canvas areas), proc-browser.js (procedure tree modal), lib-loader.js (lazy library loading), templates.js (project templates), errno-data.js (errno table)
- Test infrastructure: browser test suite (28 tests) and Node pure-function tests (75 tests)
- Warning system: unified .block-warn for disconnected inputs, unconnected error hooks, and zero-exit-in-error-path
- Error path highlighting: red flow paths and block borders for error-only subgraphs
- Input hooks: hidden by default, shown during linking; outputs always at bottom
- Block editor modal: pencil icon, colour picker for accent, compact field labels
- Doc generation: standalone node script extracts JSDoc -> docs/API.md (124 declarations)
- Persistence: save/restore sections, errno selection, block colours
- Fixes: _segmentsIntersect bug, WCEnd crash from closest(this), drawpath guard on detached elements
This commit is contained in:
2026-06-22 18:31:23 +02:00
parent 36fc63780a
commit b8e8ef9113
44 changed files with 9064 additions and 596 deletions
+136
View File
@@ -0,0 +1,136 @@
{
"procedures": [
{
"name": "glCreateShader",
"inputs": [["type","unsigned int"]],
"outputs": [["shader","unsigned int"]],
"desc": "Creates an empty shader object of the specified type."
},
{
"name": "glShaderSource",
"inputs": [["shader","unsigned int"],["count","int"],["source","string"]],
"outputs": [],
"desc": "Sets the source code for a shader object."
},
{
"name": "glCompileShader",
"inputs": [["shader","unsigned int"]],
"outputs": [],
"desc": "Compiles the source code of a shader object."
},
{
"name": "glGetShaderiv",
"inputs": [["shader","unsigned int"],["pname","unsigned int"]],
"outputs": [["params","int"]],
"desc": "Retrieves a parameter value from a shader object."
},
{
"name": "glCreateProgram",
"inputs": [],
"outputs": [["program","unsigned int"]],
"desc": "Creates an empty shader program object."
},
{
"name": "glAttachShader",
"inputs": [["program","unsigned int"],["shader","unsigned int"]],
"outputs": [],
"desc": "Attaches a shader object to a shader program."
},
{
"name": "glLinkProgram",
"inputs": [["program","unsigned int"]],
"outputs": [],
"desc": "Links the attached shaders into an executable program."
},
{
"name": "glGetProgramiv",
"inputs": [["program","unsigned int"],["pname","unsigned int"]],
"outputs": [["params","int"]],
"desc": "Retrieves a parameter value from a program object."
},
{
"name": "glGenVertexArrays",
"inputs": [["n","unsigned int"]],
"outputs": [["arrays","unsigned int"]],
"desc": "Generates vertex array object (VAO) names."
},
{
"name": "glBindVertexArray",
"inputs": [["array","unsigned int"]],
"outputs": [],
"desc": "Binds a VAO for use in subsequent vertex operations."
},
{
"name": "glGenBuffers",
"inputs": [["n","unsigned int"]],
"outputs": [["buffers","unsigned int"]],
"desc": "Generates buffer object names."
},
{
"name": "glBindBuffer",
"inputs": [["target","unsigned int"],["buffer","unsigned int"]],
"outputs": [],
"desc": "Binds a buffer object to a target."
},
{
"name": "glBufferData",
"inputs": [["target","unsigned int"],["size","int"],["data","string"],["usage","unsigned int"]],
"outputs": [],
"desc": "Uploads vertex data to the currently bound buffer."
},
{
"name": "glVertexAttribPointer",
"inputs": [["index","unsigned int"],["size","int"],["type","unsigned int"],["normalized","int"],["stride","int"],["pointer","int"]],
"outputs": [],
"desc": "Defines how vertex data is mapped to a shader attribute."
},
{
"name": "glEnableVertexAttribArray",
"inputs": [["index","unsigned int"]],
"outputs": [],
"desc": "Enables a vertex attribute array for rendering."
},
{
"name": "glUseProgram",
"inputs": [["program","unsigned int"]],
"outputs": [],
"desc": "Activates a shader program for rendering."
},
{
"name": "glDrawArrays",
"inputs": [["mode","unsigned int"],["first","int"],["count","int"]],
"outputs": [],
"desc": "Renders primitives from the currently bound vertex data."
},
{
"name": "glClear",
"inputs": [["mask","unsigned int"]],
"outputs": [],
"desc": "Clears the specified buffers (color, depth, stencil)."
},
{
"name": "glClearColor",
"inputs": [["red","float"],["green","float"],["blue","float"],["alpha","float"]],
"outputs": [],
"desc": "Sets the clear color used when clearing the color buffer."
},
{
"name": "glDeleteShader",
"inputs": [["shader","unsigned int"]],
"outputs": [],
"desc": "Deletes a shader object and frees its resources."
},
{
"name": "glDeleteProgram",
"inputs": [["program","unsigned int"]],
"outputs": [],
"desc": "Deletes a shader program and frees its resources."
},
{
"name": "glViewport",
"inputs": [["x","int"],["y","int"],["width","int"],["height","int"]],
"outputs": [],
"desc": "Sets the viewport rectangle for rendering."
}
]
}
+10
View File
@@ -0,0 +1,10 @@
{
"procedures": [
{
"name": "gladLoadGL",
"inputs": [],
"outputs": [["result","int"]],
"desc": "Loads all OpenGL function pointers after context creation."
}
]
}
+46
View File
@@ -0,0 +1,46 @@
{
"procedures": [
{
"name": "glfwInit",
"inputs": [],
"outputs": [["result","int"]],
"desc": "Initializes the GLFW library for window and input management."
},
{
"name": "glfwCreateWindow",
"inputs": [["width","int"],["height","int"],["title","string"]],
"outputs": [["window","int"]],
"desc": "Creates a window with the specified dimensions and title."
},
{
"name": "glfwMakeContextCurrent",
"inputs": [["window","int"]],
"outputs": [],
"desc": "Sets the OpenGL context of the given window as current."
},
{
"name": "glfwSwapBuffers",
"inputs": [["window","int"]],
"outputs": [],
"desc": "Swaps the front and back buffers of the window."
},
{
"name": "glfwPollEvents",
"inputs": [],
"outputs": [],
"desc": "Processes pending window events (keyboard, mouse, etc.)."
},
{
"name": "glfwWindowShouldClose",
"inputs": [["window","int"]],
"outputs": [["result","int"]],
"desc": "Checks if the window close button has been pressed."
},
{
"name": "glfwTerminate",
"inputs": [],
"outputs": [],
"desc": "Cleans up GLFW resources and terminates the library."
}
]
}
+40
View File
@@ -0,0 +1,40 @@
/*! `c` grammar compiled for Highlight.js 11.9.0 */
(()=>{var e=(()=>{"use strict";return e=>{const n=e.regex,t=e.COMMENT("//","$",{
contains:[{begin:/\\\n/}]
}),s="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",r="("+s+"|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",i={
className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{
match:/\batomic_[a-z]{3,6}\b/}]},l={className:"string",variants:[{
begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{
begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",
end:"'",illegal:"."},e.END_SAME_AS_BEGIN({
begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={
className:"number",variants:[{begin:"\\b(0b[01']+)"},{
begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"
},{
begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"
}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{
keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"
},contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{
className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={
className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0
},g=n.optional(a)+e.IDENT_RE+"\\s*\\(",u={
keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],
type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],
literal:"true false NULL",
built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"
},m=[c,i,t,e.C_BLOCK_COMMENT_MODE,o,l],_={variants:[{begin:/=/,end:/;/},{
begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],
keywords:u,contains:m.concat([{begin:/\(/,end:/\)/,keywords:u,
contains:m.concat(["self"]),relevance:0}]),relevance:0},p={
begin:"("+r+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,
keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:u,relevance:0},{
begin:g,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],
relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,
keywords:u,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,l,o,i,{begin:/\(/,
end:/\)/,keywords:u,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,l,o,i]
}]},i,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u,
disableAutodetect:!0,illegal:"</",contains:[].concat(_,p,m,[c,{
begin:e.IDENT_RE+"::",keywords:u},{className:"class",
beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{
beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,
strings:l,keywords:u}}}})();hljs.registerLanguage("c",e)})();
+9
View File
@@ -0,0 +1,9 @@
/*!
Theme: Default
Description: Original highlight.js style
Author: (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
Maintainer: @highlightjs/core-team
Website: https://highlightjs.org/
License: see project LICENSE
Touched: 2021
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#f3f3f3;color:#444}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
File diff suppressed because one or more lines are too long
+11
View File
@@ -0,0 +1,11 @@
[
{ "id": "stdio", "name": "stdio.h", "group": "C Standard Library" },
{ "id": "stdlib", "name": "stdlib.h", "group": "C Standard Library" },
{ "id": "string", "name": "string.h", "group": "C Standard Library" },
{ "id": "math", "name": "math.h", "group": "C Standard Library" },
{ "id": "time", "name": "time.h", "group": "C Standard Library" },
{ "id": "glfw", "name": "GLFW", "group": "OpenGL" },
{ "id": "glad", "name": "glad", "group": "OpenGL" },
{ "id": "gl", "name": "OpenGL", "group": "OpenGL" },
{ "id": "sdl3", "name": "SDL3", "group": "SDL3" }
]
+88
View File
@@ -0,0 +1,88 @@
{
"procedures": [
{
"name": "sin",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns the sine of an angle in radians."
},
{
"name": "cos",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns the cosine of an angle in radians."
},
{
"name": "tan",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns the tangent of an angle in radians."
},
{
"name": "sqrt",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns the square root of a number."
},
{
"name": "pow",
"inputs": [["x","float"],["y","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns a number raised to a power."
},
{
"name": "exp",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns e raised to the given power."
},
{
"name": "log",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns the natural logarithm of a number."
},
{
"name": "log10",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns the base-10 logarithm of a number."
},
{
"name": "fabs",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns the absolute value of a floating-point number."
},
{
"name": "floor",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Rounds a number down to the nearest integer."
},
{
"name": "ceil",
"inputs": [["x","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Rounds a number up to the nearest integer."
},
{
"name": "fmod",
"inputs": [["x","float"],["y","float"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Returns the floating-point remainder of division."
}
]
}
+238
View File
@@ -0,0 +1,238 @@
{
"procedures": [
{
"name": "SDL_Init",
"inputs": [["flags","unsigned int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Initializes SDL subsystems (video, audio, etc.) with the given flags."
},
{
"name": "SDL_Quit",
"inputs": [],
"outputs": [],
"returnStyle": "void",
"desc": "Shuts down all SDL subsystems and cleans up resources."
},
{
"name": "SDL_SetAppMetadata",
"inputs": [["name","string"],["version","string"],["identifier","string"]],
"outputs": [],
"returnStyle": "error",
"desc": "Sets the application name, version, and identifier."
},
{
"name": "SDL_CreateWindow",
"inputs": [["title","string"],["w","int"],["h","int"],["flags","unsigned int"]],
"outputs": [["window","int"]],
"returnStyle": "value",
"desc": "Creates a window with the given title, size, and flags."
},
{
"name": "SDL_DestroyWindow",
"inputs": [["window","int"]],
"outputs": [],
"returnStyle": "void",
"desc": "Destroys a window and frees its resources."
},
{
"name": "SDL_SetWindowTitle",
"inputs": [["window","int"],["title","string"]],
"outputs": [],
"returnStyle": "error",
"desc": "Changes the title of a window."
},
{
"name": "SDL_GetWindowSize",
"inputs": [["window","int"]],
"outputs": [["w","int"],["h","int"]],
"desc": "Retrieves the current width and height of a window."
},
{
"name": "SDL_ShowWindow",
"inputs": [["window","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Makes a hidden window visible on screen."
},
{
"name": "SDL_HideWindow",
"inputs": [["window","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Hides a window from view."
},
{
"name": "SDL_RaiseWindow",
"inputs": [["window","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Brings a window to the front of the display."
},
{
"name": "SDL_MaximizeWindow",
"inputs": [["window","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Maximizes a window to fill the screen."
},
{
"name": "SDL_MinimizeWindow",
"inputs": [["window","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Minimizes a window to the taskbar."
},
{
"name": "SDL_RestoreWindow",
"inputs": [["window","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Restores a window from maximized or minimized state."
},
{
"name": "SDL_CreateRenderer",
"inputs": [["window","int"],["name","string"]],
"outputs": [["renderer","int"]],
"returnStyle": "value",
"desc": "Creates a 2D renderer for the given window."
},
{
"name": "SDL_DestroyRenderer",
"inputs": [["renderer","int"]],
"outputs": [],
"returnStyle": "void",
"desc": "Destroys a renderer and frees its resources."
},
{
"name": "SDL_RenderClear",
"inputs": [["renderer","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Clears the render target with the current draw color."
},
{
"name": "SDL_RenderPresent",
"inputs": [["renderer","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Presents the rendered frame to the screen."
},
{
"name": "SDL_SetRenderDrawColor",
"inputs": [["renderer","int"],["r","int"],["g","int"],["b","int"],["a","int"]],
"outputs": [],
"returnStyle": "error",
"desc": "Sets the color used for drawing operations."
},
{
"name": "SDL_RenderPoint",
"inputs": [["renderer","int"],["x","float"],["y","float"]],
"outputs": [],
"returnStyle": "error",
"desc": "Draws a single point at the given coordinates."
},
{
"name": "SDL_RenderLine",
"inputs": [["renderer","int"],["x1","float"],["y1","float"],["x2","float"],["y2","float"]],
"outputs": [],
"returnStyle": "error",
"desc": "Draws a line between two points."
},
{
"name": "SDL_RenderRect",
"inputs": [["renderer","int"],["x","float"],["y","float"],["w","float"],["h","float"]],
"outputs": [],
"returnStyle": "error",
"desc": "Draws a rectangle outline at the given position and size."
},
{
"name": "SDL_RenderFillRect",
"inputs": [["renderer","int"],["x","float"],["y","float"],["w","float"],["h","float"]],
"outputs": [],
"returnStyle": "error",
"desc": "Draws a filled rectangle at the given position and size."
},
{
"name": "SDL_PollEvent",
"inputs": [],
"outputs": [["event","int"]],
"desc": "Polls for the next pending input event."
},
{
"name": "SDL_WaitEvent",
"inputs": [],
"outputs": [["event","int"]],
"desc": "Waits indefinitely for the next input event."
},
{
"name": "SDL_PumpEvents",
"inputs": [],
"outputs": [],
"returnStyle": "void",
"desc": "Processes pending events without blocking."
},
{
"name": "SDL_FlushEvents",
"inputs": [["minType","unsigned int"],["maxType","unsigned int"]],
"outputs": [],
"returnStyle": "void",
"desc": "Discards all pending events in a given range."
},
{
"name": "SDL_GetTicks",
"inputs": [],
"outputs": [["ticks","unsigned int"]],
"returnStyle": "value",
"desc": "Returns milliseconds since SDL initialization."
},
{
"name": "SDL_Delay",
"inputs": [["ms","unsigned int"]],
"outputs": [],
"returnStyle": "void",
"desc": "Pauses execution for the given number of milliseconds."
},
{
"name": "SDL_GetKeyboardState",
"inputs": [],
"outputs": [["state","string"]],
"desc": "Returns a snapshot of the current keyboard state."
},
{
"name": "SDL_GetModState",
"inputs": [],
"outputs": [["mod","unsigned int"]],
"returnStyle": "value",
"desc": "Returns the current modifier key state (Shift, Ctrl, Alt)."
},
{
"name": "SDL_GetError",
"inputs": [],
"outputs": [["msg","string"]],
"returnStyle": "value",
"desc": "Returns the last error message as a string."
},
{
"name": "SDL_Log",
"inputs": [["fmt","string"]],
"outputs": [],
"returnStyle": "void",
"desc": "Outputs a log message via SDL's logging system."
},
{
"name": "SDL_GetTicksNS",
"inputs": [],
"outputs": [["ticks","unsigned int"]],
"returnStyle": "value",
"desc": "Returns nanoseconds since SDL initialization."
},
{
"name": "SDL_DelayNS",
"inputs": [["ns","unsigned int"]],
"outputs": [],
"returnStyle": "void",
"desc": "Pauses execution for the given number of nanoseconds."
}
]
}
+40
View File
@@ -0,0 +1,40 @@
{
"procedures": [
{
"name": "puts",
"inputs": [["str","string"]],
"outputs": [],
"returnStyle": "void",
"desc": "Outputs a string followed by a newline to the console."
},
{
"name": "printf",
"inputs": [["fmt","string"]],
"outputs": [["result","int"]],
"returnStyle": "value",
"formatString": true,
"desc": "Outputs a formatted string with placeholders to the console. Dynamically creates data inputs for each % specifier in the format string."
},
{
"name": "getchar",
"inputs": [],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Reads a single character from the keyboard input."
},
{
"name": "putchar",
"inputs": [["c","int"]],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Writes a single character to the console output."
},
{
"name": "perror",
"inputs": [["msg","string"]],
"outputs": [],
"returnStyle": "void",
"desc": "Prints an error message describing the last error to stderr."
}
]
}
+67
View File
@@ -0,0 +1,67 @@
{
"procedures": [
{
"name": "malloc",
"inputs": [["size","int"]],
"outputs": [["ptr","int"]],
"returnStyle": "value",
"desc": "Allocates a block of memory of the given size."
},
{
"name": "free",
"inputs": [["ptr","int"]],
"outputs": [],
"returnStyle": "void",
"desc": "Releases a previously allocated memory block."
},
{
"name": "exit",
"inputs": [["status","int"]],
"outputs": [],
"returnStyle": "void",
"desc": "Terminates the program immediately with the given status code."
},
{
"name": "rand",
"inputs": [],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Returns a random integer between 0 and RAND_MAX."
},
{
"name": "srand",
"inputs": [["seed","unsigned int"]],
"outputs": [],
"returnStyle": "void",
"desc": "Seeds the random number generator with the given value."
},
{
"name": "atoi",
"inputs": [["str","string"]],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Converts a string to an integer."
},
{
"name": "atof",
"inputs": [["str","string"]],
"outputs": [["result","float"]],
"returnStyle": "value",
"desc": "Converts a string to a floating-point number."
},
{
"name": "abs",
"inputs": [["n","int"]],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Returns the absolute value of an integer."
},
{
"name": "system",
"inputs": [["cmd","string"]],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Executes a shell command."
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"procedures": [
{
"name": "strlen",
"inputs": [["str","string"]],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Returns the length of a string."
},
{
"name": "strcmp",
"inputs": [["s1","string"],["s2","string"]],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Compares two strings lexicographically."
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"procedures": [
{
"name": "time",
"inputs": [["timer","int"]],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Returns the current calendar time in seconds."
},
{
"name": "clock",
"inputs": [],
"outputs": [["result","int"]],
"returnStyle": "value",
"desc": "Returns the processor time used by the program."
}
]
}