/* * kissdx - KiSS PC-Link Daemon eXtended (based on kissd 0.11) * * Copyright (C) 2005 Stelian Pop * Portions Copyright (C) 2006 Vidar Tysse * * Heavily based on kiss4lin, * Copyright (C) 2004 Jacob Kolding * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include extern int a_opt, d_opt, k_opt, v_opt; extern char audiopath[]; extern char videopath[]; extern char picturepath[]; extern char kmlurl[]; extern char pretrigger[]; extern char posttrigger[]; extern char audiofileextensions[]; extern char videofileextensions[]; extern char picturefileextensions[]; #define KISSD_VERSION "v0.11-3, 20060929" void make_lowercase(char *buf); void handle_request(int sock); void handle_kmlrequest(int sock); void clean_pathname(char *path); #define log(format, args...) \ do { \ if (d_opt) \ syslog(LOG_WARNING, format, args); \ else \ fprintf(stderr, format "\n", args); \ } while(0) #define log0(txt) \ do { \ if (d_opt) \ syslog(LOG_WARNING, txt); \ else \ fprintf(stderr, txt "\n"); \ } while(0) #define logv(format, args...) \ do { \ if (v_opt) { \ if (d_opt) \ syslog(LOG_INFO, format, args); \ else \ fprintf(stderr, format "\n", args); \ } \ } while(0) #define logv0(txt) \ do { \ if (v_opt) { \ if (d_opt) \ syslog(LOG_INFO, txt); \ else \ fprintf(stderr, txt "\n"); \ } \ } while(0) #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) enum mediastore_t {mst_unknown=0, mst_audio, mst_video, mst_picture};