summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-06-01 16:45:26 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-06-01 16:45:26 +0200
commit8a7a3e0acc603896b9297fd82f99f91923be1b33 (patch)
tree42f1b64734fa4aa1b8829e7a6cd4a109f6b1e933
parent1373440eb043ebd121a6827aa28e4832cb959efe (diff)
downloadedoors-8a7a3e0acc603896b9297fd82f99f91923be1b33.zip
edoors-8a7a3e0acc603896b9297fd82f99f91923be1b33.tar.gz
Particle, add Eina_Stringshare struct fields : cur_action, cur_door, cur_room
-rw-r--r--src/include/eiotas_particle.h3
-rw-r--r--src/lib/eiotas_particle.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/src/include/eiotas_particle.h b/src/include/eiotas_particle.h
index 52c8011..0f93959 100644
--- a/src/include/eiotas_particle.h
+++ b/src/include/eiotas_particle.h
@@ -44,6 +44,9 @@ struct _Eiotas_Particle {
Eiotas_Iota *dst; /**< current destination */
Eina_Array *dsts; /**< array of destinatinon strings */
unsigned int cur_dst; /**< current destination index */
+ Eina_Stringshare *cur_action; /**< action part of the current destination */
+ Eina_Stringshare *cur_door; /**< door part of the current destination */
+ Eina_Stringshare *cur_room; /**< room part of the current destination */
Eina_Hash *payload; /**< string data carried by this particle */
Eina_Inlist *merged; /**< list of merged particles */
Eina_Array *link_fields; /**< fields used to generate the link value */
diff --git a/src/lib/eiotas_particle.c b/src/lib/eiotas_particle.c
index 6148845..35f3691 100644
--- a/src/lib/eiotas_particle.c
+++ b/src/lib/eiotas_particle.c
@@ -35,6 +35,9 @@ Eiotas_Particle* eiotas_particle_alloc()
particle->link_fields = eina_array_new(EIOTAS_PARTICLE_ARRAY_STEP);
particle->link_value = NULL;
particle->cur_dst = 0;
+ particle->cur_action = NULL;
+ particle->cur_door = NULL;
+ particle->cur_room = NULL;
return particle;
}
@@ -56,6 +59,9 @@ void eiotas_particle_free(Eiotas_Particle *particle)
EINA_ARRAY_ITER_NEXT(particle->link_fields, i, s, it) eina_stringshare_del(s);
eina_array_free(particle->link_fields);
if(particle->link_value) eina_stringshare_del(particle->link_value);
+ if(particle->cur_action) eina_stringshare_del(particle->cur_action);
+ if(particle->cur_door) eina_stringshare_del(particle->cur_door);
+ if(particle->cur_room) eina_stringshare_del(particle->cur_room);
free(particle);
}
@@ -80,6 +86,12 @@ EAPI void eiotas_particle_reset(Eiotas_Particle *particle)
eina_array_clean(particle->link_fields);
if(particle->link_value) eina_stringshare_del(particle->link_value);
particle->link_value = NULL;
+ if(particle->cur_action) eina_stringshare_del(particle->cur_action);
+ particle->cur_action = NULL;
+ if(particle->cur_door) eina_stringshare_del(particle->cur_door);
+ particle->cur_door = NULL;
+ if(particle->cur_room) eina_stringshare_del(particle->cur_room);
+ particle->cur_room = NULL;
}
EAPI void eiotas_particle_init(Eiotas_Particle *particle, Eiotas_Iota *iota)