Guardtime KSI c SDK
net_async.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013-2015 Guardtime, Inc.
3  *
4  * This file is part of the Guardtime client SDK.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License").
7  * You may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  * http://www.apache.org/licenses/LICENSE-2.0
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES, CONDITIONS, OR OTHER LICENSES OF ANY KIND, either
13  * express or implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  * "Guardtime" and "KSI" are trademarks or registered trademarks of
16  * Guardtime, Inc., and no license to trademarks is granted; Guardtime
17  * reserves and retains all trademark rights.
18  */
19 
20 #ifndef KSI_NET_ASYNC_H_
21 #define KSI_NET_ASYNC_H_
22 
23 #include "types.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
50 
61 
63 
71  int KSI_AsyncHandle_setRequestCtx(KSI_AsyncHandle *o, void *reqCtx, void (*reqCtx_free)(void*));
72 
79  int KSI_AsyncHandle_getRequestCtx(const KSI_AsyncHandle *o, const void **reqCtx);
80 
89  int KSI_AsyncHandle_getState(const KSI_AsyncHandle *h, int *state);
90 
98  int KSI_AsyncHandle_getError(const KSI_AsyncHandle *h, int *error);
99 
107  int KSI_AsyncHandle_getExtError(const KSI_AsyncHandle *h, long *ext);
108 
118 
128 
136 
146 
158 
166 
174 
175 
181 
190 
209 
225  int KSI_AsyncService_run(KSI_AsyncService *service, KSI_AsyncHandle **handle, size_t *waiting);
226 
230  typedef enum KSI_AsyncHandleState_en {
252 
259  int KSI_AsyncService_getPendingCount(KSI_AsyncService *s, size_t *count);
260 
269 
275  typedef enum KSI_AsyncOption_en {
276 
288 
300 
313 
321 
330 
332  } KSI_AsyncOption;
333 
334 
344  int KSI_AsyncService_setOption(KSI_AsyncService *s, const KSI_AsyncOption option, void *value);
345 
355  int KSI_AsyncService_getOption(const KSI_AsyncService *s, const KSI_AsyncOption option, void *value);
356 
361 #ifdef __cplusplus
362 }
363 #endif
364 
365 #endif /* KSI_NET_ASYNC_H_ */
enum KSI_AsyncHandleState_en KSI_AsyncHandleState
#define KSI_uint64_t
Definition: types_base.h:105
int KSI_AsyncHandle_getAggregationReq(const KSI_AsyncHandle *h, KSI_AggregationReq **req)
Definition: net_async.h:287
int KSI_AsyncService_setOption(KSI_AsyncService *s, const KSI_AsyncOption option, void *value)
struct KSI_AsyncHandle_st KSI_AsyncHandle
Definition: types.h:125
int KSI_AsyncAggregationHandle_new(KSI_CTX *ctx, KSI_AggregationReq *req, KSI_AsyncHandle **o)
Definition: net_async.h:236
KSI_AsyncOption_en
Definition: net_async.h:275
Definition: net_async.h:234
int KSI_AsyncService_getPendingCount(KSI_AsyncService *s, size_t *count)
Definition: net_async.h:312
int KSI_AsyncHandle_getRequestCtx(const KSI_AsyncHandle *o, const void **reqCtx)
int KSI_AsyncHandle_getSignature(const KSI_AsyncHandle *h, KSI_Signature **signature)
Definition: net_async.h:232
struct KSI_AsyncService_st KSI_AsyncService
Definition: types.h:123
#define KSI_DEFINE_REF(typ)
Definition: types_base.h:56
int KSI_AsyncService_addRequest(KSI_AsyncService *s, KSI_AsyncHandle *handle)
struct KSI_AggregationReq_st KSI_AggregationReq
Definition: types.h:51
struct KSI_AggregationResp_st KSI_AggregationResp
Definition: types.h:53
Definition: net_async.h:320
void KSI_AsyncClient_free(KSI_AsyncClient *c)
Definition: net_async.h:299
void KSI_AsyncService_free(KSI_AsyncService *service)
int KSI_AsyncHandle_getRequestId(const KSI_AsyncHandle *h, KSI_uint64_t *id)
KSI_AsyncHandleState_en
Definition: net_async.h:230
struct KSI_Signature_st KSI_Signature
Definition: types.h:67
Definition: net_async.h:329
Definition: net_async.h:243
int KSI_AsyncHandle_getError(const KSI_AsyncHandle *h, int *error)
struct KSI_AsyncClient_st KSI_AsyncClient
Definition: types.h:124
int KSI_SigningAsyncService_new(KSI_CTX *ctx, KSI_AsyncService **service)
int KSI_AsyncHandle_getErrorMessage(const KSI_AsyncHandle *h, KSI_Utf8String **msg)
enum KSI_AsyncOption_en KSI_AsyncOption
int KSI_AsyncHandle_getExtError(const KSI_AsyncHandle *h, long *ext)
Definition: net_async.h:331
struct KSI_CTX_st KSI_CTX
Definition: types_base.h:124
int KSI_AsyncService_run(KSI_AsyncService *service, KSI_AsyncHandle **handle, size_t *waiting)
int KSI_AsyncHandle_getState(const KSI_AsyncHandle *h, int *state)
int KSI_AsyncService_getReceivedCount(KSI_AsyncService *s, size_t *count)
int KSI_AsyncHandle_getAggregationResp(const KSI_AsyncHandle *h, KSI_AggregationResp **resp)
int KSI_AbstractAsyncClient_new(KSI_CTX *ctx, KSI_AsyncClient **c)
struct KSI_Utf8String_st KSI_Utf8String
Definition: types_base.h:150
Definition: net_async.h:250
int KSI_AsyncService_getOption(const KSI_AsyncService *s, const KSI_AsyncOption option, void *value)
int KSI_AsyncHandle_setRequestCtx(KSI_AsyncHandle *o, void *reqCtx, void(*reqCtx_free)(void *))
void KSI_AsyncHandle_free(KSI_AsyncHandle *o)