]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
WIP: progdoc looks like working 350-progdoc-formatting
authorMaria Matejka <mq@ucw.cz>
Tue, 27 Jan 2026 18:37:18 +0000 (19:37 +0100)
committerMaria Matejka <mq@ucw.cz>
Tue, 27 Jan 2026 18:37:18 +0000 (19:37 +0100)
doc/kernel-doc
proto/rpki/rpki.c
sysdep/sysdep.sgml
tools/linuxdoc.lua

index e05aa83fca514323bc07983e4159ecab497089ea..489acc863c1a3e40b163d90bc704dab7c6ef1bb3 100755 (executable)
@@ -82,7 +82,7 @@
 # '|code|' - literal string
 
 # match expressions used to find embedded type information
-$type_constant = "\\\%(\\w+)";
+$type_constant = "(?<![|])\\\%(\\w+)";
 $type_func = "(\\w+\\(\\))";
 $type_param = "\\\@(\\w+)";
 $type_struct = "\\\&(\\w+)";
index 0d1c48f572485ddabe53d08bae46642f9f9f14eb..ab62822f013e36204aaece3042c2be9e459f272e 100644 (file)
@@ -22,7 +22,7 @@
  * transport. Transport is a way how to wrap a communication with a cache
  * server. There is supported an unprotected TCP transport and an encrypted
  * SSHv2 transport. The SSH transport requires LibSSH library. LibSSH is
- * loading dynamically using |dlopen()| function. SSH support is integrated in
+ * loading dynamically using dlopen() function. SSH support is integrated in
  * |sysdep/unix/io.c|. Each transport must implement an initialization
  * function, an open function and a socket identification function. That's all.
  *
  * |tcp_transport.c| and |ssh_transport.c| from RTRlib.
  *
  * A RPKI-RTR connection is described by a structure &rpki_cache. The main
- * logic is located in |rpki_cache_change_state()| function. There is a state
+ * logic is located in rpki_cache_change_state() function. There is a state
  * machine. The standard starting state flow looks like |Down| ~> |Connecting|
  * ~> |Sync-Start| ~> |Sync-Running| ~> |Established| and then the last three
  * states are periodically repeated.
  *
  * |Connecting| state establishes the transport connection. The state from a
- * call |rpki_cache_change_state(CONNECTING)| to a call |rpki_connected_hook()|
+ * call rpki_cache_change_state(CONNECTING) to a call rpki_connected_hook()
  *
  * |Sync-Start| state starts with sending |Reset Query| or |Serial Query| and
- * then waits for |Cache Response|. The state from |rpki_connected_hook()| to
- * |rpki_handle_cache_response_pdu()|
+ * then waits for |Cache Response|. The state from rpki_connected_hook() to
+ * rpki_handle_cache_response_pdu()
  *
  * During |Sync-Running| BIRD receives data with IPv4/IPv6 Prefixes from cache
- * server. The state starts from |rpki_handle_cache_response_pdu()| and ends
- * in |rpki_handle_end_of_data_pdu()|.
+ * server. The state starts from rpki_handle_cache_response_pdu() and ends
+ * in rpki_handle_end_of_data_pdu().
  *
  * |Established| state means that BIRD has synced all data with cache server.
  * Schedules a refresh timer event that invokes |Sync-Start|. Schedules Expire
@@ -61,8 +61,8 @@
  *
  * The RPKI-RTR protocol (RFC 6810 bis) defines configurable refresh, retry and
  * expire intervals. For maintaining a connection are used timer events that
- * are scheduled by |rpki_schedule_next_refresh()|,
- * |rpki_schedule_next_retry()| and |rpki_schedule_next_expire()| functions.
+ * are scheduled by rpki_schedule_next_refresh(),
+ * rpki_schedule_next_retry() and rpki_schedule_next_expire() functions.
  *
  * A Refresh timer event performs a sync of |Established| connection. So it
  * shifts state to |Sync-Start|. If at the beginning of second call of a
index bddb46b6ca9b0f7c2434341b6435a1cf7251dbd8..16c41aa825b57fdf41f48aff4c1e9885ae3b742f 100644 (file)
@@ -15,7 +15,7 @@ communication with the network stack differs from one OS to another,
 so we need at least some OS specific code. The good news is that this
 code is isolated in a small set of modules:
 
-<descrip>
+<p><descrip>
 <tagp><tt/config.h/</tagp> is a header file with configuration information,
 definition of the standard set of types and so on.
 <tagp/Startup module/ controls BIRD startup. Common for a family of OS's (e.g.,
index bfc3bcfb34a98d67801a0118b988c6ea253e13fc..d467eebf6f8771256de122f876d283c05389993c 100644 (file)
@@ -26,6 +26,8 @@ local entitytab = {
   tilde = "~";
   amp = "&";
   verbar = "|";
+  latex = "LaTeX";
+  tex = "TeX";
 }
 local entity = P"&" * C(P(1 - S"&;")^1) * P";" / function (t)
   local e = entitytab[t]
@@ -146,6 +148,7 @@ G = P{ "Pandoc",
     })
   end;
   Sect1Inside =
+    V"FunctionBlock" +
     V"Sect2" +
     V"Sect2Inside";
 
@@ -171,6 +174,7 @@ G = P{ "Pandoc",
     V"DescripList" +
     V"CodeBlock" +
     V"TableBlock" +
+    V"Comment" +
     blankchar + V"ParseFail";
 
   Para = P"<p>" * Ct(V"InPara") * P"</p>"^-1 / function (t)
@@ -193,6 +197,11 @@ G = P{ "Pandoc",
       V"FilePathShort" +
       V"RFCRef" +
       V"InternalRef" +
+      V"CodeStruct" +
+      V"CodeFunc" +
+      V"CodeConst" +
+      V"CodeType" +
+      V"CodeParam" +
       V"Comment" +
       (V"Label" / function (e) return pandoc.Span({}, { id = e }) end);
 
@@ -277,7 +286,10 @@ G = P{ "Pandoc",
 
   Emph = P"<em/" * ininline * P"/" / pandoc.Strong;
   Bold = P"<bf/" * ininline * P"/" / pandoc.Strong;
-  It = P"<it/" * ininline * P"/" / pandoc.Emph;
+  It = (
+    P"<it/" * ininline * P"/" +
+    P"<it>" * V"InPara" * P"</it>"
+  ) / pandoc.Emph;
   InlineCodeIt = (P"<m/" + P"<M/") * ininline * P"/" / function (e)
     return pandoc.Emph(e, { class = "code" })
   end;
@@ -343,17 +355,59 @@ G = P{ "Pandoc",
     return pandoc.Code(e, { class = "filepath" })
   end;
 
+  CodeStruct = P'<struct/' * ininline * P'/' / function (e)
+    return pandoc.Code("struct " .. e, { class = "ccode struct" })
+  end;
+
+  CodeFunc = P'<func/' * ininline * P'/' / function (e)
+    return pandoc.Code(e, { class = "ccode func" })
+  end;
+
+  CodeConst = (P'<const/' * ininline * P'/' + P'<const>' * inelement * P'</const>') / function (e)
+    return pandoc.Code(e, { class = "ccode const" })
+  end;
+
+  CodeType = P'<type>' * inelement * P'</type>' / function (t)
+    return pandoc.Code(t, { class = "ccode ctype" })
+  end;
+
+  CodeParam = (P'<param/' * ininline * P'/' + P'<param>' * inelement * P'</param>') / function (p)
+    return pandoc.Code(p, { class = "ccode cparam" })
+  end;
+
   Label = P'<label id="' * C((1 - P('"'))^0) * P'">';
 
   ItemList = P"<itemize>" * Ct((V"ItemListItem" + blankchar)^1) * P"</itemize>" / pandoc.BulletList;
   ItemListItem = P"<item>" * V"InPara";
 
-  DescripList = P"<descrip>" * Ct((V"DescripListItem" + blankchar)^1) * P"</descrip>" / pandoc.DefinitionList;
+  DescripList = P"<descrip>" * Ct((
+    V"DescripListItem" +
+    V"DescripListProgItem" +
+    V"DescripListShortItem" +
+    V"DescripListShortProgItem" +
+    blankchar)^1)
+    * P"</descrip>" / pandoc.DefinitionList;
+
   DescripListItem = P"<tag>" * V"Label" * V"InPara" * "</tag>" * (V"InDescrip" - P"<tag>" - P"</descrip>") / function (l,t,u)
 --    logging.temp("dli", t,u)
     return { pandoc.Span(t, { class = "code", id = l }), { u }}
   end;
 
+  DescripListProgItem = P"<tagp>" * V"InPara" * "</tagp>" * (V"InDescrip" - P"<tagp>" - P"</descrip>") / function (t,u)
+--    logging.temp("dli", t,u)
+    return { pandoc.Span(t, { class = "code" }), { u }}
+  end;
+
+  DescripListShortItem = P"<tag/" * ininline * "/" * (V"InDescrip" - P"<tag" - P"</descrip>") / function (t,u)
+--    logging.temp("dli", t,u)
+    return { pandoc.Span(t, { class = "code" }), { u }}
+  end;
+
+  DescripListShortProgItem = P"<tagp/" * ininline * "/" * (V"InDescrip" - P"<tag" - P"</descrip>") / function (t,u)
+--    logging.temp("dli", t,u)
+    return { pandoc.Span(t, { class = "code" }), { u }}
+  end;
+
   CodeBlock = P'<code>' * C((1 - P'</code>')^0) * P'</code>' / pandoc.CodeBlock;
 
   TableBlockIgnoreBf = P'<bf/' * ininline * '/';
@@ -435,6 +489,43 @@ G = P{ "Pandoc",
       )
   end;
 
+--  FunctionBlock = P'<function><p>' * V"CodeType" * blankmore * V"FunctionName" * blankmore * '(' * V"FunctionHeaderArgs" * ')' * inelement / function (t, n, h, inside)
+  FunctionBlock = P'<function><p>' * V"CodeType" * blankmore
+  * '<funcdef>' * inelement * '</funcdef>' * blankmore
+  * V"FunctionHeaderArgs" * P' --'^0 * Ct(V"InPara") * V"FunctionDescription" * "</function>" / function (t, n, ha, hshort, desc)
+--    logging.temp(t, n, ha, hshort, desc)
+--    logging.temp("desc is", desc)
+    return pandoc.Div(mergetables({
+      pandoc.Header(4, {t, " ", n, ha}, { id = "function-" .. n }),
+      pandoc.Span(mergetables(hshort), { class = "functionshortdesc" }),
+      mergetables(desc)
+    }), { class = "function" }
+  )
+  end;
+
+  FunctionName = P'<funcdef>' * ininline * P'</funcdef>' / pandoc.Str;
+
+  FunctionHeaderArg = V"CodeType"^0 * blankmore * V"CodeParam" / function (t, p)
+    return pandoc.Span({ t, p }, { class = "functionargument" })
+--    if #t then return pandoc.Span({ t[0], p }) else return pandoc.Span({ p }) end
+  end;
+
+  FunctionHeaderArgs = P'(' * Ct(( V"FunctionHeaderArg" * (P',' * blankmore)^0)^0) * P')' / function (a)
+    return pandoc.Span(mergetables({"(", a, ")"}), { class = "functionheaderargs" })
+  end;
+
+  FunctionDescription = Ct(V"FunctionDescSect"^0) / function (inside)
+    return mergetables(inside)
+  end;
+
+  FunctionDescSect = P'<funcsect>' * inelement * Ct((V"Sect3Inside" - P"<funcsect>" - P"</function>")^0) / function (name, inside)
+    return mergetables({
+      pandoc.Header(5, name, {}),
+      mergetables(inside),
+      "meow end of " .. name,
+    })
+  end;
+
   ParseFail = (1 - P"<sect>" - P"<chapt>" - P"</book>") / function (t) return pandoc.CodeBlock("PARSER FAILED " .. t) end;
 }