+int ActionEnumerateURLs(ActionTAG*atag, char*(*callback)(char*))
+{
+ U8 op;
+ int t;
+ U8*data;
+ char* cp;
+
+ while(atag)
+ {
+
+ for(t=0;t<definedactions;t++)
+ if(actions[t].op == atag->op)
+ break;
+
+ if(t==definedactions) {
+ // unknown actiontag
+ atag = atag->next;
+ continue;
+ }
+ cp = actions[t].flags;
+ data = atag->data;
+ if(atag->len)
+ {
+ while(*cp)
+ {
+ char * replacepos = 0;
+ int replacelen = 0;
+ char * replacement;
+ switch(*cp)
+ {
+ case 'u': {
+ replacelen = strlen(data);
+ replacepos = data;
+ replacement = callback(data); // may be null
+ } break;
+ /* everything below may very well
+ contain an URL, too. However, to extract
+ these, we would have to call callback also for
+ strings which might not contain an url.
+ TODO: should we check for Strings which start
+ with "http://"?
+ */
+ case 'c': {
+ } break;
+ case 'o': {
+ } break;
+ case 'p': {
+ U8 type = *data;
+ char*value = &data[1];
+ if(type == 0) { //string
+ } else if (type == 8) { //lookup
+ }
+ } break;
+ }
+ data += OpAdvance(*cp, data);
+ cp++;
+
+ //TODO: apply replacement here.
+ }
+ }
+
+ atag = atag->next;
+ }
+}
+