- int i, counter, pointer;\r
- int a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10;\r
- char tmp[kMaxStrokeDataLength + 1];\r
- \r
- a = (int *)malloc(0);\r
- counter = 0;\r
- pointer = 0;\r
- for(i = 0; i < strlen(in); i++){\r
- if(in[i] == '$'){\r
- strncpy(tmp, &in[pointer], i - pointer);\r
- tmp[i - pointer] = '\0';\r
- a = (int *)realloc(a, sizeof(int) * 11 * (counter + 1));\r
- sscanf(tmp, "%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d",\r
- &a0,&a1,&a2,&a3,&a4,&a5,&a6,&a7,&a8,&a9,&a10);\r
- a[counter * 11 + 0] = a0;\r
- a[counter * 11 + 1] = a1;\r
- a[counter * 11 + 2] = a2;\r
- a[counter * 11 + 3] = a3;\r
- a[counter * 11 + 4] = a4;\r
- a[counter * 11 + 5] = a5;\r
- a[counter * 11 + 6] = a6;\r
- a[counter * 11 + 7] = a7;\r
- a[counter * 11 + 8] = a8;\r
- a[counter * 11 + 9] = a9;\r
- a[counter * 11 + 10] = a10;\r
- counter++;\r
- pointer = i + 1;\r
- }\r
- }\r
- strncpy(tmp, &in[pointer], i - pointer);\r
- tmp[i - pointer] = '\0';\r
- a = (int *)realloc(a, sizeof(int) * 11 * (counter + 1));\r
- sscanf(tmp, "%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d",\r
- &a0,&a1,&a2,&a3,&a4,&a5,&a6,&a7,&a8,&a9,&a10);\r
- a[counter * 11 + 0] = a0;\r
- a[counter * 11 + 1] = a1;\r
- a[counter * 11 + 2] = a2;\r
- a[counter * 11 + 3] = a3;\r
- a[counter * 11 + 4] = a4;\r
- a[counter * 11 + 5] = a5;\r
- a[counter * 11 + 6] = a6;\r
- a[counter * 11 + 7] = a7;\r
- a[counter * 11 + 8] = a8;\r
- a[counter * 11 + 9] = a9;\r
- a[counter * 11 + 10] = a10;\r
- counter++;\r
- *(size) = counter;\r
- return a;\r
+ int i, counter, pointer;\r
+ int a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10;\r
+ char tmp[kMaxStrokeDataLength + 1];\r
+ \r
+ a = (int *)malloc(0);\r
+ counter = 0;\r
+ pointer = 0;\r
+ for(i = 0; i < strlen(in); i++){\r
+ if(in[i] == '$'){\r
+ strncpy(tmp, &in[pointer], i - pointer);\r
+ tmp[i - pointer] = '\0';\r
+ a = (int *)realloc(a, sizeof(int) * 11 * (counter + 1));\r
+ sscanf(tmp, "%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d",\r
+ &a0,&a1,&a2,&a3,&a4,&a5,&a6,&a7,&a8,&a9,&a10);\r
+ a[counter * 11 + 0] = a0;\r
+ a[counter * 11 + 1] = a1;\r
+ a[counter * 11 + 2] = a2;\r
+ a[counter * 11 + 3] = a3;\r
+ a[counter * 11 + 4] = a4;\r
+ a[counter * 11 + 5] = a5;\r
+ a[counter * 11 + 6] = a6;\r
+ a[counter * 11 + 7] = a7;\r
+ a[counter * 11 + 8] = a8;\r
+ a[counter * 11 + 9] = a9;\r
+ a[counter * 11 + 10] = a10;\r
+ counter++;\r
+ pointer = i + 1;\r
+ }\r
+ }\r
+ strncpy(tmp, &in[pointer], i - pointer);\r
+ tmp[i - pointer] = '\0';\r
+ a = (int *)realloc(a, sizeof(int) * 11 * (counter + 1));\r
+ sscanf(tmp, "%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d",\r
+ &a0,&a1,&a2,&a3,&a4,&a5,&a6,&a7,&a8,&a9,&a10);\r
+ a[counter * 11 + 0] = a0;\r
+ a[counter * 11 + 1] = a1;\r
+ a[counter * 11 + 2] = a2;\r
+ a[counter * 11 + 3] = a3;\r
+ a[counter * 11 + 4] = a4;\r
+ a[counter * 11 + 5] = a5;\r
+ a[counter * 11 + 6] = a6;\r
+ a[counter * 11 + 7] = a7;\r
+ a[counter * 11 + 8] = a8;\r
+ a[counter * 11 + 9] = a9;\r
+ a[counter * 11 + 10] = a10;\r
+ counter++;\r
+ *(size) = counter;\r
+ return a;\r