This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
stellar-stellar/include/stellar/stellar_exdata.h
2024-08-12 15:48:37 +08:00

31 lines
722 B
C

#pragma once
#include "utils.h"
#include "stellar.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef void stellar_exdata_free(int idx, void *ex_ptr, void *arg);
inline static void stellar_exdata_free_default(int idx __unused, void *ex_ptr, void *arg __unused)
{
if(ex_ptr)FREE(ex_ptr);
}
int stellar_exdata_new_index(struct stellar *st, const char *name, stellar_exdata_free *free_func,void *arg);
//packet exdata api
int packet_exdata_set(struct packet *pkt, int idx, void *ex_ptr);
void *packet_exdata_get(struct packet *pkt, int idx);
//session exdata api
int session_exdata_set(struct session *sess, int idx, void *ex_ptr);
void *session_exdata_get(struct session *sess, int idx);
#ifdef __cplusplus
}
#endif