Files
@ d6e050f635ca
Branch filter:
Location: DistRen/src/common/options.h - annotation
d6e050f635ca
2.9 KiB
text/plain
Removed non-uploader stuff from client.c, added some master/slave blender code that needs to be fleshed out alot, along with some mysql stuff that should be moved to common eventually.
7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 7df3f36d8160 6fe4b438c918 6fe4b438c918 6fe4b438c918 6fe4b438c918 6fe4b438c918 2c72cec363fa 2c72cec363fa 2c72cec363fa 9a3a072f3fef 9a3a072f3fef dcf2a2b217f1 6fe4b438c918 6fe4b438c918 2b4b4fb95800 6fe4b438c918 6fe4b438c918 6fe4b438c918 2b4b4fb95800 6fe4b438c918 dcf2a2b217f1 dcf2a2b217f1 6fe4b438c918 2c72cec363fa 9a3a072f3fef 9a3a072f3fef 0f60f6f755ca 9a3a072f3fef 4cb9152e78e3 a90602b890f3 dcf2a2b217f1 dcf2a2b217f1 dee6d78ea0a4 a90602b890f3 a90602b890f3 a90602b890f3 9a3a072f3fef f17d2abc8601 9a3a072f3fef 7af1394bffb3 7af1394bffb3 7af1394bffb3 9a3a072f3fef 2c72cec363fa | /*
Copyright 2008 Nathan Phillip Brink, Ethan Zonca
This file is a part of distren.
Distren is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Distren 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with distren. If not, see <http://www.gnu.org/licenses/>.
*/
/*
The point of this file is to handle options parsing that is common to both the server and client of distren. Options parsing that is specific to either should be managed by the server or the client. This means that the user of this interface will be given a handle to a part of a confuse config tree and have to eat that part of the tree to fulfill its own options.
Unfortunately, this extra layer of abstraction shall possibly require a common_opts struct to be made that must be passed to all functions that use the common config. This would include any interface in /src/common/
*/
#ifndef _DISTREN_OPTIONS_H
#define _DISTREN_OPTIONS_H
#include <confuse.h>
/**
incomplete:
maybe remoteio.h should define its own struct which is injected into this struct and have its own handlers that parse its section of the confuse config file... (it'd be more modular)?
Maybe we should just stick with compile-time modularity :-D (did I just suggest we make tons of macros?)
*/
struct options_common
{
struct options_common_data *data;
struct remoteio_opts *remoteio;
struct client_opts *client;
struct daemon_opts *daemon;
};
/**
This function needs to eat some of your arguments to it, just like gtk+ and other libs like to. It particularly needs to be able to find the location of the config file, which should be taken from arguments if it's there. The argument list will have members that I recognize removed.
Options should be kept alive during the program's life.
\param mycfg will be set to the section of the configuration file specific to the caller (client or server specific section)
\param myopts holds the caller's confuse option declarations
\param myname holds the name of the section of the config file that refers to mycfg and myopts
\param allopts will be set to a pointer that many functions need for operation
\param argc the argc that was passed to main()
\param argv the argv that was passed to main()
*/
int options_init(int argc, char *argv[], cfg_t **mycfg, cfg_opt_t *myopts, char *myname, struct options_common **allopts);
/**
Frees the struct options_common. This should be run before the program exits.
*/
int options_free(struct options_common *allopts);
#endif
|