[sword-cvs] sword/bindings flatapi.cpp,1.8,1.9

sword@www.crosswire.org sword@www.crosswire.org
Fri, 16 Jan 2004 11:55:23 -0700


Update of /cvs/core/sword/bindings
In directory www:/tmp/cvs-serv29154

Modified Files:
	flatapi.cpp 
Log Message:
work on flatapi

Index: flatapi.cpp
===================================================================
RCS file: /cvs/core/sword/bindings/flatapi.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- flatapi.cpp	16 Jan 2004 03:47:42 -0000	1.8
+++ flatapi.cpp	16 Jan 2004 18:55:21 -0000	1.9
@@ -250,7 +250,48 @@
 	return (const char *)((module) ? module->RenderText() : 0);
 }
 
+const char *SWModule_getPreverseHeader(SWHANDLE hmodule, const char *key, int pvHeading) {
+	SWModule *module = (SWModule *)hmodule;
+	static SWBuf preverseHeading;
+	char buf[12];	
+	sprintf(buf, "%i", pvHeading);  
+	module->SetKey(key);	
+	module->RenderText();                 	
+	preverseHeading = module->getEntryAttributes()["Heading"]["Preverse"][buf].c_str();
+	return (preverseHeading.length()) ? (const char*)preverseHeading.c_str() : NULL;
+}
 
+const char *SWModule_getFootnoteType(SWHANDLE hmodule, const char *key, const char *note) {
+	SWModule *module = (SWModule *)hmodule;
+	static SWBuf type;
+	module->Error();
+	module->SetKey(key);
+	module->RenderText();	
+	type = module->getEntryAttributes()["Footnote"][note]["type"].c_str();
+	return (type) ? (const char*)type.c_str() : NULL;
+}
+
+const char *SWModule_getFootnoteBody(SWHANDLE hmodule, const char *key, const char *note) {
+	SWModule *module = (SWModule *)hmodule;
+	static SWBuf body;
+	module->Error();
+	module->setKey(key);
+	module->RenderText();
+	body = module->getEntryAttributes()["Footnote"][note]["body"].c_str();
+	SWKey *keybuf = module->getKey();;
+	module->renderFilter(body, keybuf);
+	return (body) ? (const char*)body.c_str() : NULL;
+}
+
+const char *SWModule_getFootnoteRefList(SWHANDLE hmodule, const char *key, const char *note) {
+	SWModule *module = (SWModule *)hmodule;
+	static SWBuf refList;
+	module->Error();
+	module->SetKey(key);
+	module->RenderText();	
+	refList = module->getEntryAttributes()["Footnote"][note]["refList"].c_str();
+	return (refList) ? (const char*)refList.c_str() : NULL;
+}
 
 //-----------------------------------------------------------------
 // stringlist_iterator methods