Skip to content

Commit 1465efb

Browse files
committed
update API
1 parent 126dfca commit 1465efb

File tree

18 files changed

+312
-386
lines changed

18 files changed

+312
-386
lines changed

.vitepress/config.mts

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ export default defineConfig({
350350
},
351351
],
352352
},
353+
{
354+
text: 'Runtime',
355+
link: '/runtime/',
356+
items: [
357+
{ text: 'Public Functionalities', link: '/runtime/public-functionalities' },
358+
{ text: 'Runtime API', link: '/runtime/runtime-api' },
359+
],
360+
},
353361
{
354362
text: 'Integrated Jule',
355363
link: '/integrated-jule/',
@@ -392,6 +400,7 @@ export default defineConfig({
392400
text: 'API',
393401
link: '/api/',
394402
items: [
403+
{ text: 'Runtime API', link: '/api/runtime-api' },
395404
{
396405
text: 'Implementation',
397406
link: '/api/implementation/',
@@ -401,21 +410,6 @@ export default defineConfig({
401410
{ text: 'Production', link: '/api/implementation/production' },
402411
],
403412
},
404-
{
405-
text: 'Environment',
406-
link: '/api/environment/',
407-
items: [
408-
{ text: 'Command-Line Arguments', link: '/api/environment/command-line-arguments' },
409-
{ text: 'Environment Variables', link: '/api/environment/environment-variables' },
410-
],
411-
},
412-
{
413-
text: 'Process',
414-
link: '/api/process/',
415-
items: [
416-
{ text: 'Executable Path', link: '/api/process/executable-path' },
417-
],
418-
},
419413
{ text: 'Platform Specific', link: '/api/platform-specific' },
420414
{
421415
text: 'Types',
@@ -424,21 +418,11 @@ export default defineConfig({
424418
{ text: 'Primitive', link: '/api/types/primitive' },
425419
{ text: 'Limits', link: '/api/types/limits' },
426420
{ text: 'Strings', link: '/api/types/strings' },
427-
{ text: 'Maps', link: '/api/types/maps' },
428421
{ text: 'Slices', link: '/api/types/slices' },
429422
{ text: 'Any', link: '/api/types/any' },
430423
],
431424
},
432-
{ text: 'Atomicity', link: '/api/atomicity' },
433425
{ text: 'Deferred Scopes', link: '/api/deferred-scopes' },
434-
{
435-
text: 'Unicode',
436-
link: '/api/unicode/',
437-
items: [
438-
{ text: 'UTF-8', link: '/api/unicode/utf-8' },
439-
{ text: 'UTF-16', link: '/api/unicode/utf-16' },
440-
],
441-
},
442426
{
443427
text: 'Reference Counting',
444428
link: '/api/reference-counting/',
@@ -453,11 +437,6 @@ export default defineConfig({
453437
{ text: 'Wrappers', link: '/api/integrated-jule/wrappers' },
454438
],
455439
},
456-
{
457-
text: 'Using as Library',
458-
link: '/api/using-as-library/',
459-
items: [],
460-
},
461440
],
462441
}
463442
],
@@ -542,6 +521,7 @@ export default defineConfig({
542521
},
543522
{ text: 'std::net', link: '/std/net' },
544523
{ text: 'std::process', link: '/std/process' },
524+
{ text: 'std::runtime', link: '/runtime/' },
545525
{ text: 'std::slices', link: '/std/slices' },
546526
{ text: 'std::strings', link: '/std/strings' },
547527
{

src/api/environment/command-line-arguments.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/api/environment/environment-variables.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/api/environment/index.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/api/process/executable-path.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/api/process/index.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/api/reference-counting/index.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
Jule's reference counting functionality for allocations is provided in the API. The `ref.hpp` header contains the `Ptr` struct for reference counting.
44

5-
## Variables
6-
7-
```cpp
8-
constexpr signed int REFERENCE_DELTA;
9-
```
10-
The reference counting data delta value that must occur per each reference counting operation.
11-
125
## Functions
136

147
```cpp
@@ -49,11 +42,11 @@ Creates new reference from allocation and reference counting allocation. Referen
4942
static jule::Ptr<T>
5043
make(T *ptr);
5144
```
52-
Creates new reference from allocation. Allocates new allocation for reference counting data and starts counting to `jule::REFERENCE_DELTA`.
45+
Creates new reference from allocation. Allocates new allocation for reference counting data and starts counting to reference counting delta of runtime.
5346

5447
### Methods
5548

5649
```cpp
57-
void drop(void);
50+
void dealloc(void);
5851
```
5952
Drops reference. This function will destruct this instace for reference counting. Frees memory if reference counting reaches to zero.

src/api/runtime-api.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# Runtime API
2+
3+
If you want to get information about Jule runtime, read the [Runtime](/runtime/) section. This section only shows which API functions are declared to the backend and how. For documentation you need to look at the documentation of the functions.
4+
5+
## Globals
6+
7+
```cpp
8+
jule::Int __jule_argc
9+
```
10+
Declaration of: `argc`
11+
12+
```cpp
13+
jule::U8 **__jule_argv
14+
```
15+
Declaration of: `argv`
16+
17+
```cpp
18+
jule::U8 **__jule_envp
19+
```
20+
Declaration of: `envp`
21+
22+
## Functions
23+
24+
```cpp
25+
jule::Bool __jule_ptrEqual(void *a, void *b);
26+
```
27+
Declaration of: `ptrEqual`
28+
29+
```cpp
30+
jule::Str __jule_ptrToStr(void *p);
31+
```
32+
Declaration of: `ptrToStr`
33+
34+
```cpp
35+
jule::Str __jule_boolToStr(jule::Bool b);
36+
```
37+
Declaration of: `boolToStr`
38+
39+
```cpp
40+
jule::Str __jule_i64ToStr(jule::I64 x);
41+
```
42+
Declaration of: `i64ToStr`
43+
44+
```cpp
45+
jule::Str __jule_u64ToStr(jule::U64 x);
46+
```
47+
Declaration of: `u64ToStr`
48+
49+
```cpp
50+
jule::Str __jule_f64ToStr(jule::F64 x);
51+
```
52+
Declaration of: `f64ToStr`
53+
54+
```cpp
55+
jule::Uint *__jule_RCNew(void);
56+
```
57+
Declaration of: `_RCNew`
58+
59+
```cpp
60+
jule::Uint __jule_RCLoad(jule::Uint *p);
61+
```
62+
Declaration of: `_RCLoad`
63+
64+
```cpp
65+
void __jule_RCAdd(jule::Uint *p);
66+
```
67+
Declaration of: `_RCAdd`
68+
69+
```cpp
70+
jule::Bool __jule_RCDrop(jule::Uint *p);
71+
```
72+
Declaration of: `_RCDrop`
73+
74+
```cpp
75+
void __jule_RCFree(jule::Uint *p);
76+
```
77+
Declaration of: `_RCFree`
78+
79+
```cpp
80+
jule::Int __jule_compareStr(jule::Str *a, jule::Str *b);
81+
```
82+
Declaration of: `compareStr`
83+
84+
```cpp
85+
jule::Int __jule_writeStdout(jule::Slice<jule::U8> buf);
86+
```
87+
Declaration of: `writeStdout`
88+
89+
```cpp
90+
jule::Int __jule_writeStderr(jule::Slice<jule::U8> buf);
91+
```
92+
Declaration of: `writeStderr`
93+
94+
```cpp
95+
jule::Int __jule_readStdin(jule::Slice<jule::U8> buf);
96+
```
97+
Declaration of: `readStdin`
98+
99+
```cpp
100+
void __jule_panic(jule::U8 *m, jule::Int n);
101+
```
102+
Declaration of: `panic1`
103+
104+
```cpp
105+
jule::Str __jule_bytesToStr(jule::Slice<jule::U8> bytes);
106+
```
107+
Declaration of: `bytesToStr`
108+
109+
```cpp
110+
jule::Str __jule_runesToStr(jule::Slice<jule::I32> runes);
111+
```
112+
Declaration of: `runesToStr`
113+
114+
```cpp
115+
jule::Slice<jule::I32> __jule_strToRunes(jule::Str s);
116+
```
117+
Declaration of: `strToRunes`
118+
119+
```cpp
120+
jule::Slice<jule::U8> __jule_strToBytes(jule::Str s);
121+
```
122+
Declaration of: `strToBytes`
123+
124+
```cpp
125+
jule::Str __jule_strFromByte(jule::U8 b);
126+
```
127+
Declaration of: `strFromByte`
128+
129+
```cpp
130+
jule::Str __jule_strFromRune(jule::I32 r);
131+
```
132+
Declaration of: `strFromRune`
133+
134+
```cpp
135+
void __jule_runeStep(jule::U8 *s, jule::Int len, jule::I32 *r, jule::Int *outLen);
136+
```
137+
Declaration of: `runeStep`

0 commit comments

Comments
 (0)