summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
51e4587)
Author: noodles
Date: 2003/10/15 21:15:20
Adding the ability to choose a config file at runtime.
*
* Copyright 2002 Project Purple
*
*
* Copyright 2002 Project Purple
*
- * $Id: add.c,v 1.10 2003/06/04 20:57:06 noodles Exp $
+ * $Id: add.c,v 1.11 2003/10/15 21:15:20 noodles Exp $
if (ctx.buffer == NULL) {
puts("Error: No keytext to add supplied.");
} else {
if (ctx.buffer == NULL) {
puts("Error: No keytext to add supplied.");
} else {
initlogthing("add", config.logfile);
dearmor_openpgp_stream(buffer_fetchchar,
&ctx,
initlogthing("add", config.logfile);
dearmor_openpgp_stream(buffer_fetchchar,
&ctx,
*
* Copyright 2001-2002 Project Purple.
*
*
* Copyright 2001-2002 Project Purple.
*
- * $Id: gpgwww.c,v 1.11 2003/06/08 19:04:31 noodles Exp $
+ * $Id: gpgwww.c,v 1.12 2003/10/15 21:15:20 noodles Exp $
initlogthing("gpgwww", config.logfile);
initdb();
inithash();
initlogthing("gpgwww", config.logfile);
initdb();
inithash();
*
* Copyright 2002 Project Purple
*
*
* Copyright 2002 Project Purple
*
- * $Id: lookup.c,v 1.11 2003/10/04 10:21:41 noodles Exp $
+ * $Id: lookup.c,v 1.12 2003/10/15 21:15:21 noodles Exp $
} else if (search == NULL) {
puts("Error: No key to search for supplied.");
} else {
} else if (search == NULL) {
puts("Error: No key to search for supplied.");
} else {
initlogthing("lookup", config.logfile);
initdb();
switch (op) {
initlogthing("lookup", config.logfile);
initdb();
switch (op) {
*
* Copyright 2001-2002 Project Purple.
*
*
* Copyright 2001-2002 Project Purple.
*
- * $Id: maxpath.c,v 1.9 2003/06/04 20:57:10 noodles Exp $
+ * $Id: maxpath.c,v 1.10 2003/10/15 21:15:21 noodles Exp $
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
initdb();
inithash();
findmaxpath(30);
initdb();
inithash();
findmaxpath(30);
*
* Copyright 2002 Project Purple
*
*
* Copyright 2002 Project Purple
*
- * $Id: onak-conf.c,v 1.7 2003/06/04 20:57:11 noodles Exp $
+ * $Id: onak-conf.c,v 1.8 2003/10/15 21:15:21 noodles Exp $
+void readconfig(const char *configfile) {
FILE *conffile;
char curline[1024];
int i;
curline[1023] = 0;
FILE *conffile;
char curline[1024];
int i;
curline[1023] = 0;
- conffile = fopen(CONFIGFILE, "r");
+ if (configfile == NULL) {
+ conffile = fopen(CONFIGFILE, "r");
+ } else {
+ conffile = fopen(configfile, "r");
+ }
if (conffile != NULL) {
fgets(curline, 1023, conffile);
if (conffile != NULL) {
fgets(curline, 1023, conffile);
*
* Copyright 2002 Project Purple
*
*
* Copyright 2002 Project Purple
*
- * $Id: onak-conf.h,v 1.11 2003/10/11 22:28:23 noodles Exp $
+ * $Id: onak-conf.h,v 1.12 2003/10/15 21:15:21 noodles Exp $
*/
#ifndef __ONAK_CONF_H_
*/
#ifndef __ONAK_CONF_H_
/*
* readconfig - read the onak config.
/*
* readconfig - read the onak config.
+ * @configfile - the config file to read.
+ *
+ * Read in our config file. If config file is NULL read in the compile
+ * time default.
+void readconfig(const char *configfile);
/*
* cleanupconfig - clean up the config when we're shutting down.
/*
* cleanupconfig - clean up the config when we're shutting down.
*
* Copyright 2002 Project Purple
*
*
* Copyright 2002 Project Purple
*
- * $Id: onak.c,v 1.17 2003/09/30 20:40:11 noodles Exp $
+ * $Id: onak.c,v 1.18 2003/10/15 21:15:21 noodles Exp $
struct openpgp_packet_list *packets = NULL;
struct openpgp_packet_list *list_end = NULL;
struct openpgp_publickey *keys = NULL;
struct openpgp_packet_list *packets = NULL;
struct openpgp_packet_list *list_end = NULL;
struct openpgp_publickey *keys = NULL;
+ char *configfile = NULL;
int rc = EXIT_SUCCESS;
int result = 0;
char *search = NULL;
int rc = EXIT_SUCCESS;
int result = 0;
char *search = NULL;
bool fingerprint = false;
int optchar;
bool fingerprint = false;
int optchar;
- while ((optchar = getopt(argc, argv, "bfuv")) != -1 ) {
+ while ((optchar = getopt(argc, argv, "bc:fuv")) != -1 ) {
switch (optchar) {
case 'b':
binary = true;
break;
switch (optchar) {
case 'b':
binary = true;
break;
+ case 'c':
+ configfile = strdup(optarg);
+ break;
case 'f':
fingerprint = true;
break;
case 'f':
fingerprint = true;
break;
+ readconfig(configfile);
initlogthing("onak", config.logfile);
if ((argc - optind) < 1) {
initlogthing("onak", config.logfile);
if ((argc - optind) < 1) {
*
* Copyright 2001-2002 Project Purple.
*
*
* Copyright 2001-2002 Project Purple.
*
- * $Id: sixdegrees.c,v 1.4 2003/06/04 20:57:12 noodles Exp $
+ * $Id: sixdegrees.c,v 1.5 2003/10/15 21:15:21 noodles Exp $
keyid = strtoll(argv[1], NULL, 16);
}
keyid = strtoll(argv[1], NULL, 16);
}
initdb();
inithash();
sixdegrees(getfullkeyid(keyid));
initdb();
inithash();
sixdegrees(getfullkeyid(keyid));
*
* Copyright 2003 Project Purple
*
*
* Copyright 2003 Project Purple
*
- * $Id: splitkeys.c,v 1.3 2003/10/03 23:34:06 noodles Exp $
+ * $Id: splitkeys.c,v 1.4 2003/10/15 21:15:21 noodles Exp $
initlogthing("splitkeys", config.logfile);
do {
initlogthing("splitkeys", config.logfile);
do {