void execute_string(char *string) { char buf[RESULT_BUF_SIZE]; int n; ec_post_string(string); int res = 7; //means that we have to flush the output. while (res == 7) { res = ec_resume(); SKB_DEBUG("\nres = %d\n", res); //give back the result and the error messages. //in case there is no message, a '.' is still returned n = ec_queue_read(1, buf, RESULT_BUF_SIZE); if ((n >= 0) && (n < RESULT_BUF_SIZE)) { buf[n] = 0; } SKB_DEBUG("eclipse returned: %s with length %d.\n", buf, n); n = ec_queue_read(2, buf, RESULT_BUF_SIZE); if ((n >= 0) && (n < RESULT_BUF_SIZE)) { buf[n] = 0; } SKB_DEBUG("eclipse error returned: %s with length %d.\n", buf, n); } }
static void read_eclipse_queue(int qid, struct skb_writer* w) { int res = 0; do { res = ec_queue_read(qid, w->buffer + w->length, BUFFER_SIZE - res); w->length += res; } while ((res != 0) && (w->length < BUFFER_SIZE)); w->buffer[w->length] = '\0'; }