test
This commit is contained in:
@@ -18,18 +18,21 @@
|
|||||||
|
|
||||||
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);
|
||||||
portable_mutex_lock(&komodo_mutex);
|
if ( sp != 0 )
|
||||||
ep = (struct komodo_event *)calloc(1,len);
|
{
|
||||||
ep->len = len;
|
portable_mutex_lock(&komodo_mutex);
|
||||||
ep->height = height;
|
ep = (struct komodo_event *)calloc(1,len);
|
||||||
ep->type = type;
|
ep->len = len;
|
||||||
strcpy(ep->symbol,symbol);
|
ep->height = height;
|
||||||
if ( datalen != 0 )
|
ep->type = type;
|
||||||
memcpy(ep->space,data,datalen);
|
strcpy(ep->symbol,symbol);
|
||||||
sp->Komodo_events = (struct komodo_event **)realloc(sp->Komodo_events,(1 + sp->Komodo_numevents) * sizeof(*sp->Komodo_events));
|
if ( datalen != 0 )
|
||||||
sp->Komodo_events[sp->Komodo_numevents++] = ep;
|
memcpy(ep->space,data,datalen);
|
||||||
portable_mutex_unlock(&komodo_mutex);
|
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;
|
||||||
|
portable_mutex_unlock(&komodo_mutex);
|
||||||
|
}
|
||||||
return(ep);
|
return(ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,13 +127,16 @@ 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 ( kmdheight > sp->SAVEDHEIGHT )
|
if ( sp != 0 )
|
||||||
{
|
{
|
||||||
sp->SAVEDHEIGHT = kmdheight;
|
if ( kmdheight > sp->SAVEDHEIGHT )
|
||||||
sp->SAVEDTIMESTAMP = timestamp;
|
{
|
||||||
|
sp->SAVEDHEIGHT = kmdheight;
|
||||||
|
sp->SAVEDTIMESTAMP = timestamp;
|
||||||
|
}
|
||||||
|
if ( kmdheight > sp->CURRENT_HEIGHT )
|
||||||
|
sp->CURRENT_HEIGHT = kmdheight;
|
||||||
}
|
}
|
||||||
if ( kmdheight > sp->CURRENT_HEIGHT )
|
|
||||||
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