File tree Expand file tree Collapse file tree 11 files changed +505
-145
lines changed Expand file tree Collapse file tree 11 files changed +505
-145
lines changed Original file line number Diff line number Diff line change 9696#define NULL_TERMINATED_STRING_ARG (pos )
9797#endif
9898
99+ #ifdef __has_attribute
100+ #if __has_attribute (access )
101+ #define ACCESS (...) __attribute__((access(__VA_ARGS__)))
102+ #endif
103+ #endif
104+
105+ #ifndef ACCESS
106+ #define ACCESS (...)
107+ #endif
108+
99109#ifdef __has_attribute
100110#if __has_attribute (cold )
101111#define COLD __attribute__((cold))
116126#define CONST
117127#endif
118128
129+ #ifdef __has_attribute
130+ #if __has_attribute (flag_enum )
131+ #define FLAG_ENUM __attribute__((flag_enum))
132+ #endif
133+ #endif
134+
135+ #ifndef FLAG_ENUM
136+ #define FLAG_ENUM
137+ #endif
138+
119139#endif
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ typedef enum NODISCARD GglError {
4343 GGL_ERR_REMOTE ,
4444 /// Expected non-ok status
4545 GGL_ERR_EXPECTED ,
46+ /// Request timed out
47+ GGL_ERR_TIMEOUT ,
4648} GglError ;
4749
4850const char * ggl_strerror (GglError err );
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ typedef enum {
2121} EventStreamMessageType ;
2222
2323/// `:message-flags` header flags
24- typedef enum {
24+ typedef enum FLAG_ENUM {
2525 EVENTSTREAM_CONNECTION_ACCEPTED = 1 ,
2626 EVENTSTREAM_TERMINATE_STREAM = 2 ,
2727} EventStreamMessageFlags ;
Original file line number Diff line number Diff line change 99#include <ggl/buffer.h>
1010#include <ggl/error.h>
1111
12+ /// Maximum size of eventstream packet.
13+ /// Can be configured with `-D GGL_IPC_MAX_MSG_LEN=<N>`.
14+ #ifndef GGL_IPC_MAX_MSG_LEN
15+ #define GGL_IPC_MAX_MSG_LEN 10000
16+ #endif
17+
18+ /// Maximum size IPC functions will wait for server response
19+ #ifndef GGL_IPC_RESPONSE_TIMEOUT
20+ #define GGL_IPC_RESPONSE_TIMEOUT 10
21+ #endif
22+
1223/// Connect to GG-IPC server using component name.
1324/// If svcuid is non-null, it will be filled with the component's identity
1425/// token. Buffer must be able to hold at least GGL_IPC_SVCUID_STR_LEN.
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ const char *ggl_strerror(GglError err) {
4040 return "REMOTE" ;
4141 case GGL_ERR_EXPECTED :
4242 return "EXPECTED" ;
43+ case GGL_ERR_TIMEOUT :
44+ return "TIMEOUT" ;
4345 }
4446
4547 assert (false);
You can’t perform that action at this time.
0 commit comments