[Pinfo-devel] r243 - pinfo/branches/cxx/src
Nathanael Nerode
neroden-guest at costa.debian.org
Mon Sep 26 02:27:13 UTC 2005
Author: neroden-guest
Date: 2005-09-26 02:27:12 +0000 (Mon, 26 Sep 2005)
New Revision: 243
Modified:
pinfo/branches/cxx/src/mainfunction.cxx
Log:
Make stuff static and topo-order.
Modified: pinfo/branches/cxx/src/mainfunction.cxx
===================================================================
--- pinfo/branches/cxx/src/mainfunction.cxx 2005-09-26 02:22:45 UTC (rev 242)
+++ pinfo/branches/cxx/src/mainfunction.cxx 2005-09-26 02:27:12 UTC (rev 243)
@@ -40,11 +40,6 @@
#define MIN(a,b)(((a)<(b))?(a):(b))
#endif
-void rescan_cursor(); /* set the cursor to 1st item on visible screen */
-void next_infomenu(); /* go to the next menu item for sequential reading */
-int getnodeoffset(int tag_table_pos,
- typeof(indirect.size())& indirectstart); /* get node offset in file */
-
/*
* this flag is turned on when the engine receives a simulated `key.back',
* caused by the sequential auto-pgdn reading code
@@ -113,8 +108,70 @@
return get_foo_node("Node: ", type);
}
-/* Main work functions */
+/* More support functions */
+static void
+next_infomenu()
+{
+ if (hyperobjects.size() == 0) {
+ infomenu = -1;
+ return;
+ }
+ for (typeof(hyperobjects.size()) i = infomenu + 1;
+ i < hyperobjects.size(); i++) {
+ if (hyperobjects[i].type <= 1) { /* menu item */
+ infomenu = i;
+ return;
+ }
+ }
+ infomenu = -1; /* no more menuitems found */
+}
+static void
+rescan_cursor()
+{
+ for (typeof(hyperobjects.size()) i = 0; i < hyperobjects.size(); i++)
+ {
+ if ((hyperobjects[i].line >= pos) &&
+ (hyperobjects[i].line < pos + lines_visible))
+ {
+ if (hyperobjects[i].type < HIGHLIGHT)
+ {
+ cursor = i;
+ break;
+ }
+ }
+ }
+}
+
+static int
+getnodeoffset(int tag_table_pos,
+ typeof(indirect.size())& indirectstart)
+ /* count node offset in file */
+{
+ int fileoffset = 0;
+ if (!indirect.empty())
+ {
+ /* signed/unsigned. Use iterators. FIXME */
+ for (int i = indirect.size() - 1; i >= 0; i--)
+ {
+ if (indirect[i].offset <= tag_table[tag_table_pos].offset)
+ {
+ fileoffset +=(tag_table[tag_table_pos].offset - indirect[i].offset + FirstNodeOffset);
+ indirectstart = i;
+ break;
+ }
+ }
+ }
+ else
+ {
+ fileoffset +=(tag_table[tag_table_pos].offset - 2);
+ }
+ return fileoffset;
+}
+
+/*
+ * Main work function
+ */
WorkRVal
work(const vector<string> my_message, string type_str, FILE * id, int tag_table_pos)
{
@@ -1180,62 +1237,3 @@
return rval;
}
-void
-next_infomenu()
-{
- if (hyperobjects.size() == 0) {
- infomenu = -1;
- return;
- }
- for (typeof(hyperobjects.size()) i = infomenu + 1;
- i < hyperobjects.size(); i++) {
- if (hyperobjects[i].type <= 1) { /* menu item */
- infomenu = i;
- return;
- }
- }
- infomenu = -1; /* no more menuitems found */
-}
-
-void
-rescan_cursor()
-{
- for (typeof(hyperobjects.size()) i = 0; i < hyperobjects.size(); i++)
- {
- if ((hyperobjects[i].line >= pos) &&
- (hyperobjects[i].line < pos + lines_visible))
- {
- if (hyperobjects[i].type < HIGHLIGHT)
- {
- cursor = i;
- break;
- }
- }
- }
-}
-
-int
-getnodeoffset(int tag_table_pos,
- typeof(indirect.size())& indirectstart)
- /* count node offset in file */
-{
- int fileoffset = 0;
- if (!indirect.empty())
- {
- /* signed/unsigned. Use iterators. FIXME */
- for (int i = indirect.size() - 1; i >= 0; i--)
- {
- if (indirect[i].offset <= tag_table[tag_table_pos].offset)
- {
- fileoffset +=(tag_table[tag_table_pos].offset - indirect[i].offset + FirstNodeOffset);
- indirectstart = i;
- break;
- }
- }
- }
- else
- {
- fileoffset +=(tag_table[tag_table_pos].offset - 2);
- }
- return fileoffset;
-}
More information about the Pinfo-devel
mailing list