Skip to content

Commit

Permalink
update API
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Sep 21, 2024
1 parent 126dfca commit 1465efb
Show file tree
Hide file tree
Showing 18 changed files with 312 additions and 386 deletions.
40 changes: 10 additions & 30 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,14 @@ export default defineConfig({
},
],
},
{
text: 'Runtime',
link: '/runtime/',
items: [
{ text: 'Public Functionalities', link: '/runtime/public-functionalities' },
{ text: 'Runtime API', link: '/runtime/runtime-api' },
],
},
{
text: 'Integrated Jule',
link: '/integrated-jule/',
Expand Down Expand Up @@ -392,6 +400,7 @@ export default defineConfig({
text: 'API',
link: '/api/',
items: [
{ text: 'Runtime API', link: '/api/runtime-api' },
{
text: 'Implementation',
link: '/api/implementation/',
Expand All @@ -401,21 +410,6 @@ export default defineConfig({
{ text: 'Production', link: '/api/implementation/production' },
],
},
{
text: 'Environment',
link: '/api/environment/',
items: [
{ text: 'Command-Line Arguments', link: '/api/environment/command-line-arguments' },
{ text: 'Environment Variables', link: '/api/environment/environment-variables' },
],
},
{
text: 'Process',
link: '/api/process/',
items: [
{ text: 'Executable Path', link: '/api/process/executable-path' },
],
},
{ text: 'Platform Specific', link: '/api/platform-specific' },
{
text: 'Types',
Expand All @@ -424,21 +418,11 @@ export default defineConfig({
{ text: 'Primitive', link: '/api/types/primitive' },
{ text: 'Limits', link: '/api/types/limits' },
{ text: 'Strings', link: '/api/types/strings' },
{ text: 'Maps', link: '/api/types/maps' },
{ text: 'Slices', link: '/api/types/slices' },
{ text: 'Any', link: '/api/types/any' },
],
},
{ text: 'Atomicity', link: '/api/atomicity' },
{ text: 'Deferred Scopes', link: '/api/deferred-scopes' },
{
text: 'Unicode',
link: '/api/unicode/',
items: [
{ text: 'UTF-8', link: '/api/unicode/utf-8' },
{ text: 'UTF-16', link: '/api/unicode/utf-16' },
],
},
{
text: 'Reference Counting',
link: '/api/reference-counting/',
Expand All @@ -453,11 +437,6 @@ export default defineConfig({
{ text: 'Wrappers', link: '/api/integrated-jule/wrappers' },
],
},
{
text: 'Using as Library',
link: '/api/using-as-library/',
items: [],
},
],
}
],
Expand Down Expand Up @@ -542,6 +521,7 @@ export default defineConfig({
},
{ text: 'std::net', link: '/std/net' },
{ text: 'std::process', link: '/std/process' },
{ text: 'std::runtime', link: '/runtime/' },
{ text: 'std::slices', link: '/std/slices' },
{ text: 'std::strings', link: '/std/strings' },
{
Expand Down
47 changes: 0 additions & 47 deletions src/api/environment/command-line-arguments.md

This file was deleted.

46 changes: 0 additions & 46 deletions src/api/environment/environment-variables.md

This file was deleted.

3 changes: 0 additions & 3 deletions src/api/environment/index.md

This file was deleted.

10 changes: 0 additions & 10 deletions src/api/process/executable-path.md

This file was deleted.

3 changes: 0 additions & 3 deletions src/api/process/index.md

This file was deleted.

11 changes: 2 additions & 9 deletions src/api/reference-counting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

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

## Variables

```cpp
constexpr signed int REFERENCE_DELTA;
```
The reference counting data delta value that must occur per each reference counting operation.

## Functions

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

### Methods

```cpp
void drop(void);
void dealloc(void);
```
Drops reference. This function will destruct this instace for reference counting. Frees memory if reference counting reaches to zero.
137 changes: 137 additions & 0 deletions src/api/runtime-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Runtime API

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.

## Globals

```cpp
jule::Int __jule_argc
```
Declaration of: `argc`

```cpp
jule::U8 **__jule_argv
```
Declaration of: `argv`

```cpp
jule::U8 **__jule_envp
```
Declaration of: `envp`

## Functions

```cpp
jule::Bool __jule_ptrEqual(void *a, void *b);
```
Declaration of: `ptrEqual`
```cpp
jule::Str __jule_ptrToStr(void *p);
```
Declaration of: `ptrToStr`

```cpp
jule::Str __jule_boolToStr(jule::Bool b);
```
Declaration of: `boolToStr`
```cpp
jule::Str __jule_i64ToStr(jule::I64 x);
```
Declaration of: `i64ToStr`

```cpp
jule::Str __jule_u64ToStr(jule::U64 x);
```
Declaration of: `u64ToStr`
```cpp
jule::Str __jule_f64ToStr(jule::F64 x);
```
Declaration of: `f64ToStr`

```cpp
jule::Uint *__jule_RCNew(void);
```
Declaration of: `_RCNew`
```cpp
jule::Uint __jule_RCLoad(jule::Uint *p);
```
Declaration of: `_RCLoad`

```cpp
void __jule_RCAdd(jule::Uint *p);
```
Declaration of: `_RCAdd`
```cpp
jule::Bool __jule_RCDrop(jule::Uint *p);
```
Declaration of: `_RCDrop`

```cpp
void __jule_RCFree(jule::Uint *p);
```
Declaration of: `_RCFree`
```cpp
jule::Int __jule_compareStr(jule::Str *a, jule::Str *b);
```
Declaration of: `compareStr`

```cpp
jule::Int __jule_writeStdout(jule::Slice<jule::U8> buf);
```
Declaration of: `writeStdout`
```cpp
jule::Int __jule_writeStderr(jule::Slice<jule::U8> buf);
```
Declaration of: `writeStderr`

```cpp
jule::Int __jule_readStdin(jule::Slice<jule::U8> buf);
```
Declaration of: `readStdin`
```cpp
void __jule_panic(jule::U8 *m, jule::Int n);
```
Declaration of: `panic1`

```cpp
jule::Str __jule_bytesToStr(jule::Slice<jule::U8> bytes);
```
Declaration of: `bytesToStr`
```cpp
jule::Str __jule_runesToStr(jule::Slice<jule::I32> runes);
```
Declaration of: `runesToStr`

```cpp
jule::Slice<jule::I32> __jule_strToRunes(jule::Str s);
```
Declaration of: `strToRunes`
```cpp
jule::Slice<jule::U8> __jule_strToBytes(jule::Str s);
```
Declaration of: `strToBytes`

```cpp
jule::Str __jule_strFromByte(jule::U8 b);
```
Declaration of: `strFromByte`
```cpp
jule::Str __jule_strFromRune(jule::I32 r);
```
Declaration of: `strFromRune`

```cpp
void __jule_runeStep(jule::U8 *s, jule::Int len, jule::I32 *r, jule::Int *outLen);
```
Declaration of: `runeStep`
Loading

0 comments on commit 1465efb

Please sign in to comment.