Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'libhover')
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover-feature/pom.xml4
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp-feature/pom.xml2
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/pom.xml2
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/AllTests.java6
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/CheckDevhelp.java214
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpContentProducer.java38
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpPlugin.java176
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpToc.java106
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTocProvider.java34
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTopic.java220
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/ParseDevHelp.java4
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/SimpleTopic.java122
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LabelFieldEditor.java48
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverMessages.java72
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverPreferencePage.java250
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceConstants.java4
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceInitializer.java20
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.glibc/data/glibc-2.14.xml732
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml2
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/build-helper.xml88
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/toc.xml22
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java4
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml2
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml2
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml1
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java1208
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java1240
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java1722
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java1072
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java1432
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java132
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java186
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java42
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java8
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java128
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java212
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java204
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java1118
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java412
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLoadJob.java40
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java72
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java76
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java6
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java22
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/BuildFunctionInfos.java178
45 files changed, 5842 insertions, 5843 deletions
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover-feature/pom.xml b/libhover/org.eclipse.linuxtools.cdt.libhover-feature/pom.xml
index 6589e17304..0565640d40 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover-feature/pom.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover-feature/pom.xml
@@ -22,7 +22,7 @@
<packaging>eclipse-feature</packaging>
<name>Linux Tools Libhover Feature</name>
-
+
<build>
<plugins>
<plugin>
@@ -38,7 +38,7 @@
<configuration>
<excludes>
<plugin id="org.eclipse.linuxtools.cdt.libhover.library.docs"/>
- <plugin id="org.eclipse.linuxtools.cdt.libhover.glibc"/>
+ <plugin id="org.eclipse.linuxtools.cdt.libhover.glibc"/>
</excludes>
</configuration>
</execution>
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp-feature/pom.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp-feature/pom.xml
index 0e7052f75f..7637abfc96 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp-feature/pom.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp-feature/pom.xml
@@ -22,7 +22,7 @@
<packaging>eclipse-feature</packaging>
<name>Linux Tools Devhelp Libhover Feature</name>
-
+
<build>
<plugins>
<plugin>
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/pom.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/pom.xml
index fab6b8ea0f..35e4baa83a 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/pom.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/pom.xml
@@ -36,7 +36,7 @@
</excludes>
<testSuite>org.eclipse.linuxtools.cdt.libhover.devhelp.tests</testSuite>
<testClass>org.eclipse.linuxtools.cdt.libhover.devhelp.test.AllTests</testClass>
- <useUIHarness>true</useUIHarness>
+ <useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<product>org.eclipse.platform.ide</product>
</configuration>
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/AllTests.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/AllTests.java
index 483f838776..06a9fc210c 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/AllTests.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/AllTests.java
@@ -17,10 +17,10 @@ import org.junit.runners.Suite.SuiteClasses;
*/
@RunWith(Suite.class)
@SuiteClasses({
- CheckDevhelp.class,
- }
+ CheckDevhelp.class,
+ }
)
public class AllTests {
- // empty
+ // empty
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/CheckDevhelp.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/CheckDevhelp.java
index f8879a0793..6d36981347 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/CheckDevhelp.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp.tests/src/org/eclipse/linuxtools/cdt/libhover/devhelp/test/CheckDevhelp.java
@@ -50,117 +50,117 @@ import org.osgi.framework.BundleReference;
public class CheckDevhelp {
- public final static String CACHE_EXT_LIBHOVER = "org.eclipse.linuxtools.cdt.libhover.testCacheExtLibhover"; //$NON-NLS-1$
+ public final static String CACHE_EXT_LIBHOVER = "org.eclipse.linuxtools.cdt.libhover.testCacheExtLibhover"; //$NON-NLS-1$
- @Before
- public void setUp() {
- IPath p = LibhoverPlugin.getDefault().getStateLocation().append("C"); //$NON-NLS-1$
- File f = new File(p.toOSString());
- f.delete();
- }
+ @Before
+ public void setUp() {
+ IPath p = LibhoverPlugin.getDefault().getStateLocation().append("C"); //$NON-NLS-1$
+ File f = new File(p.toOSString());
+ f.delete();
+ }
- @Test
- public void testParse() throws IOException {
- ParseDevHelp.DevHelpParser p = new ParseDevHelp.DevHelpParser(
- "/usr/share/gtk-doc/html"); //$NON-NLS-1$
- LibHoverInfo hover = p.parse(new NullProgressMonitor());
- assertNotNull(hover);
- Map<String, FunctionInfo> functions = hover.functions;
- assertNotNull(functions);
- assertFalse(functions.isEmpty());
- // Now, output the LibHoverInfo for caching later
- IPath location = LibhoverPlugin.getDefault().getStateLocation()
- .append("C"); //$NON-NLS-1$
- File ldir = new File(location.toOSString());
- ldir.mkdir();
- location = location.append("devhelp.libhover"); //$NON-NLS-1$
- try (FileOutputStream f = new FileOutputStream(location.toOSString());
- ObjectOutputStream out = new ObjectOutputStream(f)) {
- out.writeObject(hover);
- }
- IPreferenceStore ps = LibhoverPlugin.getDefault().getPreferenceStore();
- ps.setValue(CACHE_EXT_LIBHOVER, true);
- LibHover.getLibHoverDocs();
- Collection<LibHoverLibrary> c = LibHover.getLibraries();
- assertFalse(c.isEmpty());
- boolean found = false;
- for (LibHoverLibrary l : c) {
- if (l.getName().equals("devhelp")) { //$NON-NLS-1$
- found = true;
- }
- }
- assertTrue(found);
- }
+ @Test
+ public void testParse() throws IOException {
+ ParseDevHelp.DevHelpParser p = new ParseDevHelp.DevHelpParser(
+ "/usr/share/gtk-doc/html"); //$NON-NLS-1$
+ LibHoverInfo hover = p.parse(new NullProgressMonitor());
+ assertNotNull(hover);
+ Map<String, FunctionInfo> functions = hover.functions;
+ assertNotNull(functions);
+ assertFalse(functions.isEmpty());
+ // Now, output the LibHoverInfo for caching later
+ IPath location = LibhoverPlugin.getDefault().getStateLocation()
+ .append("C"); //$NON-NLS-1$
+ File ldir = new File(location.toOSString());
+ ldir.mkdir();
+ location = location.append("devhelp.libhover"); //$NON-NLS-1$
+ try (FileOutputStream f = new FileOutputStream(location.toOSString());
+ ObjectOutputStream out = new ObjectOutputStream(f)) {
+ out.writeObject(hover);
+ }
+ IPreferenceStore ps = LibhoverPlugin.getDefault().getPreferenceStore();
+ ps.setValue(CACHE_EXT_LIBHOVER, true);
+ LibHover.getLibHoverDocs();
+ Collection<LibHoverLibrary> c = LibHover.getLibraries();
+ assertFalse(c.isEmpty());
+ boolean found = false;
+ for (LibHoverLibrary l : c) {
+ if (l.getName().equals("devhelp")) { //$NON-NLS-1$
+ found = true;
+ }
+ }
+ assertTrue(found);
+ }
- @Test
- public void testTocProvider() {
- DevHelpTocProvider provider = new DevHelpTocProvider();
- ITocContribution[] contributions = provider
- .getTocContributions("en_US"); //$NON-NLS-1$
- assertTrue(contributions.length > 0);
- ITocContribution c = contributions[0];
- assertEquals(c.getId(),
- "org.eclipse.linuxtools.cdt.libhover.devhelp.toc"); //$NON-NLS-1$
- assertTrue(c.isPrimary());
- assertEquals(c.getCategoryId(), null);
- assertEquals(c.getLocale(), "en_US"); //$NON-NLS-1$
- String[] docs = c.getExtraDocuments();
- assertEquals(docs.length, 0);
- assertTrue(c.getLinkTo().isEmpty());
- assertEquals(c.getContributorId(),
- "org.eclipse.linuxtools.cdt.libhover.devhelp"); //$NON-NLS-1$
- }
+ @Test
+ public void testTocProvider() {
+ DevHelpTocProvider provider = new DevHelpTocProvider();
+ ITocContribution[] contributions = provider
+ .getTocContributions("en_US"); //$NON-NLS-1$
+ assertTrue(contributions.length > 0);
+ ITocContribution c = contributions[0];
+ assertEquals(c.getId(),
+ "org.eclipse.linuxtools.cdt.libhover.devhelp.toc"); //$NON-NLS-1$
+ assertTrue(c.isPrimary());
+ assertEquals(c.getCategoryId(), null);
+ assertEquals(c.getLocale(), "en_US"); //$NON-NLS-1$
+ String[] docs = c.getExtraDocuments();
+ assertEquals(docs.length, 0);
+ assertTrue(c.getLinkTo().isEmpty());
+ assertEquals(c.getContributorId(),
+ "org.eclipse.linuxtools.cdt.libhover.devhelp"); //$NON-NLS-1$
+ }
- @Test
- public void testHelpTopic() throws IOException {
- // We need to have a devhelp directory with contents to test.
- // Copy over the needed devhelp/html contents in this test plug-in,
- // test1.devhelp2 and index.html, to the workspace.
- ClassLoader cl = getClass().getClassLoader();
- Bundle bundle = null;
- if (cl instanceof BundleReference) {
- bundle = ((BundleReference) cl).getBundle();
- }
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- IPath wslocpath = ws.getRoot().getLocation();
+ @Test
+ public void testHelpTopic() throws IOException {
+ // We need to have a devhelp directory with contents to test.
+ // Copy over the needed devhelp/html contents in this test plug-in,
+ // test1.devhelp2 and index.html, to the workspace.
+ ClassLoader cl = getClass().getClassLoader();
+ Bundle bundle = null;
+ if (cl instanceof BundleReference) {
+ bundle = ((BundleReference) cl).getBundle();
+ }
+ IWorkspace ws = ResourcesPlugin.getWorkspace();
+ IPath wslocpath = ws.getRoot().getLocation();
- IPath outfilepath = wslocpath.append("devhelp/html/test1"); //$NON-NLS-1$
- File outfiledir = outfilepath.toFile();
- assertTrue(outfiledir.mkdirs());
- outfilepath = outfilepath.append("test1.devhelp2"); //$NON-NLS-1$
- File outfile = outfilepath.toFile();
- IPath outfilepath2 = wslocpath.append("devhelp/html/test1/index.html"); //$NON-NLS-1$
- File outfile2 = outfilepath2.toFile();
- outfile.createNewFile();
- outfile2.createNewFile();
- try (InputStream in = FileLocator.openStream(bundle, new Path(
- "devhelp/html/test1/test1.devhelp2"), false)) { //$NON-NLS-1$
- Files.copy(in, Paths.get(outfile.toURI()), StandardCopyOption.REPLACE_EXISTING);
- }
- try (InputStream in2 = FileLocator.openStream(bundle, new Path(
- "devhelp/html/test1/index.html"), false)) { //$NON-NLS-1$
- Files.copy(in2, Paths.get(outfile2.toURI()), StandardCopyOption.REPLACE_EXISTING);
- }
+ IPath outfilepath = wslocpath.append("devhelp/html/test1"); //$NON-NLS-1$
+ File outfiledir = outfilepath.toFile();
+ assertTrue(outfiledir.mkdirs());
+ outfilepath = outfilepath.append("test1.devhelp2"); //$NON-NLS-1$
+ File outfile = outfilepath.toFile();
+ IPath outfilepath2 = wslocpath.append("devhelp/html/test1/index.html"); //$NON-NLS-1$
+ File outfile2 = outfilepath2.toFile();
+ outfile.createNewFile();
+ outfile2.createNewFile();
+ try (InputStream in = FileLocator.openStream(bundle, new Path(
+ "devhelp/html/test1/test1.devhelp2"), false)) { //$NON-NLS-1$
+ Files.copy(in, Paths.get(outfile.toURI()), StandardCopyOption.REPLACE_EXISTING);
+ }
+ try (InputStream in2 = FileLocator.openStream(bundle, new Path(
+ "devhelp/html/test1/index.html"), false)) { //$NON-NLS-1$
+ Files.copy(in2, Paths.get(outfile2.toURI()), StandardCopyOption.REPLACE_EXISTING);
+ }
- IPath x = wslocpath.append("devhelp/html"); //$NON-NLS-1$
- IPreferenceStore ps = DevHelpPlugin.getDefault().getPreferenceStore();
- ps.setValue(PreferenceConstants.DEVHELP_DIRECTORY, x.toOSString());
- DevHelpToc toc = new DevHelpToc();
- ITopic[] topics = toc.getTopics();
- // Verify we have the test1 topic
- assertTrue(topics.length > 0);
- ITopic topic = topics[0];
- assertTrue(topic.getLabel().startsWith("test1")); //$NON-NLS-1$
- ITopic[] subtopics = topic.getSubtopics();
- // Verify it has 4 or more sub-topics
- assertTrue(subtopics.length > 3);
- IUAElement[] elements = topic.getChildren();
- assertTrue(elements.length > 3);
- String href = topic.getHref();
- // Verify the topic href is the index.html file and that the topic is
- // enabled
- assertEquals(href,
- "/org.eclipse.linuxtools.cdt.libhover.devhelp/test1/index.html"); //$NON-NLS-1$
- assertTrue(topic.isEnabled(null));
- }
+ IPath x = wslocpath.append("devhelp/html"); //$NON-NLS-1$
+ IPreferenceStore ps = DevHelpPlugin.getDefault().getPreferenceStore();
+ ps.setValue(PreferenceConstants.DEVHELP_DIRECTORY, x.toOSString());
+ DevHelpToc toc = new DevHelpToc();
+ ITopic[] topics = toc.getTopics();
+ // Verify we have the test1 topic
+ assertTrue(topics.length > 0);
+ ITopic topic = topics[0];
+ assertTrue(topic.getLabel().startsWith("test1")); //$NON-NLS-1$
+ ITopic[] subtopics = topic.getSubtopics();
+ // Verify it has 4 or more sub-topics
+ assertTrue(subtopics.length > 3);
+ IUAElement[] elements = topic.getChildren();
+ assertTrue(elements.length > 3);
+ String href = topic.getHref();
+ // Verify the topic href is the index.html file and that the topic is
+ // enabled
+ assertEquals(href,
+ "/org.eclipse.linuxtools.cdt.libhover.devhelp/test1/index.html"); //$NON-NLS-1$
+ assertTrue(topic.isEnabled(null));
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpContentProducer.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpContentProducer.java
index bd7dda894b..c28b5be705 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpContentProducer.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpContentProducer.java
@@ -26,24 +26,24 @@ import org.eclipse.linuxtools.internal.cdt.libhover.devhelp.preferences.Preferen
public class DevHelpContentProducer implements IHelpContentProducer {
- @Override
- public InputStream getInputStream(String pluginID, String href,
- Locale locale) {
- // Eclipse help system adds parameters to the href but this breaks our path creation so we just strip them.
- if (href.contains("?")) { //$NON-NLS-1$
- href = href.substring(0, href.indexOf('?'));
- }
- IPreferenceStore ps = DevHelpPlugin.getDefault().getPreferenceStore();
- IPath devhelpLocation = new Path(ps.getString(PreferenceConstants.DEVHELP_DIRECTORY)).append(href);
- IFileSystem fs = EFS.getLocalFileSystem();
- IFileStore localLocation = fs.getStore(devhelpLocation);
- InputStream stream = null;
- try {
- stream = localLocation.openInputStream(EFS.NONE, new NullProgressMonitor());
- } catch (CoreException e) {
- e.printStackTrace();
- }
- return stream;
- }
+ @Override
+ public InputStream getInputStream(String pluginID, String href,
+ Locale locale) {
+ // Eclipse help system adds parameters to the href but this breaks our path creation so we just strip them.
+ if (href.contains("?")) { //$NON-NLS-1$
+ href = href.substring(0, href.indexOf('?'));
+ }
+ IPreferenceStore ps = DevHelpPlugin.getDefault().getPreferenceStore();
+ IPath devhelpLocation = new Path(ps.getString(PreferenceConstants.DEVHELP_DIRECTORY)).append(href);
+ IFileSystem fs = EFS.getLocalFileSystem();
+ IFileStore localLocation = fs.getStore(devhelpLocation);
+ InputStream stream = null;
+ try {
+ stream = localLocation.openInputStream(EFS.NONE, new NullProgressMonitor());
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return stream;
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpPlugin.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpPlugin.java
index b9483e4d7a..bd7aeddfa6 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpPlugin.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpPlugin.java
@@ -37,103 +37,103 @@ import org.osgi.framework.BundleContext;
*/
public class DevHelpPlugin extends AbstractUIPlugin implements IStartup {
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.libhover.devhelp"; //$NON-NLS-1$
- private static final String REGENERATE_MSG = "Libhover.Devhelp.Regenerate.msg"; //$NON-NLS-1$
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.libhover.devhelp"; //$NON-NLS-1$
+ private static final String REGENERATE_MSG = "Libhover.Devhelp.Regenerate.msg"; //$NON-NLS-1$
- // The shared instance
- private static DevHelpPlugin plugin;
+ // The shared instance
+ private static DevHelpPlugin plugin;
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
- * )
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- Job k = new DevhelpStartupJob(LibHoverMessages.getString(REGENERATE_MSG)) ;
- k.schedule();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+ * )
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ Job k = new DevhelpStartupJob(LibHoverMessages.getString(REGENERATE_MSG)) ;
+ k.schedule();
+ }
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
- * )
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+ * )
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static DevHelpPlugin getDefault() {
- return plugin;
- }
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static DevHelpPlugin getDefault() {
+ return plugin;
+ }
- @Override
- public void earlyStartup() {
- // do nothing...we just want start to get called and reparse the devhelp
- // directory
- }
+ @Override
+ public void earlyStartup() {
+ // do nothing...we just want start to get called and reparse the devhelp
+ // directory
+ }
- /**
- * Job used to load devhelp data on startup.
- *
- */
- private static class DevhelpStartupJob extends Job {
+ /**
+ * Job used to load devhelp data on startup.
+ *
+ */
+ private static class DevhelpStartupJob extends Job {
- public DevhelpStartupJob(String name) {
- super(name);
- }
+ public DevhelpStartupJob(String name) {
+ super(name);
+ }
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IPreferenceStore ps = DevHelpPlugin.getDefault()
- .getPreferenceStore();
- ParseDevHelp.DevHelpParser p = new ParseDevHelp.DevHelpParser(
- ps.getString(PreferenceConstants.DEVHELP_DIRECTORY));
- LibHoverInfo hover = p.parse(monitor);
- // Update the devhelp library info if it is on library list
- Collection<LibHoverLibrary> libs = LibHover.getLibraries();
- for (LibHoverLibrary l : libs) {
- if (l.getName().equals("devhelp")) { //$NON-NLS-1$
- l.setHoverinfo(hover);
- break;
- }
- }
- try {
- // Now, output the LibHoverInfo for caching later
- IPath location = LibhoverPlugin.getDefault()
- .getStateLocation().append("C"); //$NON-NLS-1$
- File ldir = new File(location.toOSString());
- ldir.mkdir();
- location = location.append("devhelp.libhover"); //$NON-NLS-1$
- try (FileOutputStream f = new FileOutputStream(
- location.toOSString());
- ObjectOutputStream out = new ObjectOutputStream(f)) {
- out.writeObject(hover);
- }
- monitor.done();
- } catch (IOException e) {
- monitor.done();
- return new Status(IStatus.ERROR, DevHelpPlugin.PLUGIN_ID,
- e.getLocalizedMessage(), e);
- }
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IPreferenceStore ps = DevHelpPlugin.getDefault()
+ .getPreferenceStore();
+ ParseDevHelp.DevHelpParser p = new ParseDevHelp.DevHelpParser(
+ ps.getString(PreferenceConstants.DEVHELP_DIRECTORY));
+ LibHoverInfo hover = p.parse(monitor);
+ // Update the devhelp library info if it is on library list
+ Collection<LibHoverLibrary> libs = LibHover.getLibraries();
+ for (LibHoverLibrary l : libs) {
+ if (l.getName().equals("devhelp")) { //$NON-NLS-1$
+ l.setHoverinfo(hover);
+ break;
+ }
+ }
+ try {
+ // Now, output the LibHoverInfo for caching later
+ IPath location = LibhoverPlugin.getDefault()
+ .getStateLocation().append("C"); //$NON-NLS-1$
+ File ldir = new File(location.toOSString());
+ ldir.mkdir();
+ location = location.append("devhelp.libhover"); //$NON-NLS-1$
+ try (FileOutputStream f = new FileOutputStream(
+ location.toOSString());
+ ObjectOutputStream out = new ObjectOutputStream(f)) {
+ out.writeObject(hover);
+ }
+ monitor.done();
+ } catch (IOException e) {
+ monitor.done();
+ return new Status(IStatus.ERROR, DevHelpPlugin.PLUGIN_ID,
+ e.getLocalizedMessage(), e);
+ }
- return Status.OK_STATUS;
- }
+ return Status.OK_STATUS;
+ }
- };
+ };
} \ No newline at end of file
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpToc.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpToc.java
index 1e698d1b02..6c94273f24 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpToc.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpToc.java
@@ -29,65 +29,65 @@ import org.eclipse.linuxtools.internal.cdt.libhover.devhelp.preferences.Preferen
public class DevHelpToc implements IToc {
- @Override
- public String getLabel() {
- return "Devhelp Documents"; //$NON-NLS-1$
- }
+ @Override
+ public String getLabel() {
+ return "Devhelp Documents"; //$NON-NLS-1$
+ }
- @Override
- public String getHref() {
- return null;
- }
+ @Override
+ public String getHref() {
+ return null;
+ }
- @Override
- public boolean isEnabled(IEvaluationContext context) {
- return true;
- }
+ @Override
+ public boolean isEnabled(IEvaluationContext context) {
+ return true;
+ }
- @Override
- public IUAElement[] getChildren() {
- return getTopics();
- }
+ @Override
+ public IUAElement[] getChildren() {
+ return getTopics();
+ }
- @Override
- public ITopic[] getTopics() {
- try {
- ArrayList<ITopic> topics = new ArrayList<>();
- IPreferenceStore ps = DevHelpPlugin.getDefault()
- .getPreferenceStore();
- IPath devhelpLocation = new Path(
- ps.getString(PreferenceConstants.DEVHELP_DIRECTORY));
- IFileSystem fs = EFS.getLocalFileSystem();
- IFileStore htmlDir = fs.getStore(devhelpLocation);
- IFileStore[] files = htmlDir.childStores(EFS.NONE, null);
- Arrays.sort(files, new Comparator<IFileStore>() {
+ @Override
+ public ITopic[] getTopics() {
+ try {
+ ArrayList<ITopic> topics = new ArrayList<>();
+ IPreferenceStore ps = DevHelpPlugin.getDefault()
+ .getPreferenceStore();
+ IPath devhelpLocation = new Path(
+ ps.getString(PreferenceConstants.DEVHELP_DIRECTORY));
+ IFileSystem fs = EFS.getLocalFileSystem();
+ IFileStore htmlDir = fs.getStore(devhelpLocation);
+ IFileStore[] files = htmlDir.childStores(EFS.NONE, null);
+ Arrays.sort(files, new Comparator<IFileStore>() {
- @Override
- public int compare(IFileStore arg0, IFileStore arg1) {
- return (arg0.getName().compareToIgnoreCase(arg1.getName()));
- }
+ @Override
+ public int compare(IFileStore arg0, IFileStore arg1) {
+ return (arg0.getName().compareToIgnoreCase(arg1.getName()));
+ }
- });
- for (IFileStore file: files) {
- String name = file.fetchInfo().getName();
- if (fs.getStore(
- devhelpLocation.append(name).append(name + ".devhelp2")) //$NON-NLS-1$
- .fetchInfo().exists()) {
- ITopic topic = new DevHelpTopic(name);
- topics.add(topic);
- }
- }
- ITopic[] retval = new ITopic[topics.size()];
- return topics.toArray(retval);
- } catch (CoreException e) {
- }
- return null;
- }
+ });
+ for (IFileStore file: files) {
+ String name = file.fetchInfo().getName();
+ if (fs.getStore(
+ devhelpLocation.append(name).append(name + ".devhelp2")) //$NON-NLS-1$
+ .fetchInfo().exists()) {
+ ITopic topic = new DevHelpTopic(name);
+ topics.add(topic);
+ }
+ }
+ ITopic[] retval = new ITopic[topics.size()];
+ return topics.toArray(retval);
+ } catch (CoreException e) {
+ }
+ return null;
+ }
- @Override
- public ITopic getTopic(String href) {
- // TODO Auto-generated method stub
- return null;
- }
+ @Override
+ public ITopic getTopic(String href) {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTocProvider.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTocProvider.java
index 245da83895..dead6d1542 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTocProvider.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTocProvider.java
@@ -16,48 +16,48 @@ import org.eclipse.help.ITocContribution;
public class DevHelpTocProvider extends AbstractTocProvider {
- @Override
- public ITocContribution[] getTocContributions(String locale) {
+ @Override
+ public ITocContribution[] getTocContributions(String locale) {
ITocContribution contribution = new ITocContribution() {
@Override
- public String getId() {
+ public String getId() {
// a way to identify our book
return "org.eclipse.linuxtools.cdt.libhover.devhelp.toc"; //$NON-NLS-1$
}
@Override
- public String getCategoryId() {
+ public String getCategoryId() {
// our book does not belong to any category of books
return null;
}
@Override
- public boolean isPrimary() {
+ public boolean isPrimary() {
// this is a primary, top-level contribution (a book)
return true;
}
@Override
- public IToc getToc() {
- return new DevHelpToc();
+ public IToc getToc() {
+ return new DevHelpToc();
}
@Override
- public String getLocale() {
- // this provider only provides content for the en_US locale
- return "en_US"; //$NON-NLS-1$
+ public String getLocale() {
+ // this provider only provides content for the en_US locale
+ return "en_US"; //$NON-NLS-1$
}
@Override
- public String[] getExtraDocuments() {
- // there are no extra documents associated with this book
- return new String[0];
+ public String[] getExtraDocuments() {
+ // there are no extra documents associated with this book
+ return new String[0];
}
@Override
- public String getLinkTo() {
- return ""; //$NON-NLS-1$
+ public String getLinkTo() {
+ return ""; //$NON-NLS-1$
}
@Override
public String getContributorId() {
- return "org.eclipse.linuxtools.cdt.libhover.devhelp"; //$NON-NLS-1$
+ return "org.eclipse.linuxtools.cdt.libhover.devhelp"; //$NON-NLS-1$
}
};
return new ITocContribution[] { contribution };
- }
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTopic.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTopic.java
index 3842579b5b..fdc61c74d6 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTopic.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/DevHelpTopic.java
@@ -37,114 +37,114 @@ import org.xml.sax.SAXException;
public class DevHelpTopic implements ITopic {
- private String name;
- private XPath xpath;
- private String label;
- private String link;
- private List<ITopic> subTopics;
-
- DevHelpTopic(String name) {
- this.name = name;
- xpath = XPathFactory.newInstance().newXPath();
- subTopics = new ArrayList<>();
- label = name;
- init();
- }
-
- private void init() {
- IPreferenceStore ps = DevHelpPlugin.getDefault().getPreferenceStore();
- IPath devhelpLocation = new Path(
- ps.getString(PreferenceConstants.DEVHELP_DIRECTORY)).append(
- name).append(name + ".devhelp2"); //$NON-NLS-1$
- File devhelpFile = devhelpLocation.toFile();
- if (devhelpFile.exists()) {
- DocumentBuilderFactory docfactory = DocumentBuilderFactory
- .newInstance();
- docfactory.setValidating(false);
- try {
- docfactory.setFeature("http://xml.org/sax/features/namespaces", //$NON-NLS-1$
- false);
- docfactory.setFeature("http://xml.org/sax/features/validation", //$NON-NLS-1$
- false);
- docfactory
- .setFeature(
- "http://apache.org/xml/features/nonvalidating/load-dtd-grammar", //$NON-NLS-1$
- false);
- docfactory
- .setFeature(
- "http://apache.org/xml/features/nonvalidating/load-external-dtd", //$NON-NLS-1$
- false);
-
- DocumentBuilder docbuilder = docfactory.newDocumentBuilder();
- Document docroot = docbuilder.parse(devhelpLocation.toFile());
-
- // set label
- label = xpathEval("/book/@title", docroot); //$NON-NLS-1$
- if (label.isEmpty()) {
- label = name;
- }
- link = xpathEval("/book/@link", docroot); //$NON-NLS-1$
-
- // set subtopics
- NodeList nodes = xpathEvalNodes("/book/chapters/sub", docroot); //$NON-NLS-1$
- for (int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
- subTopics.add(new SimpleTopic(name, node));
- }
- } catch (ParserConfigurationException e) {
- e.printStackTrace();
- } catch (SAXException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- private String xpathEval(String path, Document docroot) {
- String result = ""; //$NON-NLS-1$
- try {
- result = xpath.evaluate(path, docroot);
- } catch (XPathExpressionException e) {
- e.printStackTrace();
- }
- return result;
- }
-
- private NodeList xpathEvalNodes(String path, Document docroot) {
- NodeList result = null;
- try {
- result = (NodeList) xpath.evaluate(path, docroot,
- XPathConstants.NODESET);
- } catch (XPathExpressionException e) {
- e.printStackTrace();
- }
- return result;
- }
-
- @Override
- public boolean isEnabled(IEvaluationContext context) {
- return true;
- }
-
- @Override
- public IUAElement[] getChildren() {
- return getSubtopics();
- }
-
- @Override
- public String getHref() {
- return "/" + DevHelpPlugin.PLUGIN_ID + "/" + name + "/"+link; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- }
-
- @Override
- public String getLabel() {
- return label;
- }
-
- @Override
- public ITopic[] getSubtopics() {
- return subTopics.toArray(new ITopic[subTopics.size()]);
- }
+ private String name;
+ private XPath xpath;
+ private String label;
+ private String link;
+ private List<ITopic> subTopics;
+
+ DevHelpTopic(String name) {
+ this.name = name;
+ xpath = XPathFactory.newInstance().newXPath();
+ subTopics = new ArrayList<>();
+ label = name;
+ init();
+ }
+
+ private void init() {
+ IPreferenceStore ps = DevHelpPlugin.getDefault().getPreferenceStore();
+ IPath devhelpLocation = new Path(
+ ps.getString(PreferenceConstants.DEVHELP_DIRECTORY)).append(
+ name).append(name + ".devhelp2"); //$NON-NLS-1$
+ File devhelpFile = devhelpLocation.toFile();
+ if (devhelpFile.exists()) {
+ DocumentBuilderFactory docfactory = DocumentBuilderFactory
+ .newInstance();
+ docfactory.setValidating(false);
+ try {
+ docfactory.setFeature("http://xml.org/sax/features/namespaces", //$NON-NLS-1$
+ false);
+ docfactory.setFeature("http://xml.org/sax/features/validation", //$NON-NLS-1$
+ false);
+ docfactory
+ .setFeature(
+ "http://apache.org/xml/features/nonvalidating/load-dtd-grammar", //$NON-NLS-1$
+ false);
+ docfactory
+ .setFeature(
+ "http://apache.org/xml/features/nonvalidating/load-external-dtd", //$NON-NLS-1$
+ false);
+
+ DocumentBuilder docbuilder = docfactory.newDocumentBuilder();
+ Document docroot = docbuilder.parse(devhelpLocation.toFile());
+
+ // set label
+ label = xpathEval("/book/@title", docroot); //$NON-NLS-1$
+ if (label.isEmpty()) {
+ label = name;
+ }
+ link = xpathEval("/book/@link", docroot); //$NON-NLS-1$
+
+ // set subtopics
+ NodeList nodes = xpathEvalNodes("/book/chapters/sub", docroot); //$NON-NLS-1$
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Node node = nodes.item(i);
+ subTopics.add(new SimpleTopic(name, node));
+ }
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ } catch (SAXException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private String xpathEval(String path, Document docroot) {
+ String result = ""; //$NON-NLS-1$
+ try {
+ result = xpath.evaluate(path, docroot);
+ } catch (XPathExpressionException e) {
+ e.printStackTrace();
+ }
+ return result;
+ }
+
+ private NodeList xpathEvalNodes(String path, Document docroot) {
+ NodeList result = null;
+ try {
+ result = (NodeList) xpath.evaluate(path, docroot,
+ XPathConstants.NODESET);
+ } catch (XPathExpressionException e) {
+ e.printStackTrace();
+ }
+ return result;
+ }
+
+ @Override
+ public boolean isEnabled(IEvaluationContext context) {
+ return true;
+ }
+
+ @Override
+ public IUAElement[] getChildren() {
+ return getSubtopics();
+ }
+
+ @Override
+ public String getHref() {
+ return "/" + DevHelpPlugin.PLUGIN_ID + "/" + name + "/"+link; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ }
+
+ @Override
+ public String getLabel() {
+ return label;
+ }
+
+ @Override
+ public ITopic[] getSubtopics() {
+ return subTopics.toArray(new ITopic[subTopics.size()]);
+ }
} \ No newline at end of file
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/ParseDevHelp.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/ParseDevHelp.java
index 6c7dcb0002..6c5605aa53 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/ParseDevHelp.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/ParseDevHelp.java
@@ -113,7 +113,7 @@ public class ParseDevHelp {
descStart = true;;
description.append("<p>"); //$NON-NLS-1$
}
- } else if (descStart) {
+ } else if (descStart) {
if ("P".equals(name.rawname)) { //$NON-NLS-1$
description.append("<p>"); //$NON-NLS-1$
} else if ("TABLE".equals(name.rawname)) { //$NON-NLS-1$
@@ -143,7 +143,7 @@ public class ParseDevHelp {
if (begin) {
if ("DIV".equals(name.rawname)) { //$NON-NLS-1$
--divCounter;
-// System.out.println("divCounter is " + divCounter);
+// System.out.println("divCounter is " + divCounter);
if (divCounter <= 0) {
begin = false;
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/SimpleTopic.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/SimpleTopic.java
index 41a95150c3..b49eaab11c 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/SimpleTopic.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/SimpleTopic.java
@@ -26,75 +26,75 @@ import org.w3c.dom.NodeList;
public class SimpleTopic implements ITopic {
- private String bookName;
- private Node node;
- private XPath xpath;
- private List<ITopic> subTopics;
+ private String bookName;
+ private Node node;
+ private XPath xpath;
+ private List<ITopic> subTopics;
- public SimpleTopic(String bookName, Node node) {
- this.bookName = bookName;
- this.node = node;
- xpath = XPathFactory.newInstance().newXPath();
- subTopics = new ArrayList<>();
- initSubtopics();
- }
+ public SimpleTopic(String bookName, Node node) {
+ this.bookName = bookName;
+ this.node = node;
+ xpath = XPathFactory.newInstance().newXPath();
+ subTopics = new ArrayList<>();
+ initSubtopics();
+ }
- private void initSubtopics() {
- NodeList nodes = xpathEvalNodes("sub", node); //$NON-NLS-1$
- if (nodes != null) {
- for (int i = 0; i < nodes.getLength(); i++) {
- Node innerNode = nodes.item(i);
- subTopics.add(new SimpleTopic(bookName, innerNode));
- }
- }
+ private void initSubtopics() {
+ NodeList nodes = xpathEvalNodes("sub", node); //$NON-NLS-1$
+ if (nodes != null) {
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Node innerNode = nodes.item(i);
+ subTopics.add(new SimpleTopic(bookName, innerNode));
+ }
+ }
- }
+ }
- private NodeList xpathEvalNodes(String path, Node docroot) {
- NodeList result = null;
- try {
- result = (NodeList) xpath.evaluate(path, docroot,
- XPathConstants.NODESET);
- } catch (XPathExpressionException e) {
- e.printStackTrace();
- }
- return result;
- }
+ private NodeList xpathEvalNodes(String path, Node docroot) {
+ NodeList result = null;
+ try {
+ result = (NodeList) xpath.evaluate(path, docroot,
+ XPathConstants.NODESET);
+ } catch (XPathExpressionException e) {
+ e.printStackTrace();
+ }
+ return result;
+ }
- @Override
- public boolean isEnabled(IEvaluationContext context) {
- return true;
- }
+ @Override
+ public boolean isEnabled(IEvaluationContext context) {
+ return true;
+ }
- @Override
- public IUAElement[] getChildren() {
- return getSubtopics();
- }
+ @Override
+ public IUAElement[] getChildren() {
+ return getSubtopics();
+ }
- @Override
- public String getHref() {
- String link = ""; //$NON-NLS-1$
- try {
- link = xpath.evaluate("@link", node); //$NON-NLS-1$
- } catch (XPathExpressionException e) {
- e.printStackTrace();
- }
- return "/" + DevHelpPlugin.PLUGIN_ID + "/" + bookName + "/" + link; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
+ @Override
+ public String getHref() {
+ String link = ""; //$NON-NLS-1$
+ try {
+ link = xpath.evaluate("@link", node); //$NON-NLS-1$
+ } catch (XPathExpressionException e) {
+ e.printStackTrace();
+ }
+ return "/" + DevHelpPlugin.PLUGIN_ID + "/" + bookName + "/" + link; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
- @Override
- public String getLabel() {
- try {
- return xpath.evaluate("@name", node); //$NON-NLS-1$
- } catch (XPathExpressionException e) {
- e.printStackTrace();
- }
- return ""; //$NON-NLS-1$
- }
+ @Override
+ public String getLabel() {
+ try {
+ return xpath.evaluate("@name", node); //$NON-NLS-1$
+ } catch (XPathExpressionException e) {
+ e.printStackTrace();
+ }
+ return ""; //$NON-NLS-1$
+ }
- @Override
- public ITopic[] getSubtopics() {
- return subTopics.toArray(new ITopic[subTopics.size()]);
- }
+ @Override
+ public ITopic[] getSubtopics() {
+ return subTopics.toArray(new ITopic[subTopics.size()]);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LabelFieldEditor.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LabelFieldEditor.java
index aa47c55391..91550be853 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LabelFieldEditor.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LabelFieldEditor.java
@@ -6,16 +6,16 @@ import org.eclipse.swt.widgets.Composite;
// Label class for a preference page.
class LabelFieldEditor extends FieldEditor {
- private Composite parent;
+ private Composite parent;
- public LabelFieldEditor( Composite parent, String title ) {
- this.parent = parent;
- init("org.eclipse.linuxtools.cdt.libhover.dummy", title); //$NON-NLS-1$
- createControl(parent);
- }
+ public LabelFieldEditor( Composite parent, String title ) {
+ this.parent = parent;
+ init("org.eclipse.linuxtools.cdt.libhover.dummy", title); //$NON-NLS-1$
+ createControl(parent);
+ }
- @Override
- protected void adjustForNumColumns( int numColumns ) {
+ @Override
+ protected void adjustForNumColumns( int numColumns ) {
GridData gd = new GridData();
gd.horizontalSpan = numColumns;
// We only grab excess space if we have to
@@ -23,23 +23,23 @@ class LabelFieldEditor extends FieldEditor {
// we assume it is setting the width.
gd.grabExcessHorizontalSpace = gd.horizontalSpan == 1;
getLabelControl(parent).setLayoutData(gd);
- }
+ }
- @Override
- protected void doFillIntoGrid( Composite parent, int numColumns ) {
- getLabelControl(parent);
- }
+ @Override
+ protected void doFillIntoGrid( Composite parent, int numColumns ) {
+ getLabelControl(parent);
+ }
- @Override
- public int getNumberOfControls() { return 1; }
- /**
- * The label field editor is only used to present a text label on a preference page.
- */
- @Override
- protected void doLoad() {}
- @Override
- protected void doLoadDefault() {}
- @Override
- protected void doStore() {}
+ @Override
+ public int getNumberOfControls() { return 1; }
+ /**
+ * The label field editor is only used to present a text label on a preference page.
+ */
+ @Override
+ protected void doLoad() {}
+ @Override
+ protected void doLoadDefault() {}
+ @Override
+ protected void doStore() {}
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverMessages.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverMessages.java
index b42d3b3bd0..42312773b9 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverMessages.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverMessages.java
@@ -21,41 +21,41 @@ import java.util.ResourceBundle;
*/
public class LibHoverMessages {
- /**
- *
- */
-
- private static final String RESOURCE_BUNDLE= LibHoverMessages.class.getName();
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private LibHoverMessages() {
- }
-
- public static ResourceBundle getResourceBundle() {
- return fgResourceBundle;
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- } catch (NullPointerException e) {
- return '#' + key + '#';
- }
- }
-
- /**
- * Returns the formatted string from the resource bundle,
- * or 'key' if not found.
- *
- * @param key the message key
- * @param args an array of substituition strings
- * @return the resource bundle message
- */
- public static String getFormattedString(String key, String[] args) {
- return MessageFormat.format(getString(key), (Object[])args);
- }
+ /**
+ *
+ */
+
+ private static final String RESOURCE_BUNDLE= LibHoverMessages.class.getName();
+
+ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private LibHoverMessages() {
+ }
+
+ public static ResourceBundle getResourceBundle() {
+ return fgResourceBundle;
+ }
+
+ public static String getString(String key) {
+ try {
+ return fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+ /**
+ * Returns the formatted string from the resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substituition strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getString(key), (Object[])args);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverPreferencePage.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverPreferencePage.java
index 194212ee34..c68dae59a7 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverPreferencePage.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/LibHoverPreferencePage.java
@@ -61,138 +61,138 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
*/
public class LibHoverPreferencePage extends FieldEditorPreferencePage implements
- IWorkbenchPreferencePage {
-
- private final static String DEVHELP_DIR = "Libhover.Devhelp.Directory"; //$NON-NLS-1$
- private final static String GENERATE = "Libhover.Devhelp.Generate.lbl"; //$NON-NLS-1$
- private final static String REGENERATE_MSG = "Libhover.Devhelp.Regenerate.msg"; //$NON-NLS-1$
- private final static String TITLE = "Libhover.Devhelp.Preference.title"; //$NON-NLS-1$
-
- private Button generateButton;
-
- public LibHoverPreferencePage() {
- super(GRID);
- setPreferenceStore(DevHelpPlugin.getDefault().getPreferenceStore());
- }
-
- private static class DevhelpStringFieldEditor extends DirectoryFieldEditor {
- public DevhelpStringFieldEditor(String name, String labelText,
- Composite parent) {
- super(name, labelText, parent);
- setFilterPath(new File(DevHelpPlugin.getDefault().getPreferenceStore().getString(name)));
- }
-
- }
-
- private synchronized void regenerate() {
- generateButton.setEnabled(false);
- Job k = new Job(LibHoverMessages.getString(REGENERATE_MSG)) {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- IPreferenceStore ps = DevHelpPlugin.getDefault().getPreferenceStore();
- ParseDevHelp.DevHelpParser p =
- new ParseDevHelp.DevHelpParser(ps.getString(PreferenceConstants.DEVHELP_DIRECTORY));
- LibHoverInfo hover = p.parse(monitor);
- // Update the devhelp library info if it is on library list
- Collection<LibHoverLibrary> libs = LibHover.getLibraries();
- for (LibHoverLibrary l : libs) {
- if (l.getName().equals("devhelp")) { //$NON-NLS-1$
- l.setHoverinfo(hover);
- break;
- }
- }
- try {
- // Now, output the LibHoverInfo for caching later
- IPath location = LibhoverPlugin.getDefault().getStateLocation().append("C"); //$NON-NLS-1$
- File ldir = new File(location.toOSString());
- ldir.mkdir();
- location = location.append("devhelp.libhover"); //$NON-NLS-1$
- try (FileOutputStream f = new FileOutputStream(
- location.toOSString());
- ObjectOutputStream out = new ObjectOutputStream(f)) {
- out.writeObject(hover);
- }
- monitor.done();
- } catch(IOException e) {
- monitor.done();
- return new Status(IStatus.ERROR, DevHelpPlugin.PLUGIN_ID, e.getLocalizedMessage(), e);
- }
-
-
- return Status.OK_STATUS;
- }
-
- };
- k.setUser(true);
- k.addJobChangeListener(new JobChangeAdapter() {
- @Override
- public void done(IJobChangeEvent event) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- generateButton.setEnabled(true);
- }
- });
- }
- });
- k.schedule();
- }
-
- @Override
- protected void contributeButtons(Composite parent) {
- ((GridLayout) parent.getLayout()).numColumns++;
- generateButton = new Button(parent, SWT.NONE);
- generateButton.setFont(parent.getFont());
- generateButton.setText(LibHoverMessages.getString(GENERATE));
- generateButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent evt) {
- regenerate();
- }
- });
- generateButton.addDisposeListener(new DisposeListener() {
- @Override
- public void widgetDisposed(DisposeEvent event) {
- generateButton = null;
- }
- });
- GridData gd = new GridData();
+ IWorkbenchPreferencePage {
+
+ private final static String DEVHELP_DIR = "Libhover.Devhelp.Directory"; //$NON-NLS-1$
+ private final static String GENERATE = "Libhover.Devhelp.Generate.lbl"; //$NON-NLS-1$
+ private final static String REGENERATE_MSG = "Libhover.Devhelp.Regenerate.msg"; //$NON-NLS-1$
+ private final static String TITLE = "Libhover.Devhelp.Preference.title"; //$NON-NLS-1$
+
+ private Button generateButton;
+
+ public LibHoverPreferencePage() {
+ super(GRID);
+ setPreferenceStore(DevHelpPlugin.getDefault().getPreferenceStore());
+ }
+
+ private static class DevhelpStringFieldEditor extends DirectoryFieldEditor {
+ public DevhelpStringFieldEditor(String name, String labelText,
+ Composite parent) {
+ super(name, labelText, parent);
+ setFilterPath(new File(DevHelpPlugin.getDefault().getPreferenceStore().getString(name)));
+ }
+
+ }
+
+ private synchronized void regenerate() {
+ generateButton.setEnabled(false);
+ Job k = new Job(LibHoverMessages.getString(REGENERATE_MSG)) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ IPreferenceStore ps = DevHelpPlugin.getDefault().getPreferenceStore();
+ ParseDevHelp.DevHelpParser p =
+ new ParseDevHelp.DevHelpParser(ps.getString(PreferenceConstants.DEVHELP_DIRECTORY));
+ LibHoverInfo hover = p.parse(monitor);
+ // Update the devhelp library info if it is on library list
+ Collection<LibHoverLibrary> libs = LibHover.getLibraries();
+ for (LibHoverLibrary l : libs) {
+ if (l.getName().equals("devhelp")) { //$NON-NLS-1$
+ l.setHoverinfo(hover);
+ break;
+ }
+ }
+ try {
+ // Now, output the LibHoverInfo for caching later
+ IPath location = LibhoverPlugin.getDefault().getStateLocation().append("C"); //$NON-NLS-1$
+ File ldir = new File(location.toOSString());
+ ldir.mkdir();
+ location = location.append("devhelp.libhover"); //$NON-NLS-1$
+ try (FileOutputStream f = new FileOutputStream(
+ location.toOSString());
+ ObjectOutputStream out = new ObjectOutputStream(f)) {
+ out.writeObject(hover);
+ }
+ monitor.done();
+ } catch(IOException e) {
+ monitor.done();
+ return new Status(IStatus.ERROR, DevHelpPlugin.PLUGIN_ID, e.getLocalizedMessage(), e);
+ }
+
+
+ return Status.OK_STATUS;
+ }
+
+ };
+ k.setUser(true);
+ k.addJobChangeListener(new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ generateButton.setEnabled(true);
+ }
+ });
+ }
+ });
+ k.schedule();
+ }
+
+ @Override
+ protected void contributeButtons(Composite parent) {
+ ((GridLayout) parent.getLayout()).numColumns++;
+ generateButton = new Button(parent, SWT.NONE);
+ generateButton.setFont(parent.getFont());
+ generateButton.setText(LibHoverMessages.getString(GENERATE));
+ generateButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent evt) {
+ regenerate();
+ }
+ });
+ generateButton.addDisposeListener(new DisposeListener() {
+ @Override
+ public void widgetDisposed(DisposeEvent event) {
+ generateButton = null;
+ }
+ });
+ GridData gd = new GridData();
gd.horizontalAlignment = GridData.FILL;
int widthHint = convertHorizontalDLUsToPixels(
IDialogConstants.BUTTON_WIDTH);
gd.widthHint = Math.max(widthHint, generateButton.computeSize(
SWT.DEFAULT, SWT.DEFAULT, true).x);
- generateButton.setLayoutData(gd);
+ generateButton.setLayoutData(gd);
}
- /**
- * Creates the field editors. Field editors are abstractions of
- * the common GUI blocks needed to manipulate various types
- * of preferences. Each field editor knows how to save and
- * restore itself.
- */
- @Override
- public void createFieldEditors() {
- addField(
- new LabelFieldEditor(
- getFieldEditorParent(),
- LibHoverMessages.getString(TITLE)));
- addField(
- new DevhelpStringFieldEditor(
- PreferenceConstants.DEVHELP_DIRECTORY,
- LibHoverMessages.getString(DEVHELP_DIR),
- getFieldEditorParent()));
-
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- @Override
- public void init(IWorkbench workbench) {
- }
+ /**
+ * Creates the field editors. Field editors are abstractions of
+ * the common GUI blocks needed to manipulate various types
+ * of preferences. Each field editor knows how to save and
+ * restore itself.
+ */
+ @Override
+ public void createFieldEditors() {
+ addField(
+ new LabelFieldEditor(
+ getFieldEditorParent(),
+ LibHoverMessages.getString(TITLE)));
+ addField(
+ new DevhelpStringFieldEditor(
+ PreferenceConstants.DEVHELP_DIRECTORY,
+ LibHoverMessages.getString(DEVHELP_DIR),
+ getFieldEditorParent()));
+
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ @Override
+ public void init(IWorkbench workbench) {
+ }
} \ No newline at end of file
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceConstants.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceConstants.java
index a4b99109eb..d42b4ac0fc 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceConstants.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceConstants.java
@@ -15,6 +15,6 @@ package org.eclipse.linuxtools.internal.cdt.libhover.devhelp.preferences;
*/
public class PreferenceConstants {
- public final static String DEVHELP_DIRECTORY = "org.eclipse.linuxtools.cdt.libhover.devhelp.directory"; //$NON-NLS-1$
-
+ public final static String DEVHELP_DIRECTORY = "org.eclipse.linuxtools.cdt.libhover.devhelp.directory"; //$NON-NLS-1$
+
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceInitializer.java b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceInitializer.java
index a473be8a41..c30fe9d239 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceInitializer.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.devhelp/src/org/eclipse/linuxtools/internal/cdt/libhover/devhelp/preferences/PreferenceInitializer.java
@@ -19,15 +19,15 @@ import org.eclipse.linuxtools.internal.cdt.libhover.devhelp.DevHelpPlugin;
*/
public class PreferenceInitializer extends AbstractPreferenceInitializer {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- @Override
- public void initializeDefaultPreferences() {
- IPreferenceStore store = DevHelpPlugin.getDefault().getPreferenceStore();
- store.setDefault(PreferenceConstants.DEVHELP_DIRECTORY, "/usr/share/gtk-doc/html"); //$NON-NLS-1$
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = DevHelpPlugin.getDefault().getPreferenceStore();
+ store.setDefault(PreferenceConstants.DEVHELP_DIRECTORY, "/usr/share/gtk-doc/html"); //$NON-NLS-1$
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.glibc/data/glibc-2.14.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.glibc/data/glibc-2.14.xml
index db124fb25f..ec144314f9 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.glibc/data/glibc-2.14.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.glibc/data/glibc-2.14.xml
@@ -545,7 +545,7 @@ b. Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
-8.
+8.
You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
@@ -678,23 +678,23 @@ safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
``copyright'' line and a pointer to where the full notice is found.
- one line to give the library's name and an idea of what it does.
- Copyright (C) year name of author
+ one line to give the library's name and an idea of what it does.
+ Copyright (C) year name of author
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or (at
- your option) any later version.
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version.
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
- USA.
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
+ USA.
Also add information on how to contact you by electronic and paper mail.
@@ -702,11 +702,11 @@ You should also get your employer (if you work as a programmer) or your
school, if any, to sign a ``copyright disclaimer'' for the library, if
necessary. Here is a sample; alter the names:
- Yoyodyne, Inc., hereby disclaims all copyright interest in the library
- `Frob' (a library for tweaking knobs) written by James Random Hacker.
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the library
+ `Frob' (a library for tweaking knobs) written by James Random Hacker.
- signature of Ty Coon, 1 April 1990
- Ty Coon, President of Vice
+ signature of Ty Coon, 1 April 1990
+ Ty Coon, President of Vice
That's all there is to it!
@@ -1102,7 +1102,7 @@ to permit their use in free software.
========================================================================================
A transparent copy of this modified document can be found along-side the binary .libhover file
-in the org.eclipse.cdt.libhover.glibc plug-in jar under the data directory. The plug-in can be
+in the org.eclipse.cdt.libhover.glibc plug-in jar under the data directory. The plug-in can be
unzipped via "unzip". The original un-modified document can be generated from the sources which
can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
@@ -1417,7 +1417,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;ENAMETOOLONG&lt;/CODE&gt;
&lt;DD&gt;
The &lt;VAR&gt;size&lt;/VAR&gt; argument is less than the size of the host name plus one.
-
+
&lt;br&gt;&lt;br&gt; On some systems, there is a symbol for the maximum possible host name
length: &lt;CODE&gt;MAXHOSTNAMELEN&lt;/CODE&gt;. It is defined in &lt;TT&gt;sys/param.h&lt;/TT&gt;.
But you can't count on this to exist, so it is cleaner to handle
@@ -1455,7 +1455,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
&lt;DD&gt;
This process cannot set the host name because it is not privileged.
-
+
</synopsis>
</function>
</construct>
@@ -1549,7 +1549,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The operating system does not support setting the host ID. On some
systems, the host ID is a meaningless but unique number hard-coded for
each machine.
-
+
</synopsis>
</function>
</construct>
@@ -1596,14 +1596,14 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; Since the value in &lt;CODE&gt;machine&lt;/CODE&gt; is supposed to describe just the
hardware, it consists of the first two parts of the configuration name:
&lt;samp&gt;&lt;VAR&gt;cpu&lt;/VAR&gt;-&lt;VAR&gt;manufacturer&lt;/VAR&gt;&lt;/samp&gt;. For example, it might be one of these:
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;"sparc-sun"&lt;/CODE&gt;,
&lt;CODE&gt;"i386-&lt;VAR&gt;anything&lt;/VAR&gt;"&lt;/CODE&gt;,
&lt;CODE&gt;"m68k-hp"&lt;/CODE&gt;,
&lt;CODE&gt;"m68k-sony"&lt;/CODE&gt;,
&lt;CODE&gt;"m68k-sun"&lt;/CODE&gt;,
&lt;CODE&gt;"mips-dec"&lt;/CODE&gt;
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</element>
@@ -2209,7 +2209,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; MS_NODIRATIME
This bit on specifies that access times of directories shall not be updated
when the directories are accessed while the filesystem in mounted.
- &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; Any bits not covered by the above masks should be set off; otherwise,
results are undefined.
&lt;br&gt;&lt;br&gt; The meaning of &lt;VAR&gt;data&lt;/VAR&gt; depends on the filesystem type and is controlled
@@ -2269,7 +2269,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The table of dummy devices is full. &lt;CODE&gt;mount&lt;/CODE&gt; needs to create a
dummy device (aka ``unnamed'' device) if the filesystem being mounted is
not one that uses a device.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -2298,7 +2298,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
busy, by making it unbusy first. If the bit is off and the filesystem is
busy, &lt;CODE&gt;umount2&lt;/CODE&gt; fails with &lt;CODE&gt;errno&lt;/CODE&gt; = &lt;CODE&gt;EBUSY&lt;/CODE&gt;. Depending
on the filesystem, this may override all, some, or no busy conditions.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; All other bits in &lt;VAR&gt;flags&lt;/VAR&gt; should be set to zero; otherwise, the result
is undefined.
&lt;br&gt;&lt;br&gt; Example:
@@ -2326,7 +2326,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
&lt;VAR&gt;file&lt;/VAR&gt; validly refers to a file, but that file is neither a mount
point nor a device special file of a currently mounted filesystem.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;/DL&gt;
&lt;br&gt;&lt;br&gt; This function is not available on all systems.
</synopsis>
@@ -2444,7 +2444,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
This value may be returned instead of the more correct &lt;CODE&gt;EINVAL&lt;/CODE&gt; in some
cases where the space provided for the return of the system parameter is too
small.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -2578,7 +2578,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The value of the &lt;VAR&gt;newuid&lt;/VAR&gt; argument is invalid.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
The process may not change to the specified ID.
-
+
&lt;br&gt;&lt;br&gt; Older systems (those without the &lt;CODE&gt;_POSIX_SAVED_IDS&lt;/CODE&gt; feature) do not
have this function.
</synopsis>
@@ -2633,7 +2633,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
The process does not have the appropriate privileges; you do not
have permission to change to the specified ID.
-
+
</synopsis>
</function>
</construct>
@@ -2725,7 +2725,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
&lt;DD&gt;
The calling process is not privileged.
-
+
</synopsis>
</function>
</construct>
@@ -3062,7 +3062,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
The process does not have the appropriate privileges; you cannot modify
the user accounting database.
-
+
</synopsis>
</function>
</construct>
@@ -3149,10 +3149,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; The following macros are defined for use as the &lt;VAR&gt;file&lt;/VAR&gt; argument:
&lt;br&gt;&lt;br&gt; Macro {char *} _PATH_UTMP
This macro is used to specify the user accounting database.
-
+
&lt;br&gt;&lt;br&gt; Macro {char *} _PATH_WTMP
This macro is used to specify the user accounting log file.
-
+
&lt;br&gt;&lt;br&gt; The &lt;CODE&gt;utmpname&lt;/CODE&gt; function returns a value of &lt;CODE&gt;0&lt;/CODE&gt; if the new name
was successfully stored, and a value of &lt;CODE&gt;-1&lt;/CODE&gt; to indicate an error.
Note that &lt;CODE&gt;utmpname&lt;/CODE&gt; does not try to open the database, and that
@@ -4095,7 +4095,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Internet domain, only the super-user is allowed to specify a port number
in the range 0 through &lt;CODE&gt;IPPORT_RESERVED&lt;/CODE&gt; minus one; see
Ports.)
-
+
&lt;br&gt;&lt;br&gt; Additional conditions may be possible depending on the particular namespace
of the socket.
</synopsis>
@@ -4135,7 +4135,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOBUFS
There are not enough internal buffers available for the operation.
-
+
</synopsis>
</function>
</construct>
@@ -5037,7 +5037,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;VAR&gt;style&lt;/VAR&gt; or &lt;VAR&gt;protocol&lt;/VAR&gt;.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOBUFS
The system ran out of internal buffer space.
-
+
&lt;br&gt;&lt;br&gt; The file descriptor returned by the &lt;CODE&gt;socket&lt;/CODE&gt; function supports both
read and write operations. However, like pipes, sockets do not support file
positioning operations.
@@ -5070,7 +5070,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
sent; don't retransmit it if it is lost.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; 2
Stop both reception and transmission.
-
+
&lt;br&gt;&lt;br&gt; The return value is &lt;CODE&gt;0&lt;/CODE&gt; on success and &lt;CODE&gt;-1&lt;/CODE&gt; on failure. The
following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions are defined for this function:
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
@@ -5081,7 +5081,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTCONN
&lt;VAR&gt;socket&lt;/VAR&gt; is not connected.
-
+
</synopsis>
</function>
</construct>
@@ -5125,7 +5125,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The specified protocol is not supported.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EOPNOTSUPP
The specified protocol does not support the creation of socket pairs.
-
+
</synopsis>
</function>
</construct>
@@ -5184,7 +5184,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EALREADY
The socket &lt;VAR&gt;socket&lt;/VAR&gt; is non-blocking and already has a pending
connection in progress (see &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt; above).
-
+
&lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
allocated resources (like memory, files descriptors, semaphores or
@@ -5220,7 +5220,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The argument &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EOPNOTSUPP
The socket &lt;VAR&gt;socket&lt;/VAR&gt; does not support this operation.
-
+
</synopsis>
</function>
</construct>
@@ -5268,7 +5268,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EWOULDBLOCK
&lt;VAR&gt;socket&lt;/VAR&gt; has nonblocking mode set, and there are no pending
connections immediately available.
-
+
&lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
allocated resources (like memory, files descriptors, semaphores or
@@ -5307,7 +5307,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The socket &lt;VAR&gt;socket&lt;/VAR&gt; is not connected.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOBUFS
There are not enough internal buffers available.
-
+
</synopsis>
</function>
</construct>
@@ -5360,7 +5360,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
case, &lt;CODE&gt;send&lt;/CODE&gt; generates a &lt;CODE&gt;SIGPIPE&lt;/CODE&gt; signal first; if that
signal is ignored or blocked, or if its handler returns, then
&lt;CODE&gt;send&lt;/CODE&gt; fails with &lt;CODE&gt;EPIPE&lt;/CODE&gt;.
-
+
&lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
allocated resources (like memory, files descriptors, semaphores or
@@ -5403,7 +5403,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTCONN
You never connected this socket.
-
+
&lt;br&gt;&lt;br&gt; This function is defined as a cancellation point in multi-threaded
programs, so one has to be prepared for this and make sure that
allocated resources (like memory, files descriptors, semaphores or
@@ -5553,7 +5553,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The descriptor &lt;VAR&gt;socket&lt;/VAR&gt; is not a socket.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOPROTOOPT
The &lt;VAR&gt;optname&lt;/VAR&gt; doesn't make sense for the given &lt;VAR&gt;level&lt;/VAR&gt;.
-
+
</synopsis>
</function>
</construct>
@@ -5573,11 +5573,11 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
This function is used to set the socket option &lt;VAR&gt;optname&lt;/VAR&gt; at level
&lt;VAR&gt;level&lt;/VAR&gt; for socket &lt;VAR&gt;socket&lt;/VAR&gt;. The value of the option is passed
in the buffer &lt;VAR&gt;optval&lt;/VAR&gt; of size &lt;VAR&gt;optlen&lt;/VAR&gt;.
- &lt;br&gt;&lt;br&gt;
-
+ &lt;br&gt;&lt;br&gt;
+
The return value and error codes for &lt;CODE&gt;setsockopt&lt;/CODE&gt; are the same as
for &lt;CODE&gt;getsockopt&lt;/CODE&gt;.
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -5732,7 +5732,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<construct id="struct-timeval" type="struct">
<structure>
<synopsis>
-
+
The &lt;CODE&gt;struct timeval&lt;/CODE&gt; structure represents an elapsed time. It is
declared in &lt;TT&gt;sys/time.h&lt;/TT&gt; and has the following members:
&lt;br&gt;&lt;br&gt;
@@ -5750,7 +5750,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<construct id="struct-timespec" type="struct">
<structure>
<synopsis>
-
+
The &lt;CODE&gt;struct timespec&lt;/CODE&gt; structure represents an elapsed time. It is
declared in &lt;TT&gt;time.h&lt;/TT&gt; and has the following members:
&lt;br&gt;&lt;br&gt;
@@ -5885,7 +5885,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
&lt;DD&gt;
The process is not superuser.
-
+
</synopsis>
</function>
</construct>
@@ -5933,7 +5933,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
support using &lt;CODE&gt;struct timezone&lt;/CODE&gt; to represent time zone
information; that is an obsolete feature of 4.3 BSD.
Instead, use the facilities described in Time Zone Functions.
-
+
</synopsis>
</function>
</construct>
@@ -5976,7 +5976,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
The operating system does not support setting time zone information, and
&lt;VAR&gt;tzp&lt;/VAR&gt; is not a null pointer.
-
+
</synopsis>
</function>
</construct>
@@ -6012,7 +6012,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EPERM&lt;/CODE&gt;
&lt;DD&gt;
You do not have privilege to set the time.
-
+
</synopsis>
</function>
</construct>
@@ -6321,7 +6321,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The precision clock model is not properly set up at the moment, thus the
clock must be considered unsynchronized, and the values should be
treated with care.
-
+
</synopsis>
</function>
</construct>
@@ -6504,7 +6504,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
are not allowed.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
The process specified a settings update, but is not superuser.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; For more details see RFC1305 (Network Time Protocol, Version 3) and
related documents.
&lt;br&gt;&lt;br&gt; Portability note: Early versions of the GNU C library did not
@@ -6638,7 +6638,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ^
The output uses uppercase characters, but only if this is possible
.
-
+
&lt;br&gt;&lt;br&gt; The default action is to pad the number with zeros to keep it a constant
width. Numbers that do not have a range indicated below are never
padded, since there is no natural width for them.
@@ -6661,7 +6661,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; O
Use the locale's alternate numeric symbols for numbers. This modifier
applies only to numeric format specifiers.
-
+
&lt;br&gt;&lt;br&gt; If the format supports the modifier but no alternate representation
is available, it is ignored.
&lt;br&gt;&lt;br&gt; The conversion specifier ends with a format specifier taken from the
@@ -6744,7 +6744,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;samp&gt;PM&lt;/samp&gt; and midnight as &lt;samp&gt;AM&lt;/samp&gt;. In most locales
&lt;samp&gt;AM&lt;/samp&gt;/&lt;samp&gt;PM&lt;/samp&gt; format is not supported, in such cases &lt;CODE&gt;"%p"&lt;/CODE&gt;
yields an empty string.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;LI&gt; %P
Either &lt;samp&gt;am&lt;/samp&gt; or &lt;samp&gt;pm&lt;/samp&gt;, according to the given time value; or the
corresponding strings for the current locale, printed in lowercase
@@ -6823,7 +6823,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The time zone abbreviation (empty if the time zone can't be determined).
&lt;br&gt;&lt;br&gt; &lt;LI&gt; %%
A literal &lt;samp&gt;%&lt;/samp&gt; character.
-
+
&lt;br&gt;&lt;br&gt; The &lt;VAR&gt;size&lt;/VAR&gt; parameter can be used to specify the maximum number of
characters to be stored in the array &lt;VAR&gt;s&lt;/VAR&gt;, including the terminating
null character. If the formatted time requires more than &lt;VAR&gt;size&lt;/VAR&gt;
@@ -7103,7 +7103,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
recognized, input is consumed but no field in &lt;VAR&gt;tm&lt;/VAR&gt; is set.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; %%
A literal &lt;samp&gt;%&lt;/samp&gt; character.
-
+
&lt;br&gt;&lt;br&gt; All other characters in the format string must have a matching character
in the input string. Exceptions are white spaces in the input string
which can match zero or more whitespace characters in the format string.
@@ -7313,7 +7313,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
&lt;DD&gt;
The timer period is too large.
-
+
</synopsis>
</function>
</construct>
@@ -7407,7 +7407,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The nanosecond value in the &lt;VAR&gt;requested_time&lt;/VAR&gt; parameter contains an
illegal value. Either the value is negative or greater than or equal to
1000 million.
-
+
&lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
is a problem if the thread allocates some resources (like memory, file
descriptors, semaphores or whatever) at the time &lt;CODE&gt;nanosleep&lt;/CODE&gt; is
@@ -7518,7 +7518,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
The process requires more space than the system can supply.
-
+
</synopsis>
</function>
</construct>
@@ -7732,7 +7732,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
is not a child of the calling process.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
An invalid value was provided for the &lt;VAR&gt;options&lt;/VAR&gt; argument.
-
+
</synopsis>
</function>
</construct>
@@ -7868,7 +7868,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
name. You need to allocate a bigger array and try again.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
Permission to read or search a component of the file name was denied.
-
+
</synopsis>
</function>
</construct>
@@ -7881,7 +7881,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<header filename = "unistd.h"/>
</headers>
<synopsis>
-
+
This &lt;CODE&gt;get_current_dir_name&lt;/CODE&gt; function is basically equivalent to
&lt;CODE&gt;getcwd (NULL, 0)&lt;/CODE&gt;. The only difference is that the value of
the &lt;CODE&gt;PWD&lt;/CODE&gt; variable is returned if this value is correct. This is a
@@ -7939,7 +7939,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The function call was interrupt by a signal.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
An I/O error occurred.
-
+
</synopsis>
</function>
</construct>
@@ -8009,7 +8009,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
</element>
<element content="DT_SOCK">
<synopsis>
- A local-domain socket.
+ A local-domain socket.
&lt;br&gt;&lt;br&gt;
</synopsis>
</element>
@@ -8054,7 +8054,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
(This problem cannot happen on the GNU system.)
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
Not enough memory available.
-
+
&lt;br&gt;&lt;br&gt; The &lt;CODE&gt;DIR&lt;/CODE&gt; type is typically implemented using a file descriptor,
and the &lt;CODE&gt;opendir&lt;/CODE&gt; function in terms of the &lt;CODE&gt;open&lt;/CODE&gt; function.
. Directory streams and the underlying
@@ -8096,7 +8096,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The descriptor does not allow reading the directory content.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
Not enough memory available.
-
+
</synopsis>
</function>
</construct>
@@ -8141,7 +8141,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
&lt;DD&gt;
The &lt;VAR&gt;dirstream&lt;/VAR&gt; argument is not valid.
-
+
&lt;br&gt;&lt;br&gt; &lt;CODE&gt;readdir&lt;/CODE&gt; is not thread safe. Multiple threads using
&lt;CODE&gt;readdir&lt;/CODE&gt; on the same &lt;VAR&gt;dirstream&lt;/VAR&gt; may overwrite the return
value. Use &lt;CODE&gt;readdir_r&lt;/CODE&gt; when this is critical.
@@ -8250,7 +8250,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
&lt;DD&gt;
The &lt;VAR&gt;dirstream&lt;/VAR&gt; argument is not valid.
-
+
</synopsis>
</function>
</construct>
@@ -8427,7 +8427,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
first parameter points to the file name, the second parameter to an
object of type &lt;CODE&gt;struct stat&lt;/CODE&gt; which is filled in for the file named
in the first parameter.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
The last parameter is a flag giving more information about the current
file. It can have the following values:
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
@@ -8469,8 +8469,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
int (*) (const char *, const struct stat *, int, struct FTW *)&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
-
+ &lt;br&gt;&lt;br&gt;
+
The first three arguments are the same as for the &lt;CODE&gt;__ftw_func_t&lt;/CODE&gt;
type. However for the third argument some additional values are defined
to allow finer differentiation:
@@ -8702,7 +8702,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
You are not allowed to write to the directory in which the new link is
to be written.
-
+
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EEXIST
There is already a file named &lt;VAR&gt;newname&lt;/VAR&gt;. If you want to replace
this link with a new link, you must remove the old link explicitly first.
@@ -8728,7 +8728,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
than the existing file.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
A hardware error occurred while trying to read or write the to filesystem.
-
+
</synopsis>
</function>
</construct>
@@ -8760,8 +8760,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The directory or file system cannot be extended to make the new link.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
A hardware error occurred while reading or writing data on the disk.
- &lt;br&gt;&lt;br&gt;
-
+ &lt;br&gt;&lt;br&gt;
+
</synopsis>
</function>
</construct>
@@ -8816,7 +8816,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The named file is not a symbolic link.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EIO
A hardware error occurred while reading or writing data on the disk.
-
+
</synopsis>
</function>
</construct>
@@ -8853,7 +8853,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
At least one of the path components does not exist.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ELOOP
More than &lt;CODE&gt;MAXSYMLINKS&lt;/CODE&gt; many symlinks have been followed.
-
+
&lt;br&gt;&lt;br&gt; This function is a GNU extension and is declared in &lt;TT&gt;stdlib.h&lt;/TT&gt;.
</synopsis>
</function>
@@ -8925,7 +8925,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
The directory containing the file name to be deleted is on a read-only
file system and can't be modified.
-
+
</synopsis>
</function>
</construct>
@@ -8952,7 +8952,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
&lt;LI&gt;x EEXIST
The directory to be deleted is not empty.
-
+
&lt;br&gt;&lt;br&gt; These two error codes are synonymous; some systems use one, and some use
the other. The GNU system always uses &lt;CODE&gt;ENOTEMPTY&lt;/CODE&gt;.
&lt;br&gt;&lt;br&gt; The prototype for this function is declared in the header file
@@ -9050,7 +9050,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EXDEV
The two file names &lt;VAR&gt;newname&lt;/VAR&gt; and &lt;VAR&gt;oldname&lt;/VAR&gt; are on different
file systems.
-
+
</synopsis>
</function>
</construct>
@@ -9092,7 +9092,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
The parent directory of the directory being created is on a read-only
file system and cannot be modified.
-
+
&lt;br&gt;&lt;br&gt; To use this function, your program should include the header file
&lt;TT&gt;sys/stat.h&lt;/TT&gt;.
</synopsis>
@@ -9198,7 +9198,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
This is the fractional part of the time of the last modification to the
attributes of the file. .
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
</synopsis>
</element>
<element content="blkcnt_t st_blocks">
@@ -9326,7 +9326,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
This is the fractional part of the time of the last modification to the
attributes of the file. .
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
</synopsis>
</element>
<element content="blkcnt64_t st_blocks">
@@ -9393,7 +9393,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;ENOENT&lt;/CODE&gt;
&lt;DD&gt;
The file named by &lt;VAR&gt;filename&lt;/VAR&gt; doesn't exist.
-
+
&lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
function is in fact &lt;CODE&gt;stat64&lt;/CODE&gt; since the LFS interface transparently
replaces the normal implementation.
@@ -9441,7 +9441,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
&lt;DD&gt;
The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
-
+
&lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
function is in fact &lt;CODE&gt;fstat64&lt;/CODE&gt; since the LFS interface transparently
replaces the normal implementation.
@@ -9544,7 +9544,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;CODE&gt;_POSIX_CHOWN_RESTRICTED&lt;/CODE&gt; macro.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
The file is on a read-only file system.
-
+
</synopsis>
</function>
</construct>
@@ -9577,7 +9577,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
see &lt;CODE&gt;chmod&lt;/CODE&gt; above.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
The file resides on a read-only file system.
-
+
</synopsis>
</function>
</construct>
@@ -9604,7 +9604,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
return mask;&lt;br&gt;
}&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
However, it is better to use &lt;CODE&gt;getumask&lt;/CODE&gt; if you just want to read
the mask value, because it is reentrant (at least if you use the GNU
operating system).
@@ -9663,7 +9663,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
meaning for non-directory files, so it is always safe to just clear the
bit in &lt;VAR&gt;mode&lt;/VAR&gt; and call &lt;CODE&gt;chmod&lt;/CODE&gt; again. ,
for full details on the sticky bit.
-
+
</synopsis>
</function>
</construct>
@@ -9696,7 +9696,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
of the process) or a privileged user can change them.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
The file resides on a read-only file system.
-
+
</synopsis>
</function>
</construct>
@@ -9734,7 +9734,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The file doesn't exist.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
Write permission was requested for a file on a read-only file system.
-
+
</synopsis>
</function>
</construct>
@@ -9795,7 +9795,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
the owner of the file or be a privileged user.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
The file lives on a read-only file system.
-
+
</synopsis>
</function>
</construct>
@@ -9874,7 +9874,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
the owner of the file or be a privileged user.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
The file lives on a read-only file system.
-
+
</synopsis>
</function>
</construct>
@@ -9915,7 +9915,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The file is "append-only" or "immutable".
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
The operation was interrupted by a signal.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -9989,7 +9989,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The file is "append-only" or "immutable".
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
The operation was interrupted by a signal.
- &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -10049,7 +10049,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EEXIST
There is already a file named &lt;VAR&gt;filename&lt;/VAR&gt;. If you want to replace
this file, you must remove the old file explicitly first.
-
+
</synopsis>
</function>
</construct>
@@ -10322,14 +10322,14 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;SIG_DFL&lt;/CODE&gt;
&lt;DD&gt;
-
+
action for a signal
&lt;CODE&gt;SIG_DFL&lt;/CODE&gt; specifies the default action for the particular signal.
The default actions for various kinds of signals are stated in
Standard Signals.
&lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;SIG_IGN&lt;/CODE&gt;
&lt;DD&gt;
-
+
action for a signal
&lt;CODE&gt;SIG_IGN&lt;/CODE&gt; specifies that the signal should be ignored.
&lt;br&gt;&lt;br&gt; Your program generally should not ignore signals that represent serious
@@ -10347,7 +10347,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
running this handler as the way to deliver the signal.
&lt;br&gt;&lt;br&gt; For more information about defining signal handler functions,
see Defining Handlers.
-
+
&lt;br&gt;&lt;br&gt; If you set the action for a signal to &lt;CODE&gt;SIG_IGN&lt;/CODE&gt;, or if you set it
to &lt;CODE&gt;SIG_DFL&lt;/CODE&gt; and the default action is to ignore that signal, then
any pending signals of that type are discarded (even if they are
@@ -10365,7 +10365,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;LI&gt; EINVAL
You specified an invalid &lt;VAR&gt;signum&lt;/VAR&gt;; or you tried to ignore or provide
a handler for &lt;CODE&gt;SIGKILL&lt;/CODE&gt; or &lt;CODE&gt;SIGSTOP&lt;/CODE&gt;.
-
+
</synopsis>
</function>
</construct>
@@ -10468,7 +10468,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
The &lt;VAR&gt;signum&lt;/VAR&gt; argument is not valid, or you are trying to
trap or ignore &lt;CODE&gt;SIGKILL&lt;/CODE&gt; or &lt;CODE&gt;SIGSTOP&lt;/CODE&gt;.
-
+
</synopsis>
</function>
</construct>
@@ -10537,7 +10537,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
If the process is privileged, send the signal to all processes except
for some special system processes. Otherwise, send the signal to all
processes with the same effective user ID.
-
+
&lt;br&gt;&lt;br&gt; A process can send a signal to itself with a call like &lt;CODE&gt;kill
(getpid(), &lt;VAR&gt;signum&lt;/VAR&gt;)&lt;/CODE&gt;. If &lt;CODE&gt;kill&lt;/CODE&gt; is used by a process to send
a signal to itself, and the signal is not blocked, then &lt;CODE&gt;kill&lt;/CODE&gt;
@@ -10560,7 +10560,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
the processes in the process group named by &lt;VAR&gt;pid&lt;/VAR&gt;.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ESRCH
The &lt;VAR&gt;pid&lt;/VAR&gt; argument does not refer to an existing process or group.
-
+
</synopsis>
</function>
</construct>
@@ -10632,7 +10632,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
&lt;DD&gt;
The &lt;VAR&gt;signum&lt;/VAR&gt; argument doesn't specify a valid signal.
-
+
</synopsis>
</function>
</construct>
@@ -10672,7 +10672,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
&lt;DD&gt;
The &lt;VAR&gt;signum&lt;/VAR&gt; argument doesn't specify a valid signal.
-
+
</synopsis>
</function>
</construct>
@@ -10692,20 +10692,20 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
mask is changed, and must be one of the following values:
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
-
+
&lt;DT&gt;&lt;CODE&gt;SIG_BLOCK&lt;/CODE&gt;
&lt;DD&gt;
Block the signals in &lt;CODE&gt;set&lt;/CODE&gt;---add them to the existing mask. In
other words, the new mask is the union of the existing mask and
&lt;VAR&gt;set&lt;/VAR&gt;.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;DT&gt;&lt;CODE&gt;SIG_UNBLOCK&lt;/CODE&gt;
&lt;DD&gt;
Unblock the signals in &lt;VAR&gt;set&lt;/VAR&gt;---remove them from the existing mask.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;LI&gt; SIG_SETMASK
Use &lt;VAR&gt;set&lt;/VAR&gt; for the mask; ignore the previous value of the mask.
-
+
&lt;br&gt;&lt;br&gt; The last argument, &lt;VAR&gt;oldset&lt;/VAR&gt;, is used to return information about the
old process signal mask. If you just want to change the mask without
looking at it, pass a null pointer as the &lt;VAR&gt;oldset&lt;/VAR&gt; argument.
@@ -10728,7 +10728,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;LI&gt; EINVAL
The &lt;VAR&gt;how&lt;/VAR&gt; argument is invalid.
-
+
&lt;br&gt;&lt;br&gt; You can't block the &lt;CODE&gt;SIGKILL&lt;/CODE&gt; and &lt;CODE&gt;SIGSTOP&lt;/CODE&gt; signals, but
if the signal set includes these, &lt;CODE&gt;sigprocmask&lt;/CODE&gt; just ignores
them instead of returning an error status.
@@ -10783,7 +10783,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EINTR&lt;/CODE&gt;
&lt;DD&gt;
The function was interrupted by delivery of a signal.
-
+
&lt;br&gt;&lt;br&gt; If the signal causes program termination, &lt;CODE&gt;pause&lt;/CODE&gt; doesn't return
(obviously).
&lt;br&gt;&lt;br&gt; This function is a cancellation point in multithreaded programs. This
@@ -10909,7 +10909,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOMEM
The size of the alternate stack was too small.
It must be greater than &lt;CODE&gt;MINSIGSTKSZ&lt;/CODE&gt;.
-
+
</synopsis>
</function>
</construct>
@@ -11085,7 +11085,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
There are too many open files in the entire system. ,
for more information about &lt;CODE&gt;ENFILE&lt;/CODE&gt;. This error never occurs in
the GNU system.
-
+
</synopsis>
</function>
</construct>
@@ -11159,7 +11159,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EROFS
The directory that would contain the file resides on a read-only file
system.
-
+
</synopsis>
</function>
</construct>
@@ -11327,7 +11327,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;pre&gt;&lt;br&gt;
error (0, errno, format, the parameters)&lt;br&gt;
&lt;/pre&gt;
-
+
except that the global variables &lt;CODE&gt;error&lt;/CODE&gt; respects and modifies
are not used.
</synopsis>
@@ -11363,7 +11363,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;pre&gt;&lt;br&gt;
error (0, 0, format, the parameters)&lt;br&gt;
&lt;/pre&gt;
-
+
except that the global variables &lt;CODE&gt;error&lt;/CODE&gt; respects and modifies
are not used. The difference to &lt;CODE&gt;warn&lt;/CODE&gt; is that no error number
string is printed.
@@ -11401,7 +11401,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;pre&gt;&lt;br&gt;
error (status, errno, format, the parameters)&lt;br&gt;
&lt;/pre&gt;
-
+
except that the global variables &lt;CODE&gt;error&lt;/CODE&gt; respects and modifies
are not used and that the program is exited even if &lt;VAR&gt;status&lt;/VAR&gt; is zero.
</synopsis>
@@ -11439,7 +11439,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;pre&gt;&lt;br&gt;
error (status, 0, format, the parameters)&lt;br&gt;
&lt;/pre&gt;
-
+
except that the global variables &lt;CODE&gt;error&lt;/CODE&gt; respects and modifies
are not used and that the program is exited even if &lt;VAR&gt;status&lt;/VAR&gt;
is zero. The difference to &lt;CODE&gt;err&lt;/CODE&gt; is that no error number
@@ -11693,10 +11693,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
There was an error opening a directory, and you used the flag
&lt;CODE&gt;GLOB_ERR&lt;/CODE&gt; or your specified &lt;VAR&gt;errfunc&lt;/VAR&gt; returned a nonzero
value.
-
-
+
+
,
-
+
for an explanation of the &lt;CODE&gt;GLOB_ERR&lt;/CODE&gt; flag and &lt;VAR&gt;errfunc&lt;/VAR&gt;.
&lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;GLOB_NOMATCH&lt;/CODE&gt;
&lt;DD&gt;
@@ -12009,7 +12009,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; WRDE_SYNTAX
There was a syntax error in the input string. For example, an unmatched
quoting character is a syntax error.
-
+
</synopsis>
</function>
</construct>
@@ -12158,7 +12158,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
The calling process is already a process group leader, or there is
already another process group around that has the same process group ID.
-
+
</synopsis>
</function>
</construct>
@@ -12187,7 +12187,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
different sessions, and the implementation doesn't allow to access the
process group ID of the session leader of the process with ID &lt;VAR&gt;pid&lt;/VAR&gt;
from the calling process.
-
+
</synopsis>
</function>
</construct>
@@ -12227,7 +12227,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ESRCH
The process indicated by the &lt;VAR&gt;pid&lt;/VAR&gt; argument is not the calling
process or a child of the calling process.
-
+
</synopsis>
</function>
</construct>
@@ -12274,7 +12274,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
The terminal file associated with the &lt;VAR&gt;filedes&lt;/VAR&gt; argument isn't the
controlling terminal of the calling process.
-
+
</synopsis>
</function>
</construct>
@@ -12316,7 +12316,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EPERM
The &lt;VAR&gt;pgid&lt;/VAR&gt; isn't a process group in the same session as the calling
process.
-
+
</synopsis>
</function>
</construct>
@@ -12342,7 +12342,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
The calling process does not have a controlling terminal, or the file
is not the controlling terminal.
-
+
</synopsis>
</function>
</construct>
@@ -12479,7 +12479,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
horizontal tab
&lt;br&gt;&lt;br&gt; &lt;LI&gt; '\v'
vertical tab
-
+
</synopsis>
</function>
</construct>
@@ -12645,7 +12645,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
some standard properties each locale can define its own ones. In case
no property with the given name is known for the current locale
selected for the &lt;CODE&gt;LC_CTYPE&lt;/CODE&gt; category, the function returns zero.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
The properties known in every locale are:
&lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;DD&gt;&lt;br&gt;
@@ -12683,7 +12683,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
character (a letter or number); in other words, if either &lt;CODE&gt;iswalpha&lt;/CODE&gt;
or &lt;CODE&gt;iswdigit&lt;/CODE&gt; is true of a character, then &lt;CODE&gt;iswalnum&lt;/CODE&gt; is also
true.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("alnum"))&lt;br&gt;
@@ -12708,7 +12708,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;CODE&gt;iswalpha&lt;/CODE&gt; is true---letters which are neither upper case nor lower
case. But in the standard &lt;CODE&gt;"C"&lt;/CODE&gt; locale, there are no such
additional characters.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("alpha"))&lt;br&gt;
@@ -12728,7 +12728,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a control character (that is, a character that
is not a printing character).
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("cntrl"))&lt;br&gt;
@@ -12780,7 +12780,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a graphic character; that is, a character
that has a glyph associated with it. The whitespace characters are not
considered graphic.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("graph"))&lt;br&gt;
@@ -12800,7 +12800,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a lower-case letter. The letter need not be
from the Latin alphabet, any alphabet representable is valid.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("lower"))&lt;br&gt;
@@ -12820,7 +12820,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a printing character. Printing characters
include all the graphic characters, plus the space (&lt;samp&gt; &lt;/samp&gt;) character.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("print"))&lt;br&gt;
@@ -12841,7 +12841,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is a punctuation character.
This means any printing character that is not alphanumeric or a space
character.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("punct"))&lt;br&gt;
@@ -12877,8 +12877,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
horizontal tab
&lt;br&gt;&lt;br&gt; &lt;LI&gt; L'\v'
vertical tab
-
- &lt;br&gt;&lt;br&gt;
+
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("space"))&lt;br&gt;
@@ -12898,7 +12898,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
Returns true if &lt;VAR&gt;wc&lt;/VAR&gt; is an upper-case letter. The letter need not be
from the Latin alphabet, any alphabet representable is valid.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("upper"))&lt;br&gt;
@@ -12920,7 +12920,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Hexadecimal digits include the normal decimal digits &lt;samp&gt;0&lt;/samp&gt; through
&lt;samp&gt;9&lt;/samp&gt; and the letters &lt;samp&gt;A&lt;/samp&gt; through &lt;samp&gt;F&lt;/samp&gt; and
&lt;samp&gt;a&lt;/samp&gt; through &lt;samp&gt;f&lt;/samp&gt;.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
iswctype (wc, wctype ("xdigit"))&lt;br&gt;
@@ -12966,7 +12966,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
guaranteed to be available in every locale:
&lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;&lt;/pre&gt;
&lt;DD&gt;&lt;br&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
These functions are declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
</synopsis>
</function>
@@ -12985,7 +12985,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
according to the rules of the mapping for which &lt;VAR&gt;desc&lt;/VAR&gt; is a
descriptor, and returns the value it finds. &lt;VAR&gt;desc&lt;/VAR&gt; must be
obtained by a successful call to &lt;CODE&gt;wctrans&lt;/CODE&gt;.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
</synopsis>
</function>
@@ -13002,12 +13002,12 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
If &lt;VAR&gt;wc&lt;/VAR&gt; is an upper-case letter, &lt;CODE&gt;towlower&lt;/CODE&gt; returns the corresponding
lower-case letter. If &lt;VAR&gt;wc&lt;/VAR&gt; is not an upper-case letter,
&lt;VAR&gt;wc&lt;/VAR&gt; is returned unchanged.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;towlower&lt;/CODE&gt; can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
towctrans (wc, wctrans ("tolower"))&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
</synopsis>
</function>
@@ -13023,12 +13023,12 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
If &lt;VAR&gt;wc&lt;/VAR&gt; is a lower-case letter, &lt;CODE&gt;towupper&lt;/CODE&gt; returns the corresponding
upper-case letter. Otherwise &lt;VAR&gt;wc&lt;/VAR&gt; is returned unchanged.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;towupper&lt;/CODE&gt; can be implemented using
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
towctrans (wc, wctrans ("toupper"))&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
This function is declared in &lt;TT&gt;wctype.h&lt;/TT&gt;.
</synopsis>
</function>
@@ -13154,7 +13154,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
}&lt;br&gt;
}&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
When an error occurred the global variable &lt;VAR&gt;errno&lt;/VAR&gt; is set to
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
@@ -13163,7 +13163,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;LI&gt; ENOMSG
The set/message tuple does not name an existing element in the
message catalog.
-
+
&lt;br&gt;&lt;br&gt; While it sometimes can be useful to test for errors programs normally
will avoid any test. If the translation is not available it is no big
problem if the original, untranslated message is printed. Either the
@@ -13723,7 +13723,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The file resides on a read-only file system and any of &lt;CODE&gt;O_WRONLY&lt;/CODE&gt;,
&lt;CODE&gt;O_RDWR&lt;/CODE&gt;, and &lt;CODE&gt;O_TRUNC&lt;/CODE&gt; are set in the &lt;VAR&gt;flags&lt;/VAR&gt; argument,
or &lt;CODE&gt;O_CREAT&lt;/CODE&gt; is set and the file does not already exist.
-
+
&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; If on a 32 bit machine the sources are translated with
&lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; the function &lt;CODE&gt;open&lt;/CODE&gt; returns a file
descriptor opened in the large file mode which enables the file handling
@@ -13810,7 +13810,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
When the file is accessed by NFS, these errors from &lt;CODE&gt;write&lt;/CODE&gt; can sometimes
not be detected until &lt;CODE&gt;close&lt;/CODE&gt;. , for details
on their meaning.
-
+
&lt;br&gt;&lt;br&gt; Please note that there is &lt;EM&gt;no&lt;/EM&gt; separate &lt;CODE&gt;close64&lt;/CODE&gt; function.
This is not necessary since this function does not determine nor depend
on the mode of the file. The kernel which performs the &lt;CODE&gt;close&lt;/CODE&gt;
@@ -13896,7 +13896,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
In some systems, when reading from a character or block device, position
and size offsets must be aligned to a particular block size. This error
indicates that the offsets were not properly aligned.
-
+
&lt;br&gt;&lt;br&gt; Please note that there is no function named &lt;CODE&gt;read64&lt;/CODE&gt;. This is not
necessary since this function does not directly modify or handle the
possibly wide file offset. Since the kernel handles this state
@@ -13947,7 +13947,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ESPIPE
The file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt; is associate with a pipe or a FIFO and
this device does not allow positioning of the file pointer.
-
+
&lt;br&gt;&lt;br&gt; The function is an extension defined in the Unix Single Specification
version 2.
</synopsis>
@@ -14054,7 +14054,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
In some systems, when writing to a character or block device, position
and size offsets must be aligned to a particular block size. This error
indicates that the offsets were not properly aligned.
-
+
&lt;br&gt;&lt;br&gt; Unless you have arranged to prevent &lt;CODE&gt;EINTR&lt;/CODE&gt; failures, you should
check &lt;CODE&gt;errno&lt;/CODE&gt; after each failing call to &lt;CODE&gt;write&lt;/CODE&gt;, and if the
error was &lt;CODE&gt;EINTR&lt;/CODE&gt;, you should simply repeat the call.
@@ -14113,7 +14113,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ESPIPE
The file descriptor &lt;VAR&gt;filedes&lt;/VAR&gt; is associated with a pipe or a FIFO and
this device does not allow positioning of the file pointer.
-
+
&lt;br&gt;&lt;br&gt; The function is an extension defined in the Unix Single Specification
version 2.
</synopsis>
@@ -14178,7 +14178,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
current end. If you set the position past the current end, and
actually write data, you will extend the file with zeros up to that
position.
-
+
&lt;br&gt;&lt;br&gt; The return value from &lt;CODE&gt;lseek&lt;/CODE&gt; is normally the resulting file
position, measured in bytes from the beginning of the file.
You can use this feature together with &lt;CODE&gt;SEEK_CUR&lt;/CODE&gt; to read the
@@ -14213,7 +14213,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
such as a pipe, FIFO or terminal device. (POSIX.1 specifies this error
only for pipes and FIFOs, but in the GNU system, you always get
&lt;CODE&gt;ESPIPE&lt;/CODE&gt; if the object is not seekable.)
-
+
&lt;br&gt;&lt;br&gt; When the source file is compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; the
&lt;CODE&gt;lseek&lt;/CODE&gt; function is in fact &lt;CODE&gt;lseek64&lt;/CODE&gt; and the type
&lt;CODE&gt;off_t&lt;/CODE&gt; has 64 bits which makes it possible to handle files up to
@@ -14427,9 +14427,9 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;CODE&gt;NULL&lt;/CODE&gt; expresses no preference. Any previous mapping at that
address is automatically removed. The address you give may still be
changed, unless you use the &lt;CODE&gt;MAP_FIXED&lt;/CODE&gt; flag.
- &lt;br&gt;&lt;br&gt;
-
-
+ &lt;br&gt;&lt;br&gt;
+
+
&lt;VAR&gt;protect&lt;/VAR&gt; contains flags that control what kind of access is
permitted. They include &lt;CODE&gt;PROT_READ&lt;/CODE&gt;, &lt;CODE&gt;PROT_WRITE&lt;/CODE&gt;, and
&lt;CODE&gt;PROT_EXEC&lt;/CODE&gt;, which permit reading, writing, and execution,
@@ -14495,8 +14495,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; This file is of a type that doesn't support mapping.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOEXEC
&lt;br&gt;&lt;br&gt; The file is on a filesystem that doesn't support mapping.
- &lt;br&gt;&lt;br&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -14551,7 +14551,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
The memory range given was outside the user mmap range or wasn't page
aligned.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -14596,7 +14596,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
An invalid region was given, or the &lt;VAR&gt;flags&lt;/VAR&gt; were invalid.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EFAULT
There is no existing mapping in at least part of the given region.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -14638,7 +14638,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
available to extend it. Also, this error will occur if
&lt;CODE&gt;MREMAP_MAYMOVE&lt;/CODE&gt; is not given and the extension would collide with
another mapped region.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
</synopsis>
</function>
</construct>
@@ -14678,7 +14678,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The region is no longer needed. The kernel may free these pages,
causing any changes to the pages to be lost, as well as swapped
out pages to be discarded.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; The POSIX names are slightly different, but with the same meanings:
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
@@ -14692,7 +14692,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
This corresponds with BSD's &lt;CODE&gt;MADV_WILLNEED&lt;/CODE&gt;.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; POSIX_MADV_DONTNEED
This corresponds with BSD's &lt;CODE&gt;MADV_DONTNEED&lt;/CODE&gt;.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; &lt;CODE&gt;msync&lt;/CODE&gt; returns 0 for success and -1 for
error. Errors include:
&lt;DL&gt;
@@ -14701,7 +14701,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
An invalid region was given, or the &lt;VAR&gt;advice&lt;/VAR&gt; was invalid.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EFAULT
There is no existing mapping in at least part of the given region.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
</synopsis>
</function>
</construct>
@@ -14779,7 +14779,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
The &lt;VAR&gt;timeout&lt;/VAR&gt; argument is invalid; one of the components is negative
or too large.
-
+
</synopsis>
</function>
</construct>
@@ -14831,7 +14831,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The descriptor &lt;VAR&gt;fildes&lt;/VAR&gt; is not valid.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
No synchronization is possible since the system does not implement this.
-
+
</synopsis>
</function>
</construct>
@@ -14862,7 +14862,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The descriptor &lt;VAR&gt;fildes&lt;/VAR&gt; is not valid.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
No synchronization is possible since the system does not implement this.
-
+
</synopsis>
</function>
</construct>
@@ -15065,7 +15065,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; or &lt;CODE&gt;aiocbp-&gt;aio_reqpiro&lt;/CODE&gt; value is
invalid. This condition need not be recognized before enqueueing the
request and so this error might also be signaled asynchronously.
-
+
&lt;br&gt;&lt;br&gt; If &lt;CODE&gt;aio_read&lt;/CODE&gt; returns zero, the current status of the request
can be queried using &lt;CODE&gt;aio_error&lt;/CODE&gt; and &lt;CODE&gt;aio_return&lt;/CODE&gt; functions.
As long as the value returned by &lt;CODE&gt;aio_error&lt;/CODE&gt; is &lt;CODE&gt;EINPROGRESS&lt;/CODE&gt;
@@ -15081,10 +15081,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; descriptor is not valid.
&lt;LI&gt; ECANCELED
The operation was canceled before the operation was finished
-
+
&lt;LI&gt; EINVAL
The &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; value is invalid.
-
+
&lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
function is in fact &lt;CODE&gt;aio_read64&lt;/CODE&gt; since the LFS interface transparently
replaces the normal implementation.
@@ -15153,7 +15153,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; or &lt;CODE&gt;aiocbp-&gt;aio_reqprio&lt;/CODE&gt; value is
invalid. This condition may not be recognized before enqueueing the
request and so this error might also be signaled asynchronously.
-
+
&lt;br&gt;&lt;br&gt; In the case &lt;CODE&gt;aio_write&lt;/CODE&gt; returns zero, the current status of the
request can be queried using &lt;CODE&gt;aio_error&lt;/CODE&gt; and &lt;CODE&gt;aio_return&lt;/CODE&gt;
functions. As long as the value returned by &lt;CODE&gt;aio_error&lt;/CODE&gt; is
@@ -15170,10 +15170,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The &lt;CODE&gt;aiocbp-&gt;aio_fildes&lt;/CODE&gt; descriptor is not valid.
&lt;LI&gt; ECANCELED
The operation was canceled before the operation was finished.
-
+
&lt;LI&gt; EINVAL
The &lt;CODE&gt;aiocbp-&gt;aio_offset&lt;/CODE&gt; value is invalid.
-
+
&lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
function is in fact &lt;CODE&gt;aio_write64&lt;/CODE&gt; since the LFS interface transparently
replaces the normal implementation.
@@ -15274,7 +15274,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
each request should be checked to determine which one failed.
&lt;LI&gt; ENOSYS
The &lt;CODE&gt;lio_listio&lt;/CODE&gt; function is not supported.
-
+
&lt;br&gt;&lt;br&gt; If the &lt;VAR&gt;mode&lt;/VAR&gt; parameter is &lt;CODE&gt;LIO_NOWAIT&lt;/CODE&gt; and the caller cancels
a request, the error status for this request returned by
&lt;CODE&gt;aio_error&lt;/CODE&gt; is &lt;CODE&gt;ECANCELED&lt;/CODE&gt;.
@@ -15446,7 +15446,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
parameter is other than &lt;CODE&gt;O_DSYNC&lt;/CODE&gt; and &lt;CODE&gt;O_SYNC&lt;/CODE&gt;.
&lt;LI&gt; ENOSYS
This function is not implemented.
-
+
&lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
function is in fact &lt;CODE&gt;aio_fsync64&lt;/CODE&gt; since the LFS interface
transparently replaces the normal implementation.
@@ -15511,7 +15511,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
of one of the requests.
&lt;LI&gt; ENOSYS
The &lt;CODE&gt;aio_suspend&lt;/CODE&gt; function is not implemented.
-
+
&lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; this
function is in fact &lt;CODE&gt;aio_suspend64&lt;/CODE&gt; since the LFS interface
transparently replaces the normal implementation.
@@ -15583,7 +15583,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The file descriptor &lt;VAR&gt;fildes&lt;/VAR&gt; is not valid.
&lt;LI&gt; ENOSYS
&lt;CODE&gt;aio_cancel&lt;/CODE&gt; is not implemented.
-
+
&lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt;, this
function is in fact &lt;CODE&gt;aio_cancel64&lt;/CODE&gt; since the LFS interface
transparently replaces the normal implementation.
@@ -15720,7 +15720,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; F_SETOWN
Set process or process group ID to receive &lt;CODE&gt;SIGIO&lt;/CODE&gt; signals.
.
-
+
&lt;br&gt;&lt;br&gt; This function is a cancellation point in multi-threaded programs. This
is a problem if the thread allocates some resources (like memory, file
descriptors, semaphores or whatever) at the time &lt;CODE&gt;fcntl&lt;/CODE&gt; is
@@ -16719,7 +16719,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
determined by the currently selected locale. In the standard &lt;CODE&gt;"C"&lt;/CODE&gt;
locale the characters "A and "a do not match but in a locale which
regards these characters as parts of the alphabet they do match.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;strcasecmp&lt;/CODE&gt; is derived from BSD.
</synopsis>
</function>
@@ -16739,7 +16739,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
determined by the currently selected locale. In the standard &lt;CODE&gt;"C"&lt;/CODE&gt;
locale the characters "A and "a do not match but in a locale which
regards these characters as parts of the alphabet they do match.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;wcscasecmp&lt;/CODE&gt; is a GNU extension.
</synopsis>
</function>
@@ -16794,7 +16794,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
This function is like &lt;CODE&gt;strncmp&lt;/CODE&gt;, except that differences in case
are ignored. Like &lt;CODE&gt;strcasecmp&lt;/CODE&gt;, it is locale dependent how
uppercase and lowercase characters are related.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;strncasecmp&lt;/CODE&gt; is a GNU extension.
</synopsis>
</function>
@@ -16813,7 +16813,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
This function is like &lt;CODE&gt;wcsncmp&lt;/CODE&gt;, except that differences in case
are ignored. Like &lt;CODE&gt;wcscasecmp&lt;/CODE&gt;, it is locale dependent how
uppercase and lowercase characters are related.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;wcsncasecmp&lt;/CODE&gt; is a GNU extension.
</synopsis>
</function>
@@ -17049,7 +17049,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
rawmemchr (str, '\0')&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
will never go beyond the end of the string.
&lt;br&gt;&lt;br&gt; This function is a GNU extension.
</synopsis>
@@ -18331,7 +18331,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
app -foo&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
the &lt;CODE&gt;getopt_long_only&lt;/CODE&gt; will first look for a long option named
&lt;samp&gt;foo&lt;/samp&gt;. If this is not found, the short options &lt;samp&gt;f&lt;/samp&gt;, &lt;samp&gt;o&lt;/samp&gt;,
and again &lt;samp&gt;o&lt;/samp&gt; are recognized.
@@ -18375,7 +18375,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
div_t result;&lt;br&gt;
result = div (20, -6);&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
Now &lt;CODE&gt;result.quot&lt;/CODE&gt; is &lt;CODE&gt;-3&lt;/CODE&gt; and &lt;CODE&gt;result.rem&lt;/CODE&gt; is &lt;CODE&gt;2&lt;/CODE&gt;.
</synopsis>
</function>
@@ -20475,7 +20475,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<header filename = "math.h"/>
</headers>
<synopsis>
-
+
The &lt;CODE&gt;fma&lt;/CODE&gt; function performs floating-point multiply-add. This is
the operation (&lt;VAR&gt;x&lt;/VAR&gt; &lt;VAR&gt;y&lt;/VAR&gt;) + &lt;VAR&gt;z&lt;/VAR&gt;, but the
intermediate result is not rounded to the destination type. This can
@@ -20485,7 +20485,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
directly, because the expression &lt;samp&gt;x*y + z&lt;/samp&gt; is defined to round the
intermediate result. &lt;CODE&gt;fma&lt;/CODE&gt; lets you choose when you want to round
only once.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
On processors which do not implement multiply-add in hardware,
&lt;CODE&gt;fma&lt;/CODE&gt; can be very slow since it must avoid intermediate rounding.
&lt;TT&gt;math.h&lt;/TT&gt; defines the symbols &lt;CODE&gt;FP_FAST_FMA&lt;/CODE&gt;,
@@ -20507,7 +20507,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<header filename = "math.h"/>
</headers>
<synopsis>
-
+
The &lt;CODE&gt;fma&lt;/CODE&gt; function performs floating-point multiply-add. This is
the operation (&lt;VAR&gt;x&lt;/VAR&gt; &lt;VAR&gt;y&lt;/VAR&gt;) + &lt;VAR&gt;z&lt;/VAR&gt;, but the
intermediate result is not rounded to the destination type. This can
@@ -20517,7 +20517,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
directly, because the expression &lt;samp&gt;x*y + z&lt;/samp&gt; is defined to round the
intermediate result. &lt;CODE&gt;fma&lt;/CODE&gt; lets you choose when you want to round
only once.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
On processors which do not implement multiply-add in hardware,
&lt;CODE&gt;fma&lt;/CODE&gt; can be very slow since it must avoid intermediate rounding.
&lt;TT&gt;math.h&lt;/TT&gt; defines the symbols &lt;CODE&gt;FP_FAST_FMA&lt;/CODE&gt;,
@@ -20539,7 +20539,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<header filename = "math.h"/>
</headers>
<synopsis>
-
+
The &lt;CODE&gt;fma&lt;/CODE&gt; function performs floating-point multiply-add. This is
the operation (&lt;VAR&gt;x&lt;/VAR&gt; &lt;VAR&gt;y&lt;/VAR&gt;) + &lt;VAR&gt;z&lt;/VAR&gt;, but the
intermediate result is not rounded to the destination type. This can
@@ -20549,7 +20549,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
directly, because the expression &lt;samp&gt;x*y + z&lt;/samp&gt; is defined to round the
intermediate result. &lt;CODE&gt;fma&lt;/CODE&gt; lets you choose when you want to round
only once.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
On processors which do not implement multiply-add in hardware,
&lt;CODE&gt;fma&lt;/CODE&gt; can be very slow since it must avoid intermediate rounding.
&lt;TT&gt;math.h&lt;/TT&gt; defines the symbols &lt;CODE&gt;FP_FAST_FMA&lt;/CODE&gt;,
@@ -21663,7 +21663,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<header filename = "wchar.h"/>
</headers>
<synopsis>
-
+
The &lt;CODE&gt;mbrtowc&lt;/CODE&gt; function (``multibyte restartable to wide
character'') converts the next multibyte character in the string pointed
to by &lt;VAR&gt;s&lt;/VAR&gt; into a wide character and stores it in the wide character
@@ -21749,7 +21749,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
wcrtombs (temp_buf, L'\0', ps)&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
since, if &lt;VAR&gt;s&lt;/VAR&gt; is a null pointer, &lt;CODE&gt;wcrtomb&lt;/CODE&gt; performs as if it
writes into an internal buffer, which is guaranteed to be large enough.
&lt;br&gt;&lt;br&gt; If &lt;VAR&gt;wc&lt;/VAR&gt; is the NUL wide character, &lt;CODE&gt;wcrtomb&lt;/CODE&gt; emits, if
@@ -22130,7 +22130,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Not enough memory to carry out the operation.
&lt;LI&gt; EINVAL
The conversion from &lt;VAR&gt;fromcode&lt;/VAR&gt; to &lt;VAR&gt;tocode&lt;/VAR&gt; is not supported.
-
+
&lt;br&gt;&lt;br&gt; It is not possible to use the same descriptor in different threads to
perform independent conversions. The data structures associated
with the descriptor include information about the conversion state.
@@ -22183,7 +22183,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EBADF&lt;/CODE&gt;
&lt;DD&gt;
The conversion descriptor is invalid.
-
+
&lt;br&gt;&lt;br&gt; The &lt;CODE&gt;iconv_close&lt;/CODE&gt; function was introduced together with the rest
of the &lt;CODE&gt;iconv&lt;/CODE&gt; functions in XPG2 and is declared in &lt;TT&gt;iconv.h&lt;/TT&gt;.
</synopsis>
@@ -22202,7 +22202,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<header filename = "iconv.h"/>
</headers>
<synopsis>
-
+
The &lt;CODE&gt;iconv&lt;/CODE&gt; function converts the text in the input buffer
according to the rules associated with the descriptor &lt;VAR&gt;cd&lt;/VAR&gt; and
stores the result in the output buffer. It is possible to call the
@@ -22272,7 +22272,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
of the input buffer.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EBADF
The &lt;VAR&gt;cd&lt;/VAR&gt; argument is invalid.
-
+
&lt;br&gt;&lt;br&gt; The &lt;CODE&gt;iconv&lt;/CODE&gt; function was introduced in the XPG2 standard and is
declared in the &lt;TT&gt;iconv.h&lt;/TT&gt; header.
</synopsis>
@@ -23035,7 +23035,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
low order bits of this parameter when they are allocated (except when
allocated by &lt;CODE&gt;calloc&lt;/CODE&gt;) and freed. This can be used to debug the
use of uninitialized or freed heap memory.
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -23670,7 +23670,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
The request would cause the data segment to overlap another segment or
exceed the process' data storage limit.
-
+
&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -23716,7 +23716,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;VAR&gt;len&lt;/VAR&gt; is not positive.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
The kernel does not provide &lt;CODE&gt;mlock&lt;/CODE&gt; capability.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; You can lock &lt;EM&gt;all&lt;/EM&gt; a process' memory with &lt;CODE&gt;mlockall&lt;/CODE&gt;. You
unlock memory with &lt;CODE&gt;munlock&lt;/CODE&gt; or &lt;CODE&gt;munlockall&lt;/CODE&gt;.
&lt;br&gt;&lt;br&gt; To avoid all page faults in a C program, you have to use
@@ -23774,7 +23774,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
affect future address spaces owned by the same process so exec, which
replaces a process' address space, wipes out &lt;CODE&gt;MCL_FUTURE&lt;/CODE&gt;.
.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; When the function returns successfully, and you specified
&lt;CODE&gt;MCL_CURRENT&lt;/CODE&gt;, all of the process' pages are backed by (connected
to) real frames (they are resident) and are marked to stay that way.
@@ -23808,7 +23808,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Undefined bits in &lt;VAR&gt;flags&lt;/VAR&gt; are not zero.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOSYS
The kernel does not provide &lt;CODE&gt;mlockall&lt;/CODE&gt; capability.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; You can lock just specific pages with &lt;CODE&gt;mlock&lt;/CODE&gt;. You unlock pages
with &lt;CODE&gt;munlockall&lt;/CODE&gt; and &lt;CODE&gt;munlock&lt;/CODE&gt;.
&lt;br&gt;&lt;br&gt;
@@ -23856,7 +23856,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;RUSAGE_CHILDREN&lt;/CODE&gt;
&lt;DD&gt;
All child processes (direct and indirect) that have already terminated.
-
+
&lt;br&gt;&lt;br&gt; In the GNU system, you can also inquire about a particular child process
by specifying its process ID.
&lt;br&gt;&lt;br&gt; The return value of &lt;CODE&gt;getrusage&lt;/CODE&gt; is zero for success, and &lt;CODE&gt;-1&lt;/CODE&gt;
@@ -23865,7 +23865,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;LI&gt; EINVAL
The argument &lt;VAR&gt;processes&lt;/VAR&gt; is not valid.
-
+
</synopsis>
</function>
</construct>
@@ -24025,8 +24025,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Disk reads. Analogous to &lt;CODE&gt;ru_inblk&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
&lt;LI&gt; vm_oublk
Disk writes. Analogous to &lt;CODE&gt;ru_oublk&lt;/CODE&gt; in &lt;CODE&gt;struct rusage&lt;/CODE&gt;
-
-
+
+
&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; The return value is zero if the function succeeds; &lt;CODE&gt;-1&lt;/CODE&gt; otherwise.
&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
</synopsis>
@@ -24096,7 +24096,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt;
The process tried to raise a maximum limit, but is not superuser.
&lt;/OL&gt;
-
+
&lt;br&gt;&lt;br&gt; When the sources are compiled with &lt;CODE&gt;_FILE_OFFSET_BITS == 64&lt;/CODE&gt; on a
32-bit system this function is in fact &lt;CODE&gt;setrlimit64&lt;/CODE&gt;. Thus, the
LFS interface transparently replaces the old interface.
@@ -24186,7 +24186,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
Set the current and maximum limit on the size of a file to &lt;VAR&gt;limit&lt;/VAR&gt; *
512 bytes.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; There are also some other &lt;VAR&gt;cmd&lt;/VAR&gt; values that may do things on some
systems, but they are not supported.
&lt;br&gt;&lt;br&gt; Only the superuser may increase a maximum limit.
@@ -24198,7 +24198,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;LI&gt; EPERM
A process tried to increase a maximum limit, but is not superuser.
-
+
&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -24231,14 +24231,14 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
Maximum core file size. Same as &lt;CODE&gt;RLIMIT_COR&lt;/CODE&gt; for &lt;CODE&gt;setrlimit&lt;/CODE&gt;.
&lt;LI&gt; LIM_MAXRSS
Maximum physical memory. Same as &lt;CODE&gt;RLIMIT_RSS&lt;/CODE&gt; for &lt;CODE&gt;setrlimit&lt;/CODE&gt;.
-
+
&lt;br&gt;&lt;br&gt; The return value is zero for success, and &lt;CODE&gt;-1&lt;/CODE&gt; with &lt;CODE&gt;errno&lt;/CODE&gt; set
accordingly for failure:
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
&lt;LI&gt; EPERM
The process tried to set its current limit beyond its maximum limit.
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -24278,7 +24278,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
First In First Out
&lt;LI&gt; SCHED_RR
Round Robin
-
+
&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; On success, the return value is &lt;CODE&gt;0&lt;/CODE&gt;. Otherwise, it is &lt;CODE&gt;-1&lt;/CODE&gt;
and &lt;CODE&gt;ERRNO&lt;/CODE&gt; is set accordingly. The &lt;CODE&gt;errno&lt;/CODE&gt; values specific
to this function are:
@@ -24311,7 +24311,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt;
&lt;VAR&gt;pid&lt;/VAR&gt; is negative.
&lt;/OL&gt;
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -24339,7 +24339,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
There is no process with pid &lt;VAR&gt;pid&lt;/VAR&gt; and it is not zero.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
&lt;VAR&gt;pid&lt;/VAR&gt; is negative.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; Note that this function is not an exact mate to &lt;CODE&gt;sched_setscheduler&lt;/CODE&gt;
because while that function sets the scheduling policy and the absolute
priority, this function gets only the scheduling policy. To get the
@@ -24390,7 +24390,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
There is no process with pid &lt;VAR&gt;pid&lt;/VAR&gt; and it is not zero.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
&lt;VAR&gt;pid&lt;/VAR&gt; is negative.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -24415,7 +24415,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
&lt;DD&gt;
&lt;VAR&gt;policy&lt;/VAR&gt; does not identify an existing scheduling policy.
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -24440,7 +24440,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
&lt;DD&gt;
&lt;VAR&gt;policy&lt;/VAR&gt; does not identify an existing scheduling policy.
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -24525,7 +24525,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
process.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
The value of &lt;VAR&gt;class&lt;/VAR&gt; is not valid.
-
+
&lt;br&gt;&lt;br&gt; If the return value is &lt;CODE&gt;-1&lt;/CODE&gt;, it could indicate failure, or it could
be the nice value. The only way to make certain is to set &lt;CODE&gt;errno =
0&lt;/CODE&gt; before calling &lt;CODE&gt;getpriority&lt;/CODE&gt;, then use &lt;CODE&gt;errno != 0&lt;/CODE&gt;
@@ -24565,7 +24565,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
The call would lower the process' nice value and the process does not have
&lt;CODE&gt;CAP_SYS_NICE&lt;/CODE&gt; permission.
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -24629,7 +24629,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
No process or thread with the given ID found.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EFAULT
The pointer &lt;VAR&gt;cpuset&lt;/VAR&gt; is does not point to a valid object.
-
+
&lt;br&gt;&lt;br&gt; This function is a GNU extension and is declared in &lt;TT&gt;sched.h&lt;/TT&gt;.
</synopsis>
</function>
@@ -24661,7 +24661,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
The bitset is not valid. This might mean that the affinity set might
not leave a processor for the process or thread to run on.
-
+
&lt;br&gt;&lt;br&gt; This function is a GNU extension and is declared in &lt;TT&gt;sched.h&lt;/TT&gt;.
</synopsis>
</function>
@@ -24820,7 +24820,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ERANGE
The buffer length &lt;VAR&gt;len&lt;/VAR&gt; is too small to store the string to be
returned.
-
+
</synopsis>
</function>
</construct>
@@ -24890,7 +24890,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not a valid file descriptor.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal.
-
+
</synopsis>
</function>
</construct>
@@ -24914,19 +24914,19 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;TCSANOW&lt;/CODE&gt;
&lt;DD&gt;
-
+
Make the change immediately.
&lt;br&gt;&lt;br&gt; &lt;DT&gt;&lt;CODE&gt;TCSADRAIN&lt;/CODE&gt;
&lt;DD&gt;
-
+
Make the change after waiting until all queued output has been written.
You should usually use this option when changing parameters that affect
output.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; TCSAFLUSH
-
+
This is like &lt;CODE&gt;TCSADRAIN&lt;/CODE&gt;, but also discards any queued input.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; TCSASOFT
-
+
This is a flag bit that you can add to any of the above alternatives.
Its meaning is to inhibit alteration of the state of the terminal
hardware. It is a BSD extension; it is only supported on BSD systems
@@ -24934,7 +24934,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; Using &lt;CODE&gt;TCSASOFT&lt;/CODE&gt; is exactly the same as setting the &lt;CODE&gt;CIGNORE&lt;/CODE&gt;
bit in the &lt;CODE&gt;c_cflag&lt;/CODE&gt; member of the structure &lt;VAR&gt;termios-p&lt;/VAR&gt; points
to. , for a description of &lt;CODE&gt;CIGNORE&lt;/CODE&gt;.
-
+
&lt;br&gt;&lt;br&gt; If this function is called from a background process on its controlling
terminal, normally all processes in the process group are sent a
&lt;CODE&gt;SIGTTOU&lt;/CODE&gt; signal, in the same way as if the process were trying to
@@ -24953,7 +24953,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
Either the value of the &lt;CODE&gt;when&lt;/CODE&gt; argument is not valid, or there is
something wrong with the data in the &lt;VAR&gt;termios-p&lt;/VAR&gt; argument.
-
+
</synopsis>
</function>
</construct>
@@ -25157,7 +25157,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The &lt;VAR&gt;filedes&lt;/VAR&gt; is not a valid file descriptor.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; ENOTTY
The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal device.
-
+
</synopsis>
</function>
</construct>
@@ -25191,7 +25191,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINTR
The operation was interrupted by delivery of a signal.
.
-
+
</synopsis>
</function>
</construct>
@@ -25211,18 +25211,18 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
following values:
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
-
+
&lt;DT&gt;&lt;CODE&gt;TCIFLUSH&lt;/CODE&gt;
&lt;DD&gt;
&lt;br&gt;&lt;br&gt; Clear any input data received, but not yet read.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;DT&gt;&lt;CODE&gt;TCOFLUSH&lt;/CODE&gt;
&lt;DD&gt;
&lt;br&gt;&lt;br&gt; Clear any output data written, but not yet transmitted.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;LI&gt; TCIOFLUSH
&lt;br&gt;&lt;br&gt; Clear both queued input and output.
-
+
&lt;br&gt;&lt;br&gt; The return value is normally zero. In the event of an error, a value
of -1 is returned. The following &lt;CODE&gt;errno&lt;/CODE&gt; error conditions
are defined for this function:
@@ -25234,7 +25234,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal device.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
A bad value was supplied as the &lt;VAR&gt;queue&lt;/VAR&gt; argument.
-
+
&lt;br&gt;&lt;br&gt; It is unfortunate that this function is named &lt;CODE&gt;tcflush&lt;/CODE&gt;, because
the term ``flush'' is normally used for quite another operation---waiting
until all output is transmitted---and using it for discarding input or
@@ -25259,21 +25259,21 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
be one of the following values:
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
-
+
&lt;DT&gt;&lt;CODE&gt;TCOOFF&lt;/CODE&gt;
&lt;DD&gt;
Suspend transmission of output.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;DT&gt;&lt;CODE&gt;TCOON&lt;/CODE&gt;
&lt;DD&gt;
Restart transmission of output.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;LI&gt; TCIOFF
Transmit a STOP character.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;LI&gt; TCION
Transmit a START character.
-
+
&lt;br&gt;&lt;br&gt; For more information about the STOP and START characters, see Special
Characters.
&lt;br&gt;&lt;br&gt; The return value is normally zero. In the event of an error, a value
@@ -25281,16 +25281,16 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
are defined for this function:
&lt;br&gt;&lt;br&gt; &lt;DL&gt;
-
+
&lt;LI&gt; EBADF
The &lt;VAR&gt;filedes&lt;/VAR&gt; is not a valid file descriptor.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;LI&gt; ENOTTY
The &lt;VAR&gt;filedes&lt;/VAR&gt; is not associated with a terminal device.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;LI&gt; EINVAL
A bad value was supplied as the &lt;VAR&gt;action&lt;/VAR&gt; argument.
-
+
</synopsis>
</function>
</construct>
@@ -25313,7 +25313,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;ENOENT&lt;/CODE&gt;
&lt;DD&gt;
There are no free master pseudo-terminals available.
-
+
&lt;br&gt;&lt;br&gt; This function is a GNU extension.
</synopsis>
</function>
@@ -25354,7 +25354,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EACCES
The slave pseudo-terminal device corresponding to the master associated
with &lt;VAR&gt;filedes&lt;/VAR&gt; could not be accessed.
-
+
&lt;br&gt;&lt;br&gt;
</synopsis>
</function>
@@ -25384,7 +25384,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
The &lt;VAR&gt;filedes&lt;/VAR&gt; argument is not associated with a master pseudo-terminal
device.
-
+
</synopsis>
</function>
</construct>
@@ -25454,7 +25454,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;ENOENT&lt;/CODE&gt;
&lt;DD&gt;
There are no free pseudo-terminal pairs available.
-
+
&lt;br&gt;&lt;br&gt; Warning: Using the &lt;CODE&gt;openpty&lt;/CODE&gt; function with &lt;VAR&gt;name&lt;/VAR&gt; not
set to &lt;CODE&gt;NULL&lt;/CODE&gt; is very dangerous because it provides no
protection against overflowing the string &lt;VAR&gt;name&lt;/VAR&gt;. You should use
@@ -25576,7 +25576,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
exactly the opposite.
&lt;br&gt;&lt;br&gt; &lt;LI&gt; LOG_ODELAY
This bit does nothing. It exists for backward compatibility.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; If any other bit in &lt;VAR&gt;options&lt;/VAR&gt; is on, the result is undefined.
&lt;br&gt;&lt;br&gt; &lt;VAR&gt;facility&lt;/VAR&gt; is the default facility code for this connection. A
&lt;CODE&gt;syslog&lt;/CODE&gt; on this connection that specifies default facility causes
@@ -25994,7 +25994,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
system call failed. In that case, &lt;CODE&gt;syscall&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt; and
sets &lt;CODE&gt;errno&lt;/CODE&gt; to an error code that the system call returned. Note
that system calls do not return &lt;CODE&gt;-1&lt;/CODE&gt; when they succeed.
-
+
&lt;br&gt;&lt;br&gt; If you specify an invalid &lt;VAR&gt;sysno&lt;/VAR&gt;, &lt;CODE&gt;syscall&lt;/CODE&gt; returns &lt;CODE&gt;-1&lt;/CODE&gt;
with &lt;CODE&gt;errno&lt;/CODE&gt; = &lt;CODE&gt;ENOSYS&lt;/CODE&gt;.
&lt;br&gt;&lt;br&gt; Example:
@@ -26336,10 +26336,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex sine of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex sine is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
sin (z) = 1/(2*i) * (exp (z*i) - exp (-z*i)).
-
-
+
+
</synopsis>
</function>
</construct>
@@ -26354,10 +26354,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex sine of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex sine is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
sin (z) = 1/(2*i) * (exp (z*i) - exp (-z*i)).
-
-
+
+
</synopsis>
</function>
</construct>
@@ -26372,10 +26372,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex sine of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex sine is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
sin (z) = 1/(2*i) * (exp (z*i) - exp (-z*i)).
-
-
+
+
</synopsis>
</function>
</construct>
@@ -26390,10 +26390,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex cosine of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex cosine is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
cos (z) = 1/2 * (exp (z*i) + exp (-z*i))
-
-
+
+
</synopsis>
</function>
</construct>
@@ -26408,10 +26408,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex cosine of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex cosine is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
cos (z) = 1/2 * (exp (z*i) + exp (-z*i))
-
-
+
+
</synopsis>
</function>
</construct>
@@ -26426,10 +26426,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex cosine of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex cosine is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
cos (z) = 1/2 * (exp (z*i) + exp (-z*i))
-
-
+
+
</synopsis>
</function>
</construct>
@@ -26444,11 +26444,11 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex tangent of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex tangent is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
tan (z) = -i * (exp (z*i) - exp (-z*i)) / (exp (z*i) + exp (-z*i))
-
-
- &lt;br&gt;&lt;br&gt;
+
+
+ &lt;br&gt;&lt;br&gt;
The complex tangent has poles at pi/2 + 2n, where n is an
integer. &lt;CODE&gt;ctan&lt;/CODE&gt; may signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; is too close to a
pole.
@@ -26466,11 +26466,11 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex tangent of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex tangent is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
tan (z) = -i * (exp (z*i) - exp (-z*i)) / (exp (z*i) + exp (-z*i))
-
-
- &lt;br&gt;&lt;br&gt;
+
+
+ &lt;br&gt;&lt;br&gt;
The complex tangent has poles at pi/2 + 2n, where n is an
integer. &lt;CODE&gt;ctan&lt;/CODE&gt; may signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; is too close to a
pole.
@@ -26488,11 +26488,11 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the complex tangent of &lt;VAR&gt;z&lt;/VAR&gt;.
The mathematical definition of the complex tangent is
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
tan (z) = -i * (exp (z*i) - exp (-z*i)) / (exp (z*i) + exp (-z*i))
-
-
- &lt;br&gt;&lt;br&gt;
+
+
+ &lt;br&gt;&lt;br&gt;
The complex tangent has poles at pi/2 + 2n, where n is an
integer. &lt;CODE&gt;ctan&lt;/CODE&gt; may signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; is too close to a
pole.
@@ -27603,10 +27603,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
These functions return &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural
logarithms) raised to the power of &lt;VAR&gt;z&lt;/VAR&gt;.
Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
exp (z) = exp (creal (z)) * (cos (cimag (z)) + I * sin (cimag (z)))
-
-
+
+
</synopsis>
</function>
</construct>
@@ -27622,10 +27622,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
These functions return &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural
logarithms) raised to the power of &lt;VAR&gt;z&lt;/VAR&gt;.
Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
exp (z) = exp (creal (z)) * (cos (cimag (z)) + I * sin (cimag (z)))
-
-
+
+
</synopsis>
</function>
</construct>
@@ -27641,10 +27641,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
These functions return &lt;CODE&gt;e&lt;/CODE&gt; (the base of natural
logarithms) raised to the power of &lt;VAR&gt;z&lt;/VAR&gt;.
Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
exp (z) = exp (creal (z)) * (cos (cimag (z)) + I * sin (cimag (z)))
-
-
+
+
</synopsis>
</function>
</construct>
@@ -27659,11 +27659,11 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the natural logarithm of &lt;VAR&gt;z&lt;/VAR&gt;.
Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
log (z) = log (cabs (z)) + I * carg (z)
-
-
- &lt;br&gt;&lt;br&gt;
+
+
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;clog&lt;/CODE&gt; has a pole at 0, and will signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; equals
or is very close to 0. It is well-defined for all other values of
&lt;VAR&gt;z&lt;/VAR&gt;.
@@ -27681,11 +27681,11 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the natural logarithm of &lt;VAR&gt;z&lt;/VAR&gt;.
Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
log (z) = log (cabs (z)) + I * carg (z)
-
-
- &lt;br&gt;&lt;br&gt;
+
+
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;clog&lt;/CODE&gt; has a pole at 0, and will signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; equals
or is very close to 0. It is well-defined for all other values of
&lt;VAR&gt;z&lt;/VAR&gt;.
@@ -27703,11 +27703,11 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the natural logarithm of &lt;VAR&gt;z&lt;/VAR&gt;.
Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
log (z) = log (cabs (z)) + I * carg (z)
-
-
- &lt;br&gt;&lt;br&gt;
+
+
+ &lt;br&gt;&lt;br&gt;
&lt;CODE&gt;clog&lt;/CODE&gt; has a pole at 0, and will signal overflow if &lt;VAR&gt;z&lt;/VAR&gt; equals
or is very close to 0. It is well-defined for all other values of
&lt;VAR&gt;z&lt;/VAR&gt;.
@@ -27725,10 +27725,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the base 10 logarithm of the complex value
&lt;VAR&gt;z&lt;/VAR&gt;. Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
log (z) = log10 (cabs (z)) + I * carg (z)
-
-
+
+
&lt;br&gt;&lt;br&gt; These functions are GNU extensions.
</synopsis>
</function>
@@ -27744,10 +27744,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the base 10 logarithm of the complex value
&lt;VAR&gt;z&lt;/VAR&gt;. Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
log (z) = log10 (cabs (z)) + I * carg (z)
-
-
+
+
&lt;br&gt;&lt;br&gt; These functions are GNU extensions.
</synopsis>
</function>
@@ -27763,10 +27763,10 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
These functions return the base 10 logarithm of the complex value
&lt;VAR&gt;z&lt;/VAR&gt;. Mathematically, this corresponds to the value
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
log (z) = log10 (cabs (z)) + I * carg (z)
-
-
+
+
&lt;br&gt;&lt;br&gt; These functions are GNU extensions.
</synopsis>
</function>
@@ -28400,12 +28400,12 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;erf&lt;/CODE&gt; returns the error function of &lt;VAR&gt;x&lt;/VAR&gt;. The error
function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
erf (x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt&lt;br&gt;
&lt;/pre&gt;
-
+
</synopsis>
</function>
</construct>
@@ -28420,12 +28420,12 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;erf&lt;/CODE&gt; returns the error function of &lt;VAR&gt;x&lt;/VAR&gt;. The error
function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
erf (x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt&lt;br&gt;
&lt;/pre&gt;
-
+
</synopsis>
</function>
</construct>
@@ -28440,12 +28440,12 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;erf&lt;/CODE&gt; returns the error function of &lt;VAR&gt;x&lt;/VAR&gt;. The error
function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
erf (x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt&lt;br&gt;
&lt;/pre&gt;
-
+
</synopsis>
</function>
</construct>
@@ -28502,8 +28502,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;lgamma&lt;/CODE&gt; returns the natural logarithm of the absolute value of
the gamma function of &lt;VAR&gt;x&lt;/VAR&gt;. The gamma function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
@@ -28536,8 +28536,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;lgamma&lt;/CODE&gt; returns the natural logarithm of the absolute value of
the gamma function of &lt;VAR&gt;x&lt;/VAR&gt;. The gamma function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
@@ -28570,8 +28570,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;lgamma&lt;/CODE&gt; returns the natural logarithm of the absolute value of
the gamma function of &lt;VAR&gt;x&lt;/VAR&gt;. The gamma function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
@@ -28700,12 +28700,12 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;tgamma&lt;/CODE&gt; applies the gamma function to &lt;VAR&gt;x&lt;/VAR&gt;. The gamma
function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
&lt;/pre&gt;
-
+
&lt;br&gt;&lt;br&gt; This function was introduced in ISO C99.
</synopsis>
</function>
@@ -28721,12 +28721,12 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;tgamma&lt;/CODE&gt; applies the gamma function to &lt;VAR&gt;x&lt;/VAR&gt;. The gamma
function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
&lt;/pre&gt;
-
+
&lt;br&gt;&lt;br&gt; This function was introduced in ISO C99.
</synopsis>
</function>
@@ -28742,12 +28742,12 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
<synopsis>
&lt;CODE&gt;tgamma&lt;/CODE&gt; applies the gamma function to &lt;VAR&gt;x&lt;/VAR&gt;. The gamma
function is defined as
-
-
+
+
&lt;pre&gt;&lt;br&gt;
gamma (x) = integral from 0 to infinity{} of t^(x-1) e^-t dt&lt;br&gt;
&lt;/pre&gt;
-
+
&lt;br&gt;&lt;br&gt; This function was introduced in ISO C99.
</synopsis>
</function>
@@ -29625,7 +29625,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
&lt;DD&gt;
The value of the &lt;VAR&gt;parameter&lt;/VAR&gt; is invalid.
-
+
</synopsis>
</function>
</construct>
@@ -29662,7 +29662,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;
The value of &lt;VAR&gt;parameter&lt;/VAR&gt; is invalid, or the implementation doesn't
support the &lt;VAR&gt;parameter&lt;/VAR&gt; for the specific file.
-
+
</synopsis>
</function>
</construct>
@@ -29688,7 +29688,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; EINVAL
The value of &lt;VAR&gt;parameter&lt;/VAR&gt; is invalid, or the implementation doesn't
support the &lt;VAR&gt;parameter&lt;/VAR&gt; for the specific file.
-
+
</synopsis>
</function>
</construct>
@@ -29723,7 +29723,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DT&gt;&lt;CODE&gt;EINVAL&lt;/CODE&gt;
&lt;DD&gt;
The value of the &lt;VAR&gt;parameter&lt;/VAR&gt; is invalid.
-
+
</synopsis>
</function>
</construct>
@@ -30221,7 +30221,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;LI&gt; -1
The answer matched neither the &lt;CODE&gt;YESEXPR&lt;/CODE&gt; nor the &lt;CODE&gt;NOEXPR&lt;/CODE&gt;
regular expression.
-
+
&lt;br&gt;&lt;br&gt; This function is not standardized but available beside in GNU libc at
least also in the IBM AIX library.
</synopsis>
@@ -30843,7 +30843,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
fputs ("you ", stdout);&lt;br&gt;
fputs ("hungry?\n", stdout);&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
outputs the text &lt;samp&gt;Are you hungry?&lt;/samp&gt; followed by a newline.
</synopsis>
</function>
@@ -30917,7 +30917,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
puts ("This is a message.");&lt;br&gt;
&lt;/pre&gt;
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
outputs the text &lt;samp&gt;This is a message.&lt;/samp&gt; followed by a newline.
</synopsis>
</function>
@@ -31597,19 +31597,19 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
return NULL;&lt;br&gt;
&lt;br&gt;&lt;br&gt; /* Try to print in the allocated space. */&lt;br&gt;
nchars = snprintf (buffer, size, "value of %s is %s",&lt;br&gt;
- name, value);&lt;br&gt;
+ name, value);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
if (nchars &gt;= size)&lt;br&gt;
{&lt;br&gt;
/* Reallocate buffer now that we know&lt;br&gt;
- how much space is needed. */&lt;br&gt;
+ how much space is needed. */&lt;br&gt;
size = nchars + 1;&lt;br&gt;
buffer = (char *) xrealloc (buffer, size);&lt;br&gt;
&lt;br&gt;&lt;br&gt; if (buffer != NULL)&lt;br&gt;
- /* Try again. */&lt;br&gt;
- snprintf (buffer, size, "value of %s is %s",&lt;br&gt;
- name, value);&lt;br&gt;
+ /* Try again. */&lt;br&gt;
+ snprintf (buffer, size, "value of %s is %s",&lt;br&gt;
+ name, value);&lt;br&gt;
}&lt;br&gt;
/* The last call worked, return the string. */&lt;br&gt;
return buffer;&lt;br&gt;
@@ -31883,7 +31883,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;CODE&gt;parse_printf_format&lt;/CODE&gt; when this conversion appears in a
template string. , for information
about this.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt; Attention: In the GNU C library versions before 2.0 the
&lt;VAR&gt;arginfo-function&lt;/VAR&gt; function did not need to be installed unless
the user used the &lt;CODE&gt;parse_printf_format&lt;/CODE&gt; function. This has changed.
@@ -32041,7 +32041,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
1000 is used.
&lt;br&gt;&lt;br&gt; The postfix tag corresponds to bytes, kilobytes, megabytes, gigabytes,
etc. The full table is:
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
&lt;DL&gt;
&lt;DT&gt;&lt;pre&gt;low Multiplier From Upper Multiplier&lt;/pre&gt;
&lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;' ' 1 ' ' 1&lt;/pre&gt;
@@ -32054,8 +32054,8 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;z 2^70 zetta Z 10^21&lt;/pre&gt;
&lt;DD&gt;&lt;br&gt; &lt;DT&gt;&lt;pre&gt;y 2^80 yotta Y 10^24&lt;/pre&gt;
&lt;DD&gt;&lt;br&gt; &lt;/DL&gt;
-
-
+
+
&lt;br&gt;&lt;br&gt; The default precision is 3, i.e., 1024 is printed with a lower-case
format character as if it were &lt;CODE&gt;%.3fk&lt;/CODE&gt; and will yield &lt;CODE&gt;1.000k&lt;/CODE&gt;.
</synopsis>
@@ -33095,7 +33095,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;CODE&gt;addseverity&lt;/CODE&gt; function one can add more severity levels with their
corresponding string to print. This is described below
.
- &lt;br&gt;&lt;br&gt;
+ &lt;br&gt;&lt;br&gt;
If no parameter is ignored the output looks like this:
&lt;br&gt;&lt;br&gt; &lt;pre&gt;&lt;br&gt;
&lt;VAR&gt;label&lt;/VAR&gt;: &lt;VAR&gt;severity-string&lt;/VAR&gt;: &lt;VAR&gt;text&lt;/VAR&gt;&lt;br&gt;
@@ -33458,7 +33458,7 @@ can be found at: http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz
&lt;LI&gt; ESRCH
The &lt;VAR&gt;action&lt;/VAR&gt; parameter is &lt;CODE&gt;FIND&lt;/CODE&gt; and no corresponding element
is found in the table.
-
+
</synopsis>
</function>
</construct>
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml
index 65e6fbb10c..790286714f 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.glibc/toc.xml
@@ -2,6 +2,6 @@
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="glibc library" link_to="../org.eclipse.linuxtools.cdt.libhover.library.docs/libraries.xml#moreclibdocs">
- <topic href="http://www.gnu.org/software/libc/manual/html_node/index.html" label="glibc">
+ <topic href="http://www.gnu.org/software/libc/manual/html_node/index.html" label="glibc">
</topic>
</toc>
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/build-helper.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/build-helper.xml
index 42980cb90e..7774fb6fe8 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/build-helper.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/build-helper.xml
@@ -1,62 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="org.eclipse.linuxtools.cdt.libhover.library-docs" default="all">
- <description>
+ <description>
Generate Eclipse help content for the Linux Tools Libhover Developers guide
</description>
- <property name="help.doc.url.base" value="http://wiki.eclipse.org" />
+ <property name="help.doc.url.base" value="http://wiki.eclipse.org" />
- <path id="tasks.classpath" path="bin" />
- <path id="wikitext.tasks.classpath">
- <!-- Replace dir with the dir you have wikitext installed into.-->
- <fileset dir="/notnfs/jjohnstn/helios/eclipse/plugins">
- <include name="org.eclipse.mylyn.wikitext.*core*.jar" />
- </fileset>
- </path>
+ <path id="tasks.classpath" path="bin" />
+ <path id="wikitext.tasks.classpath">
+ <!-- Replace dir with the dir you have wikitext installed into.-->
+ <fileset dir="/notnfs/jjohnstn/helios/eclipse/plugins">
+ <include name="org.eclipse.mylyn.wikitext.*core*.jar" />
+ </fileset>
+ </path>
- <taskdef classpathref="wikitext.tasks.classpath" resource="org/eclipse/mylyn/internal/wikitext/mediawiki/core/tasks/tasks.properties" />
- <taskdef classpathref="wikitext.tasks.classpath" resource="org/eclipse/mylyn/wikitext/core/util/anttask/tasks.properties" />
+ <taskdef classpathref="wikitext.tasks.classpath" resource="org/eclipse/mylyn/internal/wikitext/mediawiki/core/tasks/tasks.properties" />
+ <taskdef classpathref="wikitext.tasks.classpath" resource="org/eclipse/mylyn/wikitext/core/util/anttask/tasks.properties" />
- <target name="all" description="Generate Eclipse help content for the Linux Tools changelog user guide">
- <mediawiki-to-eclipse-help wikiBaseUrl="${help.doc.url.base}" title="Libhover Developer's Guide" formatoutput="true" dest="." templateExcludes="*eclipseproject*">
+ <target name="all" description="Generate Eclipse help content for the Linux Tools changelog user guide">
+ <mediawiki-to-eclipse-help wikiBaseUrl="${help.doc.url.base}" title="Libhover Developer's Guide" formatoutput="true" dest="." templateExcludes="*eclipseproject*">
- <path name="Linux_Tools_Project/Libhover/Developers_Guide" title="Libhover Developer's Guide" generateToc="false" />
- <stylesheet url="book.css" />
- <pageAppendum>
- = Updating This Document =
+ <path name="Linux_Tools_Project/Libhover/Developers_Guide" title="Libhover Developer's Guide" generateToc="false" />
+ <stylesheet url="book.css" />
+ <pageAppendum>
+ = Updating This Document =
- This document is maintained in a collaborative wiki. If you wish to update or modify this document please visit
- http://wiki.eclipse.org/Linux_Tools_Project/Libhover/Developers_Guide .
- </pageAppendum>
- </mediawiki-to-eclipse-help>
- <antcall target="test" />
- </target>
+ This document is maintained in a collaborative wiki. If you wish to update or modify this document please visit
+ http://wiki.eclipse.org/Linux_Tools_Project/Libhover/Developers_Guide .
+ </pageAppendum>
+ </mediawiki-to-eclipse-help>
+ <antcall target="test" />
+ </target>
- <target name="test" description="verify that all of the HTML files are well-formed XML">
- <echo level="info">
+ <target name="test" description="verify that all of the HTML files are well-formed XML">
+ <echo level="info">
Validating help content XML and HTML files: The Eclipse help system expects well-formed XML
-
+
If validation fails it is because either:
-
+
* the userguide source code is poorly formed, or
* the WikiText MediaWiki parser has a bug
-
+
Problems with userguide source are usually caused by improper use of HTML markup in the MediaWiki source,
or inadvertently starting a line with a space character (in MediaWiki this starts a preformatted block)
- </echo>
-
- <!--
- Don't bother with DTD validation: we only care if the files are well-formed.
- We therefore provide an empty DTD
- -->
- <mkdir dir="tmp"/>
- <echo file="tmp/__empty.dtd" message="" />
- <xmlvalidate lenient="true">
- <fileset dir="Linux_Tools_Project">
- <include name="**/*.html" />
- </fileset>
- <dtd publicid="-//W3C//DTD XHTML 1.0 Transitional//EN" location="${basedir}/tmp/__empty.dtd" />
- </xmlvalidate>
- <delete dir="tmp" />
- </target>
+ </echo>
+
+ <!--
+ Don't bother with DTD validation: we only care if the files are well-formed.
+ We therefore provide an empty DTD
+ -->
+ <mkdir dir="tmp"/>
+ <echo file="tmp/__empty.dtd" message="" />
+ <xmlvalidate lenient="true">
+ <fileset dir="Linux_Tools_Project">
+ <include name="**/*.html" />
+ </fileset>
+ <dtd publicid="-//W3C//DTD XHTML 1.0 Transitional//EN" location="${basedir}/tmp/__empty.dtd" />
+ </xmlvalidate>
+ <delete dir="tmp" />
+ </target>
</project>
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/toc.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/toc.xml
index 28e1784acf..10b6302f5c 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/toc.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.library.docs/toc.xml
@@ -1,14 +1,14 @@
<?xml version='1.0' encoding='utf-8' ?>
<toc topic="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html" label="Libhover Developer's Guide">
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html" label="Libhover Developer's Guide">
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html" label="Introduction"></topic>
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#Libhover_Extension" label="Libhover Extension"></topic>
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#Libhover_Data" label="Libhover Data"></topic>
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#C_Library_Data" label="C Library Data">
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#C_Library_Hover_Utility" label="C Library Hover Utility"></topic>
- </topic>
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#C.2B.2B_Library_Hover" label="C++ Library Hover"></topic>
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#Libhover_Logic" label="Libhover Logic"></topic>
- <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Updating-This-Document.html" label="Updating This Document"></topic>
- </topic>
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html" label="Libhover Developer's Guide">
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html" label="Introduction"></topic>
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#Libhover_Extension" label="Libhover Extension"></topic>
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#Libhover_Data" label="Libhover Data"></topic>
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#C_Library_Data" label="C Library Data">
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#C_Library_Hover_Utility" label="C Library Hover Utility"></topic>
+ </topic>
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#C.2B.2B_Library_Hover" label="C++ Library Hover"></topic>
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Developers-Guide.html#Libhover_Logic" label="Libhover Logic"></topic>
+ <topic href="Linux_Tools_Project/Libhover/Developers_Guide/Updating-This-Document.html" label="Updating This Document"></topic>
+ </topic>
</toc> \ No newline at end of file
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
index 1065ed51d6..701a83aef9 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
@@ -223,7 +223,7 @@ public class DoxygenCPPInfo {
} else {
// We probably have a template that needs resolution
String baseClassName = n2.getTextContent();
-// System.out.println("base class name is " + baseClassName);
+// System.out.println("base class name is " + baseClassName);
baseClass = getClassInfo(baseClassName);
}
if (d != null && baseClass != null)
@@ -492,7 +492,7 @@ public class DoxygenCPPInfo {
* Create LibHoverInfo serialized output
*
* @param args (args[0] = location of Doxygen xml document to parse (file or URL),
- * args[1] = name of file to put serialized LibHoverInfo
+ * args[1] = name of file to put serialized LibHoverInfo
*/
public static void main(String[] args) {
URI acDoc;
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml
index a4fc261cfd..9832a42561 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/toc.xml
@@ -2,6 +2,6 @@
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="libstdc++ library" link_to="../org.eclipse.linuxtools.cdt.libhover.library.docs/libraries.xml#moreclibdocs">
- <topic href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/spine.html" label="libstdc++">
+ <topic href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/spine.html" label="libstdc++">
</topic>
</toc>
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml
index 706fa13083..cafe07363a 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.newlib/toc.xml
@@ -2,7 +2,7 @@
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="newlib library" link_to="../org.eclipse.linuxtools.cdt.libhover.library.docs/libraries.xml#moreclibdocs">
- <topic href="http://www.sourceware.org/newlib/libc.html" label="newlib libc">
+ <topic href="http://www.sourceware.org/newlib/libc.html" label="newlib libc">
</topic>
<topic href="http://www.sourceware.org/newlib/libm.html" label="newlib libm">
</topic>
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml
index 9abc931009..77b8969e07 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/build.xml
@@ -12,4 +12,3 @@
<javac srcdir="${src}" destdir="${build}" />
</target>
</project>
- \ No newline at end of file
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java
index 00234c09b5..75ec68636e 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutoconfTexinfo.java
@@ -32,614 +32,614 @@ import java.util.regex.Pattern;
public class ParseAutoconfTexinfo {
- static final boolean DEBUG = false;
-
- static final String ATcmd = "(@\\w*)";
-
- // 0
- static final String Defmac = "@defmac";
- static final String Defmacx = "@defmacx";
-
- // 1
- static final String MacroName = "(\\w*)";
- static final int MacroNameIndex = 1;
-
- // 2 3
- static final String Parms = "(\\((.*)\\))";
- static final int ParmsIndex = 2;
-
- static final String rest = ".*";
-
- static final String WhiteSpace = "\\s*";
-
- static final Pattern MacroPattern
- = Pattern.compile("^" + Defmac + WhiteSpace +
- MacroName + WhiteSpace +
- Parms +
- rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern MacroPattern2
- = Pattern.compile("^" + Defmac + WhiteSpace + MacroName + rest,
- Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern MacroPatternx
- = Pattern.compile("^" + Defmacx + WhiteSpace +
- MacroName + WhiteSpace +
- Parms +
- rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern MacroPatternx2
- = Pattern.compile("^" + Defmacx + WhiteSpace + MacroName + rest,
- Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
- static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
- static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
- static final Pattern ExamplePattern = Pattern.compile("@example");
- static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
- static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
- static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
- static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
- static final Pattern ItemPattern = Pattern.compile("@item");
- static final Pattern NoIndentPattern = Pattern.compile("@noindent");
- static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
- static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
- static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
- static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
- static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
- static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
- static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
- static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
- static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
- static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
- static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
- static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
- static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
- static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
- static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
- static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
- static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
- static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
- static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
- static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
- static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
- static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
- static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
- static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
- static final Pattern AmpersandPattern = Pattern.compile("&");
- static final Pattern LeftAnglePattern = Pattern.compile("<");
- static final Pattern RightAnglePattern = Pattern.compile(">");
-
-
- private static Map<String, MacroDef> macroMap;
-
- static class MacroParms {
- String[] parms;
- MacroParms nextParms = null;
-
- public MacroParms(String[] parms) {
- this.parms = parms;
- }
- }
-
- static class MacroDef {
- String MacroName;
- MacroParms Parameters;
- }
-
- static class TPElement {
- String Content;
- String Synopsis;
- }
-
- static class TPDef {
- String TPType;
- String TPName;
- String TPSynopsis;
- TPElement[] TPElements;
- Object[] IncludeList;
- }
-
- private static String killTagsParms(String tt) {
- Matcher mm;
-
- mm = ParmBracketPattern.matcher(tt);
- tt= mm.replaceAll("$1");
-
- mm = OVarPattern.matcher(tt);
- tt = mm.replaceAll("[$1]");
-
- mm = DVarPattern.matcher(tt);
- tt = mm.replaceAll("[$1=$2]");
-
- mm = VarPattern.matcher(tt);
- tt = mm.replaceAll("$1");
-
- mm = RPattern.matcher(tt);
- tt = mm.replaceAll("$1");
-
- mm = DotsPattern.matcher(tt);
- tt = mm.replaceAll("...");
-
- return tt;
- }
-
-
- private static String killTags(String tt) {
- Matcher mm;
- String ss = "";
-
- while (ss != tt) {
- mm = XrefPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = IndexPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = IndexPattern2.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = NoIndentPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = VarPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<VAR>$1</VAR>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = DotsPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<small>...</small>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = CommandPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>$1</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = CodePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>$1</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = KbdPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<KBD>$1</KBD>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EmphPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<EM>$1</EM>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = FilePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<TT>$1</TT>");
- }
-
-
- ss = "";
- while (ss != tt) {
- mm = VerbatimPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndVerbatimPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = SampPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<samp>$1</samp>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = OptionPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<samp>$1</samp>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ExamplePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndExamplePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</pre></td></tr></table>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EnumeratePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<OL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndEnumeratePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</OL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableSampItemPattern.matcher(tt);
- ss = tt;
- if (mm.matches()) {
- System.out.println("group 1 is " + mm.group(1));
- System.out.println("group 2 is " + mm.group(2));
- System.out.println("group 3 is " + mm.group(3));
- }
- tt = mm.replaceAll("$1<DT>'<SAMP>$2</SAMP>'\n<DD>$3");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableAsisItemPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1<DT>$2\n<DD>$3");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableSampPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableAsisPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndTablePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</DL>");
- }
-
- //FIXME: if there ever is a @itemize @bullet within a
- // @itemize @minus or vice-versa, the following
- // logic will get it wrong.
- ss = "";
- while (ss != tt) {
- mm = ItemizeMinusPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<UL>$1</UL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ItemizeBulletPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<OL>$1</OL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ItemPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<LI>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TagPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1");
- }
-
- mm = AmpersandPattern.matcher(tt);
- tt = mm.replaceAll("&amp;");
-
- mm = LeftAnglePattern.matcher(tt);
- tt = mm.replaceAll("&lt;");
-
- mm = RightAnglePattern.matcher(tt);
- tt = mm.replaceAll("&gt;");
-
- // Clean up the eol markers we used to mark end of line for items
- mm = EOLPattern.matcher(tt);
- tt = mm.replaceAll("");
-
- return tt;
- }
-
- private static MacroDef BuildMacroDef(Matcher m) {
- MacroDef md = new MacroDef();
-
- md.MacroName = m.group(MacroNameIndex);
-
- if (null != m.group(ParmsIndex)) {
- String tt = killTagsParms(m.group(ParmsIndex));
- String[] parms = tt.split(",\\s");
- md.Parameters = new MacroParms(parms);
- }
- return md;
- }
-
- private static MacroParms AddMacroDefxParms(MacroParms mp, Matcher mx) {
- if (null != mx.group(ParmsIndex)) {
- String tt = killTagsParms(mx.group(ParmsIndex));
- String[] parms = tt.split(",\\s");
- MacroParms mpnew = new MacroParms(parms);
- mp.nextParms = mpnew;
- return mpnew;
- }
- return null;
- }
-
- private static MacroDef HandleMacroDef(BufferedReader is, String s) throws IOException {
- MacroDef fd = null;
-
- Matcher m = MacroPattern.matcher(s);
-
- if (m.matches()) {
- fd = BuildMacroDef(m);
- }
- else { // assume the line got split and retry
- is.mark(100);
- String il = is.readLine();
- m = MacroPattern.matcher(s + il);
- if (m.matches()) fd = BuildMacroDef(m);
- else {
- is.reset();
- m = MacroPattern2.matcher(s);
- if (m.matches()) {
- fd = new MacroDef();
- fd.MacroName = m.group(MacroNameIndex);
- fd.Parameters = new MacroParms(new String[0]);
- }
- }
- }
-
- if (fd != null) {
- // Look for @defmacx which are alternate prototypes for the macro
- is.mark(100);
- String il = is.readLine();
- if (il != null) {
- Matcher mx = MacroPatternx.matcher(il);
- Matcher mx2 = MacroPatternx2.matcher(il);
- MacroParms mp = fd.Parameters;
- while (mx.matches() || mx2.matches()) {
- if (mx.matches())
- mp = AddMacroDefxParms(mp, mx);
- else {
- MacroParms mpnew = new MacroParms(new String[0]);
- mp.nextParms = mpnew;
- mp = mpnew;
- }
- is.mark(100);
- il = is.readLine();
- if (il != null) {
- mx = MacroPatternx.matcher(il);
- mx2 = MacroPatternx2.matcher(il);
- }
- }
- is.reset();
- }
-
- if (macroMap.get(fd.MacroName) != null)
- return null;
- macroMap.put(fd.MacroName, fd);
- }
-
- return fd;
- }
-
- private static void WriteString(BufferedWriter os, String s) throws IOException {
- // System.out.println(s);
- os.write(s+"\n", 0, 1+s.length());
- }
-
+ static final boolean DEBUG = false;
+
+ static final String ATcmd = "(@\\w*)";
+
+ // 0
+ static final String Defmac = "@defmac";
+ static final String Defmacx = "@defmacx";
+
+ // 1
+ static final String MacroName = "(\\w*)";
+ static final int MacroNameIndex = 1;
+
+ // 2 3
+ static final String Parms = "(\\((.*)\\))";
+ static final int ParmsIndex = 2;
+
+ static final String rest = ".*";
+
+ static final String WhiteSpace = "\\s*";
+
+ static final Pattern MacroPattern
+ = Pattern.compile("^" + Defmac + WhiteSpace +
+ MacroName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPattern2
+ = Pattern.compile("^" + Defmac + WhiteSpace + MacroName + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPatternx
+ = Pattern.compile("^" + Defmacx + WhiteSpace +
+ MacroName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPatternx2
+ = Pattern.compile("^" + Defmacx + WhiteSpace + MacroName + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+
+ private static Map<String, MacroDef> macroMap;
+
+ static class MacroParms {
+ String[] parms;
+ MacroParms nextParms = null;
+
+ public MacroParms(String[] parms) {
+ this.parms = parms;
+ }
+ }
+
+ static class MacroDef {
+ String MacroName;
+ MacroParms Parameters;
+ }
+
+ static class TPElement {
+ String Content;
+ String Synopsis;
+ }
+
+ static class TPDef {
+ String TPType;
+ String TPName;
+ String TPSynopsis;
+ TPElement[] TPElements;
+ Object[] IncludeList;
+ }
+
+ private static String killTagsParms(String tt) {
+ Matcher mm;
+
+ mm = ParmBracketPattern.matcher(tt);
+ tt= mm.replaceAll("$1");
+
+ mm = OVarPattern.matcher(tt);
+ tt = mm.replaceAll("[$1]");
+
+ mm = DVarPattern.matcher(tt);
+ tt = mm.replaceAll("[$1=$2]");
+
+ mm = VarPattern.matcher(tt);
+ tt = mm.replaceAll("$1");
+
+ mm = RPattern.matcher(tt);
+ tt = mm.replaceAll("$1");
+
+ mm = DotsPattern.matcher(tt);
+ tt = mm.replaceAll("...");
+
+ return tt;
+ }
+
+
+ private static String killTags(String tt) {
+ Matcher mm;
+ String ss = "";
+
+ while (ss != tt) {
+ mm = XrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern2.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = NoIndentPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<VAR>$1</VAR>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DotsPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<small>...</small>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CommandPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = KbdPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<KBD>$1</KBD>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EmphPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<EM>$1</EM>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = FilePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TT>$1</TT>");
+ }
+
+
+ ss = "";
+ while (ss != tt) {
+ mm = VerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndVerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = OptionPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</pre></td></tr></table>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndEnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.matches()) {
+ System.out.println("group 1 is " + mm.group(1));
+ System.out.println("group 2 is " + mm.group(2));
+ System.out.println("group 3 is " + mm.group(3));
+ }
+ tt = mm.replaceAll("$1<DT>'<SAMP>$2</SAMP>'\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1<DT>$2\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndTablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ //FIXME: if there ever is a @itemize @bullet within a
+ // @itemize @minus or vice-versa, the following
+ // logic will get it wrong.
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeMinusPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<UL>$1</UL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeBulletPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>$1</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<LI>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ mm = AmpersandPattern.matcher(tt);
+ tt = mm.replaceAll("&amp;");
+
+ mm = LeftAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&lt;");
+
+ mm = RightAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&gt;");
+
+ // Clean up the eol markers we used to mark end of line for items
+ mm = EOLPattern.matcher(tt);
+ tt = mm.replaceAll("");
+
+ return tt;
+ }
+
+ private static MacroDef BuildMacroDef(Matcher m) {
+ MacroDef md = new MacroDef();
+
+ md.MacroName = m.group(MacroNameIndex);
+
+ if (null != m.group(ParmsIndex)) {
+ String tt = killTagsParms(m.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ md.Parameters = new MacroParms(parms);
+ }
+ return md;
+ }
+
+ private static MacroParms AddMacroDefxParms(MacroParms mp, Matcher mx) {
+ if (null != mx.group(ParmsIndex)) {
+ String tt = killTagsParms(mx.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ MacroParms mpnew = new MacroParms(parms);
+ mp.nextParms = mpnew;
+ return mpnew;
+ }
+ return null;
+ }
+
+ private static MacroDef HandleMacroDef(BufferedReader is, String s) throws IOException {
+ MacroDef fd = null;
+
+ Matcher m = MacroPattern.matcher(s);
+
+ if (m.matches()) {
+ fd = BuildMacroDef(m);
+ }
+ else { // assume the line got split and retry
+ is.mark(100);
+ String il = is.readLine();
+ m = MacroPattern.matcher(s + il);
+ if (m.matches()) fd = BuildMacroDef(m);
+ else {
+ is.reset();
+ m = MacroPattern2.matcher(s);
+ if (m.matches()) {
+ fd = new MacroDef();
+ fd.MacroName = m.group(MacroNameIndex);
+ fd.Parameters = new MacroParms(new String[0]);
+ }
+ }
+ }
+
+ if (fd != null) {
+ // Look for @defmacx which are alternate prototypes for the macro
+ is.mark(100);
+ String il = is.readLine();
+ if (il != null) {
+ Matcher mx = MacroPatternx.matcher(il);
+ Matcher mx2 = MacroPatternx2.matcher(il);
+ MacroParms mp = fd.Parameters;
+ while (mx.matches() || mx2.matches()) {
+ if (mx.matches())
+ mp = AddMacroDefxParms(mp, mx);
+ else {
+ MacroParms mpnew = new MacroParms(new String[0]);
+ mp.nextParms = mpnew;
+ mp = mpnew;
+ }
+ is.mark(100);
+ il = is.readLine();
+ if (il != null) {
+ mx = MacroPatternx.matcher(il);
+ mx2 = MacroPatternx2.matcher(il);
+ }
+ }
+ is.reset();
+ }
+
+ if (macroMap.get(fd.MacroName) != null)
+ return null;
+ macroMap.put(fd.MacroName, fd);
+ }
+
+ return fd;
+ }
+
+ private static void WriteString(BufferedWriter os, String s) throws IOException {
+ // System.out.println(s);
+ os.write(s+"\n", 0, 1+s.length());
+ }
+
private static void CreateHeader(BufferedWriter os) throws IOException {
- WriteString(os, "<!-- This file automatically generated by ParseAutoconfTexinfo utility -->");
- WriteString(os, "<!-- cvs -d:pserver:anonymous@sources.redhat.com:/cvs/eclipse \\ -->");
- WriteString(os, "<!-- co autotools/ParseTexinfo -->");
- WriteString(os, "<!DOCTYPE macros [");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT macros (macro)*>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT macro (prototype*,synopsis)>");
- WriteString(os, " <!ATTLIST macro");
- WriteString(os, " id ID #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT prototype (parameter+)?>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
- WriteString(os, " <!ATTLIST parameter");
- WriteString(os, " content CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, "]>");
- WriteString(os, "");
+ WriteString(os, "<!-- This file automatically generated by ParseAutoconfTexinfo utility -->");
+ WriteString(os, "<!-- cvs -d:pserver:anonymous@sources.redhat.com:/cvs/eclipse \\ -->");
+ WriteString(os, "<!-- co autotools/ParseTexinfo -->");
+ WriteString(os, "<!DOCTYPE macros [");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT macros (macro)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT macro (prototype*,synopsis)>");
+ WriteString(os, " <!ATTLIST macro");
+ WriteString(os, " id ID #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT prototype (parameter+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST parameter");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, "]>");
+ WriteString(os, "");
}
- private static void CreateTrailer(BufferedWriter os) throws IOException {
- WriteString(os, "</macros>");
- }
-
- private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
- String ss = killTags(Synopsis);
- String[] tt = ss.split("\\s");
- String aa = "";
- String spaces = indent ? " " : " ";
- WriteString(os, spaces + "<synopsis>");
- if (null != Synopsis) {
- for (int pp = 0; pp < tt.length; pp++) {
- if (tt[pp].equals("&lt;br&gt;")) {
- WriteString(os, spaces + aa + "&lt;/P&gt;&lt;P&gt;\n");
- aa = "";
- }
- else {
- if ((aa.length() + tt[pp].length()) > 64) {
- WriteString(os, spaces + aa);
- aa = "";
- }
- aa = aa + " " + tt[pp];
- }
- }
- }
- if (aa.length() > 0) WriteString(os, " " + aa);
- WriteString(os, spaces + "</synopsis>");
- }
-
- private static void HandleDefmacro(BufferedWriter os, BufferedReader is, String s) throws IOException {
- String il;
- MacroDef md;
- List<MacroDef> FDefs = new ArrayList<MacroDef>();
- String Synopsis = null;
-
- if (null != (md = HandleMacroDef(is, s))) FDefs.add(md);
-
- while (null != (il = is.readLine())) {
- if (il.startsWith("@defmac")) {
- if (null != (md = HandleMacroDef(is, il))) FDefs.add(md);
- }
- else if (il.startsWith("@comment") ||
- il.startsWith("@c ")) { // comment -- ignore it
- }
- else if (il.startsWith("@end defmac")) {
- for (int kk = 0; kk < FDefs.size(); kk++) {
- md = (MacroDef)FDefs.get(kk);
-
- WriteString(os, " <macro id=\"" + md.MacroName + "\">");
-
- MacroParms mp = md.Parameters;
- do {
- WriteString(os, " <prototype>");
- String[] parms = mp.parms;
- for (int i = 0; i < parms.length; i++) {
- WriteString(os, " <parameter content=\"" + parms[i] + "\"/>");
- }
- WriteString(os, " </prototype>");
- mp = mp.nextParms;
- } while (mp != null);
-
- if (null != Synopsis) WriteSynopsis(os, Synopsis, false);
-
- WriteString(os, " </macro>");
- }
- return;
- }
- else {
- Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br>" :
- il.startsWith("@item") ? il + "<eol>" : il);
-
- }
- }
- FDefs.clear();
-
- }
-
- private static class OnlyTexi implements FilenameFilter {
- public boolean accept(File dir, String s) {
- return (s.endsWith(".texi")) ? true : false;
- }
- }
-
- public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
- try {
- macroMap = new HashMap<String, MacroDef>();
- BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
-
- CreateHeader(os);
-// CreateLicense(os);
-
- WriteString(os, "<macros>");
-
- try {
- String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
- for (int i = 0; i < dir.length; i++) {
- String qFile = srcdir.endsWith("/")
- ? srcdir + dir[i]
- : srcdir + "/" + dir[i];
-
- try {
- BufferedReader is = new BufferedReader(new FileReader(qFile));
- String il;
-
- while (null != (il = is.readLine())) {
- if (il.startsWith("@defmac")) { // handle @defmac x]
- HandleDefmacro(os, is, il);
- }
- }
- is.close();
- }
- catch (IOException e) {
- System.out.println("Input File IOException: " + e);
- return;
- }
- }
- }
- catch (NullPointerException e) {
- System.out.println("NullPointerException: " + e);
- return;
- }
-
- CreateTrailer(os);
-
- os.close();
- }
- catch (IOException e) {
- System.out.println("Output File IOException: " + e);
- return;
- }
- }
-
- public static void main(String[] args) {
- // arg[0] is input directory containing .texi documents to read
- // arg[1] is output xml file to create
- BuildXMLFromTexinfo(args[0], args[1]);
- }
+ private static void CreateTrailer(BufferedWriter os) throws IOException {
+ WriteString(os, "</macros>");
+ }
+
+ private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
+ String ss = killTags(Synopsis);
+ String[] tt = ss.split("\\s");
+ String aa = "";
+ String spaces = indent ? " " : " ";
+ WriteString(os, spaces + "<synopsis>");
+ if (null != Synopsis) {
+ for (int pp = 0; pp < tt.length; pp++) {
+ if (tt[pp].equals("&lt;br&gt;")) {
+ WriteString(os, spaces + aa + "&lt;/P&gt;&lt;P&gt;\n");
+ aa = "";
+ }
+ else {
+ if ((aa.length() + tt[pp].length()) > 64) {
+ WriteString(os, spaces + aa);
+ aa = "";
+ }
+ aa = aa + " " + tt[pp];
+ }
+ }
+ }
+ if (aa.length() > 0) WriteString(os, " " + aa);
+ WriteString(os, spaces + "</synopsis>");
+ }
+
+ private static void HandleDefmacro(BufferedWriter os, BufferedReader is, String s) throws IOException {
+ String il;
+ MacroDef md;
+ List<MacroDef> FDefs = new ArrayList<MacroDef>();
+ String Synopsis = null;
+
+ if (null != (md = HandleMacroDef(is, s))) FDefs.add(md);
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith("@defmac")) {
+ if (null != (md = HandleMacroDef(is, il))) FDefs.add(md);
+ }
+ else if (il.startsWith("@comment") ||
+ il.startsWith("@c ")) { // comment -- ignore it
+ }
+ else if (il.startsWith("@end defmac")) {
+ for (int kk = 0; kk < FDefs.size(); kk++) {
+ md = (MacroDef)FDefs.get(kk);
+
+ WriteString(os, " <macro id=\"" + md.MacroName + "\">");
+
+ MacroParms mp = md.Parameters;
+ do {
+ WriteString(os, " <prototype>");
+ String[] parms = mp.parms;
+ for (int i = 0; i < parms.length; i++) {
+ WriteString(os, " <parameter content=\"" + parms[i] + "\"/>");
+ }
+ WriteString(os, " </prototype>");
+ mp = mp.nextParms;
+ } while (mp != null);
+
+ if (null != Synopsis) WriteSynopsis(os, Synopsis, false);
+
+ WriteString(os, " </macro>");
+ }
+ return;
+ }
+ else {
+ Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br>" :
+ il.startsWith("@item") ? il + "<eol>" : il);
+
+ }
+ }
+ FDefs.clear();
+
+ }
+
+ private static class OnlyTexi implements FilenameFilter {
+ public boolean accept(File dir, String s) {
+ return (s.endsWith(".texi")) ? true : false;
+ }
+ }
+
+ public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
+ try {
+ macroMap = new HashMap<String, MacroDef>();
+ BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
+
+ CreateHeader(os);
+// CreateLicense(os);
+
+ WriteString(os, "<macros>");
+
+ try {
+ String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
+ for (int i = 0; i < dir.length; i++) {
+ String qFile = srcdir.endsWith("/")
+ ? srcdir + dir[i]
+ : srcdir + "/" + dir[i];
+
+ try {
+ BufferedReader is = new BufferedReader(new FileReader(qFile));
+ String il;
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith("@defmac")) { // handle @defmac x]
+ HandleDefmacro(os, is, il);
+ }
+ }
+ is.close();
+ }
+ catch (IOException e) {
+ System.out.println("Input File IOException: " + e);
+ return;
+ }
+ }
+ }
+ catch (NullPointerException e) {
+ System.out.println("NullPointerException: " + e);
+ return;
+ }
+
+ CreateTrailer(os);
+
+ os.close();
+ }
+ catch (IOException e) {
+ System.out.println("Output File IOException: " + e);
+ return;
+ }
+ }
+
+ public static void main(String[] args) {
+ // arg[0] is input directory containing .texi documents to read
+ // arg[1] is output xml file to create
+ BuildXMLFromTexinfo(args[0], args[1]);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java
index c61adc026a..602ccf3ec4 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseAutomakeTexinfo.java
@@ -32,630 +32,630 @@ import java.util.regex.Pattern;
public class ParseAutomakeTexinfo {
- static final boolean DEBUG = false;
-
- static final String ATcmd = "(@\\w*)";
-
- // Currently in automake docs, the macro section starts with
- // a subsection as below and a table which contains macros which
- // are item and itemx entries.
- static final String MacrosStart = "@subsection\\sPublic\\smacros";
- static final String OldMacrosStart = "@section\\sAutoconf\\smacros.*";
- static final Pattern MacroSection1 = Pattern.compile(MacrosStart);
- static final Pattern MacroSection2 = Pattern.compile(OldMacrosStart);
- // 0
- static final String Defmac = "@item";
- static final String Defmacx = "@itemx";
-
- // 1
- static final String MacroName = "(\\w*)";
- static final int MacroNameIndex = 1;
-
- // 2 3
- static final String Parms = "(\\((.*)\\))";
- static final int ParmsIndex = 2;
-
- static final String rest = ".*";
-
- static final String WhiteSpace = "\\s*";
-
- static final Pattern MacroPattern
- = Pattern.compile("^" + Defmac + WhiteSpace +
- MacroName + WhiteSpace +
- Parms +
- rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern MacroPattern2
- = Pattern.compile("^" + Defmac + WhiteSpace + MacroName + rest,
- Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern MacroPatternx
- = Pattern.compile("^" + Defmacx + WhiteSpace +
- MacroName + WhiteSpace +
- Parms +
- rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern MacroPatternx2
- = Pattern.compile("^" + Defmacx + WhiteSpace + MacroName + rest,
- Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
- static final Pattern IndexPattern = Pattern.compile("@\\w*index.*");
- static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
- static final Pattern ExamplePattern = Pattern.compile("@example");
- static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
- static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
- static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
- static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
- static final Pattern ItemPattern = Pattern.compile("@item");
- static final Pattern NoIndentPattern = Pattern.compile("@noindent");
- static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
- static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
- static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
- static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
- static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
- static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
- static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
- static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
- static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
- static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
- static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
- static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
- static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
- static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
- static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
- static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
- static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
- static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
- static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
- static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
- static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
- static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
- static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
- static final Pattern UrefPattern = Pattern.compile("@uref\\{([^,]*),\\s+([^\\}]*)\\}");
- static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
- static final Pattern AmpersandPattern = Pattern.compile("&");
- static final Pattern LeftAnglePattern = Pattern.compile("<");
- static final Pattern RightAnglePattern = Pattern.compile(">");
-
-
- private static Map macroMap;
-
- static class MacroParms {
- String[] parms;
- MacroParms nextParms = null;
-
- public MacroParms(String[] parms) {
- this.parms = parms;
- }
- }
-
- static class MacroDef {
- String MacroName;
- MacroParms Parameters;
- String Synopsis;
- }
-
- static class TPElement {
- String Content;
- String Synopsis;
- }
-
- static class TPDef {
- String TPType;
- String TPName;
- String TPSynopsis;
- TPElement[] TPElements;
- Object[] IncludeList;
- }
-
- private static String killTagsParms(String tt) {
- Matcher mm;
-
- mm = ParmBracketPattern.matcher(tt);
- tt= mm.replaceAll("$1");
-
- mm = OVarPattern.matcher(tt);
- tt = mm.replaceAll("[$1]");
-
- mm = DVarPattern.matcher(tt);
- tt = mm.replaceAll("[$1=$2]");
-
- mm = VarPattern.matcher(tt);
- tt = mm.replaceAll("$1");
-
- mm = RPattern.matcher(tt);
- tt = mm.replaceAll("$1");
-
- mm = DotsPattern.matcher(tt);
- tt = mm.replaceAll("...");
-
- return tt;
- }
-
-
- private static String killTags(String tt) {
- Matcher mm;
- String ss = "";
-
- while (ss != tt) {
- mm = XrefPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = IndexPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = IndexPattern2.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = NoIndentPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = VarPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<VAR>$1</VAR>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = DotsPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<small>...</small>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = CommandPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>$1</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = CodePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>$1</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = UrefPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<A HREF=\"$1>$2</A>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = KbdPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<KBD>$1</KBD>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EmphPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<EM>$1</EM>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = FilePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<TT>$1</TT>");
- }
-
-
- ss = "";
- while (ss != tt) {
- mm = VerbatimPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndVerbatimPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = SampPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<samp>$1</samp>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = OptionPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<samp>$1</samp>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ExamplePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndExamplePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</pre></td></tr></table>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EnumeratePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<OL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndEnumeratePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</OL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableSampItemPattern.matcher(tt);
- ss = tt;
- if (mm.matches()) {
- System.out.println("group 1 is " + mm.group(1));
- System.out.println("group 2 is " + mm.group(2));
- System.out.println("group 3 is " + mm.group(3));
- }
- tt = mm.replaceAll("$1<DT>'<SAMP>$2</SAMP>'\n<DD>$3");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableAsisItemPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1<DT>$2\n<DD>$3");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableSampPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableAsisPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndTablePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</DL>");
- }
-
- //FIXME: if there ever is a @itemize @bullet within a
- // @itemize @minus or vice-versa, the following
- // logic will get it wrong.
- ss = "";
- while (ss != tt) {
- mm = ItemizeMinusPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<UL>$1</UL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ItemizeBulletPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<OL>$1</OL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ItemPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<LI>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TagPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1");
- }
-
- mm = AmpersandPattern.matcher(tt);
- tt = mm.replaceAll("&amp;");
-
- mm = LeftAnglePattern.matcher(tt);
- tt = mm.replaceAll("&lt;");
-
- mm = RightAnglePattern.matcher(tt);
- tt = mm.replaceAll("&gt;");
-
- // Clean up the eol markers we used to mark end of line for items
- mm = EOLPattern.matcher(tt);
- tt = mm.replaceAll("");
-
- return tt;
- }
-
- private static MacroDef BuildMacroDef(Matcher m) {
- MacroDef md = new MacroDef();
-
- md.MacroName = m.group(MacroNameIndex);
-
- if (null != m.group(ParmsIndex)) {
- String tt = killTagsParms(m.group(ParmsIndex));
- String[] parms = tt.split(",\\s");
- md.Parameters = new MacroParms(parms);
- }
- return md;
- }
-
- private static MacroParms AddMacroDefxParms(MacroParms mp, Matcher mx) {
- if (null != mx.group(ParmsIndex)) {
- String tt = killTagsParms(mx.group(ParmsIndex));
- String[] parms = tt.split(",\\s");
- MacroParms mpnew = new MacroParms(parms);
- mp.nextParms = mpnew;
- return mpnew;
- }
- return null;
- }
-
- private static MacroDef HandleMacroDef(BufferedReader is, String s) throws IOException {
- MacroDef fd = null;
-
- Matcher m = MacroPattern.matcher(s);
-
- if (m.matches()) {
- fd = BuildMacroDef(m);
- }
- else { // assume the line got split and retry
- is.mark(100);
- String il = is.readLine();
- m = MacroPattern.matcher(s + il);
- if (m.matches()) fd = BuildMacroDef(m);
- else {
- is.reset();
- m = MacroPattern2.matcher(s);
- if (m.matches()) {
- fd = new MacroDef();
- fd.MacroName = m.group(MacroNameIndex);
- fd.Parameters = new MacroParms(new String[0]);
- }
- }
- }
-
- if (fd != null) {
- // Look for @defmacx which are alternate prototypes for the macro
- is.mark(100);
- String il = is.readLine();
- if (il != null) {
- Matcher mx = MacroPatternx.matcher(il);
- Matcher mx2 = MacroPatternx2.matcher(il);
- MacroParms mp = fd.Parameters;
- while (mx.matches() || mx2.matches()) {
- if (mx.matches())
- mp = AddMacroDefxParms(mp, mx);
- else {
- MacroParms mpnew = new MacroParms(new String[0]);
- mp.nextParms = mpnew;
- mp = mpnew;
- }
- is.mark(100);
- il = is.readLine();
- if (il != null) {
- mx = MacroPatternx.matcher(il);
- mx2 = MacroPatternx2.matcher(il);
- }
- }
- is.reset();
- }
-
- if (macroMap.get(fd.MacroName) != null)
- return null;
- macroMap.put(fd.MacroName, fd);
- }
-
- return fd;
- }
-
- private static void WriteString(BufferedWriter os, String s) throws IOException {
- // System.out.println(s);
- os.write(s+"\n", 0, 1+s.length());
- }
-
+ static final boolean DEBUG = false;
+
+ static final String ATcmd = "(@\\w*)";
+
+ // Currently in automake docs, the macro section starts with
+ // a subsection as below and a table which contains macros which
+ // are item and itemx entries.
+ static final String MacrosStart = "@subsection\\sPublic\\smacros";
+ static final String OldMacrosStart = "@section\\sAutoconf\\smacros.*";
+ static final Pattern MacroSection1 = Pattern.compile(MacrosStart);
+ static final Pattern MacroSection2 = Pattern.compile(OldMacrosStart);
+ // 0
+ static final String Defmac = "@item";
+ static final String Defmacx = "@itemx";
+
+ // 1
+ static final String MacroName = "(\\w*)";
+ static final int MacroNameIndex = 1;
+
+ // 2 3
+ static final String Parms = "(\\((.*)\\))";
+ static final int ParmsIndex = 2;
+
+ static final String rest = ".*";
+
+ static final String WhiteSpace = "\\s*";
+
+ static final Pattern MacroPattern
+ = Pattern.compile("^" + Defmac + WhiteSpace +
+ MacroName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPattern2
+ = Pattern.compile("^" + Defmac + WhiteSpace + MacroName + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPatternx
+ = Pattern.compile("^" + Defmacx + WhiteSpace +
+ MacroName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern MacroPatternx2
+ = Pattern.compile("^" + Defmacx + WhiteSpace + MacroName + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index.*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern UrefPattern = Pattern.compile("@uref\\{([^,]*),\\s+([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+
+ private static Map macroMap;
+
+ static class MacroParms {
+ String[] parms;
+ MacroParms nextParms = null;
+
+ public MacroParms(String[] parms) {
+ this.parms = parms;
+ }
+ }
+
+ static class MacroDef {
+ String MacroName;
+ MacroParms Parameters;
+ String Synopsis;
+ }
+
+ static class TPElement {
+ String Content;
+ String Synopsis;
+ }
+
+ static class TPDef {
+ String TPType;
+ String TPName;
+ String TPSynopsis;
+ TPElement[] TPElements;
+ Object[] IncludeList;
+ }
+
+ private static String killTagsParms(String tt) {
+ Matcher mm;
+
+ mm = ParmBracketPattern.matcher(tt);
+ tt= mm.replaceAll("$1");
+
+ mm = OVarPattern.matcher(tt);
+ tt = mm.replaceAll("[$1]");
+
+ mm = DVarPattern.matcher(tt);
+ tt = mm.replaceAll("[$1=$2]");
+
+ mm = VarPattern.matcher(tt);
+ tt = mm.replaceAll("$1");
+
+ mm = RPattern.matcher(tt);
+ tt = mm.replaceAll("$1");
+
+ mm = DotsPattern.matcher(tt);
+ tt = mm.replaceAll("...");
+
+ return tt;
+ }
+
+
+ private static String killTags(String tt) {
+ Matcher mm;
+ String ss = "";
+
+ while (ss != tt) {
+ mm = XrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern2.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = NoIndentPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<VAR>$1</VAR>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DotsPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<small>...</small>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CommandPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = UrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<A HREF=\"$1>$2</A>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = KbdPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<KBD>$1</KBD>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EmphPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<EM>$1</EM>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = FilePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TT>$1</TT>");
+ }
+
+
+ ss = "";
+ while (ss != tt) {
+ mm = VerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndVerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = OptionPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</pre></td></tr></table>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndEnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.matches()) {
+ System.out.println("group 1 is " + mm.group(1));
+ System.out.println("group 2 is " + mm.group(2));
+ System.out.println("group 3 is " + mm.group(3));
+ }
+ tt = mm.replaceAll("$1<DT>'<SAMP>$2</SAMP>'\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1<DT>$2\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndTablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ //FIXME: if there ever is a @itemize @bullet within a
+ // @itemize @minus or vice-versa, the following
+ // logic will get it wrong.
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeMinusPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<UL>$1</UL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeBulletPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>$1</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<LI>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ mm = AmpersandPattern.matcher(tt);
+ tt = mm.replaceAll("&amp;");
+
+ mm = LeftAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&lt;");
+
+ mm = RightAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&gt;");
+
+ // Clean up the eol markers we used to mark end of line for items
+ mm = EOLPattern.matcher(tt);
+ tt = mm.replaceAll("");
+
+ return tt;
+ }
+
+ private static MacroDef BuildMacroDef(Matcher m) {
+ MacroDef md = new MacroDef();
+
+ md.MacroName = m.group(MacroNameIndex);
+
+ if (null != m.group(ParmsIndex)) {
+ String tt = killTagsParms(m.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ md.Parameters = new MacroParms(parms);
+ }
+ return md;
+ }
+
+ private static MacroParms AddMacroDefxParms(MacroParms mp, Matcher mx) {
+ if (null != mx.group(ParmsIndex)) {
+ String tt = killTagsParms(mx.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ MacroParms mpnew = new MacroParms(parms);
+ mp.nextParms = mpnew;
+ return mpnew;
+ }
+ return null;
+ }
+
+ private static MacroDef HandleMacroDef(BufferedReader is, String s) throws IOException {
+ MacroDef fd = null;
+
+ Matcher m = MacroPattern.matcher(s);
+
+ if (m.matches()) {
+ fd = BuildMacroDef(m);
+ }
+ else { // assume the line got split and retry
+ is.mark(100);
+ String il = is.readLine();
+ m = MacroPattern.matcher(s + il);
+ if (m.matches()) fd = BuildMacroDef(m);
+ else {
+ is.reset();
+ m = MacroPattern2.matcher(s);
+ if (m.matches()) {
+ fd = new MacroDef();
+ fd.MacroName = m.group(MacroNameIndex);
+ fd.Parameters = new MacroParms(new String[0]);
+ }
+ }
+ }
+
+ if (fd != null) {
+ // Look for @defmacx which are alternate prototypes for the macro
+ is.mark(100);
+ String il = is.readLine();
+ if (il != null) {
+ Matcher mx = MacroPatternx.matcher(il);
+ Matcher mx2 = MacroPatternx2.matcher(il);
+ MacroParms mp = fd.Parameters;
+ while (mx.matches() || mx2.matches()) {
+ if (mx.matches())
+ mp = AddMacroDefxParms(mp, mx);
+ else {
+ MacroParms mpnew = new MacroParms(new String[0]);
+ mp.nextParms = mpnew;
+ mp = mpnew;
+ }
+ is.mark(100);
+ il = is.readLine();
+ if (il != null) {
+ mx = MacroPatternx.matcher(il);
+ mx2 = MacroPatternx2.matcher(il);
+ }
+ }
+ is.reset();
+ }
+
+ if (macroMap.get(fd.MacroName) != null)
+ return null;
+ macroMap.put(fd.MacroName, fd);
+ }
+
+ return fd;
+ }
+
+ private static void WriteString(BufferedWriter os, String s) throws IOException {
+ // System.out.println(s);
+ os.write(s+"\n", 0, 1+s.length());
+ }
+
private static void CreateHeader(BufferedWriter os) throws IOException {
- WriteString(os, "<!-- This file automatically generated by ParseAutomakeTexinfo utility -->");
- WriteString(os, "<!-- cvs -d:pserver:anonymous@sources.redhat.com:/cvs/eclipse \\ -->");
- WriteString(os, "<!-- co autotools/ParseTexinfo -->");
- WriteString(os, "<!DOCTYPE macros [");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT macros (macro)*>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT macro (prototype*,synopsis)>");
- WriteString(os, " <!ATTLIST macro");
- WriteString(os, " id ID #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT prototype (parameter+)?>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
- WriteString(os, " <!ATTLIST parameter");
- WriteString(os, " content CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, "]>");
- WriteString(os, "");
+ WriteString(os, "<!-- This file automatically generated by ParseAutomakeTexinfo utility -->");
+ WriteString(os, "<!-- cvs -d:pserver:anonymous@sources.redhat.com:/cvs/eclipse \\ -->");
+ WriteString(os, "<!-- co autotools/ParseTexinfo -->");
+ WriteString(os, "<!DOCTYPE macros [");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT macros (macro)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT macro (prototype*,synopsis)>");
+ WriteString(os, " <!ATTLIST macro");
+ WriteString(os, " id ID #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT prototype (parameter+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST parameter");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, "]>");
+ WriteString(os, "");
}
- private static void CreateTrailer(BufferedWriter os) throws IOException {
- WriteString(os, "</macros>");
- }
-
- private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
- String ss = Synopsis;
- String[] tt = ss.split("\\s");
- String aa = "";
- String spaces = indent ? " " : " ";
- WriteString(os, spaces + "<synopsis>");
- if (null != Synopsis) {
- for (int pp = 0; pp < tt.length; pp++) {
- if (tt[pp].equals("&lt;br&gt;")) {
- WriteString(os, spaces + aa + "&lt;/P&gt;&lt;P&gt;\n");
- aa = "";
- }
- else {
- if ((aa.length() + tt[pp].length()) > 64) {
- WriteString(os, spaces + aa);
- aa = "";
- }
- aa = aa + " " + tt[pp];
- }
- }
- }
- if (aa.length() > 0) WriteString(os, " " + aa);
- WriteString(os, spaces + "</synopsis>");
- }
-
- private static void HandleDefmacro(BufferedWriter os, BufferedReader is, String s) throws IOException {
- String il;
- MacroDef md = null;
- List FDefs = new ArrayList();
-
- while (null != (il = is.readLine())) {
- if (il.startsWith(Defmac)) {
- if (null != (md = HandleMacroDef(is, il))) FDefs.add(md);
- }
- else if (il.startsWith("@comment") ||
- il.startsWith("@c ")) { // comment -- ignore it
- }
- else if (il.startsWith("@subsection") ||
- il.startsWith("@section")) {
- for (int kk = 0; kk < FDefs.size(); kk++) {
- md = (MacroDef)FDefs.get(kk);
-
- WriteString(os, " <macro id=\"" + md.MacroName + "\">");
-
- MacroParms mp = md.Parameters;
- do {
- WriteString(os, " <prototype>");
- String[] parms = mp.parms;
- for (int i = 0; i < parms.length; i++) {
- WriteString(os, " <parameter content=\"" + parms[i] + "\"/>");
- }
- WriteString(os, " </prototype>");
- mp = mp.nextParms;
- } while (mp != null);
-
- if (null != md.Synopsis) WriteSynopsis(os, md.Synopsis, false);
-
- WriteString(os, " </macro>");
- }
- return;
- }
- else {
- if (md != null)
- md.Synopsis = ((md.Synopsis == null) ? "" : md.Synopsis + " " ) + ((il.length() == 0) ? "&lt;br&gt;&lt;br&gt;" :
- il.startsWith("@item") ? killTags(il) + "<eol>" : killTags(il));
- }
- }
- FDefs.clear();
-
- }
-
- private static class OnlyTexi implements FilenameFilter {
- public boolean accept(File dir, String s) {
- return (s.endsWith(".texi")) ? true : false;
- }
- }
-
- public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
- try {
- macroMap = new HashMap();
- BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
-
- CreateHeader(os);
-// CreateLicense(os);
-
- WriteString(os, "<macros>");
-
- try {
- String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
- for (int i = 0; i < dir.length; i++) {
- String qFile = srcdir.endsWith("/")
- ? srcdir + dir[i]
- : srcdir + "/" + dir[i];
-
- try {
- BufferedReader is = new BufferedReader(new FileReader(qFile));
- String il;
-
- while (null != (il = is.readLine())) {
- Matcher mm1 = MacroSection1.matcher(il);
- Matcher mm2 = MacroSection2.matcher(il);
- if (mm1.matches() || mm2.matches()) {
- HandleDefmacro(os, is, il);
- }
- }
- is.close();
- }
- catch (IOException e) {
- System.out.println("Input File IOException: " + e);
- return;
- }
- }
- }
- catch (NullPointerException e) {
- System.out.println("NullPointerException: " + e);
- return;
- }
-
- CreateTrailer(os);
-
- os.close();
- }
- catch (IOException e) {
- System.out.println("Output File IOException: " + e);
- return;
- }
- }
-
- public static void main(String[] args) {
- // arg[0] is input directory containing .texi documents to read
- // arg[1] is output xml file to create
- BuildXMLFromTexinfo(args[0], args[1]);
- }
+ private static void CreateTrailer(BufferedWriter os) throws IOException {
+ WriteString(os, "</macros>");
+ }
+
+ private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
+ String ss = Synopsis;
+ String[] tt = ss.split("\\s");
+ String aa = "";
+ String spaces = indent ? " " : " ";
+ WriteString(os, spaces + "<synopsis>");
+ if (null != Synopsis) {
+ for (int pp = 0; pp < tt.length; pp++) {
+ if (tt[pp].equals("&lt;br&gt;")) {
+ WriteString(os, spaces + aa + "&lt;/P&gt;&lt;P&gt;\n");
+ aa = "";
+ }
+ else {
+ if ((aa.length() + tt[pp].length()) > 64) {
+ WriteString(os, spaces + aa);
+ aa = "";
+ }
+ aa = aa + " " + tt[pp];
+ }
+ }
+ }
+ if (aa.length() > 0) WriteString(os, " " + aa);
+ WriteString(os, spaces + "</synopsis>");
+ }
+
+ private static void HandleDefmacro(BufferedWriter os, BufferedReader is, String s) throws IOException {
+ String il;
+ MacroDef md = null;
+ List FDefs = new ArrayList();
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith(Defmac)) {
+ if (null != (md = HandleMacroDef(is, il))) FDefs.add(md);
+ }
+ else if (il.startsWith("@comment") ||
+ il.startsWith("@c ")) { // comment -- ignore it
+ }
+ else if (il.startsWith("@subsection") ||
+ il.startsWith("@section")) {
+ for (int kk = 0; kk < FDefs.size(); kk++) {
+ md = (MacroDef)FDefs.get(kk);
+
+ WriteString(os, " <macro id=\"" + md.MacroName + "\">");
+
+ MacroParms mp = md.Parameters;
+ do {
+ WriteString(os, " <prototype>");
+ String[] parms = mp.parms;
+ for (int i = 0; i < parms.length; i++) {
+ WriteString(os, " <parameter content=\"" + parms[i] + "\"/>");
+ }
+ WriteString(os, " </prototype>");
+ mp = mp.nextParms;
+ } while (mp != null);
+
+ if (null != md.Synopsis) WriteSynopsis(os, md.Synopsis, false);
+
+ WriteString(os, " </macro>");
+ }
+ return;
+ }
+ else {
+ if (md != null)
+ md.Synopsis = ((md.Synopsis == null) ? "" : md.Synopsis + " " ) + ((il.length() == 0) ? "&lt;br&gt;&lt;br&gt;" :
+ il.startsWith("@item") ? killTags(il) + "<eol>" : killTags(il));
+ }
+ }
+ FDefs.clear();
+
+ }
+
+ private static class OnlyTexi implements FilenameFilter {
+ public boolean accept(File dir, String s) {
+ return (s.endsWith(".texi")) ? true : false;
+ }
+ }
+
+ public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
+ try {
+ macroMap = new HashMap();
+ BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
+
+ CreateHeader(os);
+// CreateLicense(os);
+
+ WriteString(os, "<macros>");
+
+ try {
+ String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
+ for (int i = 0; i < dir.length; i++) {
+ String qFile = srcdir.endsWith("/")
+ ? srcdir + dir[i]
+ : srcdir + "/" + dir[i];
+
+ try {
+ BufferedReader is = new BufferedReader(new FileReader(qFile));
+ String il;
+
+ while (null != (il = is.readLine())) {
+ Matcher mm1 = MacroSection1.matcher(il);
+ Matcher mm2 = MacroSection2.matcher(il);
+ if (mm1.matches() || mm2.matches()) {
+ HandleDefmacro(os, is, il);
+ }
+ }
+ is.close();
+ }
+ catch (IOException e) {
+ System.out.println("Input File IOException: " + e);
+ return;
+ }
+ }
+ }
+ catch (NullPointerException e) {
+ System.out.println("NullPointerException: " + e);
+ return;
+ }
+
+ CreateTrailer(os);
+
+ os.close();
+ }
+ catch (IOException e) {
+ System.out.println("Output File IOException: " + e);
+ return;
+ }
+ }
+
+ public static void main(String[] args) {
+ // arg[0] is input directory containing .texi documents to read
+ // arg[1] is output xml file to create
+ BuildXMLFromTexinfo(args[0], args[1]);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java
index 7a8e965f92..af109d7d86 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java
@@ -21,869 +21,869 @@ import java.util.*;
//arguments: ${glibc_source_path}/manual glibc.xml
public class ParseGlibcTexinfo {
- static final boolean DEBUG = false;
-
- // 1
- static final String ATcmd = "(@\\w*)";
-
-
- // 3 4
- static final String RtnTypeM = "(\\{([^\\}]*)\\})";
- static final int RtnTypeMIndex = 4;
-
- // 5
- static final String RtnTypeS = "(\\w*)";
- static final int RtnTypeSIndex = 5;
-
- // 2
- static final String RtnType = "(" + RtnTypeM + "|" + RtnTypeS + ")";
- // 6
- static final String FunctionName = "(\\w*)";
- static final int FunctionNameIndex = 6;
-
- // 7 8
- static final String Parms = "(\\((.*)\\))";
- static final int ParmsIndex = 8;
-
- static final String rest = ".*";
-
- static final String WhiteSpace = "\\s*";
-
- static final Pattern DeftypefunPattern
- = Pattern.compile("^" + ATcmd + WhiteSpace +
- RtnType + WhiteSpace +
- FunctionName + WhiteSpace +
- Parms +
- rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final String TPDataType = "\\{[^\\}]*\\}";
-
-
- // 3 4
- static final String TPTypeM = "(\\{([^\\}]*)\\})";
- static final int TPTypeMIndex = 4;
-
- // 5
- static final String TPTypeS = "(\\w*)";
- static final int TPTypeSIndex = 5;
-
- // 2
- static final String TPType = "(" + TPTypeM + "|" + TPTypeS + ")";
-
- static final Pattern DeftpPattern
- = Pattern.compile("^" + ATcmd + WhiteSpace + TPDataType + WhiteSpace + TPType + rest,
- Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern IncludePattern = Pattern.compile("^@comment ((\\w*/)*\\w*\\.h\\s*)*\\s*$");
- static final Pattern PindexPattern = Pattern.compile("^@pindex\\s*\\w*\\s*$");
- static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
- static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
- static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
- static final Pattern ExamplePattern = Pattern.compile("@example");
- static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
- static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
- static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
- static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
- static final Pattern ItemPattern = Pattern.compile("@item");
- static final Pattern NoIndentPattern = Pattern.compile("@noindent");
- static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
- static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
- static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
- static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
- static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
- static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
- static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
- static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
- static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
- static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
- static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
- static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
- static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
- static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
- static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
- static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
- static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
- static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
- static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
- static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
- static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
- static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
- static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
- static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
- static final Pattern AmpersandPattern = Pattern.compile("&");
- static final Pattern LeftAnglePattern = Pattern.compile("<");
- static final Pattern RightAnglePattern = Pattern.compile(">");
-
- static List IncludeList = new ArrayList();
-
-
- static class FunctionDef {
- String ReturnType;
- String FunctionName;
- String[] Parameters;
- Object[] IncludeList;
- }
-
- static class TPElement {
- String Content;
- String Synopsis;
- }
-
- static class TPDef {
- String TPType;
- String TPName;
- String TPSynopsis;
- TPElement[] TPElements;
- Object[] IncludeList;
- }
-
- private static FunctionDef BuildFunctionDef(Matcher m) {
- FunctionDef fd = new FunctionDef();
-
- fd.ReturnType = ((null != m.group(RtnTypeSIndex))
- ? m.group(RtnTypeSIndex)
- : m.group(RtnTypeMIndex));
- fd.FunctionName = m.group(FunctionNameIndex);
-
- if (null != m.group(ParmsIndex)) {
- String tt = TexinfoUtils.stripProtoTags(m.group(ParmsIndex));
- String[] parms = tt.split(",\\s");
- fd.Parameters = parms;
- }
-
- if (IncludeList.size() > 0) {
- fd.IncludeList = IncludeList.toArray();
- IncludeList.clear();
- }
- return fd;
- }
-
- private static void HandleDeftp(BufferedWriter os, BufferedReader is, String s) throws IOException {
- TPDef td = new TPDef();
- String il;
- String Synopsis = null;
- boolean ItemsAccumulating = false;
- TPElement tpe = new TPElement();
- List ElementList = new ArrayList();
-
- Matcher m = DeftpPattern.matcher(s);
- if (m.matches()) {
- if (null != m.group(TPTypeMIndex)) {
- String[] ss = m.group(TPTypeMIndex).split("\\s");
- switch(ss.length) {
- case 0:
- td.TPType = "";
- td.TPName = "type";
- break;
- case 1:
- td.TPType = "type";
- td.TPName = ss[0];
- break;
- case 2:
- td.TPType = ss[0];
- td.TPName = ss[1];
- break;
- default:
- td.TPType = "type";
- td.TPName = ss[ss.length - 1];
- break;
- }
- }
- else {
- td.TPType = "dtype";
- td.TPName = m.group(TPTypeSIndex);
- }
-
- while (null != (il = is.readLine())) {
- if (il.startsWith("@end deftp")) {
- WriteString(os, " <construct id=\"" + td.TPType + "-" + td.TPName
- + "\" type=\"" + td.TPType + "\">");
- WriteString(os, " <structure>");
- if (null != td.TPSynopsis) WriteSynopsis(os, td.TPSynopsis, false);
- if (ElementList.size() > 0) {
- WriteString(os, " <elements>");
- for (int ee = 0; ee < ElementList.size(); ee++) {
- TPElement ttt = (TPElement)ElementList.get(ee);
- WriteString(os, " <element content=\"" + ttt.Content + "\">");
- if (null != ttt.Synopsis) WriteSynopsis(os, ttt.Synopsis, true);
- WriteString(os, " </element>");
- }
- WriteString(os, " </elements>");
- }
- WriteString(os, " </structure>");
- WriteString(os, " </construct>");
- return;
- }
- else if (il.startsWith("@item")) {
- if (ItemsAccumulating) {
- tpe.Synopsis = Synopsis;
- ElementList.add(tpe);
- }
- else {
- td.TPSynopsis = Synopsis;
- ItemsAccumulating = true;
- }
- Synopsis = null;
- tpe = new TPElement();
- tpe.Content = TexinfoUtils.transformTags(il.replaceFirst("@item ", ""));
- }
- else {
- if (!il.startsWith("@table"))
- Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
- il + "<eol>");
- }
- }
- }
- }
-
- private static FunctionDef HandleFunctionDef(BufferedReader is, String s) throws IOException {
- FunctionDef fd;
-
- Matcher m = DeftypefunPattern.matcher(s);
-
- if (m.matches()) fd = BuildFunctionDef(m);
- else { // assume the line got split and retry
- String il = is.readLine();
- m = DeftypefunPattern.matcher(s + il);
- if (m.matches()) fd = BuildFunctionDef(m);
- else fd = null;
- }
-
- return fd;
- }
-
- private static void WriteString(BufferedWriter os, String s) throws IOException {
- // System.out.println(s);
- os.write(s+"\n", 0, 1+s.length());
- }
-
- private static void CreateHeader(BufferedWriter os) throws IOException {
- WriteString(os, "<!-- This file automatically generated by an Eclipse utility -->");
- WriteString(os, "<!DOCTYPE descriptions [");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT descriptions (construct)*>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT construct (structure|function)*>");
- WriteString(os, " <!ATTLIST construct");
- WriteString(os, " id ID #REQUIRED");
- WriteString(os, " type CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT structure (synopsis?, elements?)?>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT elements (element*)>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT element (synopsis*)>");
- WriteString(os, " <!ATTLIST element");
- WriteString(os, " content CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT function (prototype,headers?,synopsis)>");
- WriteString(os, " <!ATTLIST function");
- WriteString(os, " returntype CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT prototype (parameter+)?>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
- WriteString(os, " <!ATTLIST parameter");
- WriteString(os, " content CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT headers (header+)?>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT header (#PCDATA)*>");
- WriteString(os, " <!ATTLIST header");
- WriteString(os, " filename CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, "]>");
- WriteString(os, "");
- }
+ static final boolean DEBUG = false;
+
+ // 1
+ static final String ATcmd = "(@\\w*)";
+
+
+ // 3 4
+ static final String RtnTypeM = "(\\{([^\\}]*)\\})";
+ static final int RtnTypeMIndex = 4;
+
+ // 5
+ static final String RtnTypeS = "(\\w*)";
+ static final int RtnTypeSIndex = 5;
+
+ // 2
+ static final String RtnType = "(" + RtnTypeM + "|" + RtnTypeS + ")";
+ // 6
+ static final String FunctionName = "(\\w*)";
+ static final int FunctionNameIndex = 6;
+
+ // 7 8
+ static final String Parms = "(\\((.*)\\))";
+ static final int ParmsIndex = 8;
+
+ static final String rest = ".*";
+
+ static final String WhiteSpace = "\\s*";
+
+ static final Pattern DeftypefunPattern
+ = Pattern.compile("^" + ATcmd + WhiteSpace +
+ RtnType + WhiteSpace +
+ FunctionName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final String TPDataType = "\\{[^\\}]*\\}";
+
+
+ // 3 4
+ static final String TPTypeM = "(\\{([^\\}]*)\\})";
+ static final int TPTypeMIndex = 4;
+
+ // 5
+ static final String TPTypeS = "(\\w*)";
+ static final int TPTypeSIndex = 5;
+
+ // 2
+ static final String TPType = "(" + TPTypeM + "|" + TPTypeS + ")";
+
+ static final Pattern DeftpPattern
+ = Pattern.compile("^" + ATcmd + WhiteSpace + TPDataType + WhiteSpace + TPType + rest,
+ Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern IncludePattern = Pattern.compile("^@comment ((\\w*/)*\\w*\\.h\\s*)*\\s*$");
+ static final Pattern PindexPattern = Pattern.compile("^@pindex\\s*\\w*\\s*$");
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+ static List IncludeList = new ArrayList();
+
+
+ static class FunctionDef {
+ String ReturnType;
+ String FunctionName;
+ String[] Parameters;
+ Object[] IncludeList;
+ }
+
+ static class TPElement {
+ String Content;
+ String Synopsis;
+ }
+
+ static class TPDef {
+ String TPType;
+ String TPName;
+ String TPSynopsis;
+ TPElement[] TPElements;
+ Object[] IncludeList;
+ }
+
+ private static FunctionDef BuildFunctionDef(Matcher m) {
+ FunctionDef fd = new FunctionDef();
+
+ fd.ReturnType = ((null != m.group(RtnTypeSIndex))
+ ? m.group(RtnTypeSIndex)
+ : m.group(RtnTypeMIndex));
+ fd.FunctionName = m.group(FunctionNameIndex);
+
+ if (null != m.group(ParmsIndex)) {
+ String tt = TexinfoUtils.stripProtoTags(m.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ fd.Parameters = parms;
+ }
+
+ if (IncludeList.size() > 0) {
+ fd.IncludeList = IncludeList.toArray();
+ IncludeList.clear();
+ }
+ return fd;
+ }
+
+ private static void HandleDeftp(BufferedWriter os, BufferedReader is, String s) throws IOException {
+ TPDef td = new TPDef();
+ String il;
+ String Synopsis = null;
+ boolean ItemsAccumulating = false;
+ TPElement tpe = new TPElement();
+ List ElementList = new ArrayList();
+
+ Matcher m = DeftpPattern.matcher(s);
+ if (m.matches()) {
+ if (null != m.group(TPTypeMIndex)) {
+ String[] ss = m.group(TPTypeMIndex).split("\\s");
+ switch(ss.length) {
+ case 0:
+ td.TPType = "";
+ td.TPName = "type";
+ break;
+ case 1:
+ td.TPType = "type";
+ td.TPName = ss[0];
+ break;
+ case 2:
+ td.TPType = ss[0];
+ td.TPName = ss[1];
+ break;
+ default:
+ td.TPType = "type";
+ td.TPName = ss[ss.length - 1];
+ break;
+ }
+ }
+ else {
+ td.TPType = "dtype";
+ td.TPName = m.group(TPTypeSIndex);
+ }
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith("@end deftp")) {
+ WriteString(os, " <construct id=\"" + td.TPType + "-" + td.TPName
+ + "\" type=\"" + td.TPType + "\">");
+ WriteString(os, " <structure>");
+ if (null != td.TPSynopsis) WriteSynopsis(os, td.TPSynopsis, false);
+ if (ElementList.size() > 0) {
+ WriteString(os, " <elements>");
+ for (int ee = 0; ee < ElementList.size(); ee++) {
+ TPElement ttt = (TPElement)ElementList.get(ee);
+ WriteString(os, " <element content=\"" + ttt.Content + "\">");
+ if (null != ttt.Synopsis) WriteSynopsis(os, ttt.Synopsis, true);
+ WriteString(os, " </element>");
+ }
+ WriteString(os, " </elements>");
+ }
+ WriteString(os, " </structure>");
+ WriteString(os, " </construct>");
+ return;
+ }
+ else if (il.startsWith("@item")) {
+ if (ItemsAccumulating) {
+ tpe.Synopsis = Synopsis;
+ ElementList.add(tpe);
+ }
+ else {
+ td.TPSynopsis = Synopsis;
+ ItemsAccumulating = true;
+ }
+ Synopsis = null;
+ tpe = new TPElement();
+ tpe.Content = TexinfoUtils.transformTags(il.replaceFirst("@item ", ""));
+ }
+ else {
+ if (!il.startsWith("@table"))
+ Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
+ il + "<eol>");
+ }
+ }
+ }
+ }
+
+ private static FunctionDef HandleFunctionDef(BufferedReader is, String s) throws IOException {
+ FunctionDef fd;
+
+ Matcher m = DeftypefunPattern.matcher(s);
+
+ if (m.matches()) fd = BuildFunctionDef(m);
+ else { // assume the line got split and retry
+ String il = is.readLine();
+ m = DeftypefunPattern.matcher(s + il);
+ if (m.matches()) fd = BuildFunctionDef(m);
+ else fd = null;
+ }
+
+ return fd;
+ }
+
+ private static void WriteString(BufferedWriter os, String s) throws IOException {
+ // System.out.println(s);
+ os.write(s+"\n", 0, 1+s.length());
+ }
+
+ private static void CreateHeader(BufferedWriter os) throws IOException {
+ WriteString(os, "<!-- This file automatically generated by an Eclipse utility -->");
+ WriteString(os, "<!DOCTYPE descriptions [");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT descriptions (construct)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT construct (structure|function)*>");
+ WriteString(os, " <!ATTLIST construct");
+ WriteString(os, " id ID #REQUIRED");
+ WriteString(os, " type CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT structure (synopsis?, elements?)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT elements (element*)>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT element (synopsis*)>");
+ WriteString(os, " <!ATTLIST element");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT function (prototype,headers?,synopsis)>");
+ WriteString(os, " <!ATTLIST function");
+ WriteString(os, " returntype CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT prototype (parameter+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST parameter");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT headers (header+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT header (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST header");
+ WriteString(os, " filename CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, "]>");
+ WriteString(os, "");
+ }
// // For now we will use an aggregate document license instead of one per
// // document.
-// private static void CreateLicense(BufferedWriter os) throws IOException {
-// WriteString(os, "<!--");
-// WriteString(os, "A.1 GNU Free Documentation License");
-// WriteString(os,"Version 1.2, November 2002");
-// WriteString(os, "");
-// WriteString(os, "Copyright &copy; 2000,2001,2002 Free Software Foundation, Inc.");
-// WriteString(os, "59 Temple Place, Suite 330, Boston, MA 02111-1307, USA");
-// WriteString(os, "");
-// WriteString(os, "Everyone is permitted to copy and distribute verbatim copies");
-// WriteString(os, "of this license document, but changing it is not allowed.");
-// WriteString(os, "");
-// WriteString(os, "1. PREAMBLE");
-// WriteString(os, "");
-// WriteString(os, "The purpose of this License is to make a manual, textbook, or other");
-// WriteString(os, "functional and useful document free in the sense of freedom: to");
-// WriteString(os, "assure everyone the effective freedom to copy and redistribute it,");
-// WriteString(os, "with or without modifying it, either commercially or noncommercially.");
-// WriteString(os, "Secondarily, this License preserves for the author and publisher a way");
-// WriteString(os, "to get credit for their work, while not being considered responsible");
-// WriteString(os, "for modifications made by others.");
-// WriteString(os, "");
-// WriteString(os, "This License is a kind of \"copyleft\", which means that derivative");
-// WriteString(os, "works of the document must themselves be free in the same sense. It");
-// WriteString(os, "complements the GNU General Public License, which is a copyleft");
-// WriteString(os, "license designed for free software.");
-// WriteString(os, "");
-// WriteString(os, "We have designed this License in order to use it for manuals for free");
-// WriteString(os, "software, because free software needs free documentation: a free");
-// WriteString(os, "program should come with manuals providing the same freedoms that the");
-// WriteString(os, "software does. But this License is not limited to software manuals;");
-// WriteString(os, "it can be used for any textual work, regardless of subject matter or");
-// WriteString(os, "whether it is published as a printed book. We recommend this License");
-// WriteString(os, "principally for works whose purpose is instruction or reference.");
-// WriteString(os, "");
-// WriteString(os, "2. APPLICABILITY AND DEFINITIONS");
-// WriteString(os, "");
-// WriteString(os, "This License applies to any manual or other work, in any medium, that");
-// WriteString(os, "contains a notice placed by the copyright holder saying it can be");
-// WriteString(os, "distributed under the terms of this License. Such a notice grants a");
-// WriteString(os, "world-wide, royalty-free license, unlimited in duration, to use that");
-// WriteString(os, "work under the conditions stated herein. The \"Document\", below,");
-// WriteString(os, "refers to any such manual or work. Any member of the public is a");
-// WriteString(os, "licensee, and is addressed as \"you\". You accept the license if you");
-// WriteString(os, "copy, modify or distribute the work in a way requiring permission");
-// WriteString(os, "under copyright law.");
-// WriteString(os, "");
-// WriteString(os, "A \"Modified Version\" of the Document means any work containing the");
-// WriteString(os, "Document or a portion of it, either copied verbatim, or with");
-// WriteString(os, "modifications and/or translated into another language.");
-// WriteString(os, "");
-// WriteString(os, "A \"Secondary Section\" is a named appendix or a front-matter section");
-// WriteString(os, "of the Document that deals exclusively with the relationship of the");
-// WriteString(os, "publishers or authors of the Document to the Document's overall");
-// WriteString(os, "subject (or to related matters) and contains nothing that could fall");
-// WriteString(os, "directly within that overall subject. (Thus, if the Document is in");
-// WriteString(os, "part a textbook of mathematics, a Secondary Section may not explain");
-// WriteString(os, "any mathematics.) The relationship could be a matter of historical");
-// WriteString(os, "connection with the subject or with related matters, or of legal,");
-// WriteString(os, "commercial, philosophical, ethical or political position regarding");
-// WriteString(os, "them.");
-// WriteString(os, "");
-// WriteString(os, "The \"Invariant Sections\" are certain Secondary Sections whose titles");
-// WriteString(os, "are designated, as being those of Invariant Sections, in the notice");
-// WriteString(os, "that says that the Document is released under this License. If a");
-// WriteString(os, "section does not fit the above definition of Secondary then it is not");
-// WriteString(os, "allowed to be designated as Invariant. The Document may contain zero");
-// WriteString(os, "Invariant Sections. If the Document does not identify any Invariant");
-// WriteString(os, "Sections then there are none.");
-// WriteString(os, "");
-// WriteString(os, "The \"Cover Texts\" are certain short passages of text that are listed,");
-// WriteString(os, "as Front-Cover Texts or Back-Cover Texts, in the notice that says that");
-// WriteString(os, "the Document is released under this License. A Front-Cover Text may");
-// WriteString(os, "be at most 5 words, and a Back-Cover Text may be at most 25 words.");
-// WriteString(os, "");
-// WriteString(os, "A \"Transparent\" copy of the Document means a machine-readable copy,");
-// WriteString(os, "represented in a format whose specification is available to the");
-// WriteString(os, "general public, that is suitable for revising the document");
-// WriteString(os, "straightforwardly with generic text editors or (for images composed of");
-// WriteString(os, "pixels) generic paint programs or (for drawings) some widely available");
-// WriteString(os, "drawing editor, and that is suitable for input to text formatters or");
-// WriteString(os, "for automatic translation to a variety of formats suitable for input");
-// WriteString(os, "to text formatters. A copy made in an otherwise Transparent file");
-// WriteString(os, "format whose markup, or absence of markup, has been arranged to thwart");
-// WriteString(os, "or discourage subsequent modification by readers is not Transparent.");
-// WriteString(os, "An image format is not Transparent if used for any substantial amount");
-// WriteString(os, "of text. A copy that is not \"Transparent\" is called \"Opaque\".");
-// WriteString(os, "");
-// WriteString(os, "Examples of suitable formats for Transparent copies include plain");
-// WriteString(os, "ASCII without markup, Texinfo input format, LaTeX input");
-// WriteString(os, "format, SGML or XML using a publicly available");
-// WriteString(os, "DTD, and standard-conforming simple HTML,");
-// WriteString(os, "PostScript or PDF designed for human modification. Examples");
-// WriteString(os, "of transparent image formats include PNG, XCF and");
-// WriteString(os, "JPG. Opaque formats include proprietary formats that can be");
-// WriteString(os, "read and edited only by proprietary word processors, SGML or");
-// WriteString(os, "XML for which the DTD and/or processing tools are");
-// WriteString(os, "not generally available, and the machine-generated HTML,");
-// WriteString(os, "PostScript or PDF produced by some word processors for");
-// WriteString(os, "output purposes only.");
-// WriteString(os, "");
-// WriteString(os, "The \"Title Page\" means, for a printed book, the title page itself,");
-// WriteString(os, "plus such following pages as are needed to hold, legibly, the material");
-// WriteString(os, "this License requires to appear in the title page. For works in");
-// WriteString(os, "formats which do not have any title page as such, \"Title Page\" means");
-// WriteString(os, "the text near the most prominent appearance of the work's title,");
-// WriteString(os, "preceding the beginning of the body of the text.");
-// WriteString(os, "");
-// WriteString(os, "A section \"Entitled XYZ\" means a named subunit of the Document whose");
-// WriteString(os, "title either is precisely XYZ or contains XYZ in parentheses following");
-// WriteString(os, "text that translates XYZ in another language. (Here XYZ stands for a");
-// WriteString(os, "specific section name mentioned below, such as \"Acknowledgements\",");
-// WriteString(os, "\"Dedications\", \"Endorsements\", or \"History\".) To \"Preserve the Title\"");
-// WriteString(os, "of such a section when you modify the Document means that it remains a");
-// WriteString(os, "section \"Entitled XYZ\" according to this definition.");
-// WriteString(os, "");
-// WriteString(os, "The Document may include Warranty Disclaimers next to the notice which");
-// WriteString(os, "states that this License applies to the Document. These Warranty");
-// WriteString(os, "Disclaimers are considered to be included by reference in this");
-// WriteString(os, "License, but only as regards disclaiming warranties: any other");
-// WriteString(os, "implication that these Warranty Disclaimers may have is void and has");
-// WriteString(os, "no effect on the meaning of this License.");
-// WriteString(os, "");
-// WriteString(os, "3. VERBATIM COPYING");
-// WriteString(os, "");
-// WriteString(os, "You may copy and distribute the Document in any medium, either");
-// WriteString(os, "commercially or noncommercially, provided that this License, the");
-// WriteString(os, "copyright notices, and the license notice saying this License applies");
-// WriteString(os, "to the Document are reproduced in all copies, and that you add no other");
-// WriteString(os, "conditions whatsoever to those of this License. You may not use");
-// WriteString(os, "technical measures to obstruct or control the reading or further");
-// WriteString(os, "copying of the copies you make or distribute. However, you may accept");
-// WriteString(os, "compensation in exchange for copies. If you distribute a large enough");
-// WriteString(os, "number of copies you must also follow the conditions in section 3.");
-// WriteString(os, "");
-// WriteString(os, "You may also lend copies, under the same conditions stated above, and");
-// WriteString(os, "you may publicly display copies.");
-// WriteString(os, "");
-// WriteString(os, "4. COPYING IN QUANTITY");
-// WriteString(os, "");
-// WriteString(os, "If you publish printed copies (or copies in media that commonly have");
-// WriteString(os, "printed covers) of the Document, numbering more than 100, and the");
-// WriteString(os, "Document's license notice requires Cover Texts, you must enclose the");
-// WriteString(os, "copies in covers that carry, clearly and legibly, all these Cover");
-// WriteString(os, "Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on");
-// WriteString(os, "the back cover. Both covers must also clearly and legibly identify");
-// WriteString(os, "you as the publisher of these copies. The front cover must present");
-// WriteString(os, "the full title with all words of the title equally prominent and");
-// WriteString(os, "visible. You may add other material on the covers in addition.");
-// WriteString(os, "Copying with changes limited to the covers, as long as they preserve");
-// WriteString(os, "the title of the Document and satisfy these conditions, can be treated");
-// WriteString(os, "as verbatim copying in other respects.");
-// WriteString(os, "");
-// WriteString(os, "If the required texts for either cover are too voluminous to fit");
-// WriteString(os, "legibly, you should put the first ones listed (as many as fit");
-// WriteString(os, "reasonably) on the actual cover, and continue the rest onto adjacent");
-// WriteString(os, "pages.");
-// WriteString(os, "");
-// WriteString(os, "If you publish or distribute Opaque copies of the Document numbering");
-// WriteString(os, "more than 100, you must either include a machine-readable Transparent");
-// WriteString(os, "copy along with each Opaque copy, or state in or with each Opaque copy");
-// WriteString(os, "a computer-network location from which the general network-using");
-// WriteString(os, "public has access to download using public-standard network protocols");
-// WriteString(os, "a complete Transparent copy of the Document, free of added material.");
-// WriteString(os, "If you use the latter option, you must take reasonably prudent steps,");
-// WriteString(os, "when you begin distribution of Opaque copies in quantity, to ensure");
-// WriteString(os, "that this Transparent copy will remain thus accessible at the stated");
-// WriteString(os, "location until at least one year after the last time you distribute an");
-// WriteString(os, "Opaque copy (directly or through your agents or retailers) of that");
-// WriteString(os, "edition to the public.");
-// WriteString(os, "");
-// WriteString(os, "It is requested, but not required, that you contact the authors of the");
-// WriteString(os, "Document well before redistributing any large number of copies, to give");
-// WriteString(os, "them a chance to provide you with an updated version of the Document.");
-// WriteString(os, "");
-// WriteString(os, "5. MODIFICATIONS");
-// WriteString(os, "");
-// WriteString(os, "You may copy and distribute a Modified Version of the Document under");
-// WriteString(os, "the conditions of sections 2 and 3 above, provided that you release");
-// WriteString(os, "the Modified Version under precisely this License, with the Modified");
-// WriteString(os, "Version filling the role of the Document, thus licensing distribution");
-// WriteString(os, "and modification of the Modified Version to whoever possesses a copy");
-// WriteString(os, "of it. In addition, you must do these things in the Modified Version:");
-// WriteString(os, "");
-// WriteString(os, " 1. Use in the Title Page (and on the covers, if any) a title distinct");
-// WriteString(os, " from that of the Document, and from those of previous versions");
-// WriteString(os, " (which should, if there were any, be listed in the History section");
-// WriteString(os, " of the Document). You may use the same title as a previous version");
-// WriteString(os, " if the original publisher of that version gives permission.");
-// WriteString(os, "");
-// WriteString(os, " 2. List on the Title Page, as authors, one or more persons or entities");
-// WriteString(os, " responsible for authorship of the modifications in the Modified");
-// WriteString(os, " Version, together with at least five of the principal authors of the");
-// WriteString(os, " Document (all of its principal authors, if it has fewer than five),");
-// WriteString(os, " unless they release you from this requirement.");
-// WriteString(os, "");
-// WriteString(os, " 3. State on the Title page the name of the publisher of the");
-// WriteString(os, " Modified Version, as the publisher.");
-// WriteString(os, "");
-// WriteString(os, " 4. Preserve all the copyright notices of the Document.");
-// WriteString(os, "");
-// WriteString(os, " 5. Add an appropriate copyright notice for your modifications");
-// WriteString(os, " adjacent to the other copyright notices.");
-// WriteString(os, "");
-// WriteString(os, " 6. Include, immediately after the copyright notices, a license notice");
-// WriteString(os, " giving the public permission to use the Modified Version under the");
-// WriteString(os, " terms of this License, in the form shown in the Addendum below.");
-// WriteString(os, "");
-// WriteString(os, " 7. Preserve in that license notice the full lists of Invariant Sections");
-// WriteString(os, " and required Cover Texts given in the Document's license notice.");
-// WriteString(os, "");
-// WriteString(os, " 8. Include an unaltered copy of this License.");
-// WriteString(os, "");
-// WriteString(os, " 9. Preserve the section Entitled \"History\", Preserve its Title, and add");
-// WriteString(os, " to it an item stating at least the title, year, new authors, and");
-// WriteString(os, " publisher of the Modified Version as given on the Title Page. If");
-// WriteString(os, " there is no section Entitled \"History\" in the Document, create one");
-// WriteString(os, " stating the title, year, authors, and publisher of the Document as");
-// WriteString(os, " given on its Title Page, then add an item describing the Modified");
-// WriteString(os, " Version as stated in the previous sentence.");
-// WriteString(os, "");
-// WriteString(os, " 10. Preserve the network location, if any, given in the Document for");
-// WriteString(os, " public access to a Transparent copy of the Document, and likewise");
-// WriteString(os, " the network locations given in the Document for previous versions");
-// WriteString(os, " it was based on. These may be placed in the \"History\" section.");
-// WriteString(os, " You may omit a network location for a work that was published at");
-// WriteString(os, " least four years before the Document itself, or if the original");
-// WriteString(os, " publisher of the version it refers to gives permission.");
-// WriteString(os, "");
-// WriteString(os, " 11. For any section Entitled \"Acknowledgements\" or \"Dedications\", Preserve");
-// WriteString(os, " the Title of the section, and preserve in the section all the");
-// WriteString(os, " substance and tone of each of the contributor acknowledgements and/or");
-// WriteString(os, " dedications given therein.");
-// WriteString(os, "");
-// WriteString(os, " 12. Preserve all the Invariant Sections of the Document,");
-// WriteString(os, " unaltered in their text and in their titles. Section numbers");
-// WriteString(os, " or the equivalent are not considered part of the section titles.");
-// WriteString(os, "");
-// WriteString(os, " 13. Delete any section Entitled \"Endorsements\". Such a section");
-// WriteString(os, " may not be included in the Modified Version.");
-// WriteString(os, "");
-// WriteString(os, " 14. Do not retitle any existing section to be Entitled \"Endorsements\" or");
-// WriteString(os, " to conflict in title with any Invariant Section.");
-// WriteString(os, "");
-// WriteString(os, " 15. Preserve any Warranty Disclaimers.");
-// WriteString(os, "");
-// WriteString(os, "");
-// WriteString(os, "If the Modified Version includes new front-matter sections or");
-// WriteString(os, "appendices that qualify as Secondary Sections and contain no material");
-// WriteString(os, "copied from the Document, you may at your option designate some or all");
-// WriteString(os, "of these sections as invariant. To do this, add their titles to the");
-// WriteString(os, "list of Invariant Sections in the Modified Version's license notice.");
-// WriteString(os, "These titles must be distinct from any other section titles.");
-// WriteString(os, "");
-// WriteString(os, "You may add a section Entitled \"Endorsements\", provided it contains");
-// WriteString(os, "nothing but endorsements of your Modified Version by various");
-// WriteString(os, "parties - for example, statements of peer review or that the text has");
-// WriteString(os, "been approved by an organization as the authoritative definition of a");
-// WriteString(os, "standard.");
-// WriteString(os, "");
-// WriteString(os, "You may add a passage of up to five words as a Front-Cover Text, and a");
-// WriteString(os, "passage of up to 25 words as a Back-Cover Text, to the end of the list");
-// WriteString(os, "of Cover Texts in the Modified Version. Only one passage of");
-// WriteString(os, "Front-Cover Text and one of Back-Cover Text may be added by (or");
-// WriteString(os, "through arrangements made by) any one entity. If the Document already");
-// WriteString(os, "includes a cover text for the same cover, previously added by you or");
-// WriteString(os, "by arrangement made by the same entity you are acting on behalf of,");
-// WriteString(os, "you may not add another; but you may replace the old one, on explicit");
-// WriteString(os, "permission from the previous publisher that added the old one.");
-// WriteString(os, "");
-// WriteString(os, "The author(s) and publisher(s) of the Document do not by this License");
-// WriteString(os, "give permission to use their names for publicity for or to assert or");
-// WriteString(os, "imply endorsement of any Modified Version.");
-// WriteString(os, "");
-// WriteString(os, "6. COMBINING DOCUMENTS");
-// WriteString(os, "");
-// WriteString(os, "You may combine the Document with other documents released under this");
-// WriteString(os, "License, under the terms defined in section 4 above for modified");
-// WriteString(os, "versions, provided that you include in the combination all of the");
-// WriteString(os, "Invariant Sections of all of the original documents, unmodified, and");
-// WriteString(os, "list them all as Invariant Sections of your combined work in its");
-// WriteString(os, "license notice, and that you preserve all their Warranty Disclaimers.");
-// WriteString(os, "");
-// WriteString(os, "The combined work need only contain one copy of this License, and");
-// WriteString(os, "multiple identical Invariant Sections may be replaced with a single");
-// WriteString(os, "copy. If there are multiple Invariant Sections with the same name but");
-// WriteString(os, "different contents, make the title of each such section unique by");
-// WriteString(os, "adding at the end of it, in parentheses, the name of the original");
-// WriteString(os, "author or publisher of that section if known, or else a unique number.");
-// WriteString(os, "Make the same adjustment to the section titles in the list of");
-// WriteString(os, "Invariant Sections in the license notice of the combined work.");
-// WriteString(os, "");
-// WriteString(os, "In the combination, you must combine any sections Entitled \"History\"");
-// WriteString(os, "in the various original documents, forming one section Entitled");
-// WriteString(os, "\"History\"; likewise combine any sections Entitled \"Acknowledgements\",");
-// WriteString(os, "and any sections Entitled \"Dedications\". You must delete all");
-// WriteString(os, "sections Entitled \"Endorsements.\"");
-// WriteString(os, "");
-// WriteString(os, "7. COLLECTIONS OF DOCUMENTS");
-// WriteString(os, "");
-// WriteString(os, "You may make a collection consisting of the Document and other documents");
-// WriteString(os, "released under this License, and replace the individual copies of this");
-// WriteString(os, "License in the various documents with a single copy that is included in");
-// WriteString(os, "the collection, provided that you follow the rules of this License for");
-// WriteString(os, "verbatim copying of each of the documents in all other respects.");
-// WriteString(os, "");
-// WriteString(os, "You may extract a single document from such a collection, and distribute");
-// WriteString(os, "it individually under this License, provided you insert a copy of this");
-// WriteString(os, "License into the extracted document, and follow this License in all");
-// WriteString(os, "other respects regarding verbatim copying of that document.");
-// WriteString(os, "");
-// WriteString(os, "8. AGGREGATION WITH INDEPENDENT WORKS");
-// WriteString(os, "");
-// WriteString(os, "A compilation of the Document or its derivatives with other separate");
-// WriteString(os, "and independent documents or works, in or on a volume of a storage or");
-// WriteString(os, "distribution medium, is called an \"aggregate\" if the copyright");
-// WriteString(os, "resulting from the compilation is not used to limit the legal rights");
-// WriteString(os, "of the compilation's users beyond what the individual works permit.");
-// WriteString(os, "When the Document is included an aggregate, this License does not");
-// WriteString(os, "apply to the other works in the aggregate which are not themselves");
-// WriteString(os, "derivative works of the Document.");
-// WriteString(os, "");
-// WriteString(os, "If the Cover Text requirement of section 3 is applicable to these");
-// WriteString(os, "copies of the Document, then if the Document is less than one half of");
-// WriteString(os, "the entire aggregate, the Document's Cover Texts may be placed on");
-// WriteString(os, "covers that bracket the Document within the aggregate, or the");
-// WriteString(os, "electronic equivalent of covers if the Document is in electronic form.");
-// WriteString(os, "Otherwise they must appear on printed covers that bracket the whole");
-// WriteString(os, "aggregate.");
-// WriteString(os, "");
-// WriteString(os, "9. TRANSLATION");
-// WriteString(os, "");
-// WriteString(os, "Translation is considered a kind of modification, so you may");
-// WriteString(os, "distribute translations of the Document under the terms of section 4.");
-// WriteString(os, "Replacing Invariant Sections with translations requires special");
-// WriteString(os, "permission from their copyright holders, but you may include");
-// WriteString(os, "translations of some or all Invariant Sections in addition to the");
-// WriteString(os, "original versions of these Invariant Sections. You may include a");
-// WriteString(os, "translation of this License, and all the license notices in the");
-// WriteString(os, "Document, and any Warrany Disclaimers, provided that you also include");
-// WriteString(os, "the original English version of this License and the original versions");
-// WriteString(os, "of those notices and disclaimers. In case of a disagreement between");
-// WriteString(os, "the translation and the original version of this License or a notice");
-// WriteString(os, "or disclaimer, the original version will prevail.");
-// WriteString(os, "");
-// WriteString(os, "If a section in the Document is Entitled \"Acknowledgements\",");
-// WriteString(os, "\"Dedications\", or \"History\", the requirement (section 4) to Preserve");
-// WriteString(os, "its Title (section 1) will typically require changing the actual");
-// WriteString(os, "title.");
-// WriteString(os, "");
-// WriteString(os, "10. TERMINATION");
-// WriteString(os, "");
-// WriteString(os, "You may not copy, modify, sublicense, or distribute the Document except");
-// WriteString(os, "as expressly provided for under this License. Any other attempt to");
-// WriteString(os, "copy, modify, sublicense or distribute the Document is void, and will");
-// WriteString(os, "automatically terminate your rights under this License. However,");
-// WriteString(os, "parties who have received copies, or rights, from you under this");
-// WriteString(os, "License will not have their licenses terminated so long as such");
-// WriteString(os, "parties remain in full compliance.");
-// WriteString(os, "");
-// WriteString(os, "11. FUTURE REVISIONS OF THIS LICENSE");
-// WriteString(os, "");
-// WriteString(os, "The Free Software Foundation may publish new, revised versions");
-// WriteString(os, "of the GNU Free Documentation License from time to time. Such new");
-// WriteString(os, "versions will be similar in spirit to the present version, but may");
-// WriteString(os, "differ in detail to address new problems or concerns. See");
-// WriteString(os, "http://www.gnu.org/copyleft/.");
-// WriteString(os, "");
-// WriteString(os, "Each version of the License is given a distinguishing version number.");
-// WriteString(os, "If the Document specifies that a particular numbered version of this");
-// WriteString(os, "License \"or any later version\" applies to it, you have the option of");
-// WriteString(os, "following the terms and conditions either of that specified version or");
-// WriteString(os, "of any later version that has been published (not as a draft) by the");
-// WriteString(os, "Free Software Foundation. If the Document does not specify a version");
-// WriteString(os, "number of this License, you may choose any version ever published (not");
-// WriteString(os, "as a draft) by the Free Software Foundation.");
-// WriteString(os, "-->");
-// }
-
- private static void CreateTrailer(BufferedWriter os) throws IOException {
- WriteString(os, "</descriptions>");
- }
-
- private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
- String ss = TexinfoUtils.transformTags(Synopsis);
- String[] tt = ss.split("<eol>");
- String aa = "";
- String spaces = indent ? " " : " ";
- WriteString(os, spaces + "<synopsis>");
- if (null != Synopsis) {
- for (int pp = 0; pp < tt.length; pp++) {
- WriteString(os, spaces + tt[pp]);
-// if (tt[pp].equals("<br>")) {
-// WriteString(os, spaces + aa + "\n");
-// aa = "";
-// }
-// else {
-// if ((aa.length() + tt[pp].length()) > 64) {
-// WriteString(os, spaces + aa);
-// aa = "";
-// }
-// aa = aa + " " + tt[pp];
-// }
- }
- }
- if (aa.length() > 0) WriteString(os, " " + aa);
- WriteString(os, spaces + "</synopsis>");
- }
-
- private static String HandleInclude (String srcdir, String line, String Synopsis) {
- Pattern p = Pattern.compile("@include\\s+(.*?)\\.texi");
- Matcher mm = p.matcher(line);
- if (mm.find()) {
- String il;
- BufferedReader is = null;
- try {
- String fileName = (srcdir.endsWith("/") ? srcdir : srcdir + "/") + mm.replaceAll("examples/$1");
- is = new BufferedReader(new FileReader(fileName));
- while (null != (il = is.readLine())) {
- // C Help does not ignore "<" or ">" inside a <pre> or <samp> tag
- // so we have to prepare for two levels of indirection. The
- // first is for xml to interpret and the second is for the
- // C Help processor to interpret. So, we put &lt; and &gt; which
- // will be transformed into &amp;lt; by the tag transformer.
- Pattern p1 = Pattern.compile("<");
- Pattern p2 = Pattern.compile(">");
- Matcher mm1 = p1.matcher(il);
- il = mm1.replaceAll("&lt;");
- Matcher mm2 = p2.matcher(il);
- il = mm2.replaceAll("&gt;");
- Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
- il + "<eol>");
- }
- } catch (IOException e) {
- System.out.println("IOException reading example file");
- } finally {
- if (is != null) {
- try {
- is.close();
- } catch (IOException e) {
- }
- }
- }
- }
- return Synopsis;
- }
- private static void HandleDeftypefun(BufferedWriter os, BufferedReader is, String s, String srcdir) throws IOException {
- String il;
- FunctionDef fd;
- List FDefs = new ArrayList();
- String Synopsis = null;
-
- if (null != (fd = HandleFunctionDef(is, s))) FDefs.add(fd);
-
- while (null != (il = is.readLine())) {
- Matcher mm = IncludePattern.matcher(il);
- if (il.startsWith("@deftypefunx")) {
- if (null != (fd = HandleFunctionDef(is, il))) FDefs.add(fd);
- }
- else if (mm.matches()) {
- if (!IncludeList.contains(mm.group(1)))
- IncludeList.add(mm.group(1));
- }
- else if (il.startsWith("@comment") ||
- il.startsWith("@c ") ||
- il.startsWith("@pindex")) { // ignore
- }
- else if (il.startsWith("@include") && fd != null) {
- Synopsis = HandleInclude(srcdir, il, Synopsis);
- }
- else if (il.startsWith("@end deftypefun")) {
- for (int kk = 0; kk < FDefs.size(); kk++) {
- fd = (FunctionDef)FDefs.get(kk);
-
- WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
-
- WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
-
- WriteString(os, " <prototype>");
- String[] parms = fd.Parameters;
- for (int i = 0; i < parms.length; i++) {
- String parm = TexinfoUtils.stripProtoTags(parms[i]);
- WriteString(os, " <parameter content=\"" + parm + "\"/>");
- }
- WriteString(os, " </prototype>");
-
- if (fd.IncludeList != null) {
- WriteString(os, " <headers>");
- Object[] incs = fd.IncludeList;
- for (int j = 0; j < incs.length; j++) {
- String inc = (String)incs[j];
- WriteString(os, " <header filename = \"" + inc + "\"/>");
- }
- WriteString(os, " </headers>");
- }
-
- if (null != Synopsis) WriteSynopsis(os, Synopsis, false);
-
- WriteString(os, " </function>");
- WriteString(os, " </construct>");
- }
- return;
- }
- else {
- Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
- il + "<eol>");
- }
- }
- FDefs.clear();
-
- }
-
- private static class OnlyTexi implements FilenameFilter {
- public boolean accept(File dir, String s) {
- return (s.endsWith(".texi")) ? true : false;
- }
- }
-
- public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
- try {
- BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
-
- CreateHeader(os);
-// CreateLicense(os);
-
- WriteString(os, "<descriptions>");
-
- try {
- String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
- for (int i = 0; i < dir.length; i++) {
- String qFile = srcdir.endsWith("/")
- ? srcdir + dir[i]
- : srcdir + "/" + dir[i];
-
- try {
- BufferedReader is = new BufferedReader(new FileReader(qFile));
- String il;
-
- while (null != (il = is.readLine())) {
- Matcher mm = IncludePattern.matcher(il);
- if (il.startsWith("@deftypefun")) { // handle @deftypefun[x]
- HandleDeftypefun(os, is, il, srcdir);
- }
- else if (il.startsWith("@deftp")) { // handle @deftp
- HandleDeftp(os, is, il);
- }
- else if (mm.matches()) { // handle @comment <include_file>
- if (!IncludeList.contains(mm.group(1)))
- IncludeList.add(mm.group(1));
- }
- else if (il.startsWith("@end deftypefn"))
- // Handle accumulated header file comments that are in
- // constructs we aren't parsing.
- IncludeList.clear();
- }
- is.close();
- }
- catch (IOException e) {
- System.out.println("Input File IOException: " + e);
- return;
- }
- }
- }
- catch (NullPointerException e) {
- System.out.println("NullPointerException: " + e);
- return;
- }
-
- CreateTrailer(os);
-
- os.close();
- }
- catch (IOException e) {
- System.out.println("Output File IOException: " + e);
- return;
- }
- }
-
- public static void main(String[] args) {
- BuildXMLFromTexinfo(args[0], args[1]);
- }
+// private static void CreateLicense(BufferedWriter os) throws IOException {
+// WriteString(os, "<!--");
+// WriteString(os, "A.1 GNU Free Documentation License");
+// WriteString(os,"Version 1.2, November 2002");
+// WriteString(os, "");
+// WriteString(os, "Copyright &copy; 2000,2001,2002 Free Software Foundation, Inc.");
+// WriteString(os, "59 Temple Place, Suite 330, Boston, MA 02111-1307, USA");
+// WriteString(os, "");
+// WriteString(os, "Everyone is permitted to copy and distribute verbatim copies");
+// WriteString(os, "of this license document, but changing it is not allowed.");
+// WriteString(os, "");
+// WriteString(os, "1. PREAMBLE");
+// WriteString(os, "");
+// WriteString(os, "The purpose of this License is to make a manual, textbook, or other");
+// WriteString(os, "functional and useful document free in the sense of freedom: to");
+// WriteString(os, "assure everyone the effective freedom to copy and redistribute it,");
+// WriteString(os, "with or without modifying it, either commercially or noncommercially.");
+// WriteString(os, "Secondarily, this License preserves for the author and publisher a way");
+// WriteString(os, "to get credit for their work, while not being considered responsible");
+// WriteString(os, "for modifications made by others.");
+// WriteString(os, "");
+// WriteString(os, "This License is a kind of \"copyleft\", which means that derivative");
+// WriteString(os, "works of the document must themselves be free in the same sense. It");
+// WriteString(os, "complements the GNU General Public License, which is a copyleft");
+// WriteString(os, "license designed for free software.");
+// WriteString(os, "");
+// WriteString(os, "We have designed this License in order to use it for manuals for free");
+// WriteString(os, "software, because free software needs free documentation: a free");
+// WriteString(os, "program should come with manuals providing the same freedoms that the");
+// WriteString(os, "software does. But this License is not limited to software manuals;");
+// WriteString(os, "it can be used for any textual work, regardless of subject matter or");
+// WriteString(os, "whether it is published as a printed book. We recommend this License");
+// WriteString(os, "principally for works whose purpose is instruction or reference.");
+// WriteString(os, "");
+// WriteString(os, "2. APPLICABILITY AND DEFINITIONS");
+// WriteString(os, "");
+// WriteString(os, "This License applies to any manual or other work, in any medium, that");
+// WriteString(os, "contains a notice placed by the copyright holder saying it can be");
+// WriteString(os, "distributed under the terms of this License. Such a notice grants a");
+// WriteString(os, "world-wide, royalty-free license, unlimited in duration, to use that");
+// WriteString(os, "work under the conditions stated herein. The \"Document\", below,");
+// WriteString(os, "refers to any such manual or work. Any member of the public is a");
+// WriteString(os, "licensee, and is addressed as \"you\". You accept the license if you");
+// WriteString(os, "copy, modify or distribute the work in a way requiring permission");
+// WriteString(os, "under copyright law.");
+// WriteString(os, "");
+// WriteString(os, "A \"Modified Version\" of the Document means any work containing the");
+// WriteString(os, "Document or a portion of it, either copied verbatim, or with");
+// WriteString(os, "modifications and/or translated into another language.");
+// WriteString(os, "");
+// WriteString(os, "A \"Secondary Section\" is a named appendix or a front-matter section");
+// WriteString(os, "of the Document that deals exclusively with the relationship of the");
+// WriteString(os, "publishers or authors of the Document to the Document's overall");
+// WriteString(os, "subject (or to related matters) and contains nothing that could fall");
+// WriteString(os, "directly within that overall subject. (Thus, if the Document is in");
+// WriteString(os, "part a textbook of mathematics, a Secondary Section may not explain");
+// WriteString(os, "any mathematics.) The relationship could be a matter of historical");
+// WriteString(os, "connection with the subject or with related matters, or of legal,");
+// WriteString(os, "commercial, philosophical, ethical or political position regarding");
+// WriteString(os, "them.");
+// WriteString(os, "");
+// WriteString(os, "The \"Invariant Sections\" are certain Secondary Sections whose titles");
+// WriteString(os, "are designated, as being those of Invariant Sections, in the notice");
+// WriteString(os, "that says that the Document is released under this License. If a");
+// WriteString(os, "section does not fit the above definition of Secondary then it is not");
+// WriteString(os, "allowed to be designated as Invariant. The Document may contain zero");
+// WriteString(os, "Invariant Sections. If the Document does not identify any Invariant");
+// WriteString(os, "Sections then there are none.");
+// WriteString(os, "");
+// WriteString(os, "The \"Cover Texts\" are certain short passages of text that are listed,");
+// WriteString(os, "as Front-Cover Texts or Back-Cover Texts, in the notice that says that");
+// WriteString(os, "the Document is released under this License. A Front-Cover Text may");
+// WriteString(os, "be at most 5 words, and a Back-Cover Text may be at most 25 words.");
+// WriteString(os, "");
+// WriteString(os, "A \"Transparent\" copy of the Document means a machine-readable copy,");
+// WriteString(os, "represented in a format whose specification is available to the");
+// WriteString(os, "general public, that is suitable for revising the document");
+// WriteString(os, "straightforwardly with generic text editors or (for images composed of");
+// WriteString(os, "pixels) generic paint programs or (for drawings) some widely available");
+// WriteString(os, "drawing editor, and that is suitable for input to text formatters or");
+// WriteString(os, "for automatic translation to a variety of formats suitable for input");
+// WriteString(os, "to text formatters. A copy made in an otherwise Transparent file");
+// WriteString(os, "format whose markup, or absence of markup, has been arranged to thwart");
+// WriteString(os, "or discourage subsequent modification by readers is not Transparent.");
+// WriteString(os, "An image format is not Transparent if used for any substantial amount");
+// WriteString(os, "of text. A copy that is not \"Transparent\" is called \"Opaque\".");
+// WriteString(os, "");
+// WriteString(os, "Examples of suitable formats for Transparent copies include plain");
+// WriteString(os, "ASCII without markup, Texinfo input format, LaTeX input");
+// WriteString(os, "format, SGML or XML using a publicly available");
+// WriteString(os, "DTD, and standard-conforming simple HTML,");
+// WriteString(os, "PostScript or PDF designed for human modification. Examples");
+// WriteString(os, "of transparent image formats include PNG, XCF and");
+// WriteString(os, "JPG. Opaque formats include proprietary formats that can be");
+// WriteString(os, "read and edited only by proprietary word processors, SGML or");
+// WriteString(os, "XML for which the DTD and/or processing tools are");
+// WriteString(os, "not generally available, and the machine-generated HTML,");
+// WriteString(os, "PostScript or PDF produced by some word processors for");
+// WriteString(os, "output purposes only.");
+// WriteString(os, "");
+// WriteString(os, "The \"Title Page\" means, for a printed book, the title page itself,");
+// WriteString(os, "plus such following pages as are needed to hold, legibly, the material");
+// WriteString(os, "this License requires to appear in the title page. For works in");
+// WriteString(os, "formats which do not have any title page as such, \"Title Page\" means");
+// WriteString(os, "the text near the most prominent appearance of the work's title,");
+// WriteString(os, "preceding the beginning of the body of the text.");
+// WriteString(os, "");
+// WriteString(os, "A section \"Entitled XYZ\" means a named subunit of the Document whose");
+// WriteString(os, "title either is precisely XYZ or contains XYZ in parentheses following");
+// WriteString(os, "text that translates XYZ in another language. (Here XYZ stands for a");
+// WriteString(os, "specific section name mentioned below, such as \"Acknowledgements\",");
+// WriteString(os, "\"Dedications\", \"Endorsements\", or \"History\".) To \"Preserve the Title\"");
+// WriteString(os, "of such a section when you modify the Document means that it remains a");
+// WriteString(os, "section \"Entitled XYZ\" according to this definition.");
+// WriteString(os, "");
+// WriteString(os, "The Document may include Warranty Disclaimers next to the notice which");
+// WriteString(os, "states that this License applies to the Document. These Warranty");
+// WriteString(os, "Disclaimers are considered to be included by reference in this");
+// WriteString(os, "License, but only as regards disclaiming warranties: any other");
+// WriteString(os, "implication that these Warranty Disclaimers may have is void and has");
+// WriteString(os, "no effect on the meaning of this License.");
+// WriteString(os, "");
+// WriteString(os, "3. VERBATIM COPYING");
+// WriteString(os, "");
+// WriteString(os, "You may copy and distribute the Document in any medium, either");
+// WriteString(os, "commercially or noncommercially, provided that this License, the");
+// WriteString(os, "copyright notices, and the license notice saying this License applies");
+// WriteString(os, "to the Document are reproduced in all copies, and that you add no other");
+// WriteString(os, "conditions whatsoever to those of this License. You may not use");
+// WriteString(os, "technical measures to obstruct or control the reading or further");
+// WriteString(os, "copying of the copies you make or distribute. However, you may accept");
+// WriteString(os, "compensation in exchange for copies. If you distribute a large enough");
+// WriteString(os, "number of copies you must also follow the conditions in section 3.");
+// WriteString(os, "");
+// WriteString(os, "You may also lend copies, under the same conditions stated above, and");
+// WriteString(os, "you may publicly display copies.");
+// WriteString(os, "");
+// WriteString(os, "4. COPYING IN QUANTITY");
+// WriteString(os, "");
+// WriteString(os, "If you publish printed copies (or copies in media that commonly have");
+// WriteString(os, "printed covers) of the Document, numbering more than 100, and the");
+// WriteString(os, "Document's license notice requires Cover Texts, you must enclose the");
+// WriteString(os, "copies in covers that carry, clearly and legibly, all these Cover");
+// WriteString(os, "Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on");
+// WriteString(os, "the back cover. Both covers must also clearly and legibly identify");
+// WriteString(os, "you as the publisher of these copies. The front cover must present");
+// WriteString(os, "the full title with all words of the title equally prominent and");
+// WriteString(os, "visible. You may add other material on the covers in addition.");
+// WriteString(os, "Copying with changes limited to the covers, as long as they preserve");
+// WriteString(os, "the title of the Document and satisfy these conditions, can be treated");
+// WriteString(os, "as verbatim copying in other respects.");
+// WriteString(os, "");
+// WriteString(os, "If the required texts for either cover are too voluminous to fit");
+// WriteString(os, "legibly, you should put the first ones listed (as many as fit");
+// WriteString(os, "reasonably) on the actual cover, and continue the rest onto adjacent");
+// WriteString(os, "pages.");
+// WriteString(os, "");
+// WriteString(os, "If you publish or distribute Opaque copies of the Document numbering");
+// WriteString(os, "more than 100, you must either include a machine-readable Transparent");
+// WriteString(os, "copy along with each Opaque copy, or state in or with each Opaque copy");
+// WriteString(os, "a computer-network location from which the general network-using");
+// WriteString(os, "public has access to download using public-standard network protocols");
+// WriteString(os, "a complete Transparent copy of the Document, free of added material.");
+// WriteString(os, "If you use the latter option, you must take reasonably prudent steps,");
+// WriteString(os, "when you begin distribution of Opaque copies in quantity, to ensure");
+// WriteString(os, "that this Transparent copy will remain thus accessible at the stated");
+// WriteString(os, "location until at least one year after the last time you distribute an");
+// WriteString(os, "Opaque copy (directly or through your agents or retailers) of that");
+// WriteString(os, "edition to the public.");
+// WriteString(os, "");
+// WriteString(os, "It is requested, but not required, that you contact the authors of the");
+// WriteString(os, "Document well before redistributing any large number of copies, to give");
+// WriteString(os, "them a chance to provide you with an updated version of the Document.");
+// WriteString(os, "");
+// WriteString(os, "5. MODIFICATIONS");
+// WriteString(os, "");
+// WriteString(os, "You may copy and distribute a Modified Version of the Document under");
+// WriteString(os, "the conditions of sections 2 and 3 above, provided that you release");
+// WriteString(os, "the Modified Version under precisely this License, with the Modified");
+// WriteString(os, "Version filling the role of the Document, thus licensing distribution");
+// WriteString(os, "and modification of the Modified Version to whoever possesses a copy");
+// WriteString(os, "of it. In addition, you must do these things in the Modified Version:");
+// WriteString(os, "");
+// WriteString(os, " 1. Use in the Title Page (and on the covers, if any) a title distinct");
+// WriteString(os, " from that of the Document, and from those of previous versions");
+// WriteString(os, " (which should, if there were any, be listed in the History section");
+// WriteString(os, " of the Document). You may use the same title as a previous version");
+// WriteString(os, " if the original publisher of that version gives permission.");
+// WriteString(os, "");
+// WriteString(os, " 2. List on the Title Page, as authors, one or more persons or entities");
+// WriteString(os, " responsible for authorship of the modifications in the Modified");
+// WriteString(os, " Version, together with at least five of the principal authors of the");
+// WriteString(os, " Document (all of its principal authors, if it has fewer than five),");
+// WriteString(os, " unless they release you from this requirement.");
+// WriteString(os, "");
+// WriteString(os, " 3. State on the Title page the name of the publisher of the");
+// WriteString(os, " Modified Version, as the publisher.");
+// WriteString(os, "");
+// WriteString(os, " 4. Preserve all the copyright notices of the Document.");
+// WriteString(os, "");
+// WriteString(os, " 5. Add an appropriate copyright notice for your modifications");
+// WriteString(os, " adjacent to the other copyright notices.");
+// WriteString(os, "");
+// WriteString(os, " 6. Include, immediately after the copyright notices, a license notice");
+// WriteString(os, " giving the public permission to use the Modified Version under the");
+// WriteString(os, " terms of this License, in the form shown in the Addendum below.");
+// WriteString(os, "");
+// WriteString(os, " 7. Preserve in that license notice the full lists of Invariant Sections");
+// WriteString(os, " and required Cover Texts given in the Document's license notice.");
+// WriteString(os, "");
+// WriteString(os, " 8. Include an unaltered copy of this License.");
+// WriteString(os, "");
+// WriteString(os, " 9. Preserve the section Entitled \"History\", Preserve its Title, and add");
+// WriteString(os, " to it an item stating at least the title, year, new authors, and");
+// WriteString(os, " publisher of the Modified Version as given on the Title Page. If");
+// WriteString(os, " there is no section Entitled \"History\" in the Document, create one");
+// WriteString(os, " stating the title, year, authors, and publisher of the Document as");
+// WriteString(os, " given on its Title Page, then add an item describing the Modified");
+// WriteString(os, " Version as stated in the previous sentence.");
+// WriteString(os, "");
+// WriteString(os, " 10. Preserve the network location, if any, given in the Document for");
+// WriteString(os, " public access to a Transparent copy of the Document, and likewise");
+// WriteString(os, " the network locations given in the Document for previous versions");
+// WriteString(os, " it was based on. These may be placed in the \"History\" section.");
+// WriteString(os, " You may omit a network location for a work that was published at");
+// WriteString(os, " least four years before the Document itself, or if the original");
+// WriteString(os, " publisher of the version it refers to gives permission.");
+// WriteString(os, "");
+// WriteString(os, " 11. For any section Entitled \"Acknowledgements\" or \"Dedications\", Preserve");
+// WriteString(os, " the Title of the section, and preserve in the section all the");
+// WriteString(os, " substance and tone of each of the contributor acknowledgements and/or");
+// WriteString(os, " dedications given therein.");
+// WriteString(os, "");
+// WriteString(os, " 12. Preserve all the Invariant Sections of the Document,");
+// WriteString(os, " unaltered in their text and in their titles. Section numbers");
+// WriteString(os, " or the equivalent are not considered part of the section titles.");
+// WriteString(os, "");
+// WriteString(os, " 13. Delete any section Entitled \"Endorsements\". Such a section");
+// WriteString(os, " may not be included in the Modified Version.");
+// WriteString(os, "");
+// WriteString(os, " 14. Do not retitle any existing section to be Entitled \"Endorsements\" or");
+// WriteString(os, " to conflict in title with any Invariant Section.");
+// WriteString(os, "");
+// WriteString(os, " 15. Preserve any Warranty Disclaimers.");
+// WriteString(os, "");
+// WriteString(os, "");
+// WriteString(os, "If the Modified Version includes new front-matter sections or");
+// WriteString(os, "appendices that qualify as Secondary Sections and contain no material");
+// WriteString(os, "copied from the Document, you may at your option designate some or all");
+// WriteString(os, "of these sections as invariant. To do this, add their titles to the");
+// WriteString(os, "list of Invariant Sections in the Modified Version's license notice.");
+// WriteString(os, "These titles must be distinct from any other section titles.");
+// WriteString(os, "");
+// WriteString(os, "You may add a section Entitled \"Endorsements\", provided it contains");
+// WriteString(os, "nothing but endorsements of your Modified Version by various");
+// WriteString(os, "parties - for example, statements of peer review or that the text has");
+// WriteString(os, "been approved by an organization as the authoritative definition of a");
+// WriteString(os, "standard.");
+// WriteString(os, "");
+// WriteString(os, "You may add a passage of up to five words as a Front-Cover Text, and a");
+// WriteString(os, "passage of up to 25 words as a Back-Cover Text, to the end of the list");
+// WriteString(os, "of Cover Texts in the Modified Version. Only one passage of");
+// WriteString(os, "Front-Cover Text and one of Back-Cover Text may be added by (or");
+// WriteString(os, "through arrangements made by) any one entity. If the Document already");
+// WriteString(os, "includes a cover text for the same cover, previously added by you or");
+// WriteString(os, "by arrangement made by the same entity you are acting on behalf of,");
+// WriteString(os, "you may not add another; but you may replace the old one, on explicit");
+// WriteString(os, "permission from the previous publisher that added the old one.");
+// WriteString(os, "");
+// WriteString(os, "The author(s) and publisher(s) of the Document do not by this License");
+// WriteString(os, "give permission to use their names for publicity for or to assert or");
+// WriteString(os, "imply endorsement of any Modified Version.");
+// WriteString(os, "");
+// WriteString(os, "6. COMBINING DOCUMENTS");
+// WriteString(os, "");
+// WriteString(os, "You may combine the Document with other documents released under this");
+// WriteString(os, "License, under the terms defined in section 4 above for modified");
+// WriteString(os, "versions, provided that you include in the combination all of the");
+// WriteString(os, "Invariant Sections of all of the original documents, unmodified, and");
+// WriteString(os, "list them all as Invariant Sections of your combined work in its");
+// WriteString(os, "license notice, and that you preserve all their Warranty Disclaimers.");
+// WriteString(os, "");
+// WriteString(os, "The combined work need only contain one copy of this License, and");
+// WriteString(os, "multiple identical Invariant Sections may be replaced with a single");
+// WriteString(os, "copy. If there are multiple Invariant Sections with the same name but");
+// WriteString(os, "different contents, make the title of each such section unique by");
+// WriteString(os, "adding at the end of it, in parentheses, the name of the original");
+// WriteString(os, "author or publisher of that section if known, or else a unique number.");
+// WriteString(os, "Make the same adjustment to the section titles in the list of");
+// WriteString(os, "Invariant Sections in the license notice of the combined work.");
+// WriteString(os, "");
+// WriteString(os, "In the combination, you must combine any sections Entitled \"History\"");
+// WriteString(os, "in the various original documents, forming one section Entitled");
+// WriteString(os, "\"History\"; likewise combine any sections Entitled \"Acknowledgements\",");
+// WriteString(os, "and any sections Entitled \"Dedications\". You must delete all");
+// WriteString(os, "sections Entitled \"Endorsements.\"");
+// WriteString(os, "");
+// WriteString(os, "7. COLLECTIONS OF DOCUMENTS");
+// WriteString(os, "");
+// WriteString(os, "You may make a collection consisting of the Document and other documents");
+// WriteString(os, "released under this License, and replace the individual copies of this");
+// WriteString(os, "License in the various documents with a single copy that is included in");
+// WriteString(os, "the collection, provided that you follow the rules of this License for");
+// WriteString(os, "verbatim copying of each of the documents in all other respects.");
+// WriteString(os, "");
+// WriteString(os, "You may extract a single document from such a collection, and distribute");
+// WriteString(os, "it individually under this License, provided you insert a copy of this");
+// WriteString(os, "License into the extracted document, and follow this License in all");
+// WriteString(os, "other respects regarding verbatim copying of that document.");
+// WriteString(os, "");
+// WriteString(os, "8. AGGREGATION WITH INDEPENDENT WORKS");
+// WriteString(os, "");
+// WriteString(os, "A compilation of the Document or its derivatives with other separate");
+// WriteString(os, "and independent documents or works, in or on a volume of a storage or");
+// WriteString(os, "distribution medium, is called an \"aggregate\" if the copyright");
+// WriteString(os, "resulting from the compilation is not used to limit the legal rights");
+// WriteString(os, "of the compilation's users beyond what the individual works permit.");
+// WriteString(os, "When the Document is included an aggregate, this License does not");
+// WriteString(os, "apply to the other works in the aggregate which are not themselves");
+// WriteString(os, "derivative works of the Document.");
+// WriteString(os, "");
+// WriteString(os, "If the Cover Text requirement of section 3 is applicable to these");
+// WriteString(os, "copies of the Document, then if the Document is less than one half of");
+// WriteString(os, "the entire aggregate, the Document's Cover Texts may be placed on");
+// WriteString(os, "covers that bracket the Document within the aggregate, or the");
+// WriteString(os, "electronic equivalent of covers if the Document is in electronic form.");
+// WriteString(os, "Otherwise they must appear on printed covers that bracket the whole");
+// WriteString(os, "aggregate.");
+// WriteString(os, "");
+// WriteString(os, "9. TRANSLATION");
+// WriteString(os, "");
+// WriteString(os, "Translation is considered a kind of modification, so you may");
+// WriteString(os, "distribute translations of the Document under the terms of section 4.");
+// WriteString(os, "Replacing Invariant Sections with translations requires special");
+// WriteString(os, "permission from their copyright holders, but you may include");
+// WriteString(os, "translations of some or all Invariant Sections in addition to the");
+// WriteString(os, "original versions of these Invariant Sections. You may include a");
+// WriteString(os, "translation of this License, and all the license notices in the");
+// WriteString(os, "Document, and any Warrany Disclaimers, provided that you also include");
+// WriteString(os, "the original English version of this License and the original versions");
+// WriteString(os, "of those notices and disclaimers. In case of a disagreement between");
+// WriteString(os, "the translation and the original version of this License or a notice");
+// WriteString(os, "or disclaimer, the original version will prevail.");
+// WriteString(os, "");
+// WriteString(os, "If a section in the Document is Entitled \"Acknowledgements\",");
+// WriteString(os, "\"Dedications\", or \"History\", the requirement (section 4) to Preserve");
+// WriteString(os, "its Title (section 1) will typically require changing the actual");
+// WriteString(os, "title.");
+// WriteString(os, "");
+// WriteString(os, "10. TERMINATION");
+// WriteString(os, "");
+// WriteString(os, "You may not copy, modify, sublicense, or distribute the Document except");
+// WriteString(os, "as expressly provided for under this License. Any other attempt to");
+// WriteString(os, "copy, modify, sublicense or distribute the Document is void, and will");
+// WriteString(os, "automatically terminate your rights under this License. However,");
+// WriteString(os, "parties who have received copies, or rights, from you under this");
+// WriteString(os, "License will not have their licenses terminated so long as such");
+// WriteString(os, "parties remain in full compliance.");
+// WriteString(os, "");
+// WriteString(os, "11. FUTURE REVISIONS OF THIS LICENSE");
+// WriteString(os, "");
+// WriteString(os, "The Free Software Foundation may publish new, revised versions");
+// WriteString(os, "of the GNU Free Documentation License from time to time. Such new");
+// WriteString(os, "versions will be similar in spirit to the present version, but may");
+// WriteString(os, "differ in detail to address new problems or concerns. See");
+// WriteString(os, "http://www.gnu.org/copyleft/.");
+// WriteString(os, "");
+// WriteString(os, "Each version of the License is given a distinguishing version number.");
+// WriteString(os, "If the Document specifies that a particular numbered version of this");
+// WriteString(os, "License \"or any later version\" applies to it, you have the option of");
+// WriteString(os, "following the terms and conditions either of that specified version or");
+// WriteString(os, "of any later version that has been published (not as a draft) by the");
+// WriteString(os, "Free Software Foundation. If the Document does not specify a version");
+// WriteString(os, "number of this License, you may choose any version ever published (not");
+// WriteString(os, "as a draft) by the Free Software Foundation.");
+// WriteString(os, "-->");
+// }
+
+ private static void CreateTrailer(BufferedWriter os) throws IOException {
+ WriteString(os, "</descriptions>");
+ }
+
+ private static void WriteSynopsis(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
+ String ss = TexinfoUtils.transformTags(Synopsis);
+ String[] tt = ss.split("<eol>");
+ String aa = "";
+ String spaces = indent ? " " : " ";
+ WriteString(os, spaces + "<synopsis>");
+ if (null != Synopsis) {
+ for (int pp = 0; pp < tt.length; pp++) {
+ WriteString(os, spaces + tt[pp]);
+// if (tt[pp].equals("<br>")) {
+// WriteString(os, spaces + aa + "\n");
+// aa = "";
+// }
+// else {
+// if ((aa.length() + tt[pp].length()) > 64) {
+// WriteString(os, spaces + aa);
+// aa = "";
+// }
+// aa = aa + " " + tt[pp];
+// }
+ }
+ }
+ if (aa.length() > 0) WriteString(os, " " + aa);
+ WriteString(os, spaces + "</synopsis>");
+ }
+
+ private static String HandleInclude (String srcdir, String line, String Synopsis) {
+ Pattern p = Pattern.compile("@include\\s+(.*?)\\.texi");
+ Matcher mm = p.matcher(line);
+ if (mm.find()) {
+ String il;
+ BufferedReader is = null;
+ try {
+ String fileName = (srcdir.endsWith("/") ? srcdir : srcdir + "/") + mm.replaceAll("examples/$1");
+ is = new BufferedReader(new FileReader(fileName));
+ while (null != (il = is.readLine())) {
+ // C Help does not ignore "<" or ">" inside a <pre> or <samp> tag
+ // so we have to prepare for two levels of indirection. The
+ // first is for xml to interpret and the second is for the
+ // C Help processor to interpret. So, we put &lt; and &gt; which
+ // will be transformed into &amp;lt; by the tag transformer.
+ Pattern p1 = Pattern.compile("<");
+ Pattern p2 = Pattern.compile(">");
+ Matcher mm1 = p1.matcher(il);
+ il = mm1.replaceAll("&lt;");
+ Matcher mm2 = p2.matcher(il);
+ il = mm2.replaceAll("&gt;");
+ Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
+ il + "<eol>");
+ }
+ } catch (IOException e) {
+ System.out.println("IOException reading example file");
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+ return Synopsis;
+ }
+ private static void HandleDeftypefun(BufferedWriter os, BufferedReader is, String s, String srcdir) throws IOException {
+ String il;
+ FunctionDef fd;
+ List FDefs = new ArrayList();
+ String Synopsis = null;
+
+ if (null != (fd = HandleFunctionDef(is, s))) FDefs.add(fd);
+
+ while (null != (il = is.readLine())) {
+ Matcher mm = IncludePattern.matcher(il);
+ if (il.startsWith("@deftypefunx")) {
+ if (null != (fd = HandleFunctionDef(is, il))) FDefs.add(fd);
+ }
+ else if (mm.matches()) {
+ if (!IncludeList.contains(mm.group(1)))
+ IncludeList.add(mm.group(1));
+ }
+ else if (il.startsWith("@comment") ||
+ il.startsWith("@c ") ||
+ il.startsWith("@pindex")) { // ignore
+ }
+ else if (il.startsWith("@include") && fd != null) {
+ Synopsis = HandleInclude(srcdir, il, Synopsis);
+ }
+ else if (il.startsWith("@end deftypefun")) {
+ for (int kk = 0; kk < FDefs.size(); kk++) {
+ fd = (FunctionDef)FDefs.get(kk);
+
+ WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
+
+ WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
+
+ WriteString(os, " <prototype>");
+ String[] parms = fd.Parameters;
+ for (int i = 0; i < parms.length; i++) {
+ String parm = TexinfoUtils.stripProtoTags(parms[i]);
+ WriteString(os, " <parameter content=\"" + parm + "\"/>");
+ }
+ WriteString(os, " </prototype>");
+
+ if (fd.IncludeList != null) {
+ WriteString(os, " <headers>");
+ Object[] incs = fd.IncludeList;
+ for (int j = 0; j < incs.length; j++) {
+ String inc = (String)incs[j];
+ WriteString(os, " <header filename = \"" + inc + "\"/>");
+ }
+ WriteString(os, " </headers>");
+ }
+
+ if (null != Synopsis) WriteSynopsis(os, Synopsis, false);
+
+ WriteString(os, " </function>");
+ WriteString(os, " </construct>");
+ }
+ return;
+ }
+ else {
+ Synopsis = ((Synopsis == null) ? "" : Synopsis + " " ) + ((il.length() == 0) ? "<br><br>" :
+ il + "<eol>");
+ }
+ }
+ FDefs.clear();
+
+ }
+
+ private static class OnlyTexi implements FilenameFilter {
+ public boolean accept(File dir, String s) {
+ return (s.endsWith(".texi")) ? true : false;
+ }
+ }
+
+ public static void BuildXMLFromTexinfo(String srcdir, String dstdir) {
+ try {
+ BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
+
+ CreateHeader(os);
+// CreateLicense(os);
+
+ WriteString(os, "<descriptions>");
+
+ try {
+ String[] dir = new java.io.File(srcdir).list(new OnlyTexi());
+ for (int i = 0; i < dir.length; i++) {
+ String qFile = srcdir.endsWith("/")
+ ? srcdir + dir[i]
+ : srcdir + "/" + dir[i];
+
+ try {
+ BufferedReader is = new BufferedReader(new FileReader(qFile));
+ String il;
+
+ while (null != (il = is.readLine())) {
+ Matcher mm = IncludePattern.matcher(il);
+ if (il.startsWith("@deftypefun")) { // handle @deftypefun[x]
+ HandleDeftypefun(os, is, il, srcdir);
+ }
+ else if (il.startsWith("@deftp")) { // handle @deftp
+ HandleDeftp(os, is, il);
+ }
+ else if (mm.matches()) { // handle @comment <include_file>
+ if (!IncludeList.contains(mm.group(1)))
+ IncludeList.add(mm.group(1));
+ }
+ else if (il.startsWith("@end deftypefn"))
+ // Handle accumulated header file comments that are in
+ // constructs we aren't parsing.
+ IncludeList.clear();
+ }
+ is.close();
+ }
+ catch (IOException e) {
+ System.out.println("Input File IOException: " + e);
+ return;
+ }
+ }
+ }
+ catch (NullPointerException e) {
+ System.out.println("NullPointerException: " + e);
+ return;
+ }
+
+ CreateTrailer(os);
+
+ os.close();
+ }
+ catch (IOException e) {
+ System.out.println("Output File IOException: " + e);
+ return;
+ }
+ }
+
+ public static void main(String[] args) {
+ BuildXMLFromTexinfo(args[0], args[1]);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java
index eecce6431a..dadf341e69 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseNewlibTexinfo.java
@@ -21,544 +21,544 @@ import java.util.*;
//arguments: ${glibc_source_path}/manual glibc.xml
public class ParseNewlibTexinfo {
- static final boolean DEBUG = false;
-
- // 1, 2, 3
- static final String RtnType = "(\\w+\\s+(\\w+\\s+)?(\\w+\\s+)?\\**)";
- static final int RtnTypeSIndex = 1;
-
- // 4
- static final String FunctionName = "(\\w+)\\s*\\(";
- static final int FunctionNameIndex = 4;
-
- // 5 and 6
- static final String Parms = "((.*)\\))";
- static final int ParmsIndex = 6;
-
- static final String rest = ".*";
-
- static final String WhiteSpace = "\\s*";
-
- static final Pattern DeftypefunPattern
- = Pattern.compile("^" + WhiteSpace +
- RtnType + WhiteSpace +
- FunctionName + WhiteSpace +
- Parms +
- rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- // 1, 2, 3
- static final String RtnType2 = "(\\w*\\s*(\\w*\\*?\\s+)?(\\w*\\*?\\s+)?\\**\\s*)\\(\\*";
- static final int RtnType2Index = 1;
-
- // 4
- static final String FunctionName2 = "(\\w+)\\s*\\(";
- static final int FunctionName2Index = 4;
-
- // 5 and 6
- static final String Parms2 = "((.*)\\)\\)\\s*)";
- static final int Parms2Index = 6;
-
- // 7
- static final String RtnTypeParms = "(\\(.*\\))";
- static final int RtnTypeParmsIndex = 7;
-
- static final Pattern DeftypefunPattern2
- = Pattern.compile("^" + WhiteSpace +
- RtnType2 + WhiteSpace +
- FunctionName2 + WhiteSpace +
- Parms2 + RtnTypeParms +
- rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- // For va_arg, the prototype is @var{type} so we create a third type of function definition
- // and we make it so the return type ends up taking as many groups as the normal RtnType so
- // the BuildFunctionDef routine can be used without modification.
- // 1, 2, 3
- static final String RtnTypeVar = "@var\\{(\\w+)(\\})(\\s)";
-
- static final Pattern DeftypefunPattern3
- = Pattern.compile("^" + WhiteSpace +
- RtnTypeVar + WhiteSpace +
- FunctionName + WhiteSpace +
- Parms +
- rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
-
- static final Pattern IncludePattern = Pattern.compile("^#include\\s*<((\\w*/)*\\w*\\.h)>\\s*$");
- static final Pattern PindexPattern = Pattern.compile("^@pindex\\s*\\w*\\s*$");
- static final Pattern FindexPattern = Pattern.compile("^@findex\\s*(\\w*)\\s*$");
- static final Pattern SynopsisPattern = Pattern.compile("^\\s*@strong\\{Synopsis\\}\\s*");
- static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
- static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
- static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
- static final Pattern ExamplePattern = Pattern.compile("@example");
- static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
- static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
- static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
- static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
- static final Pattern ItemPattern = Pattern.compile("@item");
- static final Pattern NoIndentPattern = Pattern.compile("@noindent");
- static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
- static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
- static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
- static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
- static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
- static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
- static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
- static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
- static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
- static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
- static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
- static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
- static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
- static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
- static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
- static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
- static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
- static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
- static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
- static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
- static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
- static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
- static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
- static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
- static final Pattern AmpersandPattern = Pattern.compile("&");
- static final Pattern LeftAnglePattern = Pattern.compile("<");
- static final Pattern RightAnglePattern = Pattern.compile(">");
-
- static List IncludeList = new ArrayList();
- static Stack readers = new Stack();
-
- static class FunctionDef {
- String ReturnType;
- String FunctionName;
- String[] Parameters;
- Object[] IncludeList;
- }
-
- static class TPElement {
- String Content;
- String Synopsis;
- }
-
- static class TPDef {
- String TPType;
- String TPName;
- String TPSynopsis;
- TPElement[] TPElements;
- Object[] IncludeList;
- }
-
- private static FunctionDef FindFunctionDef(String name, List FDefs) {
- for (Iterator iterator = FDefs.iterator(); iterator.hasNext();) {
- FunctionDef k = (FunctionDef) iterator.next();
- if (k.FunctionName.equals(name))
- return k;
- }
- return null;
- }
-
- private static FunctionDef BuildFunctionDef(Matcher m, FunctionDef fd) {
- fd.ReturnType = m.group(RtnTypeSIndex);
- fd.FunctionName = m.group(FunctionNameIndex);
-
- if (null != m.group(ParmsIndex)) {
- String tt = TexinfoUtils.stripProtoTags(m.group(ParmsIndex));
- String[] parms = tt.split(",\\s");
- fd.Parameters = parms;
- }
-
- if (IncludeList.size() > 0) {
- fd.IncludeList = IncludeList.toArray();
- }
- return fd;
- }
-
- private static FunctionDef BuildFunctionDef2(Matcher m, FunctionDef fd) {
- fd.ReturnType = m.group(RtnType2Index) + "(*)" + m.group(RtnTypeParmsIndex);
- fd.FunctionName = m.group(FunctionName2Index);
-
- if (null != m.group(Parms2Index)) {
- String tt = TexinfoUtils.stripProtoTags(m.group(Parms2Index));
- String[] parms = tt.split(",\\s");
- fd.Parameters = parms;
- }
-
- if (IncludeList.size() > 0) {
- fd.IncludeList = IncludeList.toArray();
- }
- return fd;
- }
-
- private static void HandleFunctionDefs(BufferedReader is, List FDefs) throws IOException {
- FunctionDef fd;
- String il = null;
- boolean preRead = false;
-
- while (preRead || (il = is.readLine()) != null) {
- preRead = false;
- if (il.startsWith("@end example"))
- return;
-
- Matcher m = DeftypefunPattern.matcher(il);
- Matcher m2 = DeftypefunPattern2.matcher(il);
- Matcher m3 = DeftypefunPattern3.matcher(il);
- Matcher mm = IncludePattern.matcher(il);
-
- if (mm.matches()) {
- if (!IncludeList.contains(mm.group(1)))
- IncludeList.add(mm.group(1));
- }
- else if (m.matches()) {
- fd = FindFunctionDef(m.group(FunctionNameIndex), FDefs);
- if (fd != null)
- BuildFunctionDef(m, fd);
- else
- System.out.println("Missing findex for " + m.group(FunctionNameIndex));
- }
- else if (m2.matches()) {
- fd = FindFunctionDef(m2.group(FunctionName2Index), FDefs);
- if (fd != null)
- BuildFunctionDef2(m2, fd);
- else
- System.out.println("Missing findex for " + m2.group(FunctionName2Index));
- }
- else if (m3.matches()) {
- fd = FindFunctionDef(m3.group(FunctionNameIndex), FDefs);
- if (fd != null)
- BuildFunctionDef(m3, fd);
- else
- System.out.println("Missing findex for " + m3.group(FunctionName2Index));
- }
- else if (il.trim().length() > 0) {
- il = il.trim();
- while (il.endsWith(",")) { // assume prototype extends more than one line
- preRead = true;
- String il2 = is.readLine().trim();
- if (il2 != null && il2.startsWith("@")) { // something wrong, just look at new line fetched
- il = il2;
- continue;
- }
- il = il + il2; // concatenate
- }
- }
- }
- }
-
- private static void WriteString(BufferedWriter os, String s) throws IOException {
- // System.out.println(s);
- os.write(s+"\n", 0, 1+s.length());
- }
-
- private static void CreateHeader(BufferedWriter os) throws IOException {
- WriteString(os, "<!-- This file automatically generated by an Eclipse utility -->");
- WriteString(os, "<!DOCTYPE descriptions [");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT descriptions (construct)*>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT construct (structure|function|synopsis)*>");
- WriteString(os, " <!ATTLIST construct");
- WriteString(os, " id ID #REQUIRED");
- WriteString(os, " type CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT structure (synopsis?, elements?)?>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT elements (element*)>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT element (synopsis*)>");
- WriteString(os, " <!ATTLIST element");
- WriteString(os, " content CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT function (prototype,headers?,groupsynopsis?,synopsis)>");
- WriteString(os, " <!ATTLIST function");
- WriteString(os, " returntype CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT prototype (parameter+)?>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
- WriteString(os, " <!ATTLIST parameter");
- WriteString(os, " content CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT headers (header+)?>");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT header (#PCDATA)*>");
- WriteString(os, " <!ATTLIST header");
- WriteString(os, " filename CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, " <!ELEMENT groupsynopsis (#PCDATA)*>");
- WriteString(os, " <!ATTLIST groupsynopsis");
- WriteString(os, " id CDATA #REQUIRED");
- WriteString(os, " >");
- WriteString(os, "");
- WriteString(os, "]>");
- WriteString(os, "");
- }
-
- private static void CreateTrailer(BufferedWriter os) throws IOException {
- WriteString(os, "</descriptions>");
- }
-
- private static void WriteDescription(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
- String ss = TexinfoUtils.transformTags(Synopsis);
- String[] tt = ss.split("<eol>");
- String aa = "";
- String spaces = indent ? " " : " ";
- WriteString(os, spaces + "<synopsis>");
- if (null != Synopsis) {
- for (int pp = 0; pp < tt.length; pp++) {
- WriteString(os, spaces + tt[pp]);
-// if (tt[pp].equals("<br>")) {
-// WriteString(os, spaces + aa + "\n");
-// aa = "";
-// }
-// else {
-// if ((aa.length() + tt[pp].length()) > 64) {
-// WriteString(os, spaces + aa);
-// aa = "";
-// }
-// aa = aa + " " + tt[pp];
-// }
- }
- }
- if (aa.length() > 0) WriteString(os, " " + aa);
- WriteString(os, spaces + "</synopsis>");
- }
-
- private static BufferedReader HandleInclude (BufferedReader is, String srcdir, String line) {
- Pattern p = Pattern.compile("@include\\s+(.*?)");
- Matcher mm = p.matcher(line.trim());
- BufferedReader is2 = null;
- if (mm.find()) {
- String fileName = (srcdir.endsWith("/") ? srcdir : srcdir + "/") + mm.replaceAll("$1");
- try {
- is2 = new BufferedReader(new FileReader(fileName));
- readers.push(is);
- } catch (FileNotFoundException e) {
- System.out.println("include " + fileName + " not found");
- // do nothing and return null
- }
- }
- return is2 == null ? is : is2;
- }
-
- private static String HandleDescription(BufferedReader is) throws IOException {
- String Description = null;
- String il;
-
- while (null != (il = is.readLine())) {
- if (il.startsWith("@page") ||
- il.startsWith("@section") ||
- il.startsWith("@node"))
- break;
- Description = ((Description == null) ? "" : Description + " " ) + ((il.length() == 0) ? "<br><br>" :
- il + "<eol>");
- }
-
- return Description;
- }
-
- private static void HandleFunction(BufferedWriter os, BufferedReader is, String s, String builddir) throws IOException {
- String il;
- FunctionDef fd;
- List FDefs = new ArrayList();
- String Description = null;
- boolean synopsisMarker = false;
-
- IncludeList.clear();
+ static final boolean DEBUG = false;
+
+ // 1, 2, 3
+ static final String RtnType = "(\\w+\\s+(\\w+\\s+)?(\\w+\\s+)?\\**)";
+ static final int RtnTypeSIndex = 1;
+
+ // 4
+ static final String FunctionName = "(\\w+)\\s*\\(";
+ static final int FunctionNameIndex = 4;
+
+ // 5 and 6
+ static final String Parms = "((.*)\\))";
+ static final int ParmsIndex = 6;
+
+ static final String rest = ".*";
+
+ static final String WhiteSpace = "\\s*";
+
+ static final Pattern DeftypefunPattern
+ = Pattern.compile("^" + WhiteSpace +
+ RtnType + WhiteSpace +
+ FunctionName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ // 1, 2, 3
+ static final String RtnType2 = "(\\w*\\s*(\\w*\\*?\\s+)?(\\w*\\*?\\s+)?\\**\\s*)\\(\\*";
+ static final int RtnType2Index = 1;
+
+ // 4
+ static final String FunctionName2 = "(\\w+)\\s*\\(";
+ static final int FunctionName2Index = 4;
+
+ // 5 and 6
+ static final String Parms2 = "((.*)\\)\\)\\s*)";
+ static final int Parms2Index = 6;
+
+ // 7
+ static final String RtnTypeParms = "(\\(.*\\))";
+ static final int RtnTypeParmsIndex = 7;
+
+ static final Pattern DeftypefunPattern2
+ = Pattern.compile("^" + WhiteSpace +
+ RtnType2 + WhiteSpace +
+ FunctionName2 + WhiteSpace +
+ Parms2 + RtnTypeParms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ // For va_arg, the prototype is @var{type} so we create a third type of function definition
+ // and we make it so the return type ends up taking as many groups as the normal RtnType so
+ // the BuildFunctionDef routine can be used without modification.
+ // 1, 2, 3
+ static final String RtnTypeVar = "@var\\{(\\w+)(\\})(\\s)";
+
+ static final Pattern DeftypefunPattern3
+ = Pattern.compile("^" + WhiteSpace +
+ RtnTypeVar + WhiteSpace +
+ FunctionName + WhiteSpace +
+ Parms +
+ rest, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);
+
+ static final Pattern IncludePattern = Pattern.compile("^#include\\s*<((\\w*/)*\\w*\\.h)>\\s*$");
+ static final Pattern PindexPattern = Pattern.compile("^@pindex\\s*\\w*\\s*$");
+ static final Pattern FindexPattern = Pattern.compile("^@findex\\s*(\\w*)\\s*$");
+ static final Pattern SynopsisPattern = Pattern.compile("^\\s*@strong\\{Synopsis\\}\\s*");
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*)@item\\s*([a-zA-Z_0-9+\\-<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*)@item\\s*([a-zA-Z_0-9+\\-,<>/ ]*)<eol>(.*@end\\s*table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*)" + "@end\\s+itemize", Pattern.MULTILINE);
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w*\\{([^\\}]*)\\}");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+ static List IncludeList = new ArrayList();
+ static Stack readers = new Stack();
+
+ static class FunctionDef {
+ String ReturnType;
+ String FunctionName;
+ String[] Parameters;
+ Object[] IncludeList;
+ }
+
+ static class TPElement {
+ String Content;
+ String Synopsis;
+ }
+
+ static class TPDef {
+ String TPType;
+ String TPName;
+ String TPSynopsis;
+ TPElement[] TPElements;
+ Object[] IncludeList;
+ }
+
+ private static FunctionDef FindFunctionDef(String name, List FDefs) {
+ for (Iterator iterator = FDefs.iterator(); iterator.hasNext();) {
+ FunctionDef k = (FunctionDef) iterator.next();
+ if (k.FunctionName.equals(name))
+ return k;
+ }
+ return null;
+ }
+
+ private static FunctionDef BuildFunctionDef(Matcher m, FunctionDef fd) {
+ fd.ReturnType = m.group(RtnTypeSIndex);
+ fd.FunctionName = m.group(FunctionNameIndex);
+
+ if (null != m.group(ParmsIndex)) {
+ String tt = TexinfoUtils.stripProtoTags(m.group(ParmsIndex));
+ String[] parms = tt.split(",\\s");
+ fd.Parameters = parms;
+ }
+
+ if (IncludeList.size() > 0) {
+ fd.IncludeList = IncludeList.toArray();
+ }
+ return fd;
+ }
+
+ private static FunctionDef BuildFunctionDef2(Matcher m, FunctionDef fd) {
+ fd.ReturnType = m.group(RtnType2Index) + "(*)" + m.group(RtnTypeParmsIndex);
+ fd.FunctionName = m.group(FunctionName2Index);
+
+ if (null != m.group(Parms2Index)) {
+ String tt = TexinfoUtils.stripProtoTags(m.group(Parms2Index));
+ String[] parms = tt.split(",\\s");
+ fd.Parameters = parms;
+ }
+
+ if (IncludeList.size() > 0) {
+ fd.IncludeList = IncludeList.toArray();
+ }
+ return fd;
+ }
+
+ private static void HandleFunctionDefs(BufferedReader is, List FDefs) throws IOException {
+ FunctionDef fd;
+ String il = null;
+ boolean preRead = false;
+
+ while (preRead || (il = is.readLine()) != null) {
+ preRead = false;
+ if (il.startsWith("@end example"))
+ return;
+
+ Matcher m = DeftypefunPattern.matcher(il);
+ Matcher m2 = DeftypefunPattern2.matcher(il);
+ Matcher m3 = DeftypefunPattern3.matcher(il);
+ Matcher mm = IncludePattern.matcher(il);
+
+ if (mm.matches()) {
+ if (!IncludeList.contains(mm.group(1)))
+ IncludeList.add(mm.group(1));
+ }
+ else if (m.matches()) {
+ fd = FindFunctionDef(m.group(FunctionNameIndex), FDefs);
+ if (fd != null)
+ BuildFunctionDef(m, fd);
+ else
+ System.out.println("Missing findex for " + m.group(FunctionNameIndex));
+ }
+ else if (m2.matches()) {
+ fd = FindFunctionDef(m2.group(FunctionName2Index), FDefs);
+ if (fd != null)
+ BuildFunctionDef2(m2, fd);
+ else
+ System.out.println("Missing findex for " + m2.group(FunctionName2Index));
+ }
+ else if (m3.matches()) {
+ fd = FindFunctionDef(m3.group(FunctionNameIndex), FDefs);
+ if (fd != null)
+ BuildFunctionDef(m3, fd);
+ else
+ System.out.println("Missing findex for " + m3.group(FunctionName2Index));
+ }
+ else if (il.trim().length() > 0) {
+ il = il.trim();
+ while (il.endsWith(",")) { // assume prototype extends more than one line
+ preRead = true;
+ String il2 = is.readLine().trim();
+ if (il2 != null && il2.startsWith("@")) { // something wrong, just look at new line fetched
+ il = il2;
+ continue;
+ }
+ il = il + il2; // concatenate
+ }
+ }
+ }
+ }
+
+ private static void WriteString(BufferedWriter os, String s) throws IOException {
+ // System.out.println(s);
+ os.write(s+"\n", 0, 1+s.length());
+ }
+
+ private static void CreateHeader(BufferedWriter os) throws IOException {
+ WriteString(os, "<!-- This file automatically generated by an Eclipse utility -->");
+ WriteString(os, "<!DOCTYPE descriptions [");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT descriptions (construct)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT construct (structure|function|synopsis)*>");
+ WriteString(os, " <!ATTLIST construct");
+ WriteString(os, " id ID #REQUIRED");
+ WriteString(os, " type CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT structure (synopsis?, elements?)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT elements (element*)>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT element (synopsis*)>");
+ WriteString(os, " <!ATTLIST element");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT synopsis (#PCDATA)*>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT function (prototype,headers?,groupsynopsis?,synopsis)>");
+ WriteString(os, " <!ATTLIST function");
+ WriteString(os, " returntype CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT prototype (parameter+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT parameter (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST parameter");
+ WriteString(os, " content CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT headers (header+)?>");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT header (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST header");
+ WriteString(os, " filename CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, " <!ELEMENT groupsynopsis (#PCDATA)*>");
+ WriteString(os, " <!ATTLIST groupsynopsis");
+ WriteString(os, " id CDATA #REQUIRED");
+ WriteString(os, " >");
+ WriteString(os, "");
+ WriteString(os, "]>");
+ WriteString(os, "");
+ }
+
+ private static void CreateTrailer(BufferedWriter os) throws IOException {
+ WriteString(os, "</descriptions>");
+ }
+
+ private static void WriteDescription(BufferedWriter os, String Synopsis, boolean indent) throws IOException {
+ String ss = TexinfoUtils.transformTags(Synopsis);
+ String[] tt = ss.split("<eol>");
+ String aa = "";
+ String spaces = indent ? " " : " ";
+ WriteString(os, spaces + "<synopsis>");
+ if (null != Synopsis) {
+ for (int pp = 0; pp < tt.length; pp++) {
+ WriteString(os, spaces + tt[pp]);
+// if (tt[pp].equals("<br>")) {
+// WriteString(os, spaces + aa + "\n");
+// aa = "";
+// }
+// else {
+// if ((aa.length() + tt[pp].length()) > 64) {
+// WriteString(os, spaces + aa);
+// aa = "";
+// }
+// aa = aa + " " + tt[pp];
+// }
+ }
+ }
+ if (aa.length() > 0) WriteString(os, " " + aa);
+ WriteString(os, spaces + "</synopsis>");
+ }
+
+ private static BufferedReader HandleInclude (BufferedReader is, String srcdir, String line) {
+ Pattern p = Pattern.compile("@include\\s+(.*?)");
+ Matcher mm = p.matcher(line.trim());
+ BufferedReader is2 = null;
+ if (mm.find()) {
+ String fileName = (srcdir.endsWith("/") ? srcdir : srcdir + "/") + mm.replaceAll("$1");
+ try {
+ is2 = new BufferedReader(new FileReader(fileName));
+ readers.push(is);
+ } catch (FileNotFoundException e) {
+ System.out.println("include " + fileName + " not found");
+ // do nothing and return null
+ }
+ }
+ return is2 == null ? is : is2;
+ }
+
+ private static String HandleDescription(BufferedReader is) throws IOException {
+ String Description = null;
+ String il;
+
+ while (null != (il = is.readLine())) {
+ if (il.startsWith("@page") ||
+ il.startsWith("@section") ||
+ il.startsWith("@node"))
+ break;
+ Description = ((Description == null) ? "" : Description + " " ) + ((il.length() == 0) ? "<br><br>" :
+ il + "<eol>");
+ }
+
+ return Description;
+ }
+
+ private static void HandleFunction(BufferedWriter os, BufferedReader is, String s, String builddir) throws IOException {
+ String il;
+ FunctionDef fd;
+ List FDefs = new ArrayList();
+ String Description = null;
+ boolean synopsisMarker = false;
+
+ IncludeList.clear();
Matcher mmf = FindexPattern.matcher(s);
- fd = new FunctionDef();
- if (mmf.matches())
- fd.FunctionName = mmf.group(1);
- else
- return;
- FDefs.add(fd);
-
- while (null != (il = is.readLine())) {
- Matcher syn = SynopsisPattern.matcher(il);
- if (il.startsWith("@findex")) {
- synopsisMarker = false;
- Matcher mm2 = FindexPattern.matcher(il);
- FunctionDef fd2 = new FunctionDef();
- if (mm2.matches()) {
- fd2.FunctionName = mm2.group(1);
- FDefs.add(fd2);
- }
- }
- else if (il.startsWith("@example") && synopsisMarker) {
- HandleFunctionDefs(is, FDefs);
- synopsisMarker = false;
- }
- else if (il.startsWith("@include") && fd != null) {
- is = HandleInclude(is, builddir, il);
- }
- else if (syn.matches()) {
- synopsisMarker = true;
- }
- else if (il.startsWith("@strong{Description}")) {
- synopsisMarker = false;
- Description = HandleDescription(is);
- break; // we are done after description has been fetched
- }
- // otherwise ignore line
- }
-
- String name = ((FunctionDef)FDefs.get(0)).FunctionName;
-
+ fd = new FunctionDef();
+ if (mmf.matches())
+ fd.FunctionName = mmf.group(1);
+ else
+ return;
+ FDefs.add(fd);
+
+ while (null != (il = is.readLine())) {
+ Matcher syn = SynopsisPattern.matcher(il);
+ if (il.startsWith("@findex")) {
+ synopsisMarker = false;
+ Matcher mm2 = FindexPattern.matcher(il);
+ FunctionDef fd2 = new FunctionDef();
+ if (mm2.matches()) {
+ fd2.FunctionName = mm2.group(1);
+ FDefs.add(fd2);
+ }
+ }
+ else if (il.startsWith("@example") && synopsisMarker) {
+ HandleFunctionDefs(is, FDefs);
+ synopsisMarker = false;
+ }
+ else if (il.startsWith("@include") && fd != null) {
+ is = HandleInclude(is, builddir, il);
+ }
+ else if (syn.matches()) {
+ synopsisMarker = true;
+ }
+ else if (il.startsWith("@strong{Description}")) {
+ synopsisMarker = false;
+ Description = HandleDescription(is);
+ break; // we are done after description has been fetched
+ }
+ // otherwise ignore line
+ }
+
+ String name = ((FunctionDef)FDefs.get(0)).FunctionName;
+
if (FDefs.size() > 1) {
- for (int kk = 0; kk < FDefs.size(); kk++) {
- fd = (FunctionDef)FDefs.get(kk);
-
- WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
-
- WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
-
- WriteString(os, " <prototype>");
- String[] parms = fd.Parameters;
- if (parms == null)
- System.out.println("null parms for findex " + fd.FunctionName);
- else {
- for (int i = 0; i < parms.length; i++) {
- String parm = TexinfoUtils.stripProtoTags(parms[i]);
- WriteString(os, " <parameter content=\"" + parm + "\"/>");
- }
- }
- WriteString(os, " </prototype>");
-
- if (fd.IncludeList != null) {
- WriteString(os, " <headers>");
- Object[] incs = fd.IncludeList;
- for (int j = 0; j < incs.length; j++) {
- String inc = (String)incs[j];
- WriteString(os, " <header filename = \"" + inc + "\"/>");
- }
- WriteString(os, " </headers>");
- }
-
- if (null != Description)
- WriteString(os, " <groupsynopsis id=\"group-" + name + "\"/>");
-
-
- WriteString(os, " </function>");
- WriteString(os, " </construct>");
- }
-
- if (null != Description) {
- WriteString(os, " <construct id=\"group-" + name + "\" type=\"groupsynopsis\">");
- WriteDescription(os, Description, false);
- WriteString(os, " </construct>");
- }
- }
+ for (int kk = 0; kk < FDefs.size(); kk++) {
+ fd = (FunctionDef)FDefs.get(kk);
+
+ WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
+
+ WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
+
+ WriteString(os, " <prototype>");
+ String[] parms = fd.Parameters;
+ if (parms == null)
+ System.out.println("null parms for findex " + fd.FunctionName);
+ else {
+ for (int i = 0; i < parms.length; i++) {
+ String parm = TexinfoUtils.stripProtoTags(parms[i]);
+ WriteString(os, " <parameter content=\"" + parm + "\"/>");
+ }
+ }
+ WriteString(os, " </prototype>");
+
+ if (fd.IncludeList != null) {
+ WriteString(os, " <headers>");
+ Object[] incs = fd.IncludeList;
+ for (int j = 0; j < incs.length; j++) {
+ String inc = (String)incs[j];
+ WriteString(os, " <header filename = \"" + inc + "\"/>");
+ }
+ WriteString(os, " </headers>");
+ }
+
+ if (null != Description)
+ WriteString(os, " <groupsynopsis id=\"group-" + name + "\"/>");
+
+
+ WriteString(os, " </function>");
+ WriteString(os, " </construct>");
+ }
+
+ if (null != Description) {
+ WriteString(os, " <construct id=\"group-" + name + "\" type=\"groupsynopsis\">");
+ WriteDescription(os, Description, false);
+ WriteString(os, " </construct>");
+ }
+ }
else {
- fd = (FunctionDef)FDefs.get(0);
-
- WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
-
- WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
-
- WriteString(os, " <prototype>");
- String[] parms = fd.Parameters;
- if (parms == null)
- System.out.println("null parms for findex " + fd.FunctionName);
- else {
- for (int i = 0; i < parms.length; i++) {
- String parm = TexinfoUtils.stripProtoTags(parms[i]);
- WriteString(os, " <parameter content=\"" + parm + "\"/>");
- }
- }
- WriteString(os, " </prototype>");
-
- if (fd.IncludeList != null) {
- WriteString(os, " <headers>");
- Object[] incs = fd.IncludeList;
- for (int j = 0; j < incs.length; j++) {
- String inc = (String)incs[j];
- WriteString(os, " <header filename = \"" + inc + "\"/>");
- }
- WriteString(os, " </headers>");
- }
-
- if (null != Description) WriteDescription(os, Description, false);
-
- WriteString(os, " </function>");
- WriteString(os, " </construct>");
- }
- FDefs.clear();
- }
-
- public static void BuildXMLFromTexinfo2(String srcdir, String builddir, BufferedWriter os, String lib) {
- try {
- srcdir = srcdir.endsWith("/") ? srcdir + lib : srcdir + "/" + lib;
- builddir = builddir.endsWith("/") ? builddir + lib : builddir + "/" + lib;
- String qFile = srcdir + "/" + lib + ".texinfo";
-
- try {
- BufferedReader is = new BufferedReader(new FileReader(qFile));
- String il;
- boolean ignore = false;
-
- while (is != null) {
- while (null != (il = is.readLine())) {
- if (!ignore && il.startsWith("@findex")) {
- HandleFunction(os, is, il, builddir);
- }
- else if (!ignore && il.startsWith("@include")) {
- is = HandleInclude(is, builddir, il);
- }
- else if (il.startsWith("@ignore")) {
- ignore = true;
- }
- else if (il.startsWith("@end ignore"))
- ignore = false;
- }
- is.close();
- is = (BufferedReader)readers.pop();
- }
- }
- catch (IOException e) {
- System.out.println("Input File IOException: " + e);
- return;
- }
- catch (EmptyStackException f) {
- // ok, we expect to get here
- }
- }
- catch (NullPointerException e) {
- e.printStackTrace();
- System.out.println("NullPointerException: " + e);
- return;
- }
-
- }
-
- public static void BuildXMLFromTexinfo(String srcdir, String builddir, String dstdir) {
- try {
- BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
-
- CreateHeader(os);
-// CreateLicense(os);
-
- WriteString(os, "<descriptions>");
- BuildXMLFromTexinfo2(srcdir, builddir, os, "libc");
- BuildXMLFromTexinfo2(srcdir, builddir, os, "libm");
-
-
- CreateTrailer(os);
-
- os.close();
- }
- catch (IOException e) {
- System.out.println("Output File IOException: " + e);
- return;
- }
- }
-
- public static void main(String[] args) {
- BuildXMLFromTexinfo(args[0], args[1], args[2]);
- }
+ fd = (FunctionDef)FDefs.get(0);
+
+ WriteString(os, " <construct id=\"function-" + fd.FunctionName + "\" type=\"function\">");
+
+ WriteString(os, " <function returntype=\"" + fd.ReturnType + "\">");
+
+ WriteString(os, " <prototype>");
+ String[] parms = fd.Parameters;
+ if (parms == null)
+ System.out.println("null parms for findex " + fd.FunctionName);
+ else {
+ for (int i = 0; i < parms.length; i++) {
+ String parm = TexinfoUtils.stripProtoTags(parms[i]);
+ WriteString(os, " <parameter content=\"" + parm + "\"/>");
+ }
+ }
+ WriteString(os, " </prototype>");
+
+ if (fd.IncludeList != null) {
+ WriteString(os, " <headers>");
+ Object[] incs = fd.IncludeList;
+ for (int j = 0; j < incs.length; j++) {
+ String inc = (String)incs[j];
+ WriteString(os, " <header filename = \"" + inc + "\"/>");
+ }
+ WriteString(os, " </headers>");
+ }
+
+ if (null != Description) WriteDescription(os, Description, false);
+
+ WriteString(os, " </function>");
+ WriteString(os, " </construct>");
+ }
+ FDefs.clear();
+ }
+
+ public static void BuildXMLFromTexinfo2(String srcdir, String builddir, BufferedWriter os, String lib) {
+ try {
+ srcdir = srcdir.endsWith("/") ? srcdir + lib : srcdir + "/" + lib;
+ builddir = builddir.endsWith("/") ? builddir + lib : builddir + "/" + lib;
+ String qFile = srcdir + "/" + lib + ".texinfo";
+
+ try {
+ BufferedReader is = new BufferedReader(new FileReader(qFile));
+ String il;
+ boolean ignore = false;
+
+ while (is != null) {
+ while (null != (il = is.readLine())) {
+ if (!ignore && il.startsWith("@findex")) {
+ HandleFunction(os, is, il, builddir);
+ }
+ else if (!ignore && il.startsWith("@include")) {
+ is = HandleInclude(is, builddir, il);
+ }
+ else if (il.startsWith("@ignore")) {
+ ignore = true;
+ }
+ else if (il.startsWith("@end ignore"))
+ ignore = false;
+ }
+ is.close();
+ is = (BufferedReader)readers.pop();
+ }
+ }
+ catch (IOException e) {
+ System.out.println("Input File IOException: " + e);
+ return;
+ }
+ catch (EmptyStackException f) {
+ // ok, we expect to get here
+ }
+ }
+ catch (NullPointerException e) {
+ e.printStackTrace();
+ System.out.println("NullPointerException: " + e);
+ return;
+ }
+
+ }
+
+ public static void BuildXMLFromTexinfo(String srcdir, String builddir, String dstdir) {
+ try {
+ BufferedWriter os = new BufferedWriter(new FileWriter(dstdir));
+
+ CreateHeader(os);
+// CreateLicense(os);
+
+ WriteString(os, "<descriptions>");
+ BuildXMLFromTexinfo2(srcdir, builddir, os, "libc");
+ BuildXMLFromTexinfo2(srcdir, builddir, os, "libm");
+
+
+ CreateTrailer(os);
+
+ os.close();
+ }
+ catch (IOException e) {
+ System.out.println("Output File IOException: " + e);
+ return;
+ }
+ }
+
+ public static void main(String[] args) {
+ BuildXMLFromTexinfo(args[0], args[1], args[2]);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java
index ceb3d91d30..61d8c5e05c 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/TexinfoUtils.java
@@ -14,720 +14,720 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TexinfoUtils {
-
- static final Pattern ParmBracketPattern = Pattern.compile("\\((.*?)\\)");
- static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
- static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
- static final Pattern ExampleItem = Pattern.compile("(@example)((.*?<br><eol>)*+.*?)(<eol>.*@end\\s+example)");
- static final Pattern ExamplePattern = Pattern.compile("@example");
- static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
- static final Pattern SmallExampleItem = Pattern.compile("(@smallexample)((.*?<br><eol>)*+.*?)(<eol>.*@end\\s+smallexample)");
- static final Pattern SmallExamplePattern = Pattern.compile("@smallexample");
- static final Pattern StrongPattern = Pattern.compile("@strong\\{(\\w*)\\}(@\\*)?");
- static final Pattern EndSmallExamplePattern = Pattern.compile("@end\\s+smallexample");
- static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
- static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
- static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
- static final Pattern ItemPattern = Pattern.compile("@item");
- static final Pattern RefillPattern = Pattern.compile("@refill");
- static final Pattern NoIndentPattern = Pattern.compile("@noindent");
- static final Pattern QuotationPattern = Pattern.compile("@quotation");
- static final Pattern EndQuotation = Pattern.compile("@end\\s+quotation");
- static final Pattern GroupPattern = Pattern.compile("@group");
- static final Pattern TabPattern = Pattern.compile("@tab");
- static final Pattern DeftpPattern = Pattern.compile("@deftp\\s+\\{([^\\}]*?)\\}\\s*\\{([^\\}]*?)\\}");
- static final Pattern EndDeftpPattern = Pattern.compile("@end\\s+deftp");
- static final Pattern CommentPattern = Pattern.compile("@c<eol>|@c\\s+.*?<eol>");
- static final Pattern EndGroupPattern = Pattern.compile("@end\\s+group");
- static final Pattern BracketRefPattern = Pattern.compile("\\(@.?.?ref\\{[^\\}]*\\}\\)");
- static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
- static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
- static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
- static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*?)@item\\s+(.*?)(<eol>.*@end\\s+table)", Pattern.DOTALL);
- static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*?)@item\\s+(.*?)(<eol>.*@end\\+table)", Pattern.DOTALL);
- static final Pattern TableCodeItemPattern = Pattern.compile("(@table\\s*@code.*?)@item\\s+(.*?)(<eol>.*?)(@end\\s+table)", Pattern.DOTALL);
- static final Pattern TableVarItemPattern = Pattern.compile("(@table\\s*@var.*?)@item\\s+(.*?)(<eol>.*@end\\s+table)", Pattern.DOTALL);
- static final Pattern VtableCodeItemPattern = Pattern.compile("(@vtable\\s*@code.*?)@item\\s+(.*?)(<eol>.*@end\\s+vtable)", Pattern.DOTALL);
- static final Pattern MultitableItemPattern = Pattern.compile("(@multitable.*)@item\\s+(.*?)<eol>(.*?@end\\s+multitable)" +
- "|(@multitable.*)@item\\s*<eol>(.*?)<eol>(.*?@end\\s+multitable)", Pattern.DOTALL);
- static final Pattern TableCodeMatchPattern = Pattern.compile("(@table\\s+@code)(.*?)(@end\\s+table)", Pattern.DOTALL);
- static final Pattern TableSampMatchPattern = Pattern.compile("(@table\\s+@samp)(.*?)(@end\\s+table)", Pattern.DOTALL);
- static final Pattern TableAsisMatchPattern = Pattern.compile("(@table\\s+@asis)(.*?)(@end\\s+table)", Pattern.DOTALL);
- static final Pattern TableVarMatchPattern = Pattern.compile("(@table\\s+@var)(.*?)(@end\\s+table)", Pattern.DOTALL);
- static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
- static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
- static final Pattern TableCodePattern = Pattern.compile("@table\\s*@code", Pattern.MULTILINE);
- static final Pattern TableVarPattern = Pattern.compile("@table\\s*@var", Pattern.MULTILINE);
- static final Pattern VtableCodePattern = Pattern.compile("@vtable\\s*@code", Pattern.MULTILINE);
- static final Pattern MultitablePattern = Pattern.compile("@multitable.*?<DT>", Pattern.DOTALL);
- static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
- static final Pattern EndVtablePattern = Pattern.compile("@end\\s+vtable");
- static final Pattern EndMultitablePattern = Pattern.compile("@end\\s+multitable");
- static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
- static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*?)" + "@end\\s+itemize", Pattern.DOTALL);
- static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*?)" + "@end\\s+itemize", Pattern.DOTALL);
- static final Pattern InfoOnlyPattern = Pattern.compile("@ifinfo.*?@end\\s+ifinfo", Pattern.DOTALL);
- static final Pattern TexOnlyPattern = Pattern.compile("@iftex.*?@end\\s+iftex", Pattern.DOTALL);
- static final Pattern TexPattern = Pattern.compile("@tex.*?@end\\s+tex", Pattern.DOTALL);
- static final Pattern IgnorePattern = Pattern.compile("@ignore.*?@end\\s+ignore", Pattern.DOTALL);
- static final Pattern IfInfoPattern = Pattern.compile("@ifinfo");
- static final Pattern InfinityPattern = Pattern.compile("@infinity");
- static final Pattern EndIfInfoPattern = Pattern.compile("@end\\s+ifinfo");
- static final Pattern NotTexPattern = Pattern.compile("@ifnottex");
- static final Pattern EndNotTexPattern = Pattern.compile("@end\\s+ifnottex");
- static final Pattern DeftypevrPattern = Pattern.compile("@deftypevr\\s+");
- static final Pattern EndDeftypevr = Pattern.compile("@end\\s+deftypevr");
- static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
- static final Pattern PxrefPattern = Pattern.compile("@pxref\\{[^\\}]*\\}", Pattern.MULTILINE);
- static final Pattern AtTPattern = Pattern.compile("@t\\{([^\\}]*)\\}");
- static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
- static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
- static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
- static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
- static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
- static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
- static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
- static final Pattern AnyVarPattern = Pattern.compile("@[a-z]*var\\{([^\\}]*)\\}");
- static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
- static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
- static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
- static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
- static final Pattern TagPattern = Pattern.compile("@\\w+\\{([^\\}]*)\\}");
- static final Pattern TagCharPattern = Pattern.compile("@([\\{\\}\\:\\*\"])");
- static final Pattern StrandedPeriod = Pattern.compile("(\\w)\\s+\\.\\s+");
- static final Pattern LeftOverPeriod = Pattern.compile("^\\.\\s+<eol>");
- static final Pattern AmpersandPattern = Pattern.compile("&");
- static final Pattern LeftAnglePattern = Pattern.compile("<");
- static final Pattern RightAnglePattern = Pattern.compile(">");
-
- public static String stripProtoTags(String tt) {
- Matcher mm;
- String ss = "";
-
- ss = "";
- while (ss != tt) {
- mm = AnyVarPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1");
- }
-
- ss = "";
- while (ss != tt) {
- mm = DotsPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("...");
- }
-
- ss = "";
- while (ss != tt) {
- mm = CodePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1");
- }
-
- ss = "";
- while (ss != tt) {
- mm = AtTPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TagPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TagCharPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- return tt;
- }
-
- public static String transformTags(String tt) {
- Matcher mm;
- String ss = "";
- int endtableIndex = Integer.MAX_VALUE;
-
- ss = "";
- while (ss != tt) {
- mm = BracketRefPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = XrefPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = CommentPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<eol>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = PxrefPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = DeftypevrPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = StrongPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<h3>$1</h3>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndDeftypevr.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = IndexPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = IndexPattern2.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = NoIndentPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = GroupPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndGroupPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = QuotationPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndQuotation.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = InfinityPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("infinity");
- }
-
- ss = "";
- while (ss != tt) {
- mm = DeftpPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<h4>$1 - $2</h4>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndDeftpPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = RefillPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = VarPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<VAR>$1</VAR>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = DotsPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<small>...</small>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = CommandPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>$1</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = CodePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>$1</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = KbdPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<KBD>$1</KBD>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EmphPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<EM>$1</EM>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = FilePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<TT>$1</TT>");
- }
-
-
- ss = "";
- while (ss != tt) {
- mm = VerbatimPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndVerbatimPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</CODE>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = SampPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<samp>$1</samp>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = OptionPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<samp>$1</samp>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ExampleItem.matcher(tt);
- ss = tt;
- // We want to add a break at the end of each example line to preserve
- // formatting when Eclipse processes the xml (e.g. C code lines).
- tt = mm.replaceAll("$1$2<br>$4");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ExamplePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndExamplePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</pre></td></tr></table>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = SmallExampleItem.matcher(tt);
- ss = tt;
- // We want to add a break at the end of each example line to preserve
- // formatting when Eclipse processes the xml (e.g. C code lines).
- tt = mm.replaceAll("$1$2<br>$4");
- }
-
- ss = "";
- while (ss != tt) {
- mm = SmallExamplePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<pre>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndSmallExamplePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</pre>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EnumeratePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<OL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndEnumeratePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</OL>");
- }
-
-// ss = "";
-// while (ss != tt) {
-// mm = InfoOnlyPattern.matcher(tt);
-// ss = tt;
-// tt = mm.replaceAll("");
-// }
-
- ss = "";
- while (ss != tt) {
- mm = TexOnlyPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TexPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = IgnorePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = NotTexPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndNotTexPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- // We will treat ifinfo the same as ifnottex which we pass through.
- ss = "";
- while (ss != tt) {
- mm = IfInfoPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndIfInfoPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- endtableIndex = Integer.MAX_VALUE;
- while (ss != tt) {
- mm = TableSampItemPattern.matcher(tt);
- ss = tt;
- if (mm.find()) {
- if (mm.start(4) > endtableIndex) {
- // We try and find the last @[table samp] marker we can find with an @item before @[end table].
- // The end marker has moved forward to make the match which means we have exhausted all @item markers
- // from the last @[table samp] and @[end table] we were using prior to this iteration of the loop.
- // If we change the table markers now, we avoid the prior table from
- // matching any @item marker that sits between tables.
- Matcher mm2 = TableSampMatchPattern.matcher(tt);
- tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
- mm2 = TableSampMatchPattern.matcher(tt);
- if (mm2.find())
- endtableIndex = mm2.start(3);
- }
- else {
- tt = mm.replaceFirst("$1<DT><SAMP>$2</SAMP>\n<DD>$3$4");
- endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
- }
- }
- }
-
- //FIXME: This parser assumes that a table does not have an @itemize element
- // inside it. It allows the opposite to be true (i.e. a table inside
- // an @itemize element.
-
- ss = "";
- endtableIndex = Integer.MAX_VALUE;
- while (ss != tt) {
- mm = TableAsisItemPattern.matcher(tt);
- ss = tt;
- if (mm.find()) {
- if (mm.start(4) > endtableIndex) {
- // We try and find the last @[table asis] marker we can find with an @item before @[end table].
- // The end marker has moved forward to make the match which means we have exhausted all @item markers
- // from the last @[table asis] and @[end table] we were using prior to this iteration of the loop.
- // If we change the table markers now, we avoid the prior table from
- // matching any @item marker that sits between tables.
- Matcher mm2 = TableAsisMatchPattern.matcher(tt);
- tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
- mm2 = TableAsisMatchPattern.matcher(tt);
- if (mm2.find())
- endtableIndex = mm2.start(3);
- }
- else {
- tt = mm.replaceFirst("$1<DT>$2\n<DD>$3$4");
- endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
- }
- }
- }
-
- ss = "";
- endtableIndex = Integer.MAX_VALUE;
- while (ss != tt) {
- mm = TableCodeItemPattern.matcher(tt);
- ss = tt;
- if (mm.find()) {
- if (mm.start(4) > endtableIndex) {
- // We try and find the last @[table code] marker we can find with an @item before @[end table].
- // The end marker has moved forward to make the match which means we have exhausted all @item markers
- // from the last @[table code] and @[end table] we were using prior to this iteration of the loop.
- // If we change the table markers now, we avoid the prior table from
- // matching any @item marker that sits between tables.
- Matcher mm2 = TableCodeMatchPattern.matcher(tt);
- tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
- mm2 = TableCodeMatchPattern.matcher(tt);
- if (mm2.find())
- endtableIndex = mm2.start(3);
- }
- else {
- tt = mm.replaceFirst("$1<DT><CODE>$2</CODE>\n<DD>$3$4");
- endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
- }
- }
- }
-
- ss = "";
- endtableIndex = Integer.MAX_VALUE;
- while (ss != tt) {
- mm = TableVarItemPattern.matcher(tt);
- ss = tt;
- if (mm.find()) {
- if (mm.start(4) > endtableIndex) {
- // We try and find the last @[table var] marker we can find with an @item before @[end table].
- // The end marker has moved forward to make the match which means we have exhausted all @item markers
- // from the last @[table var] and @[end table] we were using prior to this iteration of the loop.
- // If we change the table markers now, we avoid the prior table from
- // matching any @item marker that sits between tables.
- Matcher mm2 = TableVarMatchPattern.matcher(tt);
- tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
- mm2 = TableVarMatchPattern.matcher(tt);
- if (mm2.find())
- endtableIndex = mm2.start(3);
- }
- else {
- tt = mm.replaceFirst("$1<DT><VAR>$2</VAR>\n<DD>$3$4");
- endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
- }
- }
- }
-
- ss = "";
- while (ss != tt) {
- mm = VtableCodeItemPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1<DT><CODE>$2</CODE>\n<DD>$3");
- }
-
- ss = "";
- while (ss != tt) {
- mm = MultitableItemPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1<DT><pre>$2</pre>\n<DD><br>$3");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableSampPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableAsisPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableVarPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TableCodePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = VtableCodePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n");
- }
-
- ss = "";
- while (ss != tt) {
- mm = MultitablePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<DL>\n<DT>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndTablePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</DL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndVtablePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</DL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = EndMultitablePattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("</DL>");
- }
-
- //FIXME: if there ever is a @itemize @bullet within a
- // @itemize @minus or vice-versa, the following
- // logic will get it wrong.
- ss = "";
- while (ss != tt) {
- mm = ItemizeMinusPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<UL>$1</UL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ItemizeBulletPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<OL>$1</OL>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = ItemPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("<LI>");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TagPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TagCharPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1");
- }
-
- ss = "";
- while (ss != tt) {
- mm = StrandedPeriod.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("$1. ");
- }
-
- ss = "";
- while (ss != tt) {
- mm = LeftOverPeriod.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- ss = "";
- while (ss != tt) {
- mm = TabPattern.matcher(tt);
- ss = tt;
- tt = mm.replaceAll("");
- }
-
- mm = AmpersandPattern.matcher(tt);
- tt = mm.replaceAll("&amp;");
-
- mm = LeftAnglePattern.matcher(tt);
- tt = mm.replaceAll("&lt;");
-
- mm = RightAnglePattern.matcher(tt);
- tt = mm.replaceAll("&gt;");
-
- // Put back all the eol markers
- mm = EOLPattern.matcher(tt);
- tt = mm.replaceAll("<eol>");
-
- return tt;
- }
+
+ static final Pattern ParmBracketPattern = Pattern.compile("\\((.*?)\\)");
+ static final Pattern IndexPattern = Pattern.compile("@\\w*index\\s+[a-zA-Z0-9_@\\{\\}]*");
+ static final Pattern IndexPattern2 = Pattern.compile("@\\w*index\\{[a-zA-Z0-9_@\\{\\}]*\\}");
+ static final Pattern ExampleItem = Pattern.compile("(@example)((.*?<br><eol>)*+.*?)(<eol>.*@end\\s+example)");
+ static final Pattern ExamplePattern = Pattern.compile("@example");
+ static final Pattern EndExamplePattern = Pattern.compile("@end\\s+example");
+ static final Pattern SmallExampleItem = Pattern.compile("(@smallexample)((.*?<br><eol>)*+.*?)(<eol>.*@end\\s+smallexample)");
+ static final Pattern SmallExamplePattern = Pattern.compile("@smallexample");
+ static final Pattern StrongPattern = Pattern.compile("@strong\\{(\\w*)\\}(@\\*)?");
+ static final Pattern EndSmallExamplePattern = Pattern.compile("@end\\s+smallexample");
+ static final Pattern EnumeratePattern = Pattern.compile("@enumerate");
+ static final Pattern EndEnumeratePattern = Pattern.compile("@end\\s+enumerate");
+ static final Pattern VerbatimPattern = Pattern.compile("@verbatim");
+ static final Pattern ItemPattern = Pattern.compile("@item");
+ static final Pattern RefillPattern = Pattern.compile("@refill");
+ static final Pattern NoIndentPattern = Pattern.compile("@noindent");
+ static final Pattern QuotationPattern = Pattern.compile("@quotation");
+ static final Pattern EndQuotation = Pattern.compile("@end\\s+quotation");
+ static final Pattern GroupPattern = Pattern.compile("@group");
+ static final Pattern TabPattern = Pattern.compile("@tab");
+ static final Pattern DeftpPattern = Pattern.compile("@deftp\\s+\\{([^\\}]*?)\\}\\s*\\{([^\\}]*?)\\}");
+ static final Pattern EndDeftpPattern = Pattern.compile("@end\\s+deftp");
+ static final Pattern CommentPattern = Pattern.compile("@c<eol>|@c\\s+.*?<eol>");
+ static final Pattern EndGroupPattern = Pattern.compile("@end\\s+group");
+ static final Pattern BracketRefPattern = Pattern.compile("\\(@.?.?ref\\{[^\\}]*\\}\\)");
+ static final Pattern BRPattern = Pattern.compile("&lt;br&gt;");
+ static final Pattern EOLPattern = Pattern.compile("&lt;eol&gt;");
+ static final Pattern EndVerbatimPattern = Pattern.compile("@end\\s+verbatim");
+ static final Pattern TableSampItemPattern = Pattern.compile("(@table\\s*@samp.*?)@item\\s+(.*?)(<eol>.*@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableAsisItemPattern = Pattern.compile("(@table\\s*@asis.*?)@item\\s+(.*?)(<eol>.*@end\\+table)", Pattern.DOTALL);
+ static final Pattern TableCodeItemPattern = Pattern.compile("(@table\\s*@code.*?)@item\\s+(.*?)(<eol>.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableVarItemPattern = Pattern.compile("(@table\\s*@var.*?)@item\\s+(.*?)(<eol>.*@end\\s+table)", Pattern.DOTALL);
+ static final Pattern VtableCodeItemPattern = Pattern.compile("(@vtable\\s*@code.*?)@item\\s+(.*?)(<eol>.*@end\\s+vtable)", Pattern.DOTALL);
+ static final Pattern MultitableItemPattern = Pattern.compile("(@multitable.*)@item\\s+(.*?)<eol>(.*?@end\\s+multitable)" +
+ "|(@multitable.*)@item\\s*<eol>(.*?)<eol>(.*?@end\\s+multitable)", Pattern.DOTALL);
+ static final Pattern TableCodeMatchPattern = Pattern.compile("(@table\\s+@code)(.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableSampMatchPattern = Pattern.compile("(@table\\s+@samp)(.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableAsisMatchPattern = Pattern.compile("(@table\\s+@asis)(.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableVarMatchPattern = Pattern.compile("(@table\\s+@var)(.*?)(@end\\s+table)", Pattern.DOTALL);
+ static final Pattern TableSampPattern = Pattern.compile("@table\\s*@samp", Pattern.MULTILINE);
+ static final Pattern TableAsisPattern = Pattern.compile("@table\\s*@asis", Pattern.MULTILINE);
+ static final Pattern TableCodePattern = Pattern.compile("@table\\s*@code", Pattern.MULTILINE);
+ static final Pattern TableVarPattern = Pattern.compile("@table\\s*@var", Pattern.MULTILINE);
+ static final Pattern VtableCodePattern = Pattern.compile("@vtable\\s*@code", Pattern.MULTILINE);
+ static final Pattern MultitablePattern = Pattern.compile("@multitable.*?<DT>", Pattern.DOTALL);
+ static final Pattern EndTablePattern = Pattern.compile("@end\\s+table");
+ static final Pattern EndVtablePattern = Pattern.compile("@end\\s+vtable");
+ static final Pattern EndMultitablePattern = Pattern.compile("@end\\s+multitable");
+ static final Pattern DotsPattern = Pattern.compile("@dots\\{\\}");
+ static final Pattern ItemizeMinusPattern= Pattern.compile("@itemize\\s+@minus" + "(.*?)" + "@end\\s+itemize", Pattern.DOTALL);
+ static final Pattern ItemizeBulletPattern= Pattern.compile("@itemize\\s+@bullet" + "(.*?)" + "@end\\s+itemize", Pattern.DOTALL);
+ static final Pattern InfoOnlyPattern = Pattern.compile("@ifinfo.*?@end\\s+ifinfo", Pattern.DOTALL);
+ static final Pattern TexOnlyPattern = Pattern.compile("@iftex.*?@end\\s+iftex", Pattern.DOTALL);
+ static final Pattern TexPattern = Pattern.compile("@tex.*?@end\\s+tex", Pattern.DOTALL);
+ static final Pattern IgnorePattern = Pattern.compile("@ignore.*?@end\\s+ignore", Pattern.DOTALL);
+ static final Pattern IfInfoPattern = Pattern.compile("@ifinfo");
+ static final Pattern InfinityPattern = Pattern.compile("@infinity");
+ static final Pattern EndIfInfoPattern = Pattern.compile("@end\\s+ifinfo");
+ static final Pattern NotTexPattern = Pattern.compile("@ifnottex");
+ static final Pattern EndNotTexPattern = Pattern.compile("@end\\s+ifnottex");
+ static final Pattern DeftypevrPattern = Pattern.compile("@deftypevr\\s+");
+ static final Pattern EndDeftypevr = Pattern.compile("@end\\s+deftypevr");
+ static final Pattern XrefPattern = Pattern.compile("@xref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern PxrefPattern = Pattern.compile("@pxref\\{[^\\}]*\\}", Pattern.MULTILINE);
+ static final Pattern AtTPattern = Pattern.compile("@t\\{([^\\}]*)\\}");
+ static final Pattern CommandPattern = Pattern.compile("@command\\{([^\\}]*)\\}");
+ static final Pattern KbdPattern = Pattern.compile("@kbd\\{([^\\}]*)\\}");
+ static final Pattern RPattern = Pattern.compile("@r\\{([^\\}]*)\\}");
+ static final Pattern FilePattern = Pattern.compile("@file\\{([^\\}]*)\\}");
+ static final Pattern VarPattern = Pattern.compile("@var\\{([^\\}]*)\\}");
+ static final Pattern OVarPattern = Pattern.compile("@ovar\\{([^\\}]*)\\}");
+ static final Pattern DVarPattern = Pattern.compile("@dvar\\{([^\\},\\,]*),([^\\}]*)\\}");
+ static final Pattern AnyVarPattern = Pattern.compile("@[a-z]*var\\{([^\\}]*)\\}");
+ static final Pattern CodePattern = Pattern.compile("@code\\{([^\\}]*)\\}");
+ static final Pattern EmphPattern = Pattern.compile("@emph\\{([^\\}]*)\\}");
+ static final Pattern SampPattern = Pattern.compile("@samp\\{([^\\}]*)\\}");
+ static final Pattern OptionPattern = Pattern.compile("@option\\{([^\\}]*)\\}");
+ static final Pattern TagPattern = Pattern.compile("@\\w+\\{([^\\}]*)\\}");
+ static final Pattern TagCharPattern = Pattern.compile("@([\\{\\}\\:\\*\"])");
+ static final Pattern StrandedPeriod = Pattern.compile("(\\w)\\s+\\.\\s+");
+ static final Pattern LeftOverPeriod = Pattern.compile("^\\.\\s+<eol>");
+ static final Pattern AmpersandPattern = Pattern.compile("&");
+ static final Pattern LeftAnglePattern = Pattern.compile("<");
+ static final Pattern RightAnglePattern = Pattern.compile(">");
+
+ public static String stripProtoTags(String tt) {
+ Matcher mm;
+ String ss = "";
+
+ ss = "";
+ while (ss != tt) {
+ mm = AnyVarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DotsPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("...");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = AtTPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagCharPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ return tt;
+ }
+
+ public static String transformTags(String tt) {
+ Matcher mm;
+ String ss = "";
+ int endtableIndex = Integer.MAX_VALUE;
+
+ ss = "";
+ while (ss != tt) {
+ mm = BracketRefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = XrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CommentPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<eol>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = PxrefPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DeftypevrPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = StrongPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<h3>$1</h3>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndDeftypevr.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IndexPattern2.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = NoIndentPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = GroupPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndGroupPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = QuotationPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndQuotation.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = InfinityPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("infinity");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DeftpPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<h4>$1 - $2</h4>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndDeftpPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = RefillPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<VAR>$1</VAR>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = DotsPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<small>...</small>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CommandPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = CodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>$1</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = KbdPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<KBD>$1</KBD>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EmphPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<EM>$1</EM>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = FilePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TT>$1</TT>");
+ }
+
+
+ ss = "";
+ while (ss != tt) {
+ mm = VerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndVerbatimPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</CODE>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = OptionPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<samp>$1</samp>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ExampleItem.matcher(tt);
+ ss = tt;
+ // We want to add a break at the end of each example line to preserve
+ // formatting when Eclipse processes the xml (e.g. C code lines).
+ tt = mm.replaceAll("$1$2<br>$4");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<TABLE><tr><td>&nbsp;</td><td class=example><pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</pre></td></tr></table>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SmallExampleItem.matcher(tt);
+ ss = tt;
+ // We want to add a break at the end of each example line to preserve
+ // formatting when Eclipse processes the xml (e.g. C code lines).
+ tt = mm.replaceAll("$1$2<br>$4");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = SmallExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndSmallExamplePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</pre>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndEnumeratePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</OL>");
+ }
+
+// ss = "";
+// while (ss != tt) {
+// mm = InfoOnlyPattern.matcher(tt);
+// ss = tt;
+// tt = mm.replaceAll("");
+// }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TexOnlyPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = IgnorePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = NotTexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndNotTexPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ // We will treat ifinfo the same as ifnottex which we pass through.
+ ss = "";
+ while (ss != tt) {
+ mm = IfInfoPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndIfInfoPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ endtableIndex = Integer.MAX_VALUE;
+ while (ss != tt) {
+ mm = TableSampItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.find()) {
+ if (mm.start(4) > endtableIndex) {
+ // We try and find the last @[table samp] marker we can find with an @item before @[end table].
+ // The end marker has moved forward to make the match which means we have exhausted all @item markers
+ // from the last @[table samp] and @[end table] we were using prior to this iteration of the loop.
+ // If we change the table markers now, we avoid the prior table from
+ // matching any @item marker that sits between tables.
+ Matcher mm2 = TableSampMatchPattern.matcher(tt);
+ tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
+ mm2 = TableSampMatchPattern.matcher(tt);
+ if (mm2.find())
+ endtableIndex = mm2.start(3);
+ }
+ else {
+ tt = mm.replaceFirst("$1<DT><SAMP>$2</SAMP>\n<DD>$3$4");
+ endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
+ }
+ }
+ }
+
+ //FIXME: This parser assumes that a table does not have an @itemize element
+ // inside it. It allows the opposite to be true (i.e. a table inside
+ // an @itemize element.
+
+ ss = "";
+ endtableIndex = Integer.MAX_VALUE;
+ while (ss != tt) {
+ mm = TableAsisItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.find()) {
+ if (mm.start(4) > endtableIndex) {
+ // We try and find the last @[table asis] marker we can find with an @item before @[end table].
+ // The end marker has moved forward to make the match which means we have exhausted all @item markers
+ // from the last @[table asis] and @[end table] we were using prior to this iteration of the loop.
+ // If we change the table markers now, we avoid the prior table from
+ // matching any @item marker that sits between tables.
+ Matcher mm2 = TableAsisMatchPattern.matcher(tt);
+ tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
+ mm2 = TableAsisMatchPattern.matcher(tt);
+ if (mm2.find())
+ endtableIndex = mm2.start(3);
+ }
+ else {
+ tt = mm.replaceFirst("$1<DT>$2\n<DD>$3$4");
+ endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
+ }
+ }
+ }
+
+ ss = "";
+ endtableIndex = Integer.MAX_VALUE;
+ while (ss != tt) {
+ mm = TableCodeItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.find()) {
+ if (mm.start(4) > endtableIndex) {
+ // We try and find the last @[table code] marker we can find with an @item before @[end table].
+ // The end marker has moved forward to make the match which means we have exhausted all @item markers
+ // from the last @[table code] and @[end table] we were using prior to this iteration of the loop.
+ // If we change the table markers now, we avoid the prior table from
+ // matching any @item marker that sits between tables.
+ Matcher mm2 = TableCodeMatchPattern.matcher(tt);
+ tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
+ mm2 = TableCodeMatchPattern.matcher(tt);
+ if (mm2.find())
+ endtableIndex = mm2.start(3);
+ }
+ else {
+ tt = mm.replaceFirst("$1<DT><CODE>$2</CODE>\n<DD>$3$4");
+ endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
+ }
+ }
+ }
+
+ ss = "";
+ endtableIndex = Integer.MAX_VALUE;
+ while (ss != tt) {
+ mm = TableVarItemPattern.matcher(tt);
+ ss = tt;
+ if (mm.find()) {
+ if (mm.start(4) > endtableIndex) {
+ // We try and find the last @[table var] marker we can find with an @item before @[end table].
+ // The end marker has moved forward to make the match which means we have exhausted all @item markers
+ // from the last @[table var] and @[end table] we were using prior to this iteration of the loop.
+ // If we change the table markers now, we avoid the prior table from
+ // matching any @item marker that sits between tables.
+ Matcher mm2 = TableVarMatchPattern.matcher(tt);
+ tt = mm2.replaceFirst("<DL>\n$2\n</DL>");
+ mm2 = TableVarMatchPattern.matcher(tt);
+ if (mm2.find())
+ endtableIndex = mm2.start(3);
+ }
+ else {
+ tt = mm.replaceFirst("$1<DT><VAR>$2</VAR>\n<DD>$3$4");
+ endtableIndex = mm.end(1) + 10 + mm.group(2).length() + 12 + mm.group(3).length();
+ }
+ }
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VtableCodeItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1<DT><CODE>$2</CODE>\n<DD>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = MultitableItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1<DT><pre>$2</pre>\n<DD><br>$3");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableSampPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableAsisPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableVarPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TableCodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = VtableCodePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = MultitablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<DL>\n<DT>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndTablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndVtablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = EndMultitablePattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("</DL>");
+ }
+
+ //FIXME: if there ever is a @itemize @bullet within a
+ // @itemize @minus or vice-versa, the following
+ // logic will get it wrong.
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeMinusPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<UL>$1</UL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemizeBulletPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<OL>$1</OL>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = ItemPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("<LI>");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TagCharPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = StrandedPeriod.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("$1. ");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = LeftOverPeriod.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ ss = "";
+ while (ss != tt) {
+ mm = TabPattern.matcher(tt);
+ ss = tt;
+ tt = mm.replaceAll("");
+ }
+
+ mm = AmpersandPattern.matcher(tt);
+ tt = mm.replaceAll("&amp;");
+
+ mm = LeftAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&lt;");
+
+ mm = RightAnglePattern.matcher(tt);
+ tt = mm.replaceAll("&gt;");
+
+ // Put back all the eol markers
+ mm = EOLPattern.matcher(tt);
+ tt = mm.replaceAll("<eol>");
+
+ return tt;
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java
index 0a7ac19696..5f860ff75c 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/ClassInfo.java
@@ -17,70 +17,70 @@ import org.w3c.dom.Node;
public class ClassInfo implements Serializable {
- private static final long serialVersionUID = 1L;
- private String templateParms[] = new String[0];
- private boolean templateParmsFilled = false;
- private String className;
- private String include;
- private ArrayList<ClassInfo> baseClasses = new ArrayList<>();
- private HashMap<String, MemberInfo> members = new HashMap<>();
- public transient Node classNode;
- private ArrayList<ClassInfo> children = null;
- public ClassInfo(String className, String id, Node classNode) {
- this.className = className;
- this.classNode = classNode;
- }
- public String getClassName() {
- return className;
- }
- public void setClassName(String newName) {
- className = newName;
- }
- public void addTemplate(ClassInfo child) {
- if (children == null) {
- children = new ArrayList<>();
- }
- children.add(child);
- }
- public boolean areTemplateParmsFilled() {
- return templateParmsFilled;
- }
-
- public String[] getTemplateParms() {
- return templateParms;
- }
-
- public void setTemplateParms(String[] templateParms) {
- templateParmsFilled = true;
- this.templateParms = templateParms;
- }
-
- public String getInclude() {
- return include;
- }
-
- public void setInclude(String include) {
- this.include = include;
- }
-
- public ArrayList<ClassInfo> getChildren() {
- return children;
- }
-
- public MemberInfo getMember(String name) {
- return members.get(name);
- }
-
- public void addMember(MemberInfo info) {
- String name = info.getName();
- MemberInfo member = members.get(name);
- if (member != null)
- member.addChild(info);
- else
- members.put(name, info);
- }
-
- public void addBaseClass(ClassInfo info) {
- baseClasses.add(info);
- }
+ private static final long serialVersionUID = 1L;
+ private String templateParms[] = new String[0];
+ private boolean templateParmsFilled = false;
+ private String className;
+ private String include;
+ private ArrayList<ClassInfo> baseClasses = new ArrayList<>();
+ private HashMap<String, MemberInfo> members = new HashMap<>();
+ public transient Node classNode;
+ private ArrayList<ClassInfo> children = null;
+ public ClassInfo(String className, String id, Node classNode) {
+ this.className = className;
+ this.classNode = classNode;
+ }
+ public String getClassName() {
+ return className;
+ }
+ public void setClassName(String newName) {
+ className = newName;
+ }
+ public void addTemplate(ClassInfo child) {
+ if (children == null) {
+ children = new ArrayList<>();
+ }
+ children.add(child);
+ }
+ public boolean areTemplateParmsFilled() {
+ return templateParmsFilled;
+ }
+
+ public String[] getTemplateParms() {
+ return templateParms;
+ }
+
+ public void setTemplateParms(String[] templateParms) {
+ templateParmsFilled = true;
+ this.templateParms = templateParms;
+ }
+
+ public String getInclude() {
+ return include;
+ }
+
+ public void setInclude(String include) {
+ this.include = include;
+ }
+
+ public ArrayList<ClassInfo> getChildren() {
+ return children;
+ }
+
+ public MemberInfo getMember(String name) {
+ return members.get(name);
+ }
+
+ public void addMember(MemberInfo info) {
+ String name = info.getName();
+ MemberInfo member = members.get(name);
+ if (member != null)
+ member.addChild(info);
+ else
+ members.put(name, info);
+ }
+
+ public void addBaseClass(ClassInfo info) {
+ baseClasses.add(info);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java
index 89f3c6ba49..5b50f51700 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/FunctionInfo.java
@@ -14,100 +14,100 @@ import java.io.Serializable;
import java.util.ArrayList;
public class FunctionInfo implements Serializable {
- private static final long serialVersionUID = 1L;
- private String name;
- private String prototype;
- private String desc;
- private String returnType;
- private ArrayList<String> headers = new ArrayList<>();
-
- /**
- * Constructor for function.
- *
- * @param name
- */
- public FunctionInfo(String name) {
- this.name = name;
- }
-
- /**
- * Get function name.
- *
- * @return function name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Get prototype for function.
- *
- * @return prototype string or null
- */
- public String getPrototype() {
- return prototype;
- }
-
- /**
- * Set prototype string.
- *
- * @param prototype
- */
- public void setPrototype(String prototype) {
- this.prototype = prototype;
- }
-
- /**
- * Get description for function.
- *
- * @return description string or null
- */
- public String getDescription() {
- return desc;
- }
-
- /**
- * Set description string for function.
- *
- * @param desc
- */
- public void setDescription(String desc) {
- this.desc = desc;
- }
+ private static final long serialVersionUID = 1L;
+ private String name;
+ private String prototype;
+ private String desc;
+ private String returnType;
+ private ArrayList<String> headers = new ArrayList<>();
- /**
- * Get return type for function.
- *
- * @return return type as string or null
- */
- public String getReturnType() {
- return returnType;
- }
+ /**
+ * Constructor for function.
+ *
+ * @param name
+ */
+ public FunctionInfo(String name) {
+ this.name = name;
+ }
- /**
- * Set return type for function.
- *
- * @param returnType
- */
- public void setReturnType(String returnType) {
- this.returnType = returnType;
- }
+ /**
+ * Get function name.
+ *
+ * @return function name
+ */
+ public String getName() {
+ return name;
+ }
- /**
- * Get the headers that need including for this function.
- *
- * @return list of header strings
- */
- public ArrayList<String> getHeaders() {
- return headers;
- }
-
- /**
- * Add a header to the list of headers needed for this function.
- *
- * @param header the name of the header file to add
- */
- public void addHeader(String header) {
- headers.add(header);
- }
+ /**
+ * Get prototype for function.
+ *
+ * @return prototype string or null
+ */
+ public String getPrototype() {
+ return prototype;
+ }
+
+ /**
+ * Set prototype string.
+ *
+ * @param prototype
+ */
+ public void setPrototype(String prototype) {
+ this.prototype = prototype;
+ }
+
+ /**
+ * Get description for function.
+ *
+ * @return description string or null
+ */
+ public String getDescription() {
+ return desc;
+ }
+
+ /**
+ * Set description string for function.
+ *
+ * @param desc
+ */
+ public void setDescription(String desc) {
+ this.desc = desc;
+ }
+
+ /**
+ * Get return type for function.
+ *
+ * @return return type as string or null
+ */
+ public String getReturnType() {
+ return returnType;
+ }
+
+ /**
+ * Set return type for function.
+ *
+ * @param returnType
+ */
+ public void setReturnType(String returnType) {
+ this.returnType = returnType;
+ }
+
+ /**
+ * Get the headers that need including for this function.
+ *
+ * @return list of header strings
+ */
+ public ArrayList<String> getHeaders() {
+ return headers;
+ }
+
+ /**
+ * Add a header to the list of headers needed for this function.
+ *
+ * @param header the name of the header file to add
+ */
+ public void addHeader(String header) {
+ headers.add(header);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java
index 0218bff0ce..2169ded7d8 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/HelpBook.java
@@ -14,26 +14,26 @@ import org.eclipse.cdt.ui.ICHelpBook;
public class HelpBook implements ICHelpBook {
- private String title;
- private int type;
-
- public HelpBook (String title, String typeName) {
- this.title = title;
- if (typeName.equals("C")) //$NON-NLS-1$
- type = HELP_TYPE_C;
- else if (typeName.equals("C++")) //$NON-NLS-1$
- type = HELP_TYPE_CPP;
- else
- type = HELP_TYPE_ASM;
- }
- @Override
- public String getTitle () {
- return title;
- }
-
- @Override
- public int getCHelpType () {
- return type;
- }
+ private String title;
+ private int type;
+
+ public HelpBook (String title, String typeName) {
+ this.title = title;
+ if (typeName.equals("C")) //$NON-NLS-1$
+ type = HELP_TYPE_C;
+ else if (typeName.equals("C++")) //$NON-NLS-1$
+ type = HELP_TYPE_CPP;
+ else
+ type = HELP_TYPE_ASM;
+ }
+ @Override
+ public String getTitle () {
+ return title;
+ }
+
+ @Override
+ public int getCHelpType () {
+ return type;
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java
index 097c0729a5..70724ffc47 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibHoverInfo.java
@@ -16,9 +16,9 @@ import java.util.TreeMap;
public class LibHoverInfo implements Serializable {
- private static final long serialVersionUID = 1L;
- public HashMap<String, ClassInfo> classes = new HashMap<>();
- public HashMap<String, TypedefInfo> typedefs = new HashMap<>();
- public TreeMap<String, FunctionInfo> functions = new TreeMap<>();
+ private static final long serialVersionUID = 1L;
+ public HashMap<String, ClassInfo> classes = new HashMap<>();
+ public HashMap<String, TypedefInfo> typedefs = new HashMap<>();
+ public TreeMap<String, FunctionInfo> functions = new TreeMap<>();
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java
index 8cdd691a4d..bfc1f0b5ec 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/LibhoverPlugin.java
@@ -27,73 +27,73 @@ import org.osgi.framework.BundleContext;
*/
public class LibhoverPlugin extends AbstractUIPlugin {
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.libhover"; //$NON-NLS-1$
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.libhover"; //$NON-NLS-1$
- private static final String LOAD_JOB_TXT = "LibHover.LoadJob.txt"; //$NON-NLS-1$
-
- // The shared instance
- private static LibhoverPlugin plugin;
-
- static {
- plugin = new LibhoverPlugin();
- }
+ private static final String LOAD_JOB_TXT = "LibHover.LoadJob.txt"; //$NON-NLS-1$
- /**
- * The constructor
- */
- public LibhoverPlugin() {
- }
+ // The shared instance
+ private static LibhoverPlugin plugin;
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- ResourcesPlugin.getWorkspace().addSaveParticipant(PLUGIN_ID,
- new ISaveParticipant() {
- @Override
- public void saving(ISaveContext saveContext) {
- save(saveContext);
- }
- @Override
- public void rollback(ISaveContext saveContext) {}
- @Override
- public void prepareToSave(ISaveContext saveContext) {}
- @Override
- public void doneSaving(ISaveContext saveContext) {}
- });
- IPreferenceStore ps = getPreferenceStore();
- if (ps == null || !ps.getBoolean(PreferenceConstants.LAZY_LOAD)) {
- Job k = new LibHoverLoadJob(LibHoverMessages.getString(LOAD_JOB_TXT));
- k.schedule();
- }
- }
+ static {
+ plugin = new LibhoverPlugin();
+ }
- private void save(ISaveContext context) {
- LibHover.saveLibraries();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
+ /**
+ * The constructor
+ */
+ public LibhoverPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ ResourcesPlugin.getWorkspace().addSaveParticipant(PLUGIN_ID,
+ new ISaveParticipant() {
+ @Override
+ public void saving(ISaveContext saveContext) {
+ save(saveContext);
+ }
+ @Override
+ public void rollback(ISaveContext saveContext) {}
+ @Override
+ public void prepareToSave(ISaveContext saveContext) {}
+ @Override
+ public void doneSaving(ISaveContext saveContext) {}
+ });
+ IPreferenceStore ps = getPreferenceStore();
+ if (ps == null || !ps.getBoolean(PreferenceConstants.LAZY_LOAD)) {
+ Job k = new LibHoverLoadJob(LibHoverMessages.getString(LOAD_JOB_TXT));
+ k.schedule();
+ }
+ }
+
+ private void save(ISaveContext context) {
+ LibHover.saveLibraries();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static LibhoverPlugin getDefault() {
+ return plugin;
+ }
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static LibhoverPlugin getDefault() {
- return plugin;
- }
-
} \ No newline at end of file
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java
index 5b46a910db..8530c5e3cf 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/MemberInfo.java
@@ -14,121 +14,121 @@ import java.io.Serializable;
import java.util.ArrayList;
public class MemberInfo implements Serializable {
- private static final long serialVersionUID = 1L;
- private String name;
- private String prototype;
- private String desc;
- private String returnType;
- private String[] paramTypes = new String[0];
- private ArrayList<MemberInfo> children = null;
+ private static final long serialVersionUID = 1L;
+ private String name;
+ private String prototype;
+ private String desc;
+ private String returnType;
+ private String[] paramTypes = new String[0];
+ private ArrayList<MemberInfo> children = null;
- /**
- * Constructor for member.
- *
- * @param name
- */
- public MemberInfo(String name) {
- this.name = name;
- }
+ /**
+ * Constructor for member.
+ *
+ * @param name
+ */
+ public MemberInfo(String name) {
+ this.name = name;
+ }
- /**
- * Get member name.
- *
- * @return member name
- */
- public String getName() {
- return name;
- }
+ /**
+ * Get member name.
+ *
+ * @return member name
+ */
+ public String getName() {
+ return name;
+ }
- /**
- * Get prototype for member.
- *
- * @return prototype string or null
- */
- public String getPrototype() {
- return prototype;
- }
+ /**
+ * Get prototype for member.
+ *
+ * @return prototype string or null
+ */
+ public String getPrototype() {
+ return prototype;
+ }
- /**
- * Set prototype string.
- *
- * @param prototype
- */
- public void setPrototype(String prototype) {
- this.prototype = prototype;
- }
+ /**
+ * Set prototype string.
+ *
+ * @param prototype
+ */
+ public void setPrototype(String prototype) {
+ this.prototype = prototype;
+ }
- /**
- * Get description for member.
- *
- * @return description string or null
- */
- public String getDescription() {
- return desc;
- }
+ /**
+ * Get description for member.
+ *
+ * @return description string or null
+ */
+ public String getDescription() {
+ return desc;
+ }
- /**
- * Set description string for member.
- *
- * @param desc
- */
- public void setDescription(String desc) {
- this.desc = desc;
- }
+ /**
+ * Set description string for member.
+ *
+ * @param desc
+ */
+ public void setDescription(String desc) {
+ this.desc = desc;
+ }
- /**
- * Get param types for member.
- *
- * @return return array of param types
- */
- public String[] getParamTypes() {
- return paramTypes;
- }
+ /**
+ * Get param types for member.
+ *
+ * @return return array of param types
+ */
+ public String[] getParamTypes() {
+ return paramTypes;
+ }
- /**
- * Set param types for member.
- *
- * @param paramTypes array of param types
- */
- public void setParamTypes(String[] paramTypes) {
- this.paramTypes = paramTypes;
- }
- /**
- * Get return type for member.
- *
- * @return return type as string or null
- */
- public String getReturnType() {
- return returnType;
- }
+ /**
+ * Set param types for member.
+ *
+ * @param paramTypes array of param types
+ */
+ public void setParamTypes(String[] paramTypes) {
+ this.paramTypes = paramTypes;
+ }
+ /**
+ * Get return type for member.
+ *
+ * @return return type as string or null
+ */
+ public String getReturnType() {
+ return returnType;
+ }
- /**
- * Set return type for member.
- *
- * @param returnType
- */
- public void setReturnType(String returnType) {
- this.returnType = returnType;
- }
+ /**
+ * Set return type for member.
+ *
+ * @param returnType
+ */
+ public void setReturnType(String returnType) {
+ this.returnType = returnType;
+ }
- /**
- * Add a member with the same name as a child of this member.
- *
- * @param info a member with same name as this member.
- */
- public void addChild(MemberInfo info) {
- if (children == null) {
- children = new ArrayList<>();
- }
- children.add(info);
- }
+ /**
+ * Add a member with the same name as a child of this member.
+ *
+ * @param info a member with same name as this member.
+ */
+ public void addChild(MemberInfo info) {
+ if (children == null) {
+ children = new ArrayList<>();
+ }
+ children.add(info);
+ }
- /**
- * Get the children members with same name as this member.
- *
- * @return an ArrayList of members with same name or null.
- */
- public ArrayList<MemberInfo> getChildren() {
- return children;
- }
+ /**
+ * Get the children members with same name as this member.
+ *
+ * @return an ArrayList of members with same name or null.
+ */
+ public ArrayList<MemberInfo> getChildren() {
+ return children;
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java
index f71146f530..364b6f28ce 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/cdt/libhover/TypedefInfo.java
@@ -14,107 +14,107 @@ import java.io.Serializable;
import java.util.ArrayList;
public class TypedefInfo implements Serializable {
- private static final long serialVersionUID = 1L;
- private String[] templates = new String[0];
- private String typedefName;
- private String transformedType;
- private ArrayList<TypedefInfo> children = null;
- public TypedefInfo(String typedefName, String transformedType) {
- this.typedefName = typedefName;
- this.transformedType = transformedType;
- }
- public String getTypedefName() {
- return typedefName;
- }
- public void setTypedefName(String name) {
- typedefName = name;
- }
-
- private String[] getTemplateArgs(String str) {
- ArrayList<String> list = new ArrayList<>();
- int index = 0;
- int lastIndex = 0;
- int templateCounter = 0;
- while (index < str.length()) {
- char ch = str.charAt(index);
- if (ch == '<') {
- if (templateCounter == 0)
- lastIndex = index + 1;
- templateCounter++;
- } else if (ch == '>') {
- templateCounter--;
- } else if (ch == ',' && templateCounter == 1) {
- // FIXME: do we have to strip out all blanks here?
- list.add(str.substring(lastIndex, index).trim());
- lastIndex = index + 1;
- }
- ++index;
- }
- String[] args = new String[list.size()];
- return list.toArray(args);
- }
-
- public String getTransformedType(String className) {
- int index = className.indexOf('<');
- if (index > 0) {
- TypedefInfo e = this;
- // Search the children list in case the given class name
- // matches a specific template case.
- ArrayList<TypedefInfo> children = getChildren();
- for (int x = 0; x < children.size(); ++x) {
- TypedefInfo child = children.get(x);
- if (className.matches(child.getTypedefName())) {
- e = child;
- break;
- }
- }
- String[] templates = e.getTemplates();
- String transformedName = e.transformedType;
- // Check if there are any template arguments to replace. If not,
- // we can just return the transformed type we have.
- if (templates.length <= 0)
- return transformedName;
- String[] args = getTemplateArgs(className);
- String[] templateArgs = getTemplateArgs(e.getTypedefName());
- int j = 0;
- // For every argument that doesn't match up, it must be a template
- // parameter so we'll replace the template parameter name with the
- // supplied parameter. We have to query the template parameter list
- // for the names to replace because for partial specific templates
- // those names will have been replaced with regex sequences designed to
- // help us identify when the specific template has matched. For example,
- // <char, _Tp> will be stored as <char,[a-zA-Z0-9_]*> and if we have
- // <char,char> we will replace _Tp with char in the transformed type.
- for (int i = 0; i < args.length; ++i) {
- if (!args[i].equals(templateArgs[i])) {
- transformedName = transformedName.replaceAll(templates[j], args[i]);
- ++j;
- }
- }
- return transformedName;
- } else {
- // There is no template specified.
- return transformedType;
- }
- }
-
- public void addTypedef(TypedefInfo typedef) {
- if (children == null) {
- children = new ArrayList<>();
- }
- children.add(typedef);
- }
- public ArrayList<TypedefInfo> getChildren() {
- return children;
- }
- public void copyTemplates(String[] newTemplates) {
- templates = new String[newTemplates.length];
- for (int i = 0; i < templates.length; ++i) {
- templates[i] = newTemplates[i];
- }
- }
- public String[] getTemplates() {
- return templates;
- }
+ private static final long serialVersionUID = 1L;
+ private String[] templates = new String[0];
+ private String typedefName;
+ private String transformedType;
+ private ArrayList<TypedefInfo> children = null;
+ public TypedefInfo(String typedefName, String transformedType) {
+ this.typedefName = typedefName;
+ this.transformedType = transformedType;
+ }
+ public String getTypedefName() {
+ return typedefName;
+ }
+ public void setTypedefName(String name) {
+ typedefName = name;
+ }
+
+ private String[] getTemplateArgs(String str) {
+ ArrayList<String> list = new ArrayList<>();
+ int index = 0;
+ int lastIndex = 0;
+ int templateCounter = 0;
+ while (index < str.length()) {
+ char ch = str.charAt(index);
+ if (ch == '<') {
+ if (templateCounter == 0)
+ lastIndex = index + 1;
+ templateCounter++;
+ } else if (ch == '>') {
+ templateCounter--;
+ } else if (ch == ',' && templateCounter == 1) {
+ // FIXME: do we have to strip out all blanks here?
+ list.add(str.substring(lastIndex, index).trim());
+ lastIndex = index + 1;
+ }
+ ++index;
+ }
+ String[] args = new String[list.size()];
+ return list.toArray(args);
+ }
+
+ public String getTransformedType(String className) {
+ int index = className.indexOf('<');
+ if (index > 0) {
+ TypedefInfo e = this;
+ // Search the children list in case the given class name
+ // matches a specific template case.
+ ArrayList<TypedefInfo> children = getChildren();
+ for (int x = 0; x < children.size(); ++x) {
+ TypedefInfo child = children.get(x);
+ if (className.matches(child.getTypedefName())) {
+ e = child;
+ break;
+ }
+ }
+ String[] templates = e.getTemplates();
+ String transformedName = e.transformedType;
+ // Check if there are any template arguments to replace. If not,
+ // we can just return the transformed type we have.
+ if (templates.length <= 0)
+ return transformedName;
+ String[] args = getTemplateArgs(className);
+ String[] templateArgs = getTemplateArgs(e.getTypedefName());
+ int j = 0;
+ // For every argument that doesn't match up, it must be a template
+ // parameter so we'll replace the template parameter name with the
+ // supplied parameter. We have to query the template parameter list
+ // for the names to replace because for partial specific templates
+ // those names will have been replaced with regex sequences designed to
+ // help us identify when the specific template has matched. For example,
+ // <char, _Tp> will be stored as <char,[a-zA-Z0-9_]*> and if we have
+ // <char,char> we will replace _Tp with char in the transformed type.
+ for (int i = 0; i < args.length; ++i) {
+ if (!args[i].equals(templateArgs[i])) {
+ transformedName = transformedName.replaceAll(templates[j], args[i]);
+ ++j;
+ }
+ }
+ return transformedName;
+ } else {
+ // There is no template specified.
+ return transformedType;
+ }
+ }
+
+ public void addTypedef(TypedefInfo typedef) {
+ if (children == null) {
+ children = new ArrayList<>();
+ }
+ children.add(typedef);
+ }
+ public ArrayList<TypedefInfo> getChildren() {
+ return children;
+ }
+ public void copyTemplates(String[] newTemplates) {
+ templates = new String[newTemplates.length];
+ for (int i = 0; i < templates.length; ++i) {
+ templates[i] = newTemplates[i];
+ }
+ }
+ public String[] getTemplates() {
+ return templates;
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java
index 1ea227773a..4329f326d6 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHover.java
@@ -83,21 +83,21 @@ import org.eclipse.linuxtools.internal.cdt.libhover.preferences.PreferenceConsta
public class LibHover implements ICHelpProvider {
- public final static String LIBHOVER_DOC_EXTENSION = LibhoverPlugin.PLUGIN_ID + ".library"; //$NON-NLS-1$
+ public final static String LIBHOVER_DOC_EXTENSION = LibhoverPlugin.PLUGIN_ID + ".library"; //$NON-NLS-1$
// see comment in initialize()
// private static String defaultSearchPath = null;
- private static ConcurrentHashMap<ICHelpBook, LibHoverLibrary> libraries = new ConcurrentHashMap<>();
+ private static ConcurrentHashMap<ICHelpBook, LibHoverLibrary> libraries = new ConcurrentHashMap<>();
static final String constructTypes[] = {
- "dtype", //$NON-NLS-1$
- "enum", //$NON-NLS-1$
- "function", //$NON-NLS-1$
- "groupsynopsis", //$NON-NLS-1$
- "struct", //$NON-NLS-1$
- "type", //$NON-NLS-1$
- "union" //$NON-NLS-1$
+ "dtype", //$NON-NLS-1$
+ "enum", //$NON-NLS-1$
+ "function", //$NON-NLS-1$
+ "groupsynopsis", //$NON-NLS-1$
+ "struct", //$NON-NLS-1$
+ "type", //$NON-NLS-1$
+ "union" //$NON-NLS-1$
};
static final int dtypeIndex = 0;
@@ -113,145 +113,145 @@ public class LibHover implements ICHelpProvider {
public static boolean docsFetched = false;
public static Collection<LibHoverLibrary> getLibraries() {
- return libraries.values();
+ return libraries.values();
}
public static void saveLibraries() {
- // If user preference is to cache libhover data, then save any un-saved
- // library hover data.
- IPreferenceStore ps = LibhoverPlugin.getDefault().getPreferenceStore();
- if (ps.getBoolean(PreferenceConstants.CACHE_EXT_LIBHOVER)) {
- IPath locationBase = LibhoverPlugin.getDefault().getStateLocation();
- for (Iterator<LibHoverLibrary> i = libraries.values().iterator(); i.hasNext();) {
- LibHoverLibrary l = i.next();
- try {
- // Now, output the LibHoverInfo for caching later
- IPath locationDir = locationBase;
- if (l.isCPP())
- locationDir = locationBase.append("CPP"); //$NON-NLS-1$
- else
- locationDir = locationBase.append("C"); //$NON-NLS-1$
- File lDir = new File(locationDir.toOSString());
- lDir.mkdir();
- IPath location = locationDir.append(getTransformedName(l.getName()) + ".libhover"); //$NON-NLS-1$
- File target = new File(location.toOSString());
- if (!target.exists()) {
- FileOutputStream f = new FileOutputStream(locationDir.append("tmpFile").toOSString()); //$NON-NLS-1$
- ObjectOutputStream out = new ObjectOutputStream(f);
- out.writeObject(l.getHoverInfo());
- out.close();
- File tmp = new File(locationDir.append("tmpFile").toOSString()); //$NON-NLS-1$
- tmp.renameTo(target);
- }
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
- }
+ // If user preference is to cache libhover data, then save any un-saved
+ // library hover data.
+ IPreferenceStore ps = LibhoverPlugin.getDefault().getPreferenceStore();
+ if (ps.getBoolean(PreferenceConstants.CACHE_EXT_LIBHOVER)) {
+ IPath locationBase = LibhoverPlugin.getDefault().getStateLocation();
+ for (Iterator<LibHoverLibrary> i = libraries.values().iterator(); i.hasNext();) {
+ LibHoverLibrary l = i.next();
+ try {
+ // Now, output the LibHoverInfo for caching later
+ IPath locationDir = locationBase;
+ if (l.isCPP())
+ locationDir = locationBase.append("CPP"); //$NON-NLS-1$
+ else
+ locationDir = locationBase.append("C"); //$NON-NLS-1$
+ File lDir = new File(locationDir.toOSString());
+ lDir.mkdir();
+ IPath location = locationDir.append(getTransformedName(l.getName()) + ".libhover"); //$NON-NLS-1$
+ File target = new File(location.toOSString());
+ if (!target.exists()) {
+ FileOutputStream f = new FileOutputStream(locationDir.append("tmpFile").toOSString()); //$NON-NLS-1$
+ ObjectOutputStream out = new ObjectOutputStream(f);
+ out.writeObject(l.getHoverInfo());
+ out.close();
+ File tmp = new File(locationDir.append("tmpFile").toOSString()); //$NON-NLS-1$
+ tmp.renameTo(target);
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
}
- public static synchronized void getLibHoverDocs() {
- if (docsFetched)
- return;
- libraries.clear();
- helpBooks.clear();
- helpBooksMap.clear();
- // Check if caching of library info is enabled and if so, get any
- // cached library hover info.
- IPreferenceStore ps = LibhoverPlugin.getDefault().getPreferenceStore();
- if (ps.getBoolean(PreferenceConstants.CACHE_EXT_LIBHOVER)) {
- // Look for cached libhover files in the plugin state location
- IPath stateLocation = LibhoverPlugin.getDefault().getStateLocation();
- IFileSystem fs = EFS.getLocalFileSystem();
- IPath CLibraryLocation = stateLocation.append("C"); //$NON-NLS-1$
- IPath CPPLibraryLocation = stateLocation.append("CPP"); //$NON-NLS-1$
- IFileStore cDir = fs.getStore(CLibraryLocation);
- if (cDir.fetchInfo().exists())
- getCachedLibraries(cDir, "C"); //$NON-NLS-1$
- IFileStore cppDir = fs.getStore(CPPLibraryLocation);
- if (cppDir.fetchInfo().exists())
- getCachedLibraries(cppDir, "C++"); //$NON-NLS-1$
- }
- IExtensionRegistry x = RegistryFactory.getRegistry();
- IConfigurationElement[] ces = x.getConfigurationElementsFor(LIBHOVER_DOC_EXTENSION);
- for (int i = 0; i < ces.length; ++i) {
- IConfigurationElement ce = ces[i];
- if (ce.getName().equals("library")) { //$NON-NLS-1$
- // see comment in initialize()
- // Use the FileLocator class to open the magic hover doc file
- // in the plugin's jar.
- // Either open the html file or file system file depending
- // on what has been specified.
- String location = ce.getAttribute("location"); //$NON-NLS-1$
- String name = ce.getAttribute("name"); //$NON-NLS-1$
- String helpdocs = ce.getAttribute("docs"); //$NON-NLS-1$
- String type = ce.getAttribute("type"); //$NON-NLS-1$
- String nameSpace = ce.getContributor().getName();
- // If library not already cached, create it
- ICHelpBook book = helpBooksMap.get(name);
- if (book == null) {
- HelpBook h = new HelpBook(name, type);
- helpBooks.add(h);
- helpBooksMap.put(name, h);
- LibHoverLibrary l = new LibHoverLibrary(name, location, helpdocs, nameSpace,
- "C++".equals(type)); //$NON-NLS-1$
- libraries.put(h, l);
- } else {
- LibHoverLibrary l = libraries.get(book);
- if (l != null)
- l.setDocs(helpdocs);
- }
- docsFetched = true;
- }
- }
- }
-
- private static String getTransformedName(String name) {
- return name.replaceAll("\\s", "_"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private static String getCleanName(String name) {
- return name.replaceAll("_", " "); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private static void getCachedLibraries(IFileStore dir, String type) {
- try {
- boolean isCPP = type.equals("C++"); //$NON-NLS-1$
- IFileStore[] files = dir.childStores(EFS.NONE, null);
- for (int i = 0; i < files.length; ++i) {
- IFileStore file = files[i];
- String fileName = file.fetchInfo().getName();
- if (fileName.endsWith(".libhover")) { //$NON-NLS-1$
- File f = file.toLocalFile(EFS.NONE, null);
- if (f != null) {
- String name = getCleanName(fileName.substring(0,fileName.length()-9));
- HelpBook h = new HelpBook(name, type);
- helpBooks.add(h);
- helpBooksMap.put(name, h);
- String location = file.toURI().toString();
- LibHoverLibrary l = new LibHoverLibrary(name, location, null, null, isCPP);
- libraries.put(h, l);
- }
- }
- }
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- @Override
- public void initialize() {
- getLibHoverDocs();
- }
-
- @Override
- public ICHelpBook[] getCHelpBooks () {
- ICHelpBook[] chelpbooks = new ICHelpBook[helpBooks.size()];
- return helpBooks.toArray(chelpbooks);
- }
-
- private static class FunctionSummary implements IFunctionSummary, Comparable<FunctionSummary> {
+ public static synchronized void getLibHoverDocs() {
+ if (docsFetched)
+ return;
+ libraries.clear();
+ helpBooks.clear();
+ helpBooksMap.clear();
+ // Check if caching of library info is enabled and if so, get any
+ // cached library hover info.
+ IPreferenceStore ps = LibhoverPlugin.getDefault().getPreferenceStore();
+ if (ps.getBoolean(PreferenceConstants.CACHE_EXT_LIBHOVER)) {
+ // Look for cached libhover files in the plugin state location
+ IPath stateLocation = LibhoverPlugin.getDefault().getStateLocation();
+ IFileSystem fs = EFS.getLocalFileSystem();
+ IPath CLibraryLocation = stateLocation.append("C"); //$NON-NLS-1$
+ IPath CPPLibraryLocation = stateLocation.append("CPP"); //$NON-NLS-1$
+ IFileStore cDir = fs.getStore(CLibraryLocation);
+ if (cDir.fetchInfo().exists())
+ getCachedLibraries(cDir, "C"); //$NON-NLS-1$
+ IFileStore cppDir = fs.getStore(CPPLibraryLocation);
+ if (cppDir.fetchInfo().exists())
+ getCachedLibraries(cppDir, "C++"); //$NON-NLS-1$
+ }
+ IExtensionRegistry x = RegistryFactory.getRegistry();
+ IConfigurationElement[] ces = x.getConfigurationElementsFor(LIBHOVER_DOC_EXTENSION);
+ for (int i = 0; i < ces.length; ++i) {
+ IConfigurationElement ce = ces[i];
+ if (ce.getName().equals("library")) { //$NON-NLS-1$
+ // see comment in initialize()
+ // Use the FileLocator class to open the magic hover doc file
+ // in the plugin's jar.
+ // Either open the html file or file system file depending
+ // on what has been specified.
+ String location = ce.getAttribute("location"); //$NON-NLS-1$
+ String name = ce.getAttribute("name"); //$NON-NLS-1$
+ String helpdocs = ce.getAttribute("docs"); //$NON-NLS-1$
+ String type = ce.getAttribute("type"); //$NON-NLS-1$
+ String nameSpace = ce.getContributor().getName();
+ // If library not already cached, create it
+ ICHelpBook book = helpBooksMap.get(name);
+ if (book == null) {
+ HelpBook h = new HelpBook(name, type);
+ helpBooks.add(h);
+ helpBooksMap.put(name, h);
+ LibHoverLibrary l = new LibHoverLibrary(name, location, helpdocs, nameSpace,
+ "C++".equals(type)); //$NON-NLS-1$
+ libraries.put(h, l);
+ } else {
+ LibHoverLibrary l = libraries.get(book);
+ if (l != null)
+ l.setDocs(helpdocs);
+ }
+ docsFetched = true;
+ }
+ }
+ }
+
+ private static String getTransformedName(String name) {
+ return name.replaceAll("\\s", "_"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ private static String getCleanName(String name) {
+ return name.replaceAll("_", " "); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ private static void getCachedLibraries(IFileStore dir, String type) {
+ try {
+ boolean isCPP = type.equals("C++"); //$NON-NLS-1$
+ IFileStore[] files = dir.childStores(EFS.NONE, null);
+ for (int i = 0; i < files.length; ++i) {
+ IFileStore file = files[i];
+ String fileName = file.fetchInfo().getName();
+ if (fileName.endsWith(".libhover")) { //$NON-NLS-1$
+ File f = file.toLocalFile(EFS.NONE, null);
+ if (f != null) {
+ String name = getCleanName(fileName.substring(0,fileName.length()-9));
+ HelpBook h = new HelpBook(name, type);
+ helpBooks.add(h);
+ helpBooksMap.put(name, h);
+ String location = file.toURI().toString();
+ LibHoverLibrary l = new LibHoverLibrary(name, location, null, null, isCPP);
+ libraries.put(h, l);
+ }
+ }
+ }
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void initialize() {
+ getLibHoverDocs();
+ }
+
+ @Override
+ public ICHelpBook[] getCHelpBooks () {
+ ICHelpBook[] chelpbooks = new ICHelpBook[helpBooks.size()];
+ return helpBooks.toArray(chelpbooks);
+ }
+
+ private static class FunctionSummary implements IFunctionSummary, Comparable<FunctionSummary> {
private String Name;
private String NameSpace;
@@ -261,104 +261,104 @@ public class LibHover implements ICHelpProvider {
private boolean prototypeHasBrackets;
private class RequiredInclude implements IRequiredInclude {
- private final String include;
+ private final String include;
- public RequiredInclude (String file) {
- include = file;
- }
+ public RequiredInclude (String file) {
+ include = file;
+ }
- @Override
- public String getIncludeName() {
- return include;
- }
+ @Override
+ public String getIncludeName() {
+ return include;
+ }
- @Override
- public boolean isStandard() {
- return true;
- }
+ @Override
+ public boolean isStandard() {
+ return true;
+ }
}
- @Override
- public int compareTo (FunctionSummary x) {
- FunctionSummary y = x;
- return getName().compareTo(y.getName());
- }
+ @Override
+ public int compareTo (FunctionSummary x) {
+ FunctionSummary y = x;
+ return getName().compareTo(y.getName());
+ }
private final ArrayList<RequiredInclude> Includes = new ArrayList<>();
private void setIncludeName (String iname) {
- RequiredInclude nri = new RequiredInclude(iname);
- Includes.add(nri);
+ RequiredInclude nri = new RequiredInclude(iname);
+ Includes.add(nri);
}
public class FunctionPrototypeSummary implements IFunctionPrototypeSummary {
@Override
- public String getName() { return Name; }
+ public String getName() { return Name; }
@Override
- public String getReturnType() { return ReturnType; }
+ public String getReturnType() { return ReturnType; }
@Override
- public String getArguments() { return Prototype; }
+ public String getArguments() { return Prototype; }
@Override
- public String getPrototypeString(boolean namefirst) {
+ public String getPrototypeString(boolean namefirst) {
if (true == namefirst) {
- if (prototypeHasBrackets())
- return Name + " " + Prototype + " " + ReturnType; //$NON-NLS-1$ //$NON-NLS-2$
+ if (prototypeHasBrackets())
+ return Name + " " + Prototype + " " + ReturnType; //$NON-NLS-1$ //$NON-NLS-2$
return Name + " (" + Prototype + ") " + ReturnType; //$NON-NLS-1$ //$NON-NLS-2$
}
else {
- if (prototypeHasBrackets())
- return ReturnType + " " + Name + " " + Prototype; //$NON-NLS-1$ //$NON-NLS-2$
+ if (prototypeHasBrackets())
+ return ReturnType + " " + Name + " " + Prototype; //$NON-NLS-1$ //$NON-NLS-2$
return ReturnType + " " + Name + " (" + Prototype + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
}
@Override
- public String getName() { return Name; }
+ public String getName() { return Name; }
@Override
- public String getNamespace() { return NameSpace; }
+ public String getNamespace() { return NameSpace; }
@Override
- public String getDescription() { return Summary; }
- public boolean prototypeHasBrackets() { return prototypeHasBrackets; }
- public void setPrototypeHasBrackets(boolean value) { prototypeHasBrackets = value; }
+ public String getDescription() { return Summary; }
+ public boolean prototypeHasBrackets() { return prototypeHasBrackets; }
+ public void setPrototypeHasBrackets(boolean value) { prototypeHasBrackets = value; }
@Override
- public IFunctionPrototypeSummary getPrototype() { return new FunctionPrototypeSummary(); }
+ public IFunctionPrototypeSummary getPrototype() { return new FunctionPrototypeSummary(); }
@Override
- public IRequiredInclude[] getIncludes() {
- IRequiredInclude[] includes = new IRequiredInclude[Includes.size()];
- for (int i = 0; i < Includes.size(); ++i) {
- includes[i] = Includes.get(i);
- }
- return includes;
+ public IRequiredInclude[] getIncludes() {
+ IRequiredInclude[] includes = new IRequiredInclude[Includes.size()];
+ for (int i = 0; i < Includes.size(); ++i) {
+ includes[i] = Includes.get(i);
+ }
+ return includes;
}
}
- private static class EnclosingASTNameJob extends SharedASTJob {
- private final int tlength;
- private final int toffset;
- private IASTName result = null;
- public EnclosingASTNameJob (ITranslationUnit t,
- int toffset, int tlength) {
- super("EnclosingASTNameJob", t); //$NON-NLS-1$
- this.toffset = toffset;
- this.tlength = tlength;
- }
- @Override
- public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) {
- if (ast != null) {
- result = ast.getNodeSelector(null).findEnclosingName(toffset, tlength);
- }
- return Status.OK_STATUS;
- }
- public IASTName getASTName() {
- return result;
- }
- }
-
- @Override
- public IFunctionSummary getFunctionInfo(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String name) {
+ private static class EnclosingASTNameJob extends SharedASTJob {
+ private final int tlength;
+ private final int toffset;
+ private IASTName result = null;
+ public EnclosingASTNameJob (ITranslationUnit t,
+ int toffset, int tlength) {
+ super("EnclosingASTNameJob", t); //$NON-NLS-1$
+ this.toffset = toffset;
+ this.tlength = tlength;
+ }
+ @Override
+ public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) {
+ if (ast != null) {
+ result = ast.getNodeSelector(null).findEnclosingName(toffset, tlength);
+ }
+ return Status.OK_STATUS;
+ }
+ public IASTName getASTName() {
+ return result;
+ }
+ }
+
+ @Override
+ public IFunctionSummary getFunctionInfo(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String name) {
IFunctionSummary f;
f = null;
@@ -368,374 +368,374 @@ public class LibHover implements ICHelpProvider {
ICPPFunctionType methodType = null;
if (t.isCXXLanguage()) {
- try {
- if (context instanceof IHoverHelpInvocationContext) {
- // We know the file offset of the member reference.
- IRegion region = ((IHoverHelpInvocationContext)context).getHoverRegion();
-
- // Now, let's find the declaration of the method. We need to do this because we want the specific
- // member prototype to go searching for. There could be many members called "x" which have different
- // documentation.
- final IASTName[] result= {null};
- EnclosingASTNameJob job = new EnclosingASTNameJob(t, region.getOffset(), region.getLength());
- job.schedule();
- try {
- job.join();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- if (job.getResult() == Status.OK_STATUS)
- result[0] = job.getASTName();
- if (result[0] != null) {
- final IBinding binding = result[0].getBinding();
- // Check to see we have a member function.
- if (binding instanceof ICPPFunction) {
- methodType = ((ICPPFunction)binding).getType();
- // We have a member function, find the class name.
- IBinding owner = ((ICPPFunction)binding).getOwner();
- if (owner instanceof ICPPClassType) {
- className = getClassName((ICPPClassType)owner);
- }
- }
- }
- }
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ try {
+ if (context instanceof IHoverHelpInvocationContext) {
+ // We know the file offset of the member reference.
+ IRegion region = ((IHoverHelpInvocationContext)context).getHoverRegion();
+
+ // Now, let's find the declaration of the method. We need to do this because we want the specific
+ // member prototype to go searching for. There could be many members called "x" which have different
+ // documentation.
+ final IASTName[] result= {null};
+ EnclosingASTNameJob job = new EnclosingASTNameJob(t, region.getOffset(), region.getLength());
+ job.schedule();
+ try {
+ job.join();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (job.getResult() == Status.OK_STATUS)
+ result[0] = job.getASTName();
+ if (result[0] != null) {
+ final IBinding binding = result[0].getBinding();
+ // Check to see we have a member function.
+ if (binding instanceof ICPPFunction) {
+ methodType = ((ICPPFunction)binding).getType();
+ // We have a member function, find the class name.
+ IBinding owner = ((ICPPFunction)binding).getOwner();
+ if (owner instanceof ICPPClassType) {
+ className = getClassName((ICPPClassType)owner);
+ }
+ }
+ }
+ }
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
// Loop through all the documents we have and report first match.
for (int i = 0; i < helpBooks.length; ++i) {
- LibHoverLibrary l = libraries.get(helpBooks[i]);
- if (name != null) {
- if (className != null) {
- if (l.isCPP())
- f = getMemberSummary(l, className, name, methodType);
- } else {
- f = getFunctionSummary(l, name);
- }
- if (f != null)
- return f;
- }
+ LibHoverLibrary l = libraries.get(helpBooks[i]);
+ if (name != null) {
+ if (className != null) {
+ if (l.isCPP())
+ f = getMemberSummary(l, className, name, methodType);
+ } else {
+ f = getFunctionSummary(l, name);
+ }
+ if (f != null)
+ return f;
+ }
+ }
+
+ return null;
+ }
+
+ // Get the class name for a type, including any instance template parameters
+ // e.g. std::basic_string<char>
+ private String getClassName(ICPPClassType c) {
+ String className = null;
+ try {
+ String[] qualified = c.getQualifiedName();
+ className = qualified[0];
+ for (int k = 1; k < qualified.length; ++k) {
+ className += "::" + qualified[k]; //$NON-NLS-1$
+ }
+
+ // Check if we have an instance of a template class.
+ if (c instanceof ICPPTemplateInstance) {
+ ICPPTemplateInstance ti = (ICPPTemplateInstance)c;
+ // Get a map which tells us the values of the template
+ // arguments (e.g. _CharT maps to char in the instance).
+ ICPPTemplateParameterMap tiMap = ti.getTemplateParameterMap();
+ ICPPTemplateDefinition td = ti.getTemplateDefinition();
+ ICPPTemplateParameter[] templateArgs = td.getTemplateParameters();
+ className += "<"; //$NON-NLS-1$
+ String separator = ""; //$NON-NLS-1$
+ for (int x = 0; x < templateArgs.length; ++x) {
+ ICPPTemplateParameter tp = templateArgs[x];
+ ICPPTemplateArgument ta = tiMap.getArgument(tp);
+ IType type = null;
+ // The template may have a type specified or a value.
+ // In the case of a value, figure out its type and use
+ // that when we do a lookup.
+ if (ta.isTypeValue())
+ type = ta.getTypeValue();
+ else
+ type = ta.getTypeOfNonTypeValue();
+ if (tp.getTemplateNestingLevel() == 0) {
+ // if the parameter is a class type, use recursion to
+ // get its class name including template parameters
+ if (type instanceof ICPPClassType)
+ className += separator + getClassName((ICPPClassType)type);
+ else
+ className += separator + type.toString();
+ separator = ","; //$NON-NLS-1$
+ }
+ }
+ className += ">"; //$NON-NLS-1$
+ }
+ } catch(DOMException e) {
+ return null;
+ }
+ return className;
+ }
+
+ private IFunctionSummary getFunctionSummary(LibHoverLibrary l, String name) {
+ FunctionInfo x = l.getFunctionInfo(name);
+ if (x != null) {
+ FunctionSummary f = new FunctionSummary();
+ f.ReturnType = x.getReturnType();
+ f.Prototype = x.getPrototype();
+ f.Summary = x.getDescription();
+ f.Name = x.getName();
+ ArrayList<String> headers = x.getHeaders();
+ for (int i = 0; i < headers.size(); ++i)
+ f.setIncludeName(headers.get(i));
+ return f;
+ }
+ return null;
+ }
+
+ private IFunctionSummary getMemberSummary(LibHoverLibrary l, String className,
+ String memberName, ICPPFunctionType methodType) {
+
+ ArrayList<String> templateTypes = new ArrayList<>();
+ ClassInfo info = l.getClassInfo(className, templateTypes);
+ String[] args = new String[0];
+ @SuppressWarnings("unused")
+ IType returnType = null;
+ if (info == null)
+ return null;
+ if (methodType != null) {
+ try {
+ args = resolveArgs(info, methodType.getParameterTypes(), templateTypes);
+ returnType = methodType.getReturnType();
+ } catch (Exception e) {
+ return null;
+ }
}
+ MemberInfo member = info.getMember(memberName);
+ if (member != null) {
+ MemberInfo m = null;
+ if (!isParmMatch(member, args, templateTypes, info)) {
+ ArrayList<MemberInfo> members = member.getChildren();
+ for (int i = 0; i < members.size(); ++i) {
+ MemberInfo k = members.get(i);
+ if (isParmMatch(k, args, templateTypes, info)) {
+ m = k;
+ break;
+ }
+ }
+ } else {
+ m = member;
+ }
+ if (m != null) {
+ // FIXME: do some work to determine parameters and return type.
+ FunctionSummary f = new FunctionSummary();
+ f.ReturnType = m.getReturnType();
+ f.Prototype = m.getPrototype();
+ f.Summary = m.getDescription();
+ f.Name = className + "::" + memberName; //$NON-NLS-1$
+ String[] templateParms = info.getTemplateParms();
+ for (int i = 0; i < templateTypes.size(); ++i) {
+ f.ReturnType = f.ReturnType.replaceAll(templateParms[i], templateTypes.get(i));
+ f.Prototype = f.Prototype.replaceAll(templateParms[i], templateTypes.get(i));
+ f.Name = f.Name.replaceAll(templateParms[i], templateTypes.get(i));
+ }
+ if (f.ReturnType.indexOf('<') >= 0) {
+ f.ReturnType = f.ReturnType.replaceAll("<", "&lt;"); //$NON-NLS-1$ //$NON-NLS-2$
+ f.ReturnType = f.ReturnType.replaceAll(">", "&gt;"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ if (f.Prototype.indexOf('<') >= 0) {
+ f.Prototype = f.Prototype.replaceAll("<", "&lt;"); //$NON-NLS-1$ //$NON-NLS-2$
+ f.Prototype = f.Prototype.replaceAll(">", "&gt;"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+ if (f.Name.indexOf('<') >= 0) {
+ f.Name = f.Name.replaceAll("<", "&lt;"); //$NON-NLS-1$//$NON-NLS-2$
+ f.Name = f.Name.replaceAll(">", "&gt;"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ f.setPrototypeHasBrackets(true);
+ f.setIncludeName(info.getInclude());
+ return f;
+ }
+ }
return null;
- }
-
- // Get the class name for a type, including any instance template parameters
- // e.g. std::basic_string<char>
- private String getClassName(ICPPClassType c) {
- String className = null;
- try {
- String[] qualified = c.getQualifiedName();
- className = qualified[0];
- for (int k = 1; k < qualified.length; ++k) {
- className += "::" + qualified[k]; //$NON-NLS-1$
- }
-
- // Check if we have an instance of a template class.
- if (c instanceof ICPPTemplateInstance) {
- ICPPTemplateInstance ti = (ICPPTemplateInstance)c;
- // Get a map which tells us the values of the template
- // arguments (e.g. _CharT maps to char in the instance).
- ICPPTemplateParameterMap tiMap = ti.getTemplateParameterMap();
- ICPPTemplateDefinition td = ti.getTemplateDefinition();
- ICPPTemplateParameter[] templateArgs = td.getTemplateParameters();
- className += "<"; //$NON-NLS-1$
- String separator = ""; //$NON-NLS-1$
- for (int x = 0; x < templateArgs.length; ++x) {
- ICPPTemplateParameter tp = templateArgs[x];
- ICPPTemplateArgument ta = tiMap.getArgument(tp);
- IType type = null;
- // The template may have a type specified or a value.
- // In the case of a value, figure out its type and use
- // that when we do a lookup.
- if (ta.isTypeValue())
- type = ta.getTypeValue();
- else
- type = ta.getTypeOfNonTypeValue();
- if (tp.getTemplateNestingLevel() == 0) {
- // if the parameter is a class type, use recursion to
- // get its class name including template parameters
- if (type instanceof ICPPClassType)
- className += separator + getClassName((ICPPClassType)type);
- else
- className += separator + type.toString();
- separator = ","; //$NON-NLS-1$
- }
- }
- className += ">"; //$NON-NLS-1$
- }
- } catch(DOMException e) {
- return null;
- }
- return className;
- }
-
- private IFunctionSummary getFunctionSummary(LibHoverLibrary l, String name) {
- FunctionInfo x = l.getFunctionInfo(name);
- if (x != null) {
- FunctionSummary f = new FunctionSummary();
- f.ReturnType = x.getReturnType();
- f.Prototype = x.getPrototype();
- f.Summary = x.getDescription();
- f.Name = x.getName();
- ArrayList<String> headers = x.getHeaders();
- for (int i = 0; i < headers.size(); ++i)
- f.setIncludeName(headers.get(i));
- return f;
- }
- return null;
- }
-
- private IFunctionSummary getMemberSummary(LibHoverLibrary l, String className,
- String memberName, ICPPFunctionType methodType) {
-
- ArrayList<String> templateTypes = new ArrayList<>();
- ClassInfo info = l.getClassInfo(className, templateTypes);
- String[] args = new String[0];
- @SuppressWarnings("unused")
- IType returnType = null;
- if (info == null)
- return null;
- if (methodType != null) {
- try {
- args = resolveArgs(info, methodType.getParameterTypes(), templateTypes);
- returnType = methodType.getReturnType();
- } catch (Exception e) {
- return null;
- }
- }
- MemberInfo member = info.getMember(memberName);
- if (member != null) {
- MemberInfo m = null;
- if (!isParmMatch(member, args, templateTypes, info)) {
- ArrayList<MemberInfo> members = member.getChildren();
- for (int i = 0; i < members.size(); ++i) {
- MemberInfo k = members.get(i);
- if (isParmMatch(k, args, templateTypes, info)) {
- m = k;
- break;
- }
- }
- } else {
- m = member;
- }
-
- if (m != null) {
- // FIXME: do some work to determine parameters and return type.
- FunctionSummary f = new FunctionSummary();
- f.ReturnType = m.getReturnType();
- f.Prototype = m.getPrototype();
- f.Summary = m.getDescription();
- f.Name = className + "::" + memberName; //$NON-NLS-1$
- String[] templateParms = info.getTemplateParms();
- for (int i = 0; i < templateTypes.size(); ++i) {
- f.ReturnType = f.ReturnType.replaceAll(templateParms[i], templateTypes.get(i));
- f.Prototype = f.Prototype.replaceAll(templateParms[i], templateTypes.get(i));
- f.Name = f.Name.replaceAll(templateParms[i], templateTypes.get(i));
- }
- if (f.ReturnType.indexOf('<') >= 0) {
- f.ReturnType = f.ReturnType.replaceAll("<", "&lt;"); //$NON-NLS-1$ //$NON-NLS-2$
- f.ReturnType = f.ReturnType.replaceAll(">", "&gt;"); //$NON-NLS-1$//$NON-NLS-2$
- }
- if (f.Prototype.indexOf('<') >= 0) {
- f.Prototype = f.Prototype.replaceAll("<", "&lt;"); //$NON-NLS-1$ //$NON-NLS-2$
- f.Prototype = f.Prototype.replaceAll(">", "&gt;"); //$NON-NLS-1$//$NON-NLS-2$
- }
- if (f.Name.indexOf('<') >= 0) {
- f.Name = f.Name.replaceAll("<", "&lt;"); //$NON-NLS-1$//$NON-NLS-2$
- f.Name = f.Name.replaceAll(">", "&gt;"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- f.setPrototypeHasBrackets(true);
- f.setIncludeName(info.getInclude());
- return f;
- }
- }
- return null;
- }
-
-
- private boolean isParmMatch(MemberInfo m, String[] args, ArrayList<String> templateTypes, ClassInfo info) {
- String[] memberParms = m.getParamTypes();
- String className = info.getClassName();
- int index = className.lastIndexOf("::"); //$NON-NLS-1$
- String unqualifiedName = className.substring(index+2);
- for (int i = 0; i < memberParms.length; ++i) {
- String[] templateParms = info.getTemplateParms();
- for (int j = 0; j < templateTypes.size(); ++j) {
- memberParms[i] = memberParms[i].replaceAll(templateParms[j], templateTypes.get(j));
- }
- // Look for the class being passed by reference...the doc prototype will not fill in
- // the template parms nor the qualifier so we do it here to make sure we match what
- // is coming back from the indexer which will be fully-qualified and have template
- // parameters specified.
- if (memberParms[i].contains(unqualifiedName) && !memberParms[i].contains(className)) {
- String classTemplate = ""; //$NON-NLS-1$
- if (templateTypes.size() > 0) {
- classTemplate = "<"; //$NON-NLS-1$
- String separator = ""; //$NON-NLS-1$
- for (int j = 0; j < templateTypes.size(); ++j) {
- classTemplate += separator + templateTypes.get(j);
- separator = ","; //$NON-NLS-1$
- }
- classTemplate += ">"; //$NON-NLS-1$
- }
- memberParms[i] = memberParms[i].replaceAll(unqualifiedName, className + classTemplate);
- }
- }
- return Arrays.equals(memberParms, args);
- }
-
- private String[] resolveArgs(ClassInfo info, IType[] parameterTypes, ArrayList<String> templateTypes) {
- String[] templateParms = info.getTemplateParms();
- String[] result = new String[parameterTypes.length];
- for (int i = 0; i < parameterTypes.length; ++i) {
- String param = parameterTypes[i].toString();
- param = param.replaceAll("\\{.*\\}", ""); //$NON-NLS-1$ //$NON-NLS-2$
- param = param.trim();
- int index = param.indexOf("#"); //$NON-NLS-1$
- while (index >= 0) {
- // We assume no class has more than 9 template parms.
- int digit = param.charAt(index + 1) - '0';
- // where possible, replace template parms with real values
- if (digit < templateTypes.size())
- param = param.replaceFirst(param.substring(index, index + 2), templateTypes.get(digit));
- else
- param = param.replaceFirst(param.substring(index, index + 2), templateParms[digit]);
- index = param.indexOf("#"); //$NON-NLS-1$
- }
- result[i] = param;
- }
- return result;
- }
-
- @Override
- public IFunctionSummary[] getMatchingFunctions(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String prefix) {
- ArrayList<IFunctionSummary> fList = new ArrayList<>();
+ }
+
+
+ private boolean isParmMatch(MemberInfo m, String[] args, ArrayList<String> templateTypes, ClassInfo info) {
+ String[] memberParms = m.getParamTypes();
+ String className = info.getClassName();
+ int index = className.lastIndexOf("::"); //$NON-NLS-1$
+ String unqualifiedName = className.substring(index+2);
+ for (int i = 0; i < memberParms.length; ++i) {
+ String[] templateParms = info.getTemplateParms();
+ for (int j = 0; j < templateTypes.size(); ++j) {
+ memberParms[i] = memberParms[i].replaceAll(templateParms[j], templateTypes.get(j));
+ }
+ // Look for the class being passed by reference...the doc prototype will not fill in
+ // the template parms nor the qualifier so we do it here to make sure we match what
+ // is coming back from the indexer which will be fully-qualified and have template
+ // parameters specified.
+ if (memberParms[i].contains(unqualifiedName) && !memberParms[i].contains(className)) {
+ String classTemplate = ""; //$NON-NLS-1$
+ if (templateTypes.size() > 0) {
+ classTemplate = "<"; //$NON-NLS-1$
+ String separator = ""; //$NON-NLS-1$
+ for (int j = 0; j < templateTypes.size(); ++j) {
+ classTemplate += separator + templateTypes.get(j);
+ separator = ","; //$NON-NLS-1$
+ }
+ classTemplate += ">"; //$NON-NLS-1$
+ }
+ memberParms[i] = memberParms[i].replaceAll(unqualifiedName, className + classTemplate);
+ }
+ }
+ return Arrays.equals(memberParms, args);
+ }
+
+ private String[] resolveArgs(ClassInfo info, IType[] parameterTypes, ArrayList<String> templateTypes) {
+ String[] templateParms = info.getTemplateParms();
+ String[] result = new String[parameterTypes.length];
+ for (int i = 0; i < parameterTypes.length; ++i) {
+ String param = parameterTypes[i].toString();
+ param = param.replaceAll("\\{.*\\}", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ param = param.trim();
+ int index = param.indexOf("#"); //$NON-NLS-1$
+ while (index >= 0) {
+ // We assume no class has more than 9 template parms.
+ int digit = param.charAt(index + 1) - '0';
+ // where possible, replace template parms with real values
+ if (digit < templateTypes.size())
+ param = param.replaceFirst(param.substring(index, index + 2), templateTypes.get(digit));
+ else
+ param = param.replaceFirst(param.substring(index, index + 2), templateParms[digit]);
+ index = param.indexOf("#"); //$NON-NLS-1$
+ }
+ result[i] = param;
+ }
+ return result;
+ }
+
+ @Override
+ public IFunctionSummary[] getMatchingFunctions(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String prefix) {
+ ArrayList<IFunctionSummary> fList = new ArrayList<>();
ITranslationUnit t = context.getTranslationUnit();
boolean qualifiedCPP = false;
if (t.isCXXLanguage()) {
- try {
- if (context instanceof IContentAssistHelpInvocationContext) {
- // We know the file offset of the member reference.
- IASTCompletionNode node = ((IContentAssistHelpInvocationContext)context).getCompletionNode();
-
- IASTName[] names = node.getNames();
-
- for (IASTName name : names) {
- if (name.isQualified()) {
- qualifiedCPP = true;
- break;
- }
-
- }
-
- }
- } catch (IllegalArgumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ try {
+ if (context instanceof IContentAssistHelpInvocationContext) {
+ // We know the file offset of the member reference.
+ IASTCompletionNode node = ((IContentAssistHelpInvocationContext)context).getCompletionNode();
+
+ IASTName[] names = node.getNames();
+
+ for (IASTName name : names) {
+ if (name.isQualified()) {
+ qualifiedCPP = true;
+ break;
+ }
+
+ }
+
+ }
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
if (!qualifiedCPP) {
- for (int di = 0; di < helpBooks.length; ++di) {
- LibHoverLibrary l = libraries.get(helpBooks[di]);
- LibHoverInfo cppInfo = l.getHoverInfo();
- SortedMap<String, FunctionInfo> map = cppInfo.functions.tailMap(prefix);
- Set<Map.Entry<String, FunctionInfo>> c = map.entrySet();
- for (Iterator<Entry<String, FunctionInfo>> i = c.iterator(); i.hasNext();) {
- Map.Entry<String, FunctionInfo> e = i.next();
- FunctionInfo x = e.getValue();
- String name = x.getName();
- // Look for names that start with prefix, but ignore names that
- // start with "0" which is used to import text data that cannot
- // be omitted from the binary version of the document (e.g. invariant
- // sections of a GFDL licensed document). This data is given a
- // function name that starts with the character "0" which is not
- // valid for the start of a C/C++ function name. As such, it should
- // never be offered as a choice for an empty prefix.
- if (name.startsWith(prefix) && !name.startsWith("0")) { //$NON-NLS-1$
- FunctionSummary f = new FunctionSummary();
- f.ReturnType = x.getReturnType();
- f.Prototype = x.getPrototype();
- f.Summary = x.getDescription();
- f.Name = x.getName();
- ArrayList<String> headers = x.getHeaders();
- for (int i1 = 0; i1 < headers.size(); ++i1)
- f.setIncludeName(headers.get(i1));
- fList.add(f);
- }
- }
- }
+ for (int di = 0; di < helpBooks.length; ++di) {
+ LibHoverLibrary l = libraries.get(helpBooks[di]);
+ LibHoverInfo cppInfo = l.getHoverInfo();
+ SortedMap<String, FunctionInfo> map = cppInfo.functions.tailMap(prefix);
+ Set<Map.Entry<String, FunctionInfo>> c = map.entrySet();
+ for (Iterator<Entry<String, FunctionInfo>> i = c.iterator(); i.hasNext();) {
+ Map.Entry<String, FunctionInfo> e = i.next();
+ FunctionInfo x = e.getValue();
+ String name = x.getName();
+ // Look for names that start with prefix, but ignore names that
+ // start with "0" which is used to import text data that cannot
+ // be omitted from the binary version of the document (e.g. invariant
+ // sections of a GFDL licensed document). This data is given a
+ // function name that starts with the character "0" which is not
+ // valid for the start of a C/C++ function name. As such, it should
+ // never be offered as a choice for an empty prefix.
+ if (name.startsWith(prefix) && !name.startsWith("0")) { //$NON-NLS-1$
+ FunctionSummary f = new FunctionSummary();
+ f.ReturnType = x.getReturnType();
+ f.Prototype = x.getPrototype();
+ f.Summary = x.getDescription();
+ f.Name = x.getName();
+ ArrayList<String> headers = x.getHeaders();
+ for (int i1 = 0; i1 < headers.size(); ++i1)
+ f.setIncludeName(headers.get(i1));
+ fList.add(f);
+ }
+ }
+ }
+ }
+ IFunctionSummary[] summaries = new IFunctionSummary[fList.size()];
+ for (int k = 0; k < summaries.length; k++) {
+ summaries[k] = fList.get(k);
+ }
+ return summaries;
+ }
+
+ private static class HelpResource implements IHelpResource {
+ private final String href;
+ private final String label;
+ public HelpResource(String href, String label) {
+ this.href = href;
+ this.label = label;
+ }
+ @Override
+ public String getHref() {
+ return href;
+ }
+ @Override
+ public String getLabel() {
+ return label;
+ }
+ }
+
+ private static class HelpResourceDescriptor implements ICHelpResourceDescriptor {
+ private final ICHelpBook helpbook;
+
+ public HelpResourceDescriptor(ICHelpBook helpbook) {
+ this.helpbook = helpbook;
}
- IFunctionSummary[] summaries = new IFunctionSummary[fList.size()];
- for (int k = 0; k < summaries.length; k++) {
- summaries[k] = fList.get(k);
- }
- return summaries;
- }
-
- private static class HelpResource implements IHelpResource {
- private final String href;
- private final String label;
- public HelpResource(String href, String label) {
- this.href = href;
- this.label = label;
- }
- @Override
- public String getHref() {
- return href;
- }
- @Override
- public String getLabel() {
- return label;
- }
- }
-
- private static class HelpResourceDescriptor implements ICHelpResourceDescriptor {
- private final ICHelpBook helpbook;
-
- public HelpResourceDescriptor(ICHelpBook helpbook) {
- this.helpbook = helpbook;
- }
-
- @Override
- public ICHelpBook getCHelpBook() {
- return helpbook;
- }
-
- @Override
- public IHelpResource[] getHelpResources() {
- LibHoverLibrary l = libraries.get(helpbook);
- if (l != null) {
- IHelpResource[] hr = new IHelpResource[1];
- hr[0] = new HelpResource(l.getDocs(), l.getName());
- return hr;
- }
- return null;
- }
- }
-
- @Override
- public ICHelpResourceDescriptor[] getHelpResources(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String name) {
- for (int i = 0; i < helpBooks.length; ++i) {
- IFunctionSummary fs = getFunctionInfo(context, new ICHelpBook[]{helpBooks[i]}, name);
- if (fs != null) {
- return new HelpResourceDescriptor[]{new HelpResourceDescriptor(helpBooks[i])};
- }
- }
- return null;
- }
+
+ @Override
+ public ICHelpBook getCHelpBook() {
+ return helpbook;
+ }
+
+ @Override
+ public IHelpResource[] getHelpResources() {
+ LibHoverLibrary l = libraries.get(helpbook);
+ if (l != null) {
+ IHelpResource[] hr = new IHelpResource[1];
+ hr[0] = new HelpResource(l.getDocs(), l.getName());
+ return hr;
+ }
+ return null;
+ }
+ }
+
+ @Override
+ public ICHelpResourceDescriptor[] getHelpResources(ICHelpInvocationContext context, ICHelpBook[] helpBooks, String name) {
+ for (int i = 0; i < helpBooks.length; ++i) {
+ IFunctionSummary fs = getFunctionInfo(context, new ICHelpBook[]{helpBooks[i]}, name);
+ if (fs != null) {
+ return new HelpResourceDescriptor[]{new HelpResourceDescriptor(helpBooks[i])};
+ }
+ }
+ return null;
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java
index c7f2780d00..9cbfec653c 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLibrary.java
@@ -35,211 +35,211 @@ import org.eclipse.linuxtools.cdt.libhover.TypedefInfo;
import org.osgi.framework.Bundle;
public class LibHoverLibrary {
- private String name;
- private String location;
- private String docs;
- private String nameSpace;
- private boolean isCPP;
- private LibHoverInfo hoverInfo = new LibHoverInfo();
- private boolean haveReadHoverInfo = false;
-
- public LibHoverLibrary(String name, String location, String docs,
- String nameSpace, boolean isCPP) {
- this.name = name;
- this.location = location;
- this.docs = docs;
- this.isCPP = isCPP;
- this.nameSpace = nameSpace;
- }
-
- /**
- * Get the name of the library
- *
- * @return the name of the library
- */
- public String getName() {
- return name;
- }
-
- /**
- * Get the location of the library hover info (URL or file name)
- *
- * @return the URL or file name string for the library hover info location
- */
- public String getLocation() {
- return location;
- }
-
- /**
- * Get the browser help documentation URL for this library
- *
- * @return the name of the help documentation URL
- */
- public String getDocs() {
- return docs;
- }
-
- /**
- * Set the browser help documentation URL for this library
- *
- * @param docs The name of the help documentation URL
- */
- public void setDocs(String docs) {
- this.docs = docs;
- }
-
- /**
- * Get the name space of the library hover extension
- *
- * @return the name space of the library extension
- */
- public String getNameSpace() {
- return nameSpace;
- }
-
- /**
- * Is this library a C++ library?
- *
- * @return true if C++ library, false otherwise
- */
- public boolean isCPP() {
- return isCPP;
- }
-
- /**
- * Get the library hover info for this library
- *
- * @return the library hover info for this library
- */
- public synchronized LibHoverInfo getHoverInfo() {
- // We lazily get the hover info for this library since it is possible
- // the user will never access or ultimately need it if another library
- // supplies the information first.
- if (!haveReadHoverInfo) {
- URI acDoc;
- try {
- acDoc = new URI(location);
- IPath p = URIUtil.toPath(acDoc);
- InputStream docStream = null;
- if (p == null) {
- URL url = acDoc.toURL();
- URLConnection c = url.openConnection();
- c.setReadTimeout(5000); // pick a timeout value less than 15s (default)
- docStream = c.getInputStream();
- } else {
- try {
- // Try to open the file local to the plug-in declaring the
- // extension...or fall back to the libhover plug-in itself
- // if no name space for the plug-in is stored.
- Bundle bundle = LibhoverPlugin.getDefault().getBundle();
- String nameSpace = getNameSpace();
- if (nameSpace != null)
- bundle = Platform.getBundle(nameSpace);
- docStream = FileLocator.openStream(bundle, p, false);
- } catch (IOException e) {
- // File is not local to plug-in, try file system.
- docStream = new FileInputStream(p.toFile());
- }
- }
- ObjectInputStream input = new ObjectInputStream(docStream);
- hoverInfo = (LibHoverInfo)input.readObject();
- haveReadHoverInfo = true;
- input.close();
- docStream.close();
- } catch (URISyntaxException|MalformedURLException|ClassNotFoundException e) {
- e.printStackTrace();
- } catch (ConnectException|SocketTimeoutException e) {
- // Do nothing..time-out exception
- } catch (IOException e) {
- // Do nothing as empty devhelp causes this
- }
- }
- return hoverInfo;
- }
-
- /**
- * Set the library hover info.
- *
- * @param hoverInfo the library hover info to set
- */
- public synchronized void setHoverinfo(LibHoverInfo hoverInfo) {
- this.hoverInfo = hoverInfo;
- }
-
- /**
- * Fetch the class info for a given class.
- *
- * @param className the name of the class to fetch info for
- * @return ClassInfo or null if no class info can be found
- */
- public ClassInfo getClassInfo(String className, ArrayList<String> templateTypes) {
- String typedefName = className.replaceAll("<.*>", "<>"); //$NON-NLS-1$ //$NON-NLS-2$
- TypedefInfo typedef = getHoverInfo().typedefs.get(typedefName);
- if (typedef != null) {
- className = typedef.getTransformedType(className); // Reset class name to typedef transformation
- }
- int index = className.indexOf('<');
- // Check if it is a template reference.
- if (index != -1) {
- resolveTemplateTypes(className, templateTypes, index);
- // It is. We want to see if there are partial specific templates
- // and we choose the first match. If nothing matches our particular
- // case, we fall back on the initial generic template.
- ClassInfo info = getHoverInfo().classes.get(className.substring(0, index));
- if (info != null) {
- ArrayList<ClassInfo> children = info.getChildren();
- if (children != null && children.size() > 0) {
- for (int x = 0; x < children.size(); ++x) {
- ClassInfo child = children.get(x);
- if (className.matches(child.getClassName())) {
- info = child;
- break;
- }
- }
- }
- }
- return info;
- }
- // Otherwise no template, just fetch the class info directly.
- return getHoverInfo().classes.get(className);
- }
-
- private void resolveTemplateTypes(String className,
- ArrayList<String> templateTypes, int index) {
- int startIndex = index + 1;
- int i = startIndex;
- int count = 1;
- while (count > 0 && i < className.length()) {
- char x = className.charAt(i);
- switch (x) {
- case ('<'):
- ++count;
- break;
- case ('>'):
- --count;
- if (count == 0)
- templateTypes.add(className.substring(startIndex, i).trim());
- break;
- case (','): {
- if (count == 1) {
- templateTypes.add(className.substring(startIndex, i).trim());
- startIndex = i + 1;
- }
- }
- break;
- }
- ++i;
- }
- }
-
- /**
- * Fetch the function info for a given function.
- *
- * @param name of function to find info for
- * @return FunctionInfo or null if no function info exists
- */
- public FunctionInfo getFunctionInfo(String name) {
- return getHoverInfo().functions.get(name);
- }
+ private String name;
+ private String location;
+ private String docs;
+ private String nameSpace;
+ private boolean isCPP;
+ private LibHoverInfo hoverInfo = new LibHoverInfo();
+ private boolean haveReadHoverInfo = false;
+
+ public LibHoverLibrary(String name, String location, String docs,
+ String nameSpace, boolean isCPP) {
+ this.name = name;
+ this.location = location;
+ this.docs = docs;
+ this.isCPP = isCPP;
+ this.nameSpace = nameSpace;
+ }
+
+ /**
+ * Get the name of the library
+ *
+ * @return the name of the library
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get the location of the library hover info (URL or file name)
+ *
+ * @return the URL or file name string for the library hover info location
+ */
+ public String getLocation() {
+ return location;
+ }
+
+ /**
+ * Get the browser help documentation URL for this library
+ *
+ * @return the name of the help documentation URL
+ */
+ public String getDocs() {
+ return docs;
+ }
+
+ /**
+ * Set the browser help documentation URL for this library
+ *
+ * @param docs The name of the help documentation URL
+ */
+ public void setDocs(String docs) {
+ this.docs = docs;
+ }
+
+ /**
+ * Get the name space of the library hover extension
+ *
+ * @return the name space of the library extension
+ */
+ public String getNameSpace() {
+ return nameSpace;
+ }
+
+ /**
+ * Is this library a C++ library?
+ *
+ * @return true if C++ library, false otherwise
+ */
+ public boolean isCPP() {
+ return isCPP;
+ }
+
+ /**
+ * Get the library hover info for this library
+ *
+ * @return the library hover info for this library
+ */
+ public synchronized LibHoverInfo getHoverInfo() {
+ // We lazily get the hover info for this library since it is possible
+ // the user will never access or ultimately need it if another library
+ // supplies the information first.
+ if (!haveReadHoverInfo) {
+ URI acDoc;
+ try {
+ acDoc = new URI(location);
+ IPath p = URIUtil.toPath(acDoc);
+ InputStream docStream = null;
+ if (p == null) {
+ URL url = acDoc.toURL();
+ URLConnection c = url.openConnection();
+ c.setReadTimeout(5000); // pick a timeout value less than 15s (default)
+ docStream = c.getInputStream();
+ } else {
+ try {
+ // Try to open the file local to the plug-in declaring the
+ // extension...or fall back to the libhover plug-in itself
+ // if no name space for the plug-in is stored.
+ Bundle bundle = LibhoverPlugin.getDefault().getBundle();
+ String nameSpace = getNameSpace();
+ if (nameSpace != null)
+ bundle = Platform.getBundle(nameSpace);
+ docStream = FileLocator.openStream(bundle, p, false);
+ } catch (IOException e) {
+ // File is not local to plug-in, try file system.
+ docStream = new FileInputStream(p.toFile());
+ }
+ }
+ ObjectInputStream input = new ObjectInputStream(docStream);
+ hoverInfo = (LibHoverInfo)input.readObject();
+ haveReadHoverInfo = true;
+ input.close();
+ docStream.close();
+ } catch (URISyntaxException|MalformedURLException|ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (ConnectException|SocketTimeoutException e) {
+ // Do nothing..time-out exception
+ } catch (IOException e) {
+ // Do nothing as empty devhelp causes this
+ }
+ }
+ return hoverInfo;
+ }
+
+ /**
+ * Set the library hover info.
+ *
+ * @param hoverInfo the library hover info to set
+ */
+ public synchronized void setHoverinfo(LibHoverInfo hoverInfo) {
+ this.hoverInfo = hoverInfo;
+ }
+
+ /**
+ * Fetch the class info for a given class.
+ *
+ * @param className the name of the class to fetch info for
+ * @return ClassInfo or null if no class info can be found
+ */
+ public ClassInfo getClassInfo(String className, ArrayList<String> templateTypes) {
+ String typedefName = className.replaceAll("<.*>", "<>"); //$NON-NLS-1$ //$NON-NLS-2$
+ TypedefInfo typedef = getHoverInfo().typedefs.get(typedefName);
+ if (typedef != null) {
+ className = typedef.getTransformedType(className); // Reset class name to typedef transformation
+ }
+ int index = className.indexOf('<');
+ // Check if it is a template reference.
+ if (index != -1) {
+ resolveTemplateTypes(className, templateTypes, index);
+ // It is. We want to see if there are partial specific templates
+ // and we choose the first match. If nothing matches our particular
+ // case, we fall back on the initial generic template.
+ ClassInfo info = getHoverInfo().classes.get(className.substring(0, index));
+ if (info != null) {
+ ArrayList<ClassInfo> children = info.getChildren();
+ if (children != null && children.size() > 0) {
+ for (int x = 0; x < children.size(); ++x) {
+ ClassInfo child = children.get(x);
+ if (className.matches(child.getClassName())) {
+ info = child;
+ break;
+ }
+ }
+ }
+ }
+ return info;
+ }
+ // Otherwise no template, just fetch the class info directly.
+ return getHoverInfo().classes.get(className);
+ }
+
+ private void resolveTemplateTypes(String className,
+ ArrayList<String> templateTypes, int index) {
+ int startIndex = index + 1;
+ int i = startIndex;
+ int count = 1;
+ while (count > 0 && i < className.length()) {
+ char x = className.charAt(i);
+ switch (x) {
+ case ('<'):
+ ++count;
+ break;
+ case ('>'):
+ --count;
+ if (count == 0)
+ templateTypes.add(className.substring(startIndex, i).trim());
+ break;
+ case (','): {
+ if (count == 1) {
+ templateTypes.add(className.substring(startIndex, i).trim());
+ startIndex = i + 1;
+ }
+ }
+ break;
+ }
+ ++i;
+ }
+ }
+
+ /**
+ * Fetch the function info for a given function.
+ *
+ * @param name of function to find info for
+ * @return FunctionInfo or null if no function info exists
+ */
+ public FunctionInfo getFunctionInfo(String name) {
+ return getHoverInfo().functions.get(name);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLoadJob.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLoadJob.java
index 05754df6bb..71e461c0e1 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLoadJob.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverLoadJob.java
@@ -20,25 +20,25 @@ import org.eclipse.core.runtime.jobs.Job;
public class LibHoverLoadJob extends Job {
- private static final String LOADING = "LibHover.Loading.msg"; //$NON-NLS-1$
- public LibHoverLoadJob(String title) {
- super(title);
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- // Load all libhover docs now
- monitor.beginTask(LibHoverMessages.getString(LOADING),
- IProgressMonitor.UNKNOWN);
- monitor.worked(1);
- LibHover.getLibHoverDocs();
- Collection<LibHoverLibrary> c = LibHover.getLibraries();
- for (Iterator<LibHoverLibrary> i = c.iterator(); i.hasNext();) {
- LibHoverLibrary l = i.next();
- l.getHoverInfo();
- }
- monitor.done();
- return Status.OK_STATUS;
- }
+ private static final String LOADING = "LibHover.Loading.msg"; //$NON-NLS-1$
+ public LibHoverLoadJob(String title) {
+ super(title);
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ // Load all libhover docs now
+ monitor.beginTask(LibHoverMessages.getString(LOADING),
+ IProgressMonitor.UNKNOWN);
+ monitor.worked(1);
+ LibHover.getLibHoverDocs();
+ Collection<LibHoverLibrary> c = LibHover.getLibraries();
+ for (Iterator<LibHoverLibrary> i = c.iterator(); i.hasNext();) {
+ LibHoverLibrary l = i.next();
+ l.getHoverInfo();
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java
index 74b2b412b5..a888f8222b 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/LibHoverMessages.java
@@ -21,41 +21,41 @@ import java.util.ResourceBundle;
*/
public class LibHoverMessages {
- /**
- *
- */
-
- private static final String RESOURCE_BUNDLE= LibHoverMessages.class.getName();
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private LibHoverMessages() {
- }
-
- public static ResourceBundle getResourceBundle() {
- return fgResourceBundle;
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- } catch (NullPointerException e) {
- return '#' + key + '#';
- }
- }
-
- /**
- * Returns the formatted string from the resource bundle,
- * or 'key' if not found.
- *
- * @param key the message key
- * @param args an array of substituition strings
- * @return the resource bundle message
- */
- public static String getFormattedString(String key, String[] args) {
- return MessageFormat.format(getString(key), (Object[])args);
- }
+ /**
+ *
+ */
+
+ private static final String RESOURCE_BUNDLE= LibHoverMessages.class.getName();
+
+ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private LibHoverMessages() {
+ }
+
+ public static ResourceBundle getResourceBundle() {
+ return fgResourceBundle;
+ }
+
+ public static String getString(String key) {
+ try {
+ return fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+ /**
+ * Returns the formatted string from the resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substituition strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getString(key), (Object[])args);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java
index b0488f5c3a..a27aa40185 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/LibHoverPreferencePage.java
@@ -19,10 +19,10 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
/**
* This class represents a preference page that
- * is contributed to the Preferences dialog. By
+ * is contributed to the Preferences dialog. By
* subclassing <samp>FieldEditorPreferencePage</samp>, we
* can use the field support built into JFace that allows
- * us to create a page that is small and knows how to
+ * us to create a page that is small and knows how to
* save, restore and apply itself.
* <p>
* This page is used to modify preferences only. They
@@ -32,43 +32,43 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
*/
public class LibHoverPreferencePage
- extends FieldEditorPreferencePage
- implements IWorkbenchPreferencePage {
-
- private final static String CACHE_EXT = "Libhover.CachePreference.msg"; //$NON-NLS-1$
- private final static String LOAD_ON_STARTUP = "Libhover.LoadOnStartup.msg"; //$NON-NLS-1$
+ extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
- public LibHoverPreferencePage() {
- super(GRID);
- setPreferenceStore(LibhoverPlugin.getDefault().getPreferenceStore());
- }
-
- /**
- * Creates the field editors. Field editors are abstractions of
- * the common GUI blocks needed to manipulate various types
- * of preferences. Each field editor knows how to save and
- * restore itself.
- */
- @Override
- public void createFieldEditors() {
- addField(
- new BooleanFieldEditor(
- PreferenceConstants.CACHE_EXT_LIBHOVER,
- LibHoverMessages.getString(CACHE_EXT),
- getFieldEditorParent()));
- addField(
- new BooleanFieldEditor(
- PreferenceConstants.LAZY_LOAD,
- LibHoverMessages.getString(LOAD_ON_STARTUP),
- getFieldEditorParent()));
+ private final static String CACHE_EXT = "Libhover.CachePreference.msg"; //$NON-NLS-1$
+ private final static String LOAD_ON_STARTUP = "Libhover.LoadOnStartup.msg"; //$NON-NLS-1$
- }
+ public LibHoverPreferencePage() {
+ super(GRID);
+ setPreferenceStore(LibhoverPlugin.getDefault().getPreferenceStore());
+ }
+
+ /**
+ * Creates the field editors. Field editors are abstractions of
+ * the common GUI blocks needed to manipulate various types
+ * of preferences. Each field editor knows how to save and
+ * restore itself.
+ */
+ @Override
+ public void createFieldEditors() {
+ addField(
+ new BooleanFieldEditor(
+ PreferenceConstants.CACHE_EXT_LIBHOVER,
+ LibHoverMessages.getString(CACHE_EXT),
+ getFieldEditorParent()));
+ addField(
+ new BooleanFieldEditor(
+ PreferenceConstants.LAZY_LOAD,
+ LibHoverMessages.getString(LOAD_ON_STARTUP),
+ getFieldEditorParent()));
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ @Override
+ public void init(IWorkbench workbench) {
+ }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- @Override
- public void init(IWorkbench workbench) {
- }
-
} \ No newline at end of file
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java
index c700bc0415..435c59381d 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceConstants.java
@@ -15,7 +15,7 @@ package org.eclipse.linuxtools.internal.cdt.libhover.preferences;
*/
public class PreferenceConstants {
- public final static String CACHE_EXT_LIBHOVER = "org.eclipse.linuxtools.cdt.libhover.cacheExtLibhover"; //$NON-NLS-1$
- public final static String LAZY_LOAD = "org.eclipse.linuxtools.cdt.libhover.lazyLoad"; //$NON-NLS-1$
-
+ public final static String CACHE_EXT_LIBHOVER = "org.eclipse.linuxtools.cdt.libhover.cacheExtLibhover"; //$NON-NLS-1$
+ public final static String LAZY_LOAD = "org.eclipse.linuxtools.cdt.libhover.lazyLoad"; //$NON-NLS-1$
+
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java
index 1c9ea57a40..c5344d12db 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/preferences/PreferenceInitializer.java
@@ -20,16 +20,16 @@ import org.eclipse.linuxtools.cdt.libhover.LibhoverPlugin;
*/
public class PreferenceInitializer extends AbstractPreferenceInitializer {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- @Override
- public void initializeDefaultPreferences() {
- IPreferenceStore store = LibhoverPlugin.getDefault().getPreferenceStore();
- store.setDefault(PreferenceConstants.CACHE_EXT_LIBHOVER, true);
- store.setDefault(PreferenceConstants.LAZY_LOAD, false);
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = LibhoverPlugin.getDefault().getPreferenceStore();
+ store.setDefault(PreferenceConstants.CACHE_EXT_LIBHOVER, true);
+ store.setDefault(PreferenceConstants.LAZY_LOAD, false);
+ }
}
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/BuildFunctionInfos.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/BuildFunctionInfos.java
index 32a5008977..33245f66c9 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/BuildFunctionInfos.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/BuildFunctionInfos.java
@@ -36,18 +36,18 @@ import org.xml.sax.SAXException;
public class BuildFunctionInfos {
- private Document document;
- private LibHoverInfo hoverInfo = new LibHoverInfo();
+ private Document document;
+ private LibHoverInfo hoverInfo = new LibHoverInfo();
- public BuildFunctionInfos(Document document) {
- this.document = document;
- }
+ public BuildFunctionInfos(Document document) {
+ this.document = document;
+ }
- public Document getDocument() {
- return document;
- }
+ public Document getDocument() {
+ return document;
+ }
- private FunctionInfo getFunctionInfoFromNode(String name, Node functionNode, Document document) {
+ private FunctionInfo getFunctionInfoFromNode(String name, Node functionNode, Document document) {
FunctionInfo f = new FunctionInfo(name);
NamedNodeMap functionNodeMap = functionNode.getAttributes();
Node functionNodeReturntypeNode = functionNodeMap.item(0);
@@ -59,11 +59,11 @@ public class BuildFunctionInfos {
String functionNodeRtValue = functionNodeReturntypeNode.getNodeValue();
f.setReturnType(functionNodeRtValue);
- } // returntype
+ } // returntype
NodeList kids = functionNode.getChildNodes();
for (int fnk = 0; fnk < kids.getLength(); fnk++) {
- Node kid = kids.item(fnk);
+ Node kid = kids.item(fnk);
String kidName = kid.getNodeName();
if (kidName.equals("prototype")) { //$NON-NLS-1$
@@ -84,7 +84,7 @@ public class BuildFunctionInfos {
}
}
f.setPrototype(prototype);
- } // prototype
+ } // prototype
else if (kidName.equals("headers")) { //$NON-NLS-1$
@@ -100,27 +100,27 @@ public class BuildFunctionInfos {
f.addHeader(headerNode.getNodeValue());
}
}
- } // headers
+ } // headers
else if (kidName.equals("groupsynopsis")) { //$NON-NLS-1$
- // group synopsis
-
- NamedNodeMap attr = kid.getAttributes();
- Node idnode = attr.getNamedItem("id"); //$NON-NLS-1$
- String id = idnode.getNodeValue();
- if (id != null) {
- Element elem2 = document.getElementById(id);
- if (null != elem2) {
- NodeList synopsisNode = elem2.getElementsByTagName("synopsis"); //$NON-NLS-1$
- if (null != synopsisNode && synopsisNode.getLength() > 0) {
- Node synopsis = synopsisNode.item(0);
- Node textNode = synopsis.getLastChild();
- f.setDescription(textNode.getNodeValue());
- }
- }
- }
+ // group synopsis
+
+ NamedNodeMap attr = kid.getAttributes();
+ Node idnode = attr.getNamedItem("id"); //$NON-NLS-1$
+ String id = idnode.getNodeValue();
+ if (id != null) {
+ Element elem2 = document.getElementById(id);
+ if (null != elem2) {
+ NodeList synopsisNode = elem2.getElementsByTagName("synopsis"); //$NON-NLS-1$
+ if (null != synopsisNode && synopsisNode.getLength() > 0) {
+ Node synopsis = synopsisNode.item(0);
+ Node textNode = synopsis.getLastChild();
+ f.setDescription(textNode.getNodeValue());
+ }
+ }
+ }
} else if (kidName.equals("synopsis")) { //$NON-NLS-1$
// synopsis
Node textNode = kid.getLastChild();
@@ -128,65 +128,65 @@ public class BuildFunctionInfos {
}
}
return f;
- }
-
- private void buildCPPInfo(String fileName) {
- Document document = getDocument();
- NodeList nl = document.getElementsByTagName("construct"); //$NON-NLS-1$
- for (int i = 0; i < nl.getLength(); ++i) {
- Node n = nl.item(i);
- NamedNodeMap m = n.getAttributes();
- Node id = m.getNamedItem("id"); //$NON-NLS-1$
- if (id != null && id.getNodeValue().startsWith("function-")) { //$NON-NLS-1$
- String name = id.getNodeValue().substring(9);
- NodeList nl2 = n.getChildNodes();
- for (int j = 0; j < nl2.getLength(); ++j) {
- Node n2 = nl2.item(j);
- if (n2.getNodeName().equals("function")) { //$NON-NLS-1$
- FunctionInfo f = getFunctionInfoFromNode(name, n2, document);
- hoverInfo.functions.put(name, f);
- }
- }
- }
- }
- try (FileOutputStream f = new FileOutputStream(fileName);
- ObjectOutputStream out = new ObjectOutputStream(f)){
- // Now, output the LibHoverInfo for caching later
- out.writeObject(hoverInfo);
- } catch(IOException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * @param args args[0] - URL or file name of xml document to parse
- * args[1] - file name to place resultant serialized LibHoverInfo
- */
- public static void main(String[] args) {
- URI acDoc;
- try {
- acDoc = new URI(args[0]);
- IPath p = URIUtil.toPath(acDoc);
- InputStream docStream = null;
- if (p == null) {
- URL url = acDoc.toURL();
- docStream = url.openStream();
- } else {
- docStream = new FileInputStream(p.toFile());
- }
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setValidating(false);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document doc = builder.parse(docStream);
- if (doc != null) {
- BuildFunctionInfos d = new BuildFunctionInfos(doc);
- d.buildCPPInfo(args[1]);
- }
- System.out.println("Built " + args[1] + " from " + args[0]); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (URISyntaxException|SAXException|ParserConfigurationException|IOException e) {
- e.printStackTrace();
- }
-
- }
+ }
+
+ private void buildCPPInfo(String fileName) {
+ Document document = getDocument();
+ NodeList nl = document.getElementsByTagName("construct"); //$NON-NLS-1$
+ for (int i = 0; i < nl.getLength(); ++i) {
+ Node n = nl.item(i);
+ NamedNodeMap m = n.getAttributes();
+ Node id = m.getNamedItem("id"); //$NON-NLS-1$
+ if (id != null && id.getNodeValue().startsWith("function-")) { //$NON-NLS-1$
+ String name = id.getNodeValue().substring(9);
+ NodeList nl2 = n.getChildNodes();
+ for (int j = 0; j < nl2.getLength(); ++j) {
+ Node n2 = nl2.item(j);
+ if (n2.getNodeName().equals("function")) { //$NON-NLS-1$
+ FunctionInfo f = getFunctionInfoFromNode(name, n2, document);
+ hoverInfo.functions.put(name, f);
+ }
+ }
+ }
+ }
+ try (FileOutputStream f = new FileOutputStream(fileName);
+ ObjectOutputStream out = new ObjectOutputStream(f)){
+ // Now, output the LibHoverInfo for caching later
+ out.writeObject(hoverInfo);
+ } catch(IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @param args args[0] - URL or file name of xml document to parse
+ * args[1] - file name to place resultant serialized LibHoverInfo
+ */
+ public static void main(String[] args) {
+ URI acDoc;
+ try {
+ acDoc = new URI(args[0]);
+ IPath p = URIUtil.toPath(acDoc);
+ InputStream docStream = null;
+ if (p == null) {
+ URL url = acDoc.toURL();
+ docStream = url.openStream();
+ } else {
+ docStream = new FileInputStream(p.toFile());
+ }
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setValidating(false);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ Document doc = builder.parse(docStream);
+ if (doc != null) {
+ BuildFunctionInfos d = new BuildFunctionInfos(doc);
+ d.buildCPPInfo(args[1]);
+ }
+ System.out.println("Built " + args[1] + " from " + args[0]); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (URISyntaxException|SAXException|ParserConfigurationException|IOException e) {
+ e.printStackTrace();
+ }
+
+ }
}

Back to the top