comparison src/dirtools.c @ 11:e6a594f16403

*: huge refactor the config file has changed drastically, moving to an ini file from that custom format; i *would* have used the win32 functions for those, but they were barely functional, so I decided on using ini.h which is lightweight enough. additionally, I've added Deezer support so album art will be displayed! unfortunately though winhttp is a pain in the ass so if I send a request with any form of unicode chars in it it just returns a "bad request" error. I've tried debugging this but I could never really come up with anything: my hypothesis is that deezer expects their characters in percent-encoded UTF-8, but winhttp is sending them in some other encoding. the config dialog was moved out of config.c (overdue) and many more options are given in the config as well. main.c has been renamed to plugin.c to better differentiate it from... everything else.
author Paper <paper@paper.us.eu.org>
date Thu, 14 Mar 2024 20:25:37 -0400
parents 42ac054c0231
children
comparison
equal deleted inserted replaced
10:42ac054c0231 11:e6a594f16403
2 * dirtools.c: 2 * dirtools.c:
3 * 3 *
4 * Useful tools for manipulating directory names, 4 * Useful tools for manipulating directory names,
5 * or pretty much anything involving directories. 5 * or pretty much anything involving directories.
6 **/ 6 **/
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #ifndef WIN32_LEAN_AND_MEAN
11 # define WIN32_LEAN_AND_MEAN
12 #endif
13 #include <windows.h>
14 #include "dirtools.h" 7 #include "dirtools.h"
15 8
16 /* these are aids and should be converted to wchar */ 9 #include <windef.h>
10 #include <fileapi.h>
11 #include <errhandlingapi.h>
12 #include <winerror.h>
17 13
18 static int dirtools_directory_exists(LPCWSTR restrict path) { 14 static int dirtools_directory_exists(LPCWSTR restrict path) {
19 DWORD attrib = GetFileAttributesW(path); 15 DWORD attrib = GetFileAttributesW(path);
20 return (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY)); 16 return (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY));
21 } 17 }