X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=instimg;a=blobdiff_plain;f=src%2Fmain.c;h=10b3a25bc4d76a3f3d50c732f1e955b3bd42ed8f;hp=68b4c98c64398f2385f57ed018cccf01d05c3675;hb=377e150b95639825a58c759d5ed51406fb14e429;hpb=df3263076df0ad443dd9262b6250820c038fa7f2 diff --git a/src/main.c b/src/main.c index 68b4c98..10b3a25 100644 --- a/src/main.c +++ b/src/main.c @@ -1,29 +1,29 @@ #include #include +#include #include #include "widgets.h" #include "rawdisk.h" static struct wgt_window *win; static struct wgt_widget *lb_instto, *bn_inst, *bn_cancel, *cb_devs, *ck_usbonly; + static struct rawdisk_device rawdev[64]; +static const char *items[64]; static int num_rawdev; + +static void update_disks(void); static void onclick(struct wgt_widget *w); static void onmodify(struct wgt_widget *w); +static void ck_usbonly_handler(struct wgt_widget *w); + int WINAPI WinMain(HINSTANCE hinst, HINSTANCE hprevinst, char *cmdline, int showcmd) { - int i, x, y; + int x, y; MSG msg; - static const char *items[64]; - if((num_rawdev = rawdisk_detect(rawdev, sizeof rawdev / sizeof *rawdev)) == -1) { - return 1; - } - for(i=0; ipath; + while(*ptr) { + int i; + char buf[3]; + for(i=0; i<3; i++) { + buf[i] = tolower(ptr[i]); + } + if(memcmp(buf, "usb", 3) == 0) { + return 1; + } + ptr++; + } + return 0; +} + +static void update_disks(void) +{ + int i; + + for(i=0; i