From: parking_turkeys Date: Thu, 3 Sep 2026 00:32:21 +0000 (-0400) Subject: some work in tools.c idk X-Git-Url: http://git.parking-turkeys.net/?a=commitdiff_plain;h=97c98c7f8d33dd437bb2e0bb622f63c9c40c586a;p=colon3utau.git some work in tools.c idk --- diff --git a/render/.tools.c.swp b/render/.tools.c.swp deleted file mode 100644 index 0a9e2f9..0000000 Binary files a/render/.tools.c.swp and /dev/null differ diff --git a/render/tools.c b/render/tools.c index d0e0971..f9a0c01 100644 --- a/render/tools.c +++ b/render/tools.c @@ -3,7 +3,7 @@ static int call_wavtool (struct USTinfo *ust_settings, struct USTnote *note, char *oto); static int call_resampler(struct USTinfo *ust_settings, struct USTnote *note, char *oto); -static char *find_oto_line(char *oto_dir, char *lyric); +struct oto_line find_oto_line(char *oto_dir, char *lyric); static char curr_note_file[10]; // n0000.wav\0 static int notes_done = 0; @@ -37,11 +37,19 @@ int call_wavtool (struct USTinfo *s, struct USTnote *n) char *find_oto_line(char *oto_dir, char *lyric) { - static char line[1000]; //who has a longer oto line tbh - char check[64]; int c_i = 0; + char filename[256]; //reasonable length (in same folder usually) + char alias[256]; //bit much but who knows lol + struct oto_line line = { + filename, + alias, + 0, + 0, + 0, + 0, + 0 + }; + char part[64]; //wtf are you doing with a longer number tbh FILE *fp; - int check = 0; //the part you want to check is the part after = - int correct = 0; //if 0 && check > 1 dont add anything ig?? char *oto_path = malloc(snprintf(NULL, 0, "%s/oto.ini", oto_dir)); sprintf(oto_path, "%s/oto.ini", oto_dir); @@ -50,37 +58,7 @@ char *find_oto_line(char *oto_dir, char *lyric) char c; int i = 0; while ((c = getc(fp)) != EOF) { - line[i] = c; - switch (c) { - case '=': - check = 1; - c_i = 0; - break; - case ',': - if (check == 1) { - check[c_i] = '\0'; - if (same(check, lyric)) { - correct = 1; - }; - }; - check = 2; - break; - case '\n': - if (correct == 1) { - line[i] = '\0'; - goto found; - }; - i = 0; - check = 0; - break; - default: - if (check == 1) { - check[c_i] = c; - c_i++; - }; - break; - }; - i++; + }; return NULL;