-rw-r--r-- | library/backend/vobject.cpp | 7 | ||||
-rw-r--r-- | library/backend/vobject_p.h | 15 |
2 files changed, 21 insertions, 1 deletions
diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp index dab128e..2f22c20 100644 --- a/library/backend/vobject.cpp +++ b/library/backend/vobject.cpp @@ -1274,42 +1274,47 @@ void writeVObject(FILE *fp, VObject *o) OFile ofp; // ##### //_setmode(_fileno(fp), _O_BINARY); initOFile(&ofp,fp); writeVObject_(&ofp,o); } DLLEXPORT(void) writeVObjectToFile(char *fname, VObject *o) { QFileDirect f( fname); if ( !f.open( IO_WriteOnly ) ) { qWarning("Unable to open vobject write %s", fname); return; } writeVObject( f.directHandle(),o ); } DLLEXPORT(void) writeVObjectsToFile(char *fname, VObject *list) { QFileDirect f( fname); if ( !f.open( IO_WriteOnly ) ) { qWarning("Unable to open vobject write %s", fname); return; } while (list) { writeVObject(f.directHandle(),list); list = nextVObjectInList(list); } } +#ifndef __SHARP_COMP_ + +// This function is not available in the Sharp ROM for SL 5500 ! +// Therefore I have to move it into the header file.. (se) + DLLEXPORT(const char *) vObjectTypeInfo(VObject *o) { const char *type = vObjectName( o ); if ( strcmp( type, "TYPE" ) == 0 ) type = vObjectStringZValue( o ); return type; } - +#endif // end of source file vobject.c diff --git a/library/backend/vobject_p.h b/library/backend/vobject_p.h index 0d0a2a8..bab22bb 100644 --- a/library/backend/vobject_p.h +++ b/library/backend/vobject_p.h @@ -369,38 +369,53 @@ and you can go ahead and use them. If you try to use them with the DLL LIB you will get a link error. */ extern void writeVObject(FILE *fp, VObject *o); typedef void (*MimeErrorHandler)(char *); extern DLLEXPORT(void) registerMimeErrorHandler(MimeErrorHandler); extern DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len); extern DLLEXPORT(VObject*) Parse_MIME_FromFileName(char* fname); /* NOTE regarding Parse_MIME_FromFile The function above, Parse_MIME_FromFile, comes in two flavors, neither of which is exported from the DLL. Each version takes a CFile or FILE* as a parameter, neither of which can be passed across a DLL interface (at least that is my experience). If you are linking this code into your build directly then you may find them a more convenient API that the other flavors that take a file name. If you use them with the DLL LIB you will get a link error. */ #if INCLUDEMFC extern VObject* Parse_MIME_FromFile(CFile *file); #else extern VObject* Parse_MIME_FromFile(FILE *file); #endif +#define __SHARP_COMP_ + +#ifndef __SHARP_COMP_ extern DLLEXPORT(const char *) vObjectTypeInfo(VObject *o); +#else +// This function is not available in the Sharp ROM for SL 5500 ! +// Therefore I have to move it into the header file.. (se) + +inline const char* vObjectTypeInfo(VObject *o) +{ + const char *type = vObjectName( o ); + if ( strcmp( type, "TYPE" ) == 0 ) + type = vObjectStringZValue( o ); + return type; +} +#endif #endif /* __VOBJECT_H__ */ |