test
This commit is contained in:
@@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
struct komodo_event *komodo_eventadd(struct komodo_state *sp,int32_t height,char *symbol,uint8_t type,uint8_t *data,uint16_t datalen)
|
struct komodo_event *komodo_eventadd(struct komodo_state *sp,int32_t height,char *symbol,uint8_t type,uint8_t *data,uint16_t datalen)
|
||||||
{
|
{
|
||||||
struct komodo_event *ep; uint16_t len = (uint16_t)(sizeof(*ep) + datalen);
|
struct komodo_event *ep=0; uint16_t len = (uint16_t)(sizeof(*ep) + datalen);
|
||||||
|
if ( sp != 0 )
|
||||||
|
{
|
||||||
portable_mutex_lock(&komodo_mutex);
|
portable_mutex_lock(&komodo_mutex);
|
||||||
ep = (struct komodo_event *)calloc(1,len);
|
ep = (struct komodo_event *)calloc(1,len);
|
||||||
ep->len = len;
|
ep->len = len;
|
||||||
@@ -30,6 +32,7 @@ struct komodo_event *komodo_eventadd(struct komodo_state *sp,int32_t height,char
|
|||||||
sp->Komodo_events = (struct komodo_event **)realloc(sp->Komodo_events,(1 + sp->Komodo_numevents) * sizeof(*sp->Komodo_events));
|
sp->Komodo_events = (struct komodo_event **)realloc(sp->Komodo_events,(1 + sp->Komodo_numevents) * sizeof(*sp->Komodo_events));
|
||||||
sp->Komodo_events[sp->Komodo_numevents++] = ep;
|
sp->Komodo_events[sp->Komodo_numevents++] = ep;
|
||||||
portable_mutex_unlock(&komodo_mutex);
|
portable_mutex_unlock(&komodo_mutex);
|
||||||
|
}
|
||||||
return(ep);
|
return(ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +126,8 @@ void komodo_event_rewind(struct komodo_state *sp,char *symbol,int32_t height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void komodo_setkmdheight(struct komodo_state *sp,int32_t kmdheight,uint32_t timestamp)
|
void komodo_setkmdheight(struct komodo_state *sp,int32_t kmdheight,uint32_t timestamp)
|
||||||
|
{
|
||||||
|
if ( sp != 0 )
|
||||||
{
|
{
|
||||||
if ( kmdheight > sp->SAVEDHEIGHT )
|
if ( kmdheight > sp->SAVEDHEIGHT )
|
||||||
{
|
{
|
||||||
@@ -132,6 +137,7 @@ void komodo_setkmdheight(struct komodo_state *sp,int32_t kmdheight,uint32_t time
|
|||||||
if ( kmdheight > sp->CURRENT_HEIGHT )
|
if ( kmdheight > sp->CURRENT_HEIGHT )
|
||||||
sp->CURRENT_HEIGHT = kmdheight;
|
sp->CURRENT_HEIGHT = kmdheight;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void komodo_eventadd_kmdheight(struct komodo_state *sp,char *symbol,int32_t height,int32_t kmdheight,uint32_t timestamp)
|
void komodo_eventadd_kmdheight(struct komodo_state *sp,char *symbol,int32_t height,int32_t kmdheight,uint32_t timestamp)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user