Commit 2c2a394a authored by Thomas Schmitt's avatar Thomas Schmitt

Gave aaip_0_2 a ring buffer rather than a shifted fifo

parent ef5a1c48
This diff is collapsed.
......@@ -168,6 +168,7 @@ int aaip_skip_component(struct aaip_state *aaip, int flag);
3 name and value are valid, pairs pending, fetch with num_data == 0
4 name and value are valid, no more data expected
5 name and value are not valid, no more data expected
*/
int aaip_decode_pair(struct aaip_state *aaip,
unsigned char *data, size_t num_data, size_t *consumed,
......
......@@ -26,6 +26,8 @@
#include "aaip_0_2.h"
#define Aaip_test_name_sizE 1024
#define Aaip_test_value_sizE 1024
int main(int argc, char **argv)
{
......@@ -37,11 +39,9 @@ int main(int argc, char **argv)
struct aaip_state *aaip;
size_t consumed= 0;
char name[1025];
size_t name_size= 4;
char name[Aaip_test_name_sizE + 1];
size_t name_fill;
char value[1025];
size_t value_size= 1024;
char value[Aaip_test_value_sizE + 1];
size_t value_fill;
size_t todo;
int submit_data, is_done;
......@@ -126,8 +126,8 @@ int main(int argc, char **argv)
} else
todo= 0;
ret= aaip_decode_pair(aaip, rpt, todo, &consumed,
name, name_size, &name_fill,
value, value_size, &value_fill, 0);
name, Aaip_test_name_sizE, &name_fill,
value, Aaip_test_value_sizE, &value_fill, 0);
skipped= aaip_get_pairs_skipped(aaip, 0);
if(skipped > was_skipped) {
printf("- skipped %d pair%s -\n\n", skipped - was_skipped,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment