diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/eiotas_particle.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/lib/eiotas_particle.c b/src/lib/eiotas_particle.c index 079caf1..4927e90 100644 --- a/src/lib/eiotas_particle.c +++ b/src/lib/eiotas_particle.c @@ -56,3 +56,36 @@ void eiotas_particle_free(Eiotas_Particle *particle) free(particle); } +EAPI void eiotas_particle_reset(Eiotas_Particle *particle) +{ + unsigned int i; + char *s; + Eiotas_Particle *p; + Eina_Inlist *li; + Eina_Array_Iterator it; + + particle->ts = 0; + particle->src = NULL; + particle->dst = NULL; + EINA_ARRAY_ITER_NEXT(particle->dsts, i, s, it) free(s); + eina_array_clean(particle->dsts); + eina_hash_free_buckets(particle->payload); + EINA_INLIST_FOREACH_SAFE(particle->merged, li, p) eiotas_particle_free(p); + particle->merged = NULL; + EINA_ARRAY_ITER_NEXT(particle->link_fields, i, s, it) free(s); + eina_array_clean(particle->link_fields); + if(particle->link_value) eina_stringshare_del(particle->link_value); + particle->link_value = NULL; +} + +EAPI void eiotas_particle_init(Eiotas_Particle *particle, Eiotas_Iota *iota) +{ + particle->src = iota; + particle->ts = time(NULL); +} + +EAPI void eiotas_particle_merge(Eiotas_Particle *particle, Eiotas_Particle *p) +{ + particle->merged = eina_inlist_append(particle->merged, EINA_INLIST_GET(p)); +} + |