#define USE_TCP
#define USE_MEMFILE
-#define USE_CAPTURE
-#if defined (__WIN32__)
- #define SIGNAL_CAPTURE (0)
-#else
+
+#if !defined (__WIN32__)
+ #define USE_CAPTURE
#define SIGNAL_CAPTURE SIGUSR1
#endif
return (NULL != capf) ? 0 : -1;
}
+#else
+void curly_set_cap_base(const char *s){ (void)s; }
#endif
#ifdef USE_TCP
if (flag_conn) {
sent = send(conn, ptr, bytesize, MSG_NOSIGNAL);
+#ifdef USE_CAPTURE
if (capf) fwrite(ptr, size, nmemb, capf);
+#endif
if (sent <= 0) {
DPRINT("Pious Teardown!\n");
#if defined (__WIN32__)
#endif
void parse_config (int argc, char *argv[]){
+#ifdef USE_CAPTURE
const char *ostr = "r:c:di:a:u:";
+#else
+ const char *ostr = "r:di:a:u:";
+#endif
int opt;
while ( -1 != ( opt = getopt( argc, argv, ostr ) ) ){
case 'r':
config.refresh_interval = atoi(optarg);
break;
+#ifdef USE_CAPTURE
case 'c':
config.cap_base = optarg;
break;
+#endif
case 'd':
config.disable_bwhint = 1;
break;
printf ("Max BW: %d\n", config.maxbw);
printf ("Use BW hint: %s\n", config.disable_bwhint ? "no" : "yes");
printf ("Refresh: %d\n", config.refresh_interval);
+#ifdef USE_CAPTURE
printf ("Capture basename: %s\n", config.cap_base);
+#endif
printf ("Master URL: %s\n",config.master_url);
}
parse_config (argc, argv);
strcpy(url, config.master_url);
+#ifdef USE_CAPTURE
curly_set_cap_base(config.cap_base);
+#endif
refresh_interval = config.refresh_interval; //may be override by m3u if 0