inputBuffer *in = newInputBuffer();
-
- row r = {"C:/xd", "", 0, 0};
- printf("%s %d %d\n", r.tags, r.numTags, r.lenTags);7
- insertTag(&r, "caca");
- insertTag(&r, "mierda");
- insertTag(&r, "caca ");
- insertTag(&r, "tu");
- printf("%s %d %d\n", r.tags, r.numTags, r.lenTags);
-
- printf("%d\n", strInTags(r.tags, r.lenTags, ";perro", 6, ';'));
-
- row *r2 = newRow("asa");
+ row *r = newRow("~/test/img.png");
while(1){
prompt();
getInput(in);
- insertTag(r2, in->buffer);
- printf("Tags of row '%s': %s\n", r2->path, r2->tags);
+ insertTag(r, in->buffer);
+ printf("Tags of row '%s': %s\n", r->path, r->tags);
+ printf("Number of tags: %u. Length of tags: %u\n", r->numTags, r->lenTags);
/*switch(handleInput(in)){
case META_COMMAND_SUCCESS:
break;
}*/
}
-}
\ No newline at end of file
+}
row *newRow(const char path[MAXPATH]){
- printf("len: %d\n", len(path));
row *nr = malloc(sizeof(row));
memcpy(nr->path, path, len(path));
nr->numTags = 0;
i = 0;
break;
case 0:
- printf("'%s' == '%s'\n", arr[i-1], arr[i]);
// The tag already exists, no need to alter anything
free(arr);
return;
r->tags[tagnum] = '\0';
r->numTags = l;
r->lenTags = tagnum;
-}
\ No newline at end of file
+}
bool sameStr(const char *s1, const char *s2){
uint16_t i1 = 0, i2 = 0;
- while(s1[i1] && s2[i2] && s1[i1] == s2[i2])
+ while(s1[i1] && s1[i1] == s2[i2])
++i1, ++i2;
return !s1[i1] && !s2[i2];
}
}
}
return -1;
-}
\ No newline at end of file
+}