drd64_libgoblin_debug_objinfo.h \
drd64_libgoblin_addrinfo.h \
$(USER_HEADER) $(SUPER_HEADER) $(LIB_HEADER)
-LIBRARY = ../libfiletype.a
+LIBRARY = ../libfiletype.a \
+ ../libbrownie.a
TEST_FLAGS_COMPILE = -I/usr/local/include
TEST_FLAGS_LINKER = -L/usr/local/lib -lcunit -L.. -lfiletype -lbrownie
$(TARGET): $(OBJS) $(LIB_OBJS)
- ar rv $(TARGET) $(OBJS)
+ ar rv $(TARGET) $(OBJS) $(LIBRARY)
ranlib $(TARGET)
cp $(TARGET) ..
../libfiletype.a:
$(MAKE) -C ../libfiletype all
+../libbrownie.a:
+ $(MAKE) -C ../libbrownie all
+
$(TEST_TARGET): $(TEST_OBJS) $(TARGET) $(LIBRARY)
$(CC) -o $(TEST_TARGET) $(FLAGS_DEBUG) $(TEST_OBJS) $(TARGET) $(TEST_FLAGS_LINKER)
#include<unistd.h>
#include<assert.h>
#include<libgen.h>
+#include<errno.h>
#include<sys/param.h>
#include<sys/limits.h>
#include"../include/drd64_conf.h"
#include"../include/libgoblin.h"
#include"../include/libfiletype.h"
+#include"../include/libbrownie.h"
#include"drd64_libgoblin_section_defs.h"
#include"drd64_libgoblin_type.h"
#include"drd64_libgoblin_proginfo.h"
#include"drd64_libgoblin_debug_elf.h"
#include"drd64_libgoblin_debug_objinfo.h"
+// Defines LibGoblin SourceFileID for ErrorSystem ---
+#define DRD64_SRCID_LIBGOBLIN_API 0x01
+
#endif /* DRD64_HEADER_LIBGOBLIN_MAIN */
/* EOF of drd64_.h ----------------------------------- */
#include"drd64_libgoblin.h"
+#define LOCATION(n) DRD64_ERR_LOCATION( \
+ DRD64_ERROR_MODULE_LIBGOBLIN, DRD64_ERROR_ARCH_NODEPEND, \
+ DRD64_SRCID_LIBGOBLIN_API, (n))
+
/***********************************************************************
***********************************************************************/
LIBGOBLIN_API
return 0x00;
}
-
/***********************************************************************
***********************************************************************/
+#define FUNCID_LibGoblin_Init 0x01
LIBGOBLIN_API
int
LibGoblin_Init(
{
int i_err;
- i_err = LibFileType_Init();
+ i_err = LibBrownie_Init();
if( 0x00 != i_err ) { return i_err; }
+ i_err = LibFileType_Init();
+ if( 0x00 != i_err ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_LIBCALL, 0x01, 0x01 ),
+ LOCATION( FUNCID_LibGoblin_Init ),
+ errno, (QWord)i_err, (QWord)0x00, __LINE__ );
+ return i_err;
+ }
+
i_err = ProgInfo_Init();
- if( 0x00 != i_err ) { return i_err; }
+ if( 0x00 != i_err ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_LIBCALL, 0x01, 0x02 ),
+ LOCATION( FUNCID_LibGoblin_Init ),
+ errno, (QWord)i_err, (QWord)0x00, __LINE__ );
+ return i_err;
+ }
i_err = BinaryInfo_Init();
- if( 0x00 != i_err ) { return i_err; }
+ if( 0x00 != i_err ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_LIBCALL, 0x01, 0x03 ),
+ LOCATION( FUNCID_LibGoblin_Init ),
+ errno, (QWord)i_err, (QWord)0x00, __LINE__ );
+ return i_err;
+ }
return 0x00;
}
/***********************************************************************
***********************************************************************/
+#define FUNCID_LibGoblin_Term 0x02
LIBGOBLIN_API
int
LibGoblin_Term(
int i_err;
i_err = BinaryInfo_Term();
- if( 0x00 != i_err ) { return i_err; }
+ if( 0x00 != i_err ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_LIBCALL, 0x01, 0x01 ),
+ LOCATION( FUNCID_LibGoblin_Term ),
+ errno, (QWord)i_err, (QWord)0x00, __LINE__ );
+ return i_err;
+ }
i_err = ProgInfo_Term();
- if( 0x00 != i_err ) { return i_err; }
+ if( 0x00 != i_err ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_LIBCALL, 0x01, 0x02 ),
+ LOCATION( FUNCID_LibGoblin_Term ),
+ errno, (QWord)i_err, (QWord)0x00, __LINE__ );
+ return i_err;
+ }
i_err = LibFileType_Term();
- if( 0x00 != i_err ) { return i_err; }
+ if( 0x00 != i_err ) {
+ LibBrownie_Error_SetErrorInfo(
+ DRD64_ERROR( DRD64_ERROR_PTN_LIBCALL, 0x01, 0x03 ),
+ LOCATION( FUNCID_LibGoblin_Term ),
+ errno, (QWord)i_err, (QWord)0x00, __LINE__ );
+ return i_err;
+ }
+
+ LibBrownie_Term();
return 0x00;
}