2006-11-24 20:10:57 -05:00
|
|
|
'##################################################################
|
|
|
|
'#
|
|
|
|
'# mongrel_service: Win32 native implementation for mongrel
|
|
|
|
'# (using ServiceFB and FreeBASIC)
|
|
|
|
'#
|
|
|
|
'# Copyright (c) 2006 Multimedia systems
|
|
|
|
'# (c) and code by Luis Lavena
|
|
|
|
'#
|
|
|
|
'# mongrel_service (native) and mongrel_service gem_pluing are licensed
|
|
|
|
'# in the same terms as mongrel, please review the mongrel license at
|
|
|
|
'# http://mongrel.rubyforge.org/license.html
|
|
|
|
'#
|
|
|
|
'##################################################################
|
|
|
|
|
|
|
|
'##################################################################
|
|
|
|
'# Requirements:
|
2007-09-24 01:57:44 -04:00
|
|
|
'# - FreeBASIC 0.18.
|
2006-11-24 20:10:57 -05:00
|
|
|
'#
|
|
|
|
'##################################################################
|
|
|
|
|
|
|
|
#define SERVICEFB_INCLUDE_UTILS
|
|
|
|
#include once "lib/ServiceFB/ServiceFB.bi"
|
2007-09-24 01:57:44 -04:00
|
|
|
#include once "console_process.bi"
|
2006-11-24 20:10:57 -05:00
|
|
|
|
2007-09-10 16:39:51 -04:00
|
|
|
'# use for debug versions
|
|
|
|
#if not defined(GEM_VERSION)
|
|
|
|
#define GEM_VERSION (debug mode)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
'# preprocessor stringize
|
|
|
|
#define PPSTR(x) #x
|
|
|
|
|
2006-11-24 20:10:57 -05:00
|
|
|
namespace mongrel_service
|
2007-09-10 16:39:51 -04:00
|
|
|
const VERSION as string = PPSTR(GEM_VERSION)
|
2006-11-30 12:18:35 -05:00
|
|
|
|
|
|
|
'# namespace include
|
2006-11-24 20:10:57 -05:00
|
|
|
using fb.svc
|
|
|
|
using fb.svc.utils
|
|
|
|
|
|
|
|
declare function single_onInit(byref as ServiceProcess) as integer
|
|
|
|
declare sub single_onStart(byref as ServiceProcess)
|
|
|
|
declare sub single_onStop(byref as ServiceProcess)
|
|
|
|
|
|
|
|
'# SingleMongrel
|
|
|
|
type SingleMongrel
|
|
|
|
declare constructor()
|
|
|
|
declare destructor()
|
|
|
|
|
|
|
|
'# TODO: replace for inheritance here
|
|
|
|
'declare function onInit() as integer
|
|
|
|
'declare sub onStart()
|
|
|
|
'declare sub onStop()
|
|
|
|
|
|
|
|
__service as ServiceProcess
|
2007-09-24 01:57:44 -04:00
|
|
|
__console as ConsoleProcess
|
2006-11-24 20:10:57 -05:00
|
|
|
__child_pid as uinteger
|
|
|
|
end type
|
|
|
|
|
|
|
|
'# TODO: replace with inheritance here
|
|
|
|
dim shared single_mongrel_ref as SingleMongrel ptr
|
|
|
|
end namespace
|