Branch: Tag:

2013-09-26

2013-09-26 11:22:52 by Henrik Grubbström (Grubba) <grubba@grubba.org>

FSGC: Moved API to base_server/module.pike.

This adds registration of modules that register fsgcs.

Note that this API change is incompatible with the previous API.
This shouldn't be a problem, since nothing that uses the old API
should be out in the wild yet.

1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS. - // $Id: module.pike,v 1.245 2012/01/23 12:50:52 grubba Exp $ + // $Id$      #include <module_constants.h>   #include <module.h>
2034:    return compile_string((pre || "") + file->read(), path)[index];   }    + #if constant(roxen.FSGarbWrapper) + //! Register a filesystem path for automatic garbage collection. + //! + //! @param path + //! Path in the real filesystem to garbage collect. + //! + //! @param max_age + //! Maximum allowed age in seconds for files. + //! + //! @param max_size + //! Maximum total size in bytes for all files under the path. + //! Zero to disable the limit. + //! + //! @param max_files + //! Maximum number of files under the path. + //! Zero to disable the limit. + //! + //! @returns + //! Returns a roxen.FSGarbWrapper object. The garbage collector + //! will be removed when this object is destructed (eg via + //! refcount-garb). + roxen.FSGarbWrapper register_fsgarb(string path, int max_age, +  int|void max_size, int|void max_files) + { +  return roxen.register_fsgarb(module_identifier(), path, max_age, +  max_size, max_files); + } + #endif +    private mapping __my_tables = ([]);      array(mapping(string:mixed)) sql_query( string query, mixed ... args )