]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
added typedef struct to manpages, see man ldns_pkt
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Fri, 29 Apr 2005 08:47:41 +0000 (08:47 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Fri, 29 Apr 2005 08:47:41 +0000 (08:47 +0000)
definition is copied verbatim, and must be of the form:
/** comments */
struct { etc };
typedef struct blah;

doc/doxyparse.pl
doc/function_manpages
ldns/packet.h

index 1c58f691e2743616e68a5663e53def87b8a96a49..77db8919d0525cb50db4cbe977a9cedccdfb477c 100755 (executable)
@@ -19,6 +19,7 @@ use Getopt::Std;
 
 my $state;
 my $description;
+my $struct_description;
 my $key;
 my $return;
 my $param;
@@ -129,6 +130,7 @@ while(<>) {
                $_ =~ s/{/;/;
        }
        
+#print "line: $_\n";
        if (/([\w\* ]*)[\t ]+(.*?)\((.*)\)\s*;/ and $state == 2) {
                # this should also end the current comment parsing
                $return = $1;
@@ -153,7 +155,19 @@ while(<>) {
                $api{$key} = $api;
                $return{$key} = $return;
                undef $description;
+               undef $struct_description;
                $state = 0;
+       } elsif (/^typedef\sstruct\s(\w+)\s(\w+);/ and $state == 2) {
+               $struct_description .= "\n.br\n" . $_;
+               $key = $2;
+               $description{$key} = $struct_description;
+               $api{$key} = "struct";
+               $return{$key} = $1;
+               undef $description;
+               undef $struct_description;
+               $state = 0;
+       } else {
+               $struct_description .= "\n.br\n" . $_;
        }
 }
 
@@ -181,15 +195,20 @@ foreach (keys %manpages) {
        foreach (@$name) {
                $b = $return{$_};
                $b =~ s/\s+$//;
-               print MAN  $b, " ", $_;
-               print MAN  "(", $api{$_},");\n";
-               print MAN  ".PP\n";
+               if ($api{$_} ne "struct") {
+                       print MAN  $b, " ", $_;
+                       print MAN  "(", $api{$_},");\n";
+                       print MAN  ".PP\n";
+               }
        }
 
        print MAN  "\n.SH DESCRIPTION\n";
        foreach (@$name) {
                print MAN  ".HP\n";
-               print MAN "\\fI", $_, "\\fR", "()"; 
+               print MAN "\\fI", $_, "\\fR";
+               if ($api{$_} ne "struct") {
+                       print MAN "()"; 
+               }
 #              print MAN ".br\n";
                print MAN  $description{$_};
                print MAN  "\n.PP\n";
index 840f72c017bb0357454819329c88604dcbdf20c0..b4f13d250678ff7492c12d67983aa67b127235ed 100644 (file)
@@ -106,16 +106,18 @@ ldns_rr2canonical
 ldns_rr_label_count
 
 # packet.h
-ldns_pkt_new, ldns_pkt_free, ldns_pkt_print, ldns_pkt_query_new,  ldns_pkt_query_new_frm_str, ldns_pkt_reply_type
+#ldns_pkt | ldns_pkt_new, ldns_pkt_id, ldns_pkt_set_flags, ldns_pkt_edns
+
+ldns_pkt, ldns_pkt_new, ldns_pkt_free, ldns_pkt_print, ldns_pkt_query_new,  ldns_pkt_query_new_frm_str, ldns_pkt_reply_type | ldns_pkt, ldns_pkt_id, ldns_pkt_set_flags, ldns_pkt_edns
 
 #      gets
-ldns_pkt_id, ldns_pkt_qr, ldns_pkt_aa, ldns_pkt_tc, ldns_pkt_rd, ldns_pkt_cd, ldns_pkt_ra, ldns_pkt_ad, ldns_pkt_opcode, ldns_pkt_rcode, ldns_pkt_qdcount, ldns_pkt_ancount, ldns_pkt_nscount, ldns_pkt_arcount, ldns_pkt_answerfrom, ldns_pkt_when, ldns_pkt_querytime, ldns_pkt_size, ldns_pkt_tsig, ldns_pkt_question, ldns_pkt_answer, ldns_pkt_authority, ldns_pkt_additional, ldns_pkt_xxsection, ldns_pkt_rr_list_by_name, ldns_pkt_rr_list_by_type, ldns_pkt_rr_list_by_name_and_type
+ldns_pkt_id, ldns_pkt_qr, ldns_pkt_aa, ldns_pkt_tc, ldns_pkt_rd, ldns_pkt_cd, ldns_pkt_ra, ldns_pkt_ad, ldns_pkt_opcode, ldns_pkt_rcode, ldns_pkt_qdcount, ldns_pkt_ancount, ldns_pkt_nscount, ldns_pkt_arcount, ldns_pkt_answerfrom, ldns_pkt_when, ldns_pkt_querytime, ldns_pkt_size, ldns_pkt_tsig, ldns_pkt_question, ldns_pkt_answer, ldns_pkt_authority, ldns_pkt_additional, ldns_pkt_xxsection, ldns_pkt_rr_list_by_name, ldns_pkt_rr_list_by_type, ldns_pkt_rr_list_by_name_and_type | ldns_pkt
 
 #      sets
-ldns_pkt_set_flags, ldns_pkt_set_id, ldns_pkt_set_qr, ldns_pkt_set_aa, ldns_pkt_set_tc, ldns_pkt_set_rd, ldns_pkt_set_cd, ldns_pkt_set_ra, ldns_pkt_set_ad, ldns_pkt_set_opcode, ldns_pkt_set_rcode, ldns_pkt_set_qdcount, ldns_pkt_set_ancount, ldns_pkt_set_nscount, ldns_pkt_set_arcount, ldns_pkt_set_answerfrom, ldns_pkt_set_querytime, ldns_pkt_set_size, ldns_pkt_set_when, ldns_pkt_set_xxcount, ldns_pkt_set_tsig
+ldns_pkt_set_flags, ldns_pkt_set_id, ldns_pkt_set_qr, ldns_pkt_set_aa, ldns_pkt_set_tc, ldns_pkt_set_rd, ldns_pkt_set_cd, ldns_pkt_set_ra, ldns_pkt_set_ad, ldns_pkt_set_opcode, ldns_pkt_set_rcode, ldns_pkt_set_qdcount, ldns_pkt_set_ancount, ldns_pkt_set_nscount, ldns_pkt_set_arcount, ldns_pkt_set_answerfrom, ldns_pkt_set_querytime, ldns_pkt_set_size, ldns_pkt_set_when, ldns_pkt_set_xxcount, ldns_pkt_set_tsig | ldns_pkt
 
 #      EDNS0
-ldns_pkt_edns, ldns_pkt_edns_udp_size, ldns_pkt_edns_extended_rcode, ldns_pkt_edns_version, ldns_pkt_edns_z, ldns_pkt_edns_data, ldns_pkt_set_edns_udp_size, ldns_pkt_set_edns_extended_rcode, ldns_pkt_set_edns_version, ldns_pkt_set_edns_z, ldns_pkt_set_edns_data
+ldns_pkt_edns, ldns_pkt_edns_udp_size, ldns_pkt_edns_extended_rcode, ldns_pkt_edns_version, ldns_pkt_edns_z, ldns_pkt_edns_data, ldns_pkt_set_edns_udp_size, ldns_pkt_set_edns_extended_rcode, ldns_pkt_set_edns_version, ldns_pkt_set_edns_z, ldns_pkt_set_edns_data | ldns_pkt
 
 
 
index 43290eb60c768f8ac80c319ddc5a9d9f473f1696..0958aa2db1888921430b40733fca68b9136c1ba2 100644 (file)
@@ -1,4 +1,4 @@
-/*
+r/*
  * packet.h
  *
  * DNS packet definitions
 #include <ldns/common.h>
 #include <ldns/rr.h>
 
-/*
- * \brief Header of a dns packet
+/**
+ *  Header of a dns packet
  *
  * Contains the information about the packet itself
  */
 struct ldns_struct_hdr
 {
-       /** \brief Id of a packet */
+       /**  Id of a packet */
        uint16_t _id;
-       /** \brief Query bit (0=query, 1=answer) */
+       /**  Query bit (0=query, 1=answer) */
        bool _qr;
-       /** \brief Authoritative answer */
+       /**  Authoritative answer */
        bool _aa;
-       /** \brief Packet truncated */
+       /**  Packet truncated */
        bool _tc;
-       /** \brief Recursion desired */
+       /**  Recursion desired */
        bool _rd;
-       /** \brief Checking disabled */
+       /**  Checking disabled */
        bool _cd;
-       /** \brief Recursion available */
+       /**  Recursion available */
        bool _ra;
-       /** \brief Authentic data */
+       /**  Authentic data */
        bool _ad;
-       /** \brief Query type */
+       /**  Query type */
        uint8_t _opcode;         /* XXX 8 bits? */
-       /** \brief Response code */
+       /**  Response code */
        uint8_t _rcode;
-       /** \brief question sec */
+       /**  question sec */
        uint16_t _qdcount;
-       /** \brief answer sec */
+       /**  answer sec */
        uint16_t _ancount;
-       /** \brief auth sec */
+       /**  auth sec */
        uint16_t _nscount;
-       /** \brief add sec */
+       /**  add sec */
        uint16_t _arcount;
 };
 typedef struct ldns_struct_hdr ldns_hdr;
 
-/*
- * \brief DNS packet
+/**
+ * DNS packet
  *
  * This structure contains a complete DNS packet (either a query or an answer)
  */
 struct ldns_struct_pkt
 {
-       /** \brief header section */
+       /**  header section */
        ldns_hdr *_header;
        /* extra items needed in a packet */
-       /** \brief the size in bytes of the pkt */
+       /**  the size in bytes of the pkt */
        uint16_t _answersize;
        ldns_rdf *_answerfrom;
        char *_when;
-       /** \brief query duration */
+       /**  query duration */
        uint32_t _querytime;
-       /** \brief the packet size */
+       /**  the packet size */
        size_t _size;
        /** optional tsig rr */
        ldns_rr *_tsig_rr;
@@ -81,14 +81,14 @@ struct ldns_struct_pkt
        uint8_t _edns_version;
        uint16_t _edns_z;
        ldns_rdf *_edns_data;
-       /** \brief query data */
-       /** \brief question section */
+       /**  query data */
+       /**  question section */
        ldns_rr_list    *_question;
-       /** \brief answer section */
+       /**  answer section */
        ldns_rr_list    *_answer;
-       /** \brief auth section */
+       /**  auth section */
        ldns_rr_list    *_authority;
-       /** \brief add section */
+       /**  add section */
        ldns_rr_list    *_additional;
 };
 typedef struct ldns_struct_pkt ldns_pkt;