Add initial Doxygen support
[onak.git] / onak.c
diff --git a/onak.c b/onak.c
index b295fea2126ca772fc96869d59bd180cdd7b8f31..fb14df0f9fcbd2b3cfe808205cc65614c835a2c5 100644 (file)
--- a/onak.c
+++ b/onak.c
@@ -68,11 +68,19 @@ void find_keys(char *search, uint64_t keyid, bool ishex,
        }
 }
 
+/**
+ * @brief Context for the keyserver dumping function
+ */
 struct dump_ctx {
+       /** Keys we've dumped so far to this file */
        int count;
+       /** Maximum keys to dump per file */
        int maxcount;
+       /** File descriptor for the current dump file */
        int fd;
+       /** Number of the current dump file */
        int filenum;
+       /** Base filename to use for dump files */
        char *filebase;
 };
 
@@ -288,7 +296,17 @@ int main(int argc, char *argv[])
                }
        } else if ((argc - optind) == 2) {
                search = argv[optind+1];
-               if (search != NULL) {
+               if (search != NULL && strlen(search) == 42 &&
+                               search[0] == '0' && search[1] == 'x') {
+                       /*
+                        * Fingerprint. Truncate to last 64 bits for
+                        * now.
+                        */
+                       keyid = strtoull(&search[26], &end, 16);
+                       if (end != NULL && *end == 0) {
+                               ishex = true;
+                       }
+               } else if (search != NULL) {
                        keyid = strtoul(search, &end, 16);
                        if (*search != 0 &&
                                        end != NULL &&