From 8273834a8c2a9a413f9a35f835d70b0793c89455 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Fri, 2 Apr 2004 06:48:24 +0000 Subject: [PATCH] Add feedback info --- admin-root/feedback.html | 76 ++++++++++++++++++++++++++++++++++++++++ admin-root/hdr.html | 3 +- configure.in | 10 ++++-- mkdist.sh | 2 +- src/configfile.c | 32 ++++++++++++++++- src/db-gdbm.c | 40 ++++++++++++--------- 6 files changed, 140 insertions(+), 23 deletions(-) create mode 100644 admin-root/feedback.html diff --git a/admin-root/feedback.html b/admin-root/feedback.html new file mode 100644 index 00000000..6a43eaff --- /dev/null +++ b/admin-root/feedback.html @@ -0,0 +1,76 @@ +@include hdr.html@ + +

Feedback

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Works? + The most important question. Did this version work for you? + If not, uncheck the box, and put an explanation in the NOTES + entry below. +
Version + This is the version of mt-daapd you are running. If you are using a + public release, use the version number (0.1.0, 0.1.1, etc). If it is + manually checked out of cvs, use 'cvs', if it is a nightly snapshot, + use the snapshot name, for example: 'cvs-20040328'. +
System + This is the operating system and version you are running. + Use something like "Sparc Solaris 9" or "x86 Linux 2.6.3" or + "Mac OSX 10.3" or something to help identify what platform and + version you are running. +
Compile args + If you used any compile flags, that would be helpful. Examples + might include '--with-gdbm', or '--enable-howl' or something else. +
Notes + If it didn't work for you, or if you just want to make a + suggestion, leave those notes here. Remember that these + notes are publicly viewable. +
Rating + Just for fun, give this release a rating from 1 to 10, 1 being + so bad it started your computer on fire, 10 meaning works so + well, it even made your breath fresher. +
+ + +
+ +@include ftr.html@ + diff --git a/admin-root/hdr.html b/admin-root/hdr.html index b6d8fcc5..6157e02a 100644 --- a/admin-root/hdr.html +++ b/admin-root/hdr.html @@ -12,7 +12,7 @@ + border="0">
Version @VERSION@
 
<@VERSION@>
@@ -21,6 +21,7 @@ Home Config Status + Feedback Thanks diff --git a/configure.in b/configure.in index c106356f..16165c57 100644 --- a/configure.in +++ b/configure.in @@ -20,7 +20,8 @@ AC_ARG_ENABLE(efence,Enable electric fence,LDFLAGS="$LDFLAGS -lefence") AC_ARG_ENABLE(howl,[ --enable-howl Use the howl mDNS library], [ case "${enableval}" in - yes) rend_howl=true; LDFLAGS="${LDFLAGS} -lrendezvous -lcorby -lsalt";; + yes) rend_howl=true; LDFLAGS="${LDFLAGS} -lrendezvous -lcorby -lsalt"; + CPPFLAGS="${CPPFLAGS} -DWITH_HOWL";; no) rend_howl=false;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-howl);; esac ],[rend_howl=false]) @@ -33,6 +34,9 @@ AM_CONDITIONAL(COND_NEED_STRSEP,false) dnl Darwin's stupid cpp preprocessor.... echo Host type is $host +CPPFLAGS="$CPPFLAGS -DHOST='\"$host\"'" + + case $host in *solaris*) CPPFLAGS="$CPPFLAGS -DNOT_HAVE_SA_LEN -D_XPG4_2 " @@ -57,7 +61,7 @@ AC_CHECK_LIB(pthread,pthread_create,LDFLAGS="$LDFLAGS -lpthread") AC_ARG_WITH(gdbm, [--with-gdbm store music info in gdbm databases], [ case "${withval}" in - yes) use_gdbm=true; LDFLAGS="${LDFLAGS} -lgdbm"; CFLAGS="${CFLAGS} -DWITH_GDBM";; + yes) use_gdbm=true; LDFLAGS="${LDFLAGS} -lgdbm"; CPPFLAGS="${CPPFLAGS} -DWITH_GDBM";; no) use_gdbm=false;; *) AC_MSG_ERROR(bad value ${withval} for --with-gdbm);; esac ], [use_gdbm=false]) @@ -67,7 +71,7 @@ AC_ARG_WITH(gdbm-includes, [--with-gdbm-includes[[=DIR]] use gdbm include files in DIR],[ if test "$withval" != "no" -a "$withval" != "yes"; then Z_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval" + CLAGS="${CPPFLAGS} -I$withval" fi ]) diff --git a/mkdist.sh b/mkdist.sh index 2f07fc87..42e92571 100755 --- a/mkdist.sh +++ b/mkdist.sh @@ -3,7 +3,7 @@ mv configure.in configure.in.mkdist cat configure.in.mkdist | sed -e s/AM_INIT_AUTOMAKE.*$/AM_INIT_AUTOMAKE\(mt-daapd,cvs-`date +%Y%m%d`\)/ > configure.in ./reconf -./configure +./configure --with-id3tag=/sw make dist mv configure.in.mkdist configure.in diff --git a/src/configfile.c b/src/configfile.c index c42cf990..df9c6541 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -58,6 +58,8 @@ void config_emit_service_status(WS_CONNINFO *pwsc, void *value, char *arg); void config_emit_user(WS_CONNINFO *pwsc, void *value, char *arg); void config_emit_readonly(WS_CONNINFO *pwsc, void *value, char *arg); void config_emit_version(WS_CONNINFO *pwsc, void *value, char *arg); +void config_emit_system(WS_CONNINFO *pwsc, void *value, char *arg); +void config_emit_flags(WS_CONNINFO *pwsc, void *value, char *arg); void config_subst_stream(WS_CONNINFO *pwsc, int fd_src); int config_file_is_readonly(void); int config_mutex_lock(void); @@ -105,6 +107,8 @@ CONFIGELEMENT config_elements[] = { { 0,0,0,CONFIG_TYPE_SPECIAL,"user",(void*)NULL,config_emit_user }, { 0,0,0,CONFIG_TYPE_SPECIAL,"readonly",(void*)NULL,config_emit_readonly }, { 0,0,0,CONFIG_TYPE_SPECIAL,"version",(void*)NULL,config_emit_version }, + { 0,0,0,CONFIG_TYPE_SPECIAL,"system",(void*)NULL,config_emit_system }, + { 0,0,0,CONFIG_TYPE_SPECIAL,"flags",(void*)NULL,config_emit_flags }, { -1,1,0,CONFIG_TYPE_STRING,NULL,NULL,NULL } }; @@ -923,5 +927,31 @@ int config_get_next_session(void) { * Thow out the version info */ void config_emit_version(WS_CONNINFO *pwsc, void *value, char *arg) { - ws_writefd(pwsc,"Version %s",VERSION); + ws_writefd(pwsc,"%s",VERSION); +} + + +/* + * config_emit_system + * + * Thow out the system info + */ +void config_emit_system(WS_CONNINFO *pwsc, void *value, char *arg) { + ws_writefd(pwsc,"%s",HOST); +} + + +/* + * config_emit_flags + * + * Thow out the configure flag info + */ +void config_emit_flags(WS_CONNINFO *pwsc, void *value, char *arg) { +#ifdef WITH_GDBM + ws_writefd(pwsc,"%s ","--with-gdbm"); +#endif + +#ifdef WITH_HOWL + ws_writefd(pwsc,"%s ","--enable-howl"); +#endif } diff --git a/src/db-gdbm.c b/src/db-gdbm.c index ca1c54fe..55d17e11 100644 --- a/src/db-gdbm.c +++ b/src/db-gdbm.c @@ -38,8 +38,15 @@ #include "playlist.h" #include "redblack.h" + +/* + * Defines + */ #define DB_VERSION 2 #define STRLEN(a) (a) ? strlen((a)) + 1 : 1 +#define MAYBEFREE(a) { if((a)) free((a)); }; + + /* * Typedefs */ @@ -99,8 +106,6 @@ typedef struct tag_mp3packed { } MP3PACKED; -#define MAYBEFREE(a) { if((a)) free((a)); }; - /* * Globals */ @@ -307,7 +312,8 @@ int db_end_initial_update(void) { db_update_mode=0; DPRINTF(ERR_DEBUG,"Initial update over. Removing stale items\n"); - for(val=rblookup(RB_LUFIRST,NULL,db_removed); val != NULL; val=rblookup(RB_LUNEXT,val,db_removed)) { + for(val=rblookup(RB_LUFIRST,NULL,db_removed); val != NULL; + val=rblookup(RB_LUNEXT,val,db_removed)) { db_delete(*((int*)val)); free(val); } @@ -443,7 +449,7 @@ datum *db_packrecord(MP3FILE *pmp3) { MP3PACKED *ppacked; int offset; - len=sizeof(MP3PACKED)-1; /* minus the data char... */ + len=sizeof(MP3PACKED); len += STRLEN(pmp3->path); len += STRLEN(pmp3->fname); len += STRLEN(pmp3->title); @@ -504,51 +510,51 @@ datum *db_packrecord(MP3FILE *pmp3) { offset=0; if(pmp3->path) - strncpy(&ppacked->data[offset],pmp3->path,ppacked->path_len); + memcpy(&ppacked->data[offset],pmp3->path,ppacked->path_len); offset+=ppacked->path_len; if(pmp3->fname) - strncpy(&ppacked->data[offset],pmp3->fname,ppacked->fname_len); + memcpy(&ppacked->data[offset],pmp3->fname,ppacked->fname_len); offset+=ppacked->fname_len; if(pmp3->title) - strncpy(&ppacked->data[offset],pmp3->title,ppacked->title_len); + memcpy(&ppacked->data[offset],pmp3->title,ppacked->title_len); offset+=ppacked->title_len; if(pmp3->artist) - strncpy(&ppacked->data[offset],pmp3->artist,ppacked->artist_len); + memcpy(&ppacked->data[offset],pmp3->artist,ppacked->artist_len); offset+=ppacked->artist_len; if(pmp3->album) - strncpy(&ppacked->data[offset],pmp3->album,ppacked->album_len); + memcpy(&ppacked->data[offset],pmp3->album,ppacked->album_len); offset+=ppacked->album_len; if(pmp3->genre) - strncpy(&ppacked->data[offset],pmp3->genre,ppacked->genre_len); + memcpy(&ppacked->data[offset],pmp3->genre,ppacked->genre_len); offset+=ppacked->genre_len; if(pmp3->comment) - strncpy(&ppacked->data[offset],pmp3->comment,ppacked->comment_len); + memcpy(&ppacked->data[offset],pmp3->comment,ppacked->comment_len); offset+=ppacked->comment_len; if(pmp3->type) - strncpy(&ppacked->data[offset],pmp3->type,ppacked->type_len); + memcpy(&ppacked->data[offset],pmp3->type,ppacked->type_len); offset+=ppacked->type_len; if(pmp3->composer) - strncpy(&ppacked->data[offset],pmp3->composer,ppacked->composer_len); + memcpy(&ppacked->data[offset],pmp3->composer,ppacked->composer_len); offset+=ppacked->composer_len; if(pmp3->orchestra) - strncpy(&ppacked->data[offset],pmp3->orchestra,ppacked->orchestra_len); + memcpy(&ppacked->data[offset],pmp3->orchestra,ppacked->orchestra_len); offset+=ppacked->orchestra_len; if(pmp3->conductor) - strncpy(&ppacked->data[offset],pmp3->conductor,ppacked->conductor_len); + memcpy(&ppacked->data[offset],pmp3->conductor,ppacked->conductor_len); offset+=ppacked->conductor_len; if(pmp3->grouping) - strncpy(&ppacked->data[offset],pmp3->grouping,ppacked->grouping_len); + memcpy(&ppacked->data[offset],pmp3->grouping,ppacked->grouping_len); offset+=ppacked->grouping_len; /* whew */ @@ -573,7 +579,7 @@ int db_unpackrecord(datum *pdatum, MP3FILE *pmp3) { ppacked=(MP3PACKED*)pdatum->dptr; if(ppacked->version != DB_VERSION) - log_err(1,"ON-DISK DATABASE VERSION HAS CHANGED! Delete your songs.gdb and restart.\n"); + log_err(1,"ON-DISK DATABASE VERSION HAS CHANGED\nDelete your songs.gdb and restart.\n"); pmp3->bitrate=ppacked->bitrate; pmp3->samplerate=ppacked->samplerate;