progress on x11
This commit is contained in:
+4
-4
@@ -23,7 +23,7 @@ double com_std_fabs(double v) { return fabs(v); }
|
||||
double com_std_sin(double v) { return sin(v); }
|
||||
double com_std_cos(double v) { return cos(v); }
|
||||
|
||||
com_std_fd com_std_open(char *path, uint32_t flags) {
|
||||
com_std_fd com_std_open(char const *path, uint32_t flags) {
|
||||
com_std_assert(flags != 0);
|
||||
char *mode = flags & COM_STD_OPEN_READ && flags & COM_STD_OPEN_WRITE ? "r+"
|
||||
: flags & COM_STD_OPEN_READ ? "r"
|
||||
@@ -31,14 +31,14 @@ com_std_fd com_std_open(char *path, uint32_t flags) {
|
||||
return fopen(path, mode);
|
||||
}
|
||||
|
||||
bool com_std_write(com_std_fd fd, char *data, uint32_t bytes) {
|
||||
bool com_std_write(com_std_fd fd, void const *data, uint32_t bytes) {
|
||||
com_std_assert(fd != NULL && data != NULL && bytes != 0);
|
||||
bool s = fwrite(data, 1, bytes, fd) == bytes;
|
||||
fflush(fd);
|
||||
return s;
|
||||
}
|
||||
|
||||
int32_t com_std_read(com_std_fd fd, char *data, uint32_t upto) {
|
||||
int32_t com_std_read(com_std_fd fd, void *data, uint32_t upto) {
|
||||
com_std_assert(fd != NULL && data != NULL && upto != 0);
|
||||
return fread(data, 1, upto, fd);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ com_std_fd com_std_socket(bool isnetwork) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool com_std_connect(com_std_fd fd, bool isnetwork, char *address) {
|
||||
bool com_std_connect(com_std_fd fd, bool isnetwork, char const *address) {
|
||||
com_std_assert(address != NULL);
|
||||
if (!isnetwork) {
|
||||
struct sockaddr_un addr = {.sun_family = AF_UNIX};
|
||||
|
||||
Reference in New Issue
Block a user