Skip to content

Commit 5212456

Browse files
committed
update API
1 parent a7ace45 commit 5212456

File tree

15 files changed

+150
-148
lines changed

15 files changed

+150
-148
lines changed

src/api/integrated-jule/wrappers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ private:
4949
public:
5050
Vector<T>(void) {}
5151
52-
jule::Int size(void) const
52+
__jule_Int size(void) const
5353
{ return this->buffer.size(); }
5454
55-
jule::Int capacity(void) const
55+
__jule_Int capacity(void) const
5656
{ return this->buffer.capacity(); }
5757
};
5858
```
@@ -71,13 +71,13 @@ private:
7171
public:
7272
Vector<T>(void) {}
7373

74-
jule::Int size(void) const
74+
__jule_Int size(void) const
7575
{ return this->buffer.size(); }
7676

77-
jule::Int capacity(void) const
77+
__jule_Int capacity(void) const
7878
{ return this->buffer.capacity(); }
7979

80-
void append(const jule::Slice<T> &items) {
80+
void append(const __jule_Slice<T> &items) {
8181
for (const T &item: items)
8282
this->buffer.push_back(item);
8383
}

src/api/platform-specific.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ If you want to do platform specific programming, the API provides a number of me
44

55
## Operating System
66
Defines these macros by condition:
7-
- `OS_WINDOWS`: if platform is Windows.
8-
- `OS_LINUX`: if platform is Linux.
9-
- `OS_DARWIN`: if platform is Darwin.
10-
- `OS_UNIX`: if platform is Linux or Darwin.
7+
- `__JULE_OS_WINDOWS`: if platform is Windows.
8+
- `__JULE_OS_LINUX`: if platform is Linux.
9+
- `__JULE_OS_DARWIN`: if platform is Darwin.
10+
- `__JULE_OS_UNIX`: if platform is Linux or Darwin.
1111

1212
## Architecture
1313
Defines these macros by condition:
14-
- `ARCH_AMD64`: if architecture is AMD64.
15-
- `ARCH_ARM`: if architecture is ARM.
16-
- `ARCH_ARM64`: if architecture is ARM64.
17-
- `ARCH_I386`: if architecture is intel 386.
18-
- `ARCH_X64`: if architecture is AMD64 or ARM64.
19-
- `ARCH_X32`: if architecture is ARM or intel 386.
14+
- `__JULE_ARCH_AMD64`: if architecture is AMD64.
15+
- `__JULE_ARCH_ARM`: if architecture is ARM.
16+
- `__JULE_ARCH_ARM64`: if architecture is ARM64.
17+
- `__JULE_ARCH_I386`: if architecture is intel 386.
18+
- `__JULE_ARCH_X64`: if architecture is AMD64 or ARM64.
19+
- `__JULE_ARCH_X32`: if architecture is ARM or intel 386.

src/api/reference-counting/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Jule's reference counting functionality for allocations is provided in the API.
66

77
```cpp
88
template<typename T>
9-
jule::Ptr<T> new_ptr(void);
9+
__jule_Ptr<T> __jule_new_ptr(void);
1010
```
1111
Equavelent of Jule's `new(T)` call.
1212
1313
---
1414
1515
```cpp
1616
template<typename T>
17-
jule::Ptr<T> new_ptr(const T &init);
17+
__jule_Ptr<T> __jule_new_ptr(const T &init);
1818
```
1919

2020
Equavelent of Jule's `new(T, EXPR)` call.
@@ -31,15 +31,15 @@ Wrapper structure for raw pointer of JuleC. This structure is the used by Jule r
3131
### Statics
3232

3333
```cpp
34-
static jule::Ptr<T>
35-
make(T *ptr, jule::Uint *ref);
34+
static __jule_Ptr<T>
35+
make(T *ptr, __jule_Uint *ref);
3636
```
3737
Creates new reference from allocation and reference counting allocation. Reference does not counted if reference count allocation is null, so allocation never will be deallocated by Ptr. The ref pointer should be allocated by the runtime `__jule_RCNew` function.
3838
3939
---
4040
4141
```cpp
42-
static jule::Ptr<T>
42+
static __jule_Ptr<T>
4343
make(T *ptr);
4444
```
4545
Creates new reference from allocation. Allocates new allocation for reference counting data and starts counting to reference counting delta of runtime.

src/api/reference-counting/using.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ Include reference counting header:
1111

1212
Recommended way:
1313
```cpp
14-
jule::Ptr<int> my_int = nullptr;
14+
__jule_Ptr<int> my_int = nullptr;
1515
```
1616

1717
---
1818

1919
Using default constructor:
2020
```cpp
21-
jule::Ptr<int> my_int;
21+
__jule_Ptr<int> my_int;
2222
```
2323

2424
### Initialized References
2525

2626
Recommended way:
2727
```cpp
28-
jule::Ptr<int> my_int = jule::new_ptr<int>(900);
28+
__jule_Ptr<int> my_int = __jule_new_ptr<int>(900);
2929
std::cout << *my_int << std::endl;
3030
```
3131

@@ -35,15 +35,15 @@ Create reference for custom allocation:
3535
```cpp
3636
int *my_alloc = new int;
3737
*my_alloc = 200;
38-
jule::Ptr<int> my_int = jule::Ptr<int>::make(my_alloc);
38+
__jule_Ptr<int> my_int = __jule_Ptr<int>::make(my_alloc);
3939
std::cout << *my_int << std::endl;
4040
```
4141

4242
## Accessing Data
4343

4444
Change data via assignment:
4545
```cpp
46-
jule::Ptr<int> my_int = jule::new_ptr<int>(900);
46+
__jule_Ptr<int> my_int = __jule_new_ptr<int>(900);
4747
std::cout << *my_int << std::endl;
4848
*my_int += 1000; // my_int's data is now 1900
4949
std::cout << *my_int << std::endl;
@@ -54,11 +54,11 @@ std::cout << *my_int << std::endl;
5454
Get or set fields via `->` operator:
5555
```cpp
5656
struct Person {
57-
jule::Str name;
58-
jule::Str surname;
57+
__jule_Str name;
58+
__jule_Str surname;
5959
};
6060

61-
jule::Ptr<Person> p = jule::new_ptr<Person>(Person{
61+
__jule_Ptr<Person> p = __jule_new_ptr<Person>(Person{
6262
.name="Anonymous",
6363
.surname="Julenour",
6464
});

0 commit comments

Comments
 (0)