Run include-what-you-use and do some cleanups based on its suggestions.
Pull out some logging dependencies that don't need to be there in the
process.
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <errno.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "charfuncs.h"
#include "getcgi.h"
#include "keydb.h"
-#include "keystructs.h"
#include "log.h"
#include "mem.h"
-#include "merge.h"
#include "onak-conf.h"
#include "parsekey.h"
#include "armor.h"
#include "keystructs.h"
-#include "onak-conf.h"
#include "parsekey.h"
#include "version.h"
#include <stdio.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/uio.h>
#include <unistd.h>
#include "charfuncs.h"
#include <signal.h>
#include <stdbool.h>
-#include <stdlib.h>
-#include <string.h>
#include "cleanup.h"
-#include "keydb.h"
#include "log.h"
static bool should_cleanup = false;
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdbool.h>
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "keyid.h"
#include "keystructs.h"
#include "ll.h"
-#include "log.h"
#include "openpgp.h"
/*
int length = 0;
int packetlen = 0;
- log_assert(data != NULL);
+ assert(data != NULL);
/* Make sure we actually have the 2 byte length field */
if (len < 2) {
* 7 is set in which case we log a major error.
*/
if (data[offset] & 0x80) {
- logthing(LOGTHING_CRITICAL,
- "Critical subpacket type not parsed: 0x%X",
- data[offset]);
+ return ONAK_E_UNSUPPORTED_FEATURE;
}
-
}
offset += packetlen;
}
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "charfuncs.h"
#include "cleanup.h"
-#include "keyid.h"
+#include "keydb.h"
#include "log.h"
#include "marshal.h"
#include "mem.h"
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
+#include <inttypes.h>
#include <signal.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
* slower than custom functions however.
*/
+#include <stdbool.h>
#include <stdio.h>
#include "decodekey.h"
#include "keydb.h"
#include "keyid.h"
#include "keystructs.h"
+#include "ll.h"
#include "mem.h"
#include "merge.h"
#include "openpgp.h"
-#include "parsekey.h"
#include "sendsync.h"
+#include "stats.h"
#ifdef NEED_KEYID2UID
/**
#ifndef __KEYDB_H__
#define __KEYDB_H__
+#include <stdbool.h>
#include <inttypes.h>
#include "keystructs.h"
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "decodekey.h"
#include "keystructs.h"
#include "mem.h"
+#include "ll.h"
#include "log.h"
+#include "onak.h"
#include "onak-conf.h"
#include "parsekey.h"
#include "wordlist.h"
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "keydb.h"
#include "keyid.h"
#include "keystructs.h"
-#include "ll.h"
#include "log.h"
#include "mem.h"
+#include "onak.h"
#include "onak-conf.h"
#include "parsekey.h"
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "keystructs.h"
#include "ll.h"
#include "mem.h"
+#include "onak.h"
#include "onak-conf.h"
#include "parsekey.h"
#include "log.h"
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <inttypes.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <curl/curl.h>
#include "armor.h"
#include <errno.h>
#include <fcntl.h>
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "keystructs.h"
#include "log.h"
#include "mem.h"
+#include "onak.h"
#include "onak-conf.h"
#include "parsekey.h"
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <stdbool.h>
+#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "cleankey.h"
-#include "decodekey.h"
-#include "hash.h"
#include "keydb.h"
-#include "keyid.h"
#include "keystructs.h"
+#include "ll.h"
#include "log.h"
-#include "mem.h"
-#include "merge.h"
#include "onak-conf.h"
-#include "openpgp.h"
-#include "parsekey.h"
-#include "sendsync.h"
struct onak_stacked_dbctx {
struct ll *backends;
#include "decodekey.h"
#include "getcgi.h"
-#include "hash.h"
#include "keydb.h"
#include "keyid.h"
#include "keyindex.h"
#include "keystructs.h"
#include "log.h"
#include "onak.h"
-#include "onak-conf.h"
#include "openpgp.h"
/*
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "ll.h"
-#include "log.h"
struct ll *lladd(struct ll *curll, void *object)
{
struct ll *cur;
if ((new = malloc(sizeof(struct ll))) == NULL) {
- logthing(LOGTHING_ERROR,
- "Couldn't allocate memory in lladdend()");
return NULL;
}
struct ll *cur = NULL;
struct ll *old = NULL;
- log_assert(objectcmp != NULL);
+ assert(objectcmp != NULL);
cur = curll;
if (cur == NULL) {
{
struct ll *cur;
- log_assert(objectcmp != NULL);
+ assert(objectcmp != NULL);
cur = curll;
while (cur != NULL && (*objectcmp)(cur->object, object)) {
#ifndef __LL_H__
#define __LL_H__
+#include <stdlib.h>
+
/**
* @brief Take a packet and add it to a linked list
*/
*/
#include <getopt.h>
+#include <inttypes.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "stats.h"
#include "hash.h"
#include "keydb.h"
#include "ll.h"
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "decodekey.h"
-#include "keydb.h"
#include "keyid.h"
#include "keystructs.h"
#include "ll.h"
-#include "log.h"
#include "mem.h"
#include "merge.h"
+#include "onak.h"
/**
* compare_packets - Check to see if 2 OpenPGP packets are the same.
struct openpgp_packet_list *curpacket = NULL;
struct openpgp_packet_list *nextpacket = NULL;
- log_assert(compare_packets(old->packet, new->packet) == 0);
+ assert(compare_packets(old->packet, new->packet) == 0);
curpacket = new->sigs;
while (curpacket != NULL) {
if (lastpacket != NULL) {
lastpacket->next = curpacket->next;
} else {
- log_assert(curpacket == new->sigs);
+ assert(curpacket == new->sigs);
new->sigs = curpacket->next;
}
curpacket->next = NULL;
if (lastpacket != NULL) {
lastpacket->next = curpacket->next;
} else {
- log_assert(curpacket == b->sigs);
+ assert(curpacket == b->sigs);
b->sigs = curpacket->next;
}
curpacket->next = NULL;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include "ll.h"
#include "log.h"
#ifndef __ONAK_CONF_H_
#define __ONAK_CONF_H_
-#include "keydb.h"
+#include <stdbool.h>
+
+#include "ll.h"
/**
* @brief Backend database configuration.
#include <stdlib.h>
#include <string.h>
-#include "keyid.h"
#include "keystructs.h"
#include "ll.h"
#include "mem.h"
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stdio.h>
#include <stdlib.h>
-#include "keyid.h"
-#include "keyindex.h"
#include "keystructs.h"
#include "onak.h"
#include "photoid.h"
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include "hash.h"
#include "keydb.h"
#include "ll.h"
-#include "onak-conf.h"
#include "stats.h"
/**
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <getopt.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include "armor.h"
#include "charfuncs.h"
#include "cleankey.h"
-#include "keydb.h"
#include "keyid.h"
-#include "keyindex.h"
#include "keystructs.h"
-#include "log.h"
#include "mem.h"
-#include "merge.h"
-#include "onak-conf.h"
#include "parsekey.h"
-#include "photoid.h"
#include "decodekey.h"
int main(int argc, char** argv) {
#include <ctype.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "ll.h"
#include "decodekey.h"
-#include "log.h"
+#include "keystructs.h"
#include "wordlist.h"
/**