Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Fischer
emper
Commits
6614962b
Commit
6614962b
authored
4 years ago
by
Florian Fischer
Browse files
Options
Downloads
Patches
Plain Diff
fixup! export async functions to C
parent
75bef808
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
emper/c_emper.cpp
+14
-13
14 additions, 13 deletions
emper/c_emper.cpp
emper/include/emper.h
+8
-6
8 additions, 6 deletions
emper/include/emper.h
with
22 additions
and
19 deletions
emper/c_emper.cpp
+
14
−
13
View file @
6614962b
#include
"emper.h"
#include
"emper-config.h"
#include
"Runtime.hpp"
#include
"Fiber.hpp"
#include
"BinaryPrivateSemaphore.hpp"
...
...
@@ -101,38 +102,38 @@ void wait_cps(cps* sem) {
}
#ifdef EMPER_ASYNC_NETWORK
int
async_recv
(
int
fd
,
unsigned
char
*
buff
,
int
buff_len
,
int
flags
)
{
bool
read_once
=
flags
&
READ_FULL_BUFFER
==
0
;
bool
fd_serialized
=
flags
&
UNSERIALIZED
==
0
;
int
async_recv
(
int
fd
,
void
*
buff
,
int
buff_len
,
int
flags
)
{
bool
read_once
=
(
flags
&
READ_FULL_BUFFER
)
==
0
;
bool
fd_serialized
=
(
flags
&
UNSERIALIZED
)
==
0
;
return
io
::
async_recv
(
fd
,
buff
,
buff_len
,
read_once
,
fd_serialized
);
return
io
::
async_recv
(
fd
,
(
unsigned
char
*
)
buff
,
buff_len
,
read_once
,
fd_serialized
);
}
int
async_send
(
int
fd
,
unsigned
char
*
buff
,
int
buff_len
,
int
flags
)
{
bool
fd_serialized
=
flags
&
UNSERIALIZED
==
0
;
int
async_send
(
int
fd
,
const
void
*
buff
,
int
buff_len
,
int
flags
)
{
bool
fd_serialized
=
(
flags
&
UNSERIALIZED
)
==
0
;
return
io
::
async_
recv
(
fd
,
buff
,
buff_len
,
read_once
,
fd_serialized
);
return
io
::
async_
send
(
fd
,
(
unsigned
char
*
)
buff
,
buff_len
,
fd_serialized
);
}
int
async_connect
(
int
fd
,
sockaddr
*
sockaddress
,
s
ocklen
_t
len
,
int
flags
)
{
bool
fd_serialized
=
flags
&
UNSERIALIZED
==
0
;
int
async_connect
(
int
fd
,
struct
sockaddr
*
sockaddress
,
s
ize
_t
len
,
int
flags
)
{
bool
fd_serialized
=
(
flags
&
UNSERIALIZED
)
==
0
;
return
io
::
async_connect
(
fd
,
sockaddress
,
len
,
fd_serialized
);
}
int
async_accept
(
int
fd
,
sockaddr
*
sockaddress
,
s
ocklen
_t
len
,
int
flags
)
{
bool
fd_serialized
=
flags
&
UNSERIALIZED
==
0
;
int
async_accept
(
int
fd
,
struct
sockaddr
*
sockaddress
,
s
ize
_t
len
,
int
flags
)
{
bool
fd_serialized
=
(
flags
&
UNSERIALIZED
)
==
0
;
return
io
::
async_accept
(
fd
,
sockaddress
,
len
,
fd_serialized
);
}
#endif
#ifdef EMPER_ASYNC_DISK_IO
int
async_read_file
(
int
fd
,
unsigned
char
*
buff
,
size_t
count
,
off_t
offset
)
{
int
async_read_file
(
int
fd
,
void
*
buff
,
size_t
count
,
off_t
offset
)
{
return
io
::
async_read_file
(
fd
,
buff
,
count
,
offset
);
}
int
async_write_file
(
int
fd
,
const
unsigned
char
*
buff
,
size_t
count
,
off_t
offset
)
{
int
async_write_file
(
int
fd
,
const
void
*
buff
,
size_t
count
,
off_t
offset
)
{
return
io
::
async_write_file
(
fd
,
buff
,
count
,
offset
);
}
#endif
This diff is collapsed.
Click to expand it.
emper/include/emper.h
+
8
−
6
View file @
6614962b
#pragma once
#include
"emper-common.h"
#include
"emper-config.h"
#include
"stddef.h"
#ifdef EMPER_ASYNC_NETWORK
#include
"sys/socket.h"
...
...
@@ -66,19 +68,19 @@ extern "C" {
UNSERIALIZED
=
2
,
};
int
async_recv
(
int
fd
,
unsigned
char
*
buff
,
int
buff_len
,
int
flags
);
int
async_recv
(
int
fd
,
void
*
buff
,
int
buff_len
,
int
flags
);
int
async_send
(
int
fd
,
unsigned
char
*
buff
,
int
buff_len
,
int
flags
);
int
async_send
(
int
fd
,
const
void
*
buff
,
int
buff_len
,
int
flags
);
int
async_connect
(
int
fd
,
sockaddr
*
sockaddress
,
s
ocklen
_t
len
,
int
flags
);
int
async_connect
(
int
fd
,
struct
sockaddr
*
sockaddress
,
s
ize
_t
len
,
int
flags
);
int
async_accept
(
int
fd
,
sockaddr
*
sockaddress
,
s
ocklen
_t
len
,
int
flags
);
int
async_accept
(
int
fd
,
struct
sockaddr
*
sockaddress
,
s
ize
_t
len
,
int
flags
);
#endif
#ifdef EMPER_ASYNC_DISK_IO
int
async_read_file
(
int
fd
,
unsigned
char
*
buff
,
size_t
count
,
off_t
offset
);
int
async_read_file
(
int
fd
,
void
*
buff
,
size_t
count
,
off_t
offset
);
int
async_write_file
(
int
fd
,
const
unsigned
char
*
buff
,
size_t
count
,
off_t
offset
);
int
async_write_file
(
int
fd
,
const
void
*
buff
,
size_t
count
,
off_t
offset
);
#endif
#ifdef __cplusplus
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment