00001 #include <stdio.h>
00002 #include <string.h>
00003 #include "vapiString.h"
00004 #include "vapiTypes.h"
00005 #include "vapiGtkMacrosTables.h"
00006
00007 struct {
00008 int * Numbers;
00009 int NumberOfNumbers;
00010 vChar * MacroName;
00011 }coisa;
00012
00013 void
00014 AddNumber(int number)
00015 {
00016 if (coisa.NumberOfNumbers == 0)
00017 {
00018 coisa.Numbers = malloc(sizeof(int));
00019 }
00020 else
00021 {
00022 coisa.Numbers = realloc(coisa.Numbers,++coisa.NumberOfNumbers*sizeof(int));
00023 }
00024 coisa.Numbers[coisa.NumberOfNumbers-1] = number;
00025 }
00026 void
00027 decoder (const char *macroTag)
00028 {
00029 char PtrStart, *text, *text2;
00030
00031 int ints[3], len, j, i;
00032 len = strlen (macroTag);
00033 text = v_printf ("");
00034 printf ("original %s\n", macroTag);
00035 for (j = 0; j < len; j++)
00036 {
00037
00038 PtrStart = macroTag[j];
00039 printf("cahr seleccionado %c\n", PtrStart);
00040 if (PtrStart == ':')
00041 {
00042
00043
00044
00045 ints[i] = atoi (text);
00046 printf ("numero %d string %s\n", ints[i], text);
00047 free(text);
00048 text=v_printf("");
00049 ++i;
00050 continue;
00051 }
00052 if (PtrStart == '.')
00053 {
00054 ints[i] = atoi (text);
00055 printf ("numero %d string %s\n", ints[i], text);
00056 ++i;
00057 free (text);
00058 return;
00059 }
00060
00061
00062 text2 = v_printf ("%s", text);
00063 text = v_printf ("%s%c", text2, PtrStart);
00064 free (text2);
00065 }
00066
00067 }
00068 int
00069 main ()
00070 {
00071 vMacroTagDecode * MacroTagDecode =
00072 vapiGtkTablesMacroTagDecoder ("20:14442:9294.3000 coiso");
00073
00074 return 0;
00075 }