diff options
-rw-r--r-- | src/include/eiotas_particle.h | 9 | ||||
-rw-r--r-- | src/lib/eiotas_particle.c | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/include/eiotas_particle.h b/src/include/eiotas_particle.h index 4461945..52c8011 100644 --- a/src/include/eiotas_particle.h +++ b/src/include/eiotas_particle.h @@ -107,6 +107,15 @@ EAPI void eiotas_particle_merge(Eiotas_Particle *particle, const Eiotas_Particle EAPI Eina_Bool eiotas_particle_has_dst(Eiotas_Particle *particle); /** + * @brief Point to the next destination + * + * @param particle The @ref Eiotas_Particle to mofify + * + * @return EINA_TRUE if next destination is defined, EINA_FALSE otherwise. + */ +EAPI Eina_Bool eiotas_particle_next_dst(Eiotas_Particle *particle); + +/** * @brief Add destinations to the @ref Eiotas_Particle * * @param particle The @ref Eiotas_Particle to add destinations to diff --git a/src/lib/eiotas_particle.c b/src/lib/eiotas_particle.c index 6d3facc..6148845 100644 --- a/src/lib/eiotas_particle.c +++ b/src/lib/eiotas_particle.c @@ -95,8 +95,13 @@ EAPI void eiotas_particle_merge(Eiotas_Particle *particle, const Eiotas_Particle EAPI Eina_Bool eiotas_particle_has_dst(Eiotas_Particle *particle) { - if(eina_array_count_get(particle->dsts)<=particle->cur_dst) return EINA_FALSE; - return ( (eina_array_data_get(particle->dsts,particle->cur_dst)==NULL) ? EINA_FALSE : EINA_TRUE ); + return ( (eina_array_count_get(particle->dsts)>particle->cur_dst) ? EINA_TRUE : EINA_FALSE ); +} + +EAPI Eina_Bool eiotas_particle_next_dst(Eiotas_Particle *particle) +{ + particle->cur_dst+=1; + return ( (eina_array_count_get(particle->dsts)>particle->cur_dst) ? EINA_TRUE : EINA_FALSE ); } EAPI void eiotas_particle_destinations_add(Eiotas_Particle *particle, const char* destinations) |