summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/eiotas_particle.h8
-rw-r--r--src/lib/eiotas_particle.c12
2 files changed, 20 insertions, 0 deletions
diff --git a/src/include/eiotas_particle.h b/src/include/eiotas_particle.h
index 12026d8..ca8cc8e 100644
--- a/src/include/eiotas_particle.h
+++ b/src/include/eiotas_particle.h
@@ -127,6 +127,14 @@ EAPI Eina_Bool eiotas_particle_next_dst(Eiotas_Particle *particle);
EAPI void eiotas_particle_split_dst(Eiotas_Particle *particle);
/**
+ * @brief Add a destination and set it as current
+ *
+ * @param particle The @ref Eiotas_Particle to add destination to
+ * @param destination The destination to add and set as current
+ */
+EAPI void eiotas_particle_destination_set(Eiotas_Particle *particle, const char *destination);
+
+/**
* @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 f29eeda..5f67ad7 100644
--- a/src/lib/eiotas_particle.c
+++ b/src/lib/eiotas_particle.c
@@ -185,6 +185,18 @@ EAPI void eiotas_particle_split_dst(Eiotas_Particle *particle)
}
}
+EAPI void eiotas_particle_destination_set(Eiotas_Particle *particle, const char *destination)
+{
+ char *dst, *sep;
+
+ dst = (char*)destination;
+ for(; *dst==' '; dst++) /* eat leading spaces */;
+ sep = dst;
+ for(; (*sep && *sep!=' '); sep++) /* search destination end */;
+ add_destination(particle,dst,(sep-dst));
+ particle->cur_dst = eina_array_count_get(particle->dsts)-1;
+}
+
EAPI void eiotas_particle_destinations_add(Eiotas_Particle *particle, const char* destinations)
{
char *dst, *sep;