Commit 06510b99 authored by Karl Heyes's avatar Karl Heyes
Browse files

update from win32 build. Mostly cleanup work

svn path=/icecast/trunk/icecast/; revision=14867
parent 90b70598
...@@ -33,18 +33,10 @@ typedef struct source_tag source_t; ...@@ -33,18 +33,10 @@ typedef struct source_tag source_t;
#include "logging.h" #include "logging.h"
typedef struct _skeleton_codec_tag
{
} skeleton_codec_t;
static void skeleton_codec_free (ogg_state_t *ogg_info, ogg_codec_t *codec) static void skeleton_codec_free (ogg_state_t *ogg_info, ogg_codec_t *codec)
{ {
skeleton_codec_t *skeleton = codec->specific;
DEBUG0 ("freeing skeleton codec"); DEBUG0 ("freeing skeleton codec");
ogg_stream_clear (&codec->os); ogg_stream_clear (&codec->os);
free (skeleton);
free (codec); free (codec);
} }
...@@ -82,12 +74,9 @@ ogg_codec_t *initial_skeleton_page (format_plugin_t *plugin, ogg_page *page) ...@@ -82,12 +74,9 @@ ogg_codec_t *initial_skeleton_page (format_plugin_t *plugin, ogg_page *page)
ogg_codec_t *codec = calloc (1, sizeof (ogg_codec_t)); ogg_codec_t *codec = calloc (1, sizeof (ogg_codec_t));
ogg_packet packet; ogg_packet packet;
skeleton_codec_t *skeleton_codec = calloc (1, sizeof (skeleton_codec_t));
ogg_stream_init (&codec->os, ogg_page_serialno (page)); ogg_stream_init (&codec->os, ogg_page_serialno (page));
ogg_stream_pagein (&codec->os, page); ogg_stream_pagein (&codec->os, page);
ogg_stream_packetout (&codec->os, &packet); ogg_stream_packetout (&codec->os, &packet);
DEBUG0("checking for skeleton codec"); DEBUG0("checking for skeleton codec");
...@@ -95,13 +84,11 @@ ogg_codec_t *initial_skeleton_page (format_plugin_t *plugin, ogg_page *page) ...@@ -95,13 +84,11 @@ ogg_codec_t *initial_skeleton_page (format_plugin_t *plugin, ogg_page *page)
if ((packet.bytes<8) || memcmp(packet.packet, "fishead\0", 8)) if ((packet.bytes<8) || memcmp(packet.packet, "fishead\0", 8))
{ {
ogg_stream_clear (&codec->os); ogg_stream_clear (&codec->os);
free (skeleton_codec);
free (codec); free (codec);
return NULL; return NULL;
} }
INFO0 ("seen initial skeleton header"); INFO0 ("seen initial skeleton header");
codec->specific = skeleton_codec;
codec->process_page = process_skeleton_page; codec->process_page = process_skeleton_page;
codec->codec_free = skeleton_codec_free; codec->codec_free = skeleton_codec_free;
codec->headers = 1; codec->headers = 1;
......
...@@ -1100,7 +1100,7 @@ refbuf_t *stats_get_streams (void) ...@@ -1100,7 +1100,7 @@ refbuf_t *stats_get_streams (void)
{ {
#define STREAMLIST_BLKSIZE 4096 #define STREAMLIST_BLKSIZE 4096
avl_node *node; avl_node *node;
int remaining = STREAMLIST_BLKSIZE; unsigned int remaining = STREAMLIST_BLKSIZE;
refbuf_t *start = refbuf_new (remaining), *cur = start; refbuf_t *start = refbuf_new (remaining), *cur = start;
char *buffer = cur->data; char *buffer = cur->data;
......
...@@ -89,288 +89,304 @@ SOURCE=..\src\admin.c ...@@ -89,288 +89,304 @@ SOURCE=..\src\admin.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\admin.h SOURCE=..\src\auth.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\auth.c SOURCE=..\src\auth_htpasswd.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\auth.h SOURCE=..\src\auth_url.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\auth_htpasswd.c SOURCE=..\src\avl\avl.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\auth_htpasswd.h SOURCE=..\src\cfgfile.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\auth_url.c SOURCE=..\src\client.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\auth_url.h SOURCE=..\src\connection.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\avl\avl.c SOURCE=..\src\event.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\avl\avl.h SOURCE=..\src\format.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\cfgfile.c SOURCE=..\src\format_flac.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\cfgfile.h SOURCE=..\src\format_kate.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\client.c SOURCE=..\src\format_midi.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\client.h SOURCE=..\src\format_mp3.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\compat.h SOURCE=..\src\format_ogg.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\connection.c SOURCE=..\src\format_skeleton.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\connection.h SOURCE=..\src\format_speex.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\event.c SOURCE=..\src\format_theora.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\event.h SOURCE=..\src\format_vorbis.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format.c SOURCE=..\src\fserve.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format.h SOURCE=..\src\global.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_flac.c SOURCE=..\src\httpp\httpp.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_flac.h SOURCE=..\src\log\log.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_midi.c SOURCE=..\src\logging.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_midi.h SOURCE=..\src\md5.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_mp3.c SOURCE=..\src\os.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_mp3.h SOURCE=..\src\refbuf.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_ogg.c SOURCE=..\src\net\resolver.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_ogg.h SOURCE=..\src\sighandler.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_speex.c SOURCE=..\src\slave.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_speex.h SOURCE=..\src\net\sock.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_theora.c SOURCE=..\src\source.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_theora.h SOURCE=..\src\stats.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_vorbis.c SOURCE=..\src\thread\thread.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\format_vorbis.h SOURCE=..\src\timing\timing.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\fserve.c SOURCE=..\src\util.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\fserve.h SOURCE=..\src\xslt.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\global.c SOURCE=..\src\yp.c
# End Source File # End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File # Begin Source File
SOURCE=..\src\global.h SOURCE=..\src\admin.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\httpp\httpp.c SOURCE=..\src\auth.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\httpp\httpp.h SOURCE=..\src\auth_htpasswd.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\log\log.c SOURCE=..\src\auth_url.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\log\log.h SOURCE=..\src\avl\avl.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\logging.c SOURCE=..\src\cfgfile.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\logging.h SOURCE=..\src\client.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\md5.c SOURCE=..\src\compat.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\md5.h SOURCE=..\src\connection.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\os.h SOURCE=..\src\event.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\refbuf.c SOURCE=..\src\format.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\refbuf.h SOURCE=..\src\format_flac.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\net\resolver.c SOURCE=..\src\format_kate.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\net\resolver.h SOURCE=..\src\format_midi.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\sighandler.c SOURCE=..\src\format_mp3.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\sighandler.h SOURCE=..\src\format_ogg.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\slave.c SOURCE=..\src\format_skeleton.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\net\sock.c SOURCE=..\src\format_speex.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\net\sock.h SOURCE=..\src\format_theora.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\source.c SOURCE=..\src\format_vorbis.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\source.h SOURCE=..\src\fserve.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\stats.c SOURCE=..\src\global.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\stats.h SOURCE=..\src\httpp\httpp.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\thread\thread.c SOURCE=..\src\log\log.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\thread\thread.h SOURCE=..\src\logging.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\timing\timing.c SOURCE=..\src\md5.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\util.c SOURCE=..\src\refbuf.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\util.h SOURCE=..\src\net\resolver.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\xslt.c SOURCE=..\src\sighandler.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\yp.c SOURCE=..\src\net\sock.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\yp.h SOURCE=..\src\source.h
# End Source File # End Source File
# End Group # Begin Source File
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl" SOURCE=..\src\stats.h
# End Source File
# Begin Source File
SOURCE=..\src\thread\thread.h
# End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\timing\timing.h SOURCE=..\src\timing\timing.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\util.h
# End Source File
# Begin Source File
SOURCE=..\src\xslt.h SOURCE=..\src\xslt.h
# End Source File # End Source File
# Begin Source File
SOURCE=..\src\yp.h
# End Source File
# End Group # End Group
# End Target # End Target
# End Project # End Project
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h>
#include <direct.h> #include <direct.h>
extern "C" { extern "C" {
#include "thread/thread.h" #include "thread/thread.h"
...@@ -15,6 +14,10 @@ extern "C" { ...@@ -15,6 +14,10 @@ extern "C" {
#include "stats.h" #include "stats.h"
} }
// Issues to be wary of. Careful of the runtime you use, I've had printf and similar routines
// crash because of this on apparently valid strings. some weird thing related to checking for
// multiple byte characters. DeleteService only marks a service for deletion, and the docs
// are unclear on the cases that lead to purging however a reboot should do it.
SERVICE_STATUS ServiceStatus; SERVICE_STATUS ServiceStatus;
SERVICE_STATUS_HANDLE hStatus; SERVICE_STATUS_HANDLE hStatus;
...@@ -30,14 +33,16 @@ int InitService() ...@@ -30,14 +33,16 @@ int InitService()
return(result); return(result);
} }
void installService(char *path) void installService (const char *path)
{ {