+/** \brief Push a new integer value into the cbps. */
+void
+gras_cbps_i_push(gras_cbps_t ps,
+ int val) {
+ DEBUG1("push %d as a size",val);
+ xbt_dynar_push_as(ps->lints,int,val);
+}
+/** \brief Pop the lastly pushed integer value from the cbps. */
+int
+gras_cbps_i_pop(gras_cbps_t ps) {
+ int ret;
+
+ xbt_assert0(xbt_dynar_length(ps->lints) > 0,
+ "gras_cbps_i_pop: no value to pop");
+ ret = xbt_dynar_pop_as(ps->lints,int);
+ DEBUG1("pop %d as a size",ret);
+ return ret;
+}
+
+/** \brief Generic cb returning the lastly pushed value
+ *
+ * Used by \ref gras_datadesc_ref_pop_arr
+ */
+int gras_datadesc_cb_pop(gras_datadesc_type_t ignored, gras_cbps_t vars, void *data) {
+ int res = gras_cbps_i_pop(vars);
+ DEBUG1("Pop %d as a size",res);
+ return res;
+}
+
+/* ************************* */
+/* **** PUSHy callbacks **** */
+/* ************************* */
+
+/** \brief Cb to push an integer. Must be attached to the field you want to push */
+void gras_datadesc_cb_push_int(gras_datadesc_type_t ignored, gras_cbps_t vars, void *data) {
+ int *i = (int*)data;
+ gras_cbps_i_push(vars, (int) *i);
+}
+
+/** \brief Cb to push an unsigned integer. Must be attached to the field you want to push */
+void gras_datadesc_cb_push_uint(gras_datadesc_type_t ignored, gras_cbps_t vars, void *data) {
+ unsigned int *i = (unsigned int*)data;
+ gras_cbps_i_push(vars, (int) *i);
+}
+
+/** \brief Cb to push an long integer. Must be attached to the field you want to push
+ */
+void gras_datadesc_cb_push_lint(gras_datadesc_type_t ignored, gras_cbps_t vars, void *data) {
+ long int *i = (long int*)data;
+ gras_cbps_i_push(vars, (int) *i);
+}
+/** \brief Cb to push an unsigned long integer. Must be attached to the field you want to push
+ */
+void gras_datadesc_cb_push_ulint(gras_datadesc_type_t ignored, gras_cbps_t vars, void *data) {
+ unsigned long int *i = (unsigned long int*)data;
+ gras_cbps_i_push(vars, (int) *i);
+}
+
+/* ************************************ */
+/* **** PUSHy multiplier callbacks **** */
+/* ************************************ */
+/** \brief Cb to push an integer as multiplier. Must be attached to the field you want to push */
+void gras_datadesc_cb_push_int_mult(gras_datadesc_type_t ignored, gras_cbps_t vars, void *data) {
+ int i = *(int*)data;
+ i *= gras_cbps_i_pop(vars);
+ gras_cbps_i_push(vars, i);
+}