Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
6b39a7f695 | |||
fd106bccdc | |||
8e54450ca4 | |||
a1b692e60b | |||
![]() |
0c31724556 | ||
![]() |
db5ef5d6fa | ||
265e2769e0 | |||
6edb7a72a1 | |||
00568fc30f |
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
display.d
|
||||||
|
display.o
|
||||||
|
hexViewer
|
||||||
|
main.d
|
||||||
|
main.o
|
||||||
|
package
|
||||||
|
parameter.d
|
||||||
|
parameter.o
|
93
Makefile
93
Makefile
@ -12,21 +12,12 @@
|
|||||||
# Concu Pour le projet hexViwer #
|
# Concu Pour le projet hexViwer #
|
||||||
# #
|
# #
|
||||||
##################################################################################################################
|
##################################################################################################################
|
||||||
export F_GRAS=[1m
|
|
||||||
export F_INVERSER=[7m
|
|
||||||
export F_SOUSLIGNER=[4m
|
|
||||||
export F_NORMALE=[m
|
|
||||||
export F_NOIR=[31m
|
|
||||||
export F_ROUGE=[31m
|
|
||||||
export F_VERT=[32m
|
|
||||||
export F_MARRON=[33m
|
|
||||||
export F_BLUE=[34m
|
|
||||||
export F_VIOLET=[35m
|
|
||||||
export F_CYAN=[36m
|
|
||||||
export F_GRIS=[37m
|
|
||||||
export CADRE_HAUT_BAS=' $(F_INVERSER) $(F_NORMALE)'
|
|
||||||
export CADRE_COTERS='
$(F_INVERSER) $(F_NORMALE) $(F_INVERSER) $(F_NORMALE)'
|
|
||||||
|
|
||||||
|
VERSION_TAG_SHORT=$(shell git describe --tags --abbrev=0)
|
||||||
|
#$(info $(VERSION_TAG_SHORT))
|
||||||
|
|
||||||
|
VERSION_BUILD_TIME=$(shell date)
|
||||||
|
#$(info $(VERSION_BUILD_TIME))
|
||||||
|
|
||||||
CFLAGS= -g -Wall -D_REENTRANT
|
CFLAGS= -g -Wall -D_REENTRANT
|
||||||
|
|
||||||
@ -37,38 +28,22 @@ LIB= -lpthread -lm
|
|||||||
CC= g++ $(CFLAGS)
|
CC= g++ $(CFLAGS)
|
||||||
LD= g++
|
LD= g++
|
||||||
|
|
||||||
# Liste des fichiers
|
# List of Sources
|
||||||
SRC=main.c \
|
SRC=main.c \
|
||||||
display.c \
|
display.c \
|
||||||
parameter.c
|
parameter.c
|
||||||
|
|
||||||
# Liste des objets
|
# List of Objects
|
||||||
OBJ= $(SRC:.c=.o)
|
OBJ= $(SRC:.c=.o)
|
||||||
|
|
||||||
# Liste des dépendances
|
# List of dependances
|
||||||
DEP= $(SRC:.c=.d)
|
DEP= $(SRC:.c=.d)
|
||||||
|
|
||||||
|
PROG_NAME=hexViewer
|
||||||
|
|
||||||
#
|
|
||||||
BIN=hexViewer
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: encadrer $(BIN)
|
all: $(PROG_NAME)
|
||||||
|
|
||||||
|
|
||||||
encadrer:
|
|
||||||
ifneq ($(COLOR),normal)
|
|
||||||
@echo $(CADRE_HAUT_BAS)
|
|
||||||
@echo $(CADRE_COTERS)
|
|
||||||
@echo ' DEBUT DE COMPILATION DU PROGRAMME :'$(CADRE_COTERS)
|
|
||||||
@echo ' $(F_VIOLET)$(BIN)$(F_NORMALE) '$(CADRE_COTERS)
|
|
||||||
@echo $(CADRE_COTERS)
|
|
||||||
@echo ' $(F_GRIS) Heero Yui Makefile 29-01-2010$(F_NORMALE)'$(CADRE_COTERS)
|
|
||||||
@echo $(CADRE_HAUT_BAS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
@echo $(F_VERT)" (.o) $<"$(F_NORMALE)
|
@echo $(F_VERT)" (.o) $<"$(F_NORMALE)
|
||||||
@$(CC) -o $@ -c $<
|
@$(CC) -o $@ -c $<
|
||||||
@ -76,18 +51,52 @@ endif
|
|||||||
%.d: %.c
|
%.d: %.c
|
||||||
@echo $(F_BLUE)" (.d) $<"$(F_NORMALE)
|
@echo $(F_BLUE)" (.d) $<"$(F_NORMALE)
|
||||||
@$(CC) -MM -MD -o $@ $<
|
@$(CC) -MM -MD -o $@ $<
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -f $(BIN) $(OBJ) $(DEP) *.i *.s *.bck
|
rm -f $(PROG_NAME) $(OBJ) $(DEP) *.i *.s *.bck
|
||||||
|
|
||||||
$(BIN):$(OBJ)
|
$(PROG_NAME):$(OBJ)
|
||||||
@echo $(F_ROUGE)" (bin) $@"$(F_NORMALE)
|
@echo $(F_ROUGE)" (bin) $@"$(F_NORMALE)
|
||||||
@$(LD) -o $@ $^ $(LIB)
|
@$(LD) -o $@ $^ $(LIB)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# inclusion des dependances
|
# inclusion des dependances
|
||||||
-include $(DEP)
|
-include $(DEP)
|
||||||
|
|
||||||
|
.PHONY: package
|
||||||
|
# http://alp.developpez.com/tutoriels/debian/creer-paquet/
|
||||||
|
package: all
|
||||||
|
@echo 'Create packages ...'
|
||||||
|
@mkdir -p package/$(PROG_NAME)/DEBIAN/
|
||||||
|
@mkdir -p package/$(PROG_NAME)/usr/bin/
|
||||||
|
@mkdir -p package/$(PROG_NAME)/usr/share/doc/
|
||||||
|
@mkdir -p package/$(PROG_NAME)/usr/share/edn/
|
||||||
|
# Create the control file
|
||||||
|
@echo "Package: "$(PROG_NAME) > package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Version: "$(VERSION_TAG_SHORT) >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Section: Development,Editors" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Priority: optional" >>package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Architecture: all" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Depends: bash" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Maintainer: Mr DUPIN Edouard <yui.heero@gmail.com>" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "Description: Binary comparator for shell console" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
@echo "" >> package/$(PROG_NAME)/DEBIAN/control
|
||||||
|
# Create the PostRm
|
||||||
|
@#echo "#!/bin/bash" > package/$(PROG_NAME)/DEBIAN/postrm
|
||||||
|
@#echo "rm ~/."$(PROG_NAME) >> package/$(PROG_NAME)/DEBIAN/postrm
|
||||||
|
@#echo "" >> package/$(PROG_NAME)/DEBIAN/postrm
|
||||||
|
# Enable Execution in script
|
||||||
|
@#chmod 755 package/$(PROG_NAME)/DEBIAN/post*
|
||||||
|
@#chmod 755 package/$(PROG_NAME)/DEBIAN/pre*
|
||||||
|
# copy licence and information :
|
||||||
|
@cp README package/$(PROG_NAME)/usr/share/doc/README
|
||||||
|
@cp licence.txt package/$(PROG_NAME)/usr/share/doc/copyright
|
||||||
|
@echo "First generation in progress" > package/$(PROG_NAME)/usr/share/doc/changelog
|
||||||
|
@cp -vf $(PROG_NAME) package/$(PROG_NAME)/usr/bin/
|
||||||
|
@#cp -vf data/*.xml package/$(PROG_NAME)/usr/share/edn/
|
||||||
|
@cd package; dpkg-deb --build $(PROG_NAME)
|
||||||
|
|
||||||
|
install:
|
||||||
|
sudo cp -fv hexViewer /usr/bin/hexViewer
|
||||||
|
|
||||||
|
|
||||||
|
18
README
18
README
@ -2,20 +2,6 @@ HexViewer (Hexadevimal Viewer) is a FREE software.
|
|||||||
|
|
||||||
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
|
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
|
||||||
|
|
||||||
Terms of license:
|
Copyright: 2010 Edouard DUPIN, all right reserved
|
||||||
|
|
||||||
You can:
|
License: GNU General Public License (GPL) v3.0
|
||||||
- Redistribute the sources code and binaries.
|
|
||||||
- Modify the Sources code.
|
|
||||||
- Use a part of the sources (less than 50%) in an other software, just write somewhere "HexViewer is great" visible by the user (on your product or on your website with a link to my page).
|
|
||||||
- Redistribute the modification only if you want.
|
|
||||||
- Send me the bug-fix (it could be great).
|
|
||||||
- Pay me a beer or some other things.
|
|
||||||
- Print the source code on WC paper ...
|
|
||||||
You can NOT:
|
|
||||||
- Earn money with this Software (But I can).
|
|
||||||
- Add malware in the Sources.
|
|
||||||
- Do something bad with the sources.
|
|
||||||
- Use it to travel in the space with a toaster.
|
|
||||||
|
|
||||||
I reserve the right to change this licence. If it change the version of the copy you have keep its own license
|
|
||||||
|
231
display.c
231
display.c
@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file display.c
|
* @file display.c
|
||||||
* @brief Editeur De N'ours :
|
* @brief main display system of the hexViewer (Sources)
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 05/02/2011
|
* @date 05/02/2011
|
||||||
* @par Project
|
* @par Project
|
||||||
* Edn tool : hexViewer
|
* hexViewer
|
||||||
*
|
*
|
||||||
* @par Copyright
|
* @par Copyright
|
||||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||||
@ -13,22 +13,16 @@
|
|||||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* ANY WARRANTY.
|
* ANY WARRANTY.
|
||||||
*
|
*
|
||||||
* Licence summary :
|
* Licence : GNU Lesser General Public License (LGPL) v3.0
|
||||||
* You can modify and redistribute the sources code and binaries.
|
|
||||||
* You can send me the bug-fix
|
|
||||||
* You can not earn money with this Software (if the source extract from Edn
|
|
||||||
* represent less than 50% of original Sources)
|
|
||||||
* Term of the licence in in the file licence.txt.
|
|
||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
extern FILE *filePointer[2];
|
extern fileProperties_ts fileProp[2];
|
||||||
extern char fileName[2][2096];
|
|
||||||
|
|
||||||
|
|
||||||
void drawLine(void)
|
void drawLine(bool returnLine)
|
||||||
{
|
{
|
||||||
showTypeSize_te mySize = getTypeSize();
|
showTypeSize_te mySize = getTypeSize();
|
||||||
showType_te myType = getType();
|
showType_te myType = getType();
|
||||||
@ -39,16 +33,16 @@ void drawLine(void)
|
|||||||
switch(mySize)
|
switch(mySize)
|
||||||
{
|
{
|
||||||
case SHOW_TYPE_SIZE_8:
|
case SHOW_TYPE_SIZE_8:
|
||||||
printf("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n"COLOR_NORMAL);
|
printf("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
|
||||||
break;
|
break;
|
||||||
case SHOW_TYPE_SIZE_16:
|
case SHOW_TYPE_SIZE_16:
|
||||||
printf("-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n"COLOR_NORMAL);
|
printf("-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
|
||||||
break;
|
break;
|
||||||
case SHOW_TYPE_SIZE_32:
|
case SHOW_TYPE_SIZE_32:
|
||||||
printf("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n"COLOR_NORMAL);
|
printf("---------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
|
||||||
break;
|
break;
|
||||||
case SHOW_TYPE_SIZE_64:
|
case SHOW_TYPE_SIZE_64:
|
||||||
printf("-------------------------------------------------------------------------------------------------------------------------------------------\n"COLOR_NORMAL);
|
printf("-------------------------------------------------------------------------------------------------------------------------------------------");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -59,25 +53,71 @@ void drawLine(void)
|
|||||||
switch(mySize)
|
switch(mySize)
|
||||||
{
|
{
|
||||||
case SHOW_TYPE_SIZE_8:
|
case SHOW_TYPE_SIZE_8:
|
||||||
printf("---------------------------------------------------------------------------------------------------------------------------------------------------\n"COLOR_NORMAL);
|
printf("---------------------------------------------------------------------------------------------------------------------------------------------------");
|
||||||
break;
|
break;
|
||||||
case SHOW_TYPE_SIZE_16:
|
case SHOW_TYPE_SIZE_16:
|
||||||
printf("-----------------------------------------------------------------------------------------------------------------------------------\n"COLOR_NORMAL);
|
printf("-----------------------------------------------------------------------------------------------------------------------------------");
|
||||||
break;
|
break;
|
||||||
case SHOW_TYPE_SIZE_32:
|
case SHOW_TYPE_SIZE_32:
|
||||||
printf("---------------------------------------------------------------------------------------------------------------------------\n"COLOR_NORMAL);
|
printf("---------------------------------------------------------------------------------------------------------------------------");
|
||||||
break;
|
break;
|
||||||
case SHOW_TYPE_SIZE_64:
|
case SHOW_TYPE_SIZE_64:
|
||||||
printf("-----------------------------------------------------------------------------------------------------------------------\n"COLOR_NORMAL);
|
printf("-----------------------------------------------------------------------------------------------------------------------");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (returnLine==true) {
|
||||||
|
printf("\n"COLOR_NORMAL);
|
||||||
|
} else {
|
||||||
|
printf("\r"COLOR_NORMAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* getTypeChar(showType_te myType)
|
||||||
|
{
|
||||||
|
switch(myType)
|
||||||
|
{
|
||||||
|
case SHOW_TYPE_HEX:
|
||||||
|
return "Hexadecimal ";
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_DECIMAL_SIGNED:
|
||||||
|
return "Dec Signed ";
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_DECIMAL_UNSIGNED:
|
||||||
|
return "Dec Unsigned";
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
return "? ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const char* getTypeSizeChar(showTypeSize_te mySize)
|
||||||
|
{
|
||||||
|
switch(mySize)
|
||||||
|
{
|
||||||
|
case SHOW_TYPE_SIZE_8:
|
||||||
|
return " 8 bits ";
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_16:
|
||||||
|
return " 16 bits ";
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_32:
|
||||||
|
return " 32 bits ";
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_64:
|
||||||
|
return " 64 bits ";
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_128:
|
||||||
|
return "128 bits ";
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
return " ? bits ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void showConfiguration(void)
|
void showConfiguration(void)
|
||||||
{
|
{
|
||||||
@ -89,54 +129,32 @@ void showConfiguration(void)
|
|||||||
printf(GO_TOP);
|
printf(GO_TOP);
|
||||||
|
|
||||||
printf(COLOR_BOLD_GREEN);
|
printf(COLOR_BOLD_GREEN);
|
||||||
drawLine();
|
drawLine(true);
|
||||||
printf(COLOR_GREEN);
|
printf(COLOR_GREEN);
|
||||||
printf("| hexViewer | offset : %7d octets | ", (int)getOfsetFile());
|
printf("| hexViewer | offset : %7d octets ", (int)getOfsetFile());
|
||||||
printf(" Type (t) : ");
|
printf(" | Type (t) : %s", getTypeChar(myType));
|
||||||
switch(myType)
|
|
||||||
{
|
|
||||||
case SHOW_TYPE_HEX:
|
|
||||||
printf("Hexadecimal ");
|
|
||||||
break;
|
|
||||||
case SHOW_TYPE_DECIMAL_SIGNED:
|
|
||||||
printf("Decimal Signed ");
|
|
||||||
break;
|
|
||||||
case SHOW_TYPE_DECIMAL_UNSIGNED:
|
|
||||||
printf("Decimal Unsigned");
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
printf("? ");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
printf(" | ");
|
printf(" | ");
|
||||||
printf(" Size (s) : ");
|
printf(" | Size (s) : %s", getTypeSizeChar(mySize));
|
||||||
switch(mySize)
|
printf(" | Slot (u+/i-/j/k) : %d (%s)", getSlotSize(), (getSlotDisplayMode()?"enable ":"disable"));
|
||||||
{
|
printf(" | Padding (o+/p-/m) : %d ", getPaddingOffsetFile());
|
||||||
case SHOW_TYPE_SIZE_8:
|
printf(" | ");
|
||||||
printf(" 8 bits ");
|
|
||||||
break;
|
|
||||||
case SHOW_TYPE_SIZE_16:
|
|
||||||
printf(" 16 bits ");
|
|
||||||
break;
|
|
||||||
case SHOW_TYPE_SIZE_32:
|
|
||||||
printf(" 32 bits ");
|
|
||||||
break;
|
|
||||||
case SHOW_TYPE_SIZE_64:
|
|
||||||
printf(" 64 bits ");
|
|
||||||
break;
|
|
||||||
case SHOW_TYPE_SIZE_128:
|
|
||||||
printf("128 bits ");
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
printf(" ? bits ");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
printf(COLOR_NORMAL"\n");
|
printf(COLOR_NORMAL"\n");
|
||||||
printf(COLOR_GREEN"| File Left << | " COLOR_BOLD_GREEN "%s\n" COLOR_NORMAL, fileName[0]);
|
printf(COLOR_GREEN"| File Left << | [%s%s slot=%4d delta=%4d] " COLOR_BOLD_GREEN "%s\n" COLOR_NORMAL,
|
||||||
printf(COLOR_GREEN"| File Right >> | " COLOR_BOLD_GREEN "%s\n"COLOR_NORMAL, fileName[1]);
|
getTypeChar(fileProp[0].type),
|
||||||
|
getTypeSizeChar(fileProp[0].typeSize),
|
||||||
|
fileProp[0].slotSize,
|
||||||
|
fileProp[0].delta,
|
||||||
|
fileProp[0].name);
|
||||||
|
printf(COLOR_GREEN"| File Right >> | [%s%s slot=%4d delta=%4d] " COLOR_BOLD_GREEN "%s\n"COLOR_NORMAL,
|
||||||
|
getTypeChar(fileProp[1].type),
|
||||||
|
getTypeSizeChar(fileProp[1].typeSize),
|
||||||
|
fileProp[1].slotSize,
|
||||||
|
fileProp[1].delta,
|
||||||
|
fileProp[1].name);
|
||||||
|
|
||||||
printf(COLOR_BOLD_GREEN);
|
printf(COLOR_BOLD_GREEN);
|
||||||
drawLine();
|
drawLine(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printNoElement(showType_te localType, showTypeSize_te localSize)
|
void printNoElement(showType_te localType, showTypeSize_te localSize)
|
||||||
@ -270,10 +288,13 @@ typedef union {
|
|||||||
|
|
||||||
void compareFile(FILE *filePointer1, FILE *filePointer2 ,int32_t curentFilePosition, int32_t currentPadding)
|
void compareFile(FILE *filePointer1, FILE *filePointer2 ,int32_t curentFilePosition, int32_t currentPadding)
|
||||||
{
|
{
|
||||||
|
if (filePointer1==NULL && filePointer2==NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
inputData_tu data1;
|
inputData_tu data1;
|
||||||
inputData_tu data2;
|
inputData_tu data2;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
uint32_t j;
|
uint32_t jjj;
|
||||||
|
|
||||||
showConfiguration();
|
showConfiguration();
|
||||||
|
|
||||||
@ -335,8 +356,34 @@ void compareFile(FILE *filePointer1, FILE *filePointer2 ,int32_t curentFilePosit
|
|||||||
|
|
||||||
// Display the main show
|
// Display the main show
|
||||||
printf(COLOR_BOLD_YELLOW);
|
printf(COLOR_BOLD_YELLOW);
|
||||||
drawLine();
|
drawLine(true);
|
||||||
for (j=0; j < (uint32_t)(GetNumberOfRaw()-NB_HEARDER_RAW); j++) {
|
int32_t counterLineID;
|
||||||
|
int32_t offsetDisplaySlot=0;
|
||||||
|
int32_t sizeSlotByte;
|
||||||
|
switch(getTypeSize())
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case SHOW_TYPE_SIZE_8:
|
||||||
|
sizeSlotByte = 1*getSlotSize();
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_16:
|
||||||
|
sizeSlotByte = 2*getSlotSize();
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_FLOAT:
|
||||||
|
case SHOW_TYPE_SIZE_32:
|
||||||
|
sizeSlotByte = 4*getSlotSize();
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_DOUBLE:
|
||||||
|
case SHOW_TYPE_SIZE_64:
|
||||||
|
sizeSlotByte = 8*getSlotSize();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (true == getSlotDisplayMode() && 0<getSlotSize()) {
|
||||||
|
int32_t nbElementToRead = NB_DATA_PER_LINE*4;
|
||||||
|
int32_t positionInSlot = curentFilePosition%sizeSlotByte;
|
||||||
|
offsetDisplaySlot = positionInSlot%nbElementToRead;
|
||||||
|
}
|
||||||
|
for (jjj=0, counterLineID=0; jjj < (uint32_t)(GetNumberOfRaw()-NB_HEARDER_RAW); jjj++, counterLineID++) {
|
||||||
uint32_t readFile1 = 0;
|
uint32_t readFile1 = 0;
|
||||||
uint32_t readFile2 = 0;
|
uint32_t readFile2 = 0;
|
||||||
int32_t lineNumber = 0;
|
int32_t lineNumber = 0;
|
||||||
@ -344,23 +391,51 @@ void compareFile(FILE *filePointer1, FILE *filePointer2 ,int32_t curentFilePosit
|
|||||||
// read data in files :
|
// read data in files :
|
||||||
memset(data1.data_8, 0, 16 * sizeof(uint8_t));
|
memset(data1.data_8, 0, 16 * sizeof(uint8_t));
|
||||||
memset(data2.data_8, 0, 16 * sizeof(uint8_t));
|
memset(data2.data_8, 0, 16 * sizeof(uint8_t));
|
||||||
|
|
||||||
// Generate the ofset in the file
|
// Generate the ofset in the file
|
||||||
int32_t positionStartDisplayFile1 = curentFilePosition + j*NB_DATA_PER_LINE*4;
|
int32_t positionStartDisplayFile1 = curentFilePosition + offsetDisplaySlot;
|
||||||
int32_t positionStartDisplayFile2 = curentFilePosition + j*NB_DATA_PER_LINE*4;
|
int32_t positionStartDisplayFile2 = curentFilePosition + offsetDisplaySlot;
|
||||||
if (currentPadding < 0) {
|
if (currentPadding < 0) {
|
||||||
positionStartDisplayFile1 += currentPadding;
|
positionStartDisplayFile1 += currentPadding;
|
||||||
} else {
|
} else {
|
||||||
positionStartDisplayFile2 -= currentPadding;
|
positionStartDisplayFile2 -= currentPadding;
|
||||||
}
|
}
|
||||||
|
if (true == getSlotDisplayMode() && 0<getSlotSize()) {
|
||||||
|
if (positionStartDisplayFile1%sizeSlotByte==0) {
|
||||||
|
drawLine(false);
|
||||||
|
printf(" Frame | %9d |\n", positionStartDisplayFile1/sizeSlotByte);
|
||||||
|
jjj++;
|
||||||
|
}
|
||||||
|
if (jjj >= (uint32_t)(GetNumberOfRaw()-NB_HEARDER_RAW)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int32_t nbElementToRead = NB_DATA_PER_LINE*4;
|
||||||
|
if (true == getSlotDisplayMode() && 0<getSlotSize()) {
|
||||||
|
int32_t posituionInSlot = positionStartDisplayFile1%sizeSlotByte;
|
||||||
|
if (posituionInSlot+nbElementToRead>sizeSlotByte) {
|
||||||
|
nbElementToRead = sizeSlotByte - posituionInSlot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (nbElementToRead != NB_DATA_PER_LINE*4) {
|
||||||
|
printf(" \r");
|
||||||
|
printf("nbElementToRead=%d\n",nbElementToRead);
|
||||||
|
jjj++;
|
||||||
|
}
|
||||||
|
*/
|
||||||
readFile1 = 0;
|
readFile1 = 0;
|
||||||
int32_t readStartFile1 = 16;
|
int32_t readStartFile1 = 16;
|
||||||
if (filePointer1 != NULL) {
|
if (filePointer1 != NULL) {
|
||||||
if (positionStartDisplayFile1 >= 0) {
|
if (positionStartDisplayFile1 >= 0) {
|
||||||
fseek(filePointer1 , positionStartDisplayFile1 , SEEK_SET );
|
fseek(filePointer1 , positionStartDisplayFile1+fileProp[0].fileBasicOffset , SEEK_SET );
|
||||||
readFile1 = fread(data1.data_8, sizeof(uint8_t), 16, filePointer1);
|
readFile1 = fread(data1.data_8, sizeof(uint8_t), nbElementToRead, filePointer1);
|
||||||
readStartFile1 = 0;
|
readStartFile1 = 0;
|
||||||
} else if (positionStartDisplayFile1 > -NB_DATA_PER_LINE*4) {
|
} else if (positionStartDisplayFile1 > -NB_DATA_PER_LINE*4) {
|
||||||
fseek(filePointer1 , 0 , SEEK_SET );
|
fseek(filePointer1 , fileProp[0].fileBasicOffset , SEEK_SET );
|
||||||
// Special case of the partial display ...
|
// Special case of the partial display ...
|
||||||
readFile1 = fread(data1.data_8 - positionStartDisplayFile1, sizeof(uint8_t), NB_DATA_PER_LINE*4 + positionStartDisplayFile1, filePointer1);
|
readFile1 = fread(data1.data_8 - positionStartDisplayFile1, sizeof(uint8_t), NB_DATA_PER_LINE*4 + positionStartDisplayFile1, filePointer1);
|
||||||
readStartFile1 = NB_DATA_PER_LINE*4 - readFile1;
|
readStartFile1 = NB_DATA_PER_LINE*4 - readFile1;
|
||||||
@ -371,11 +446,11 @@ void compareFile(FILE *filePointer1, FILE *filePointer2 ,int32_t curentFilePosit
|
|||||||
int32_t readStartFile2 = 16;
|
int32_t readStartFile2 = 16;
|
||||||
if (filePointer2 != NULL) {
|
if (filePointer2 != NULL) {
|
||||||
if (positionStartDisplayFile2 >= 0) {
|
if (positionStartDisplayFile2 >= 0) {
|
||||||
fseek(filePointer2 , positionStartDisplayFile2 , SEEK_SET );
|
fseek(filePointer2 , positionStartDisplayFile2+fileProp[1].fileBasicOffset , SEEK_SET );
|
||||||
readFile2 = fread(data2.data_8, sizeof(uint8_t), 16, filePointer2);
|
readFile2 = fread(data2.data_8, sizeof(uint8_t), nbElementToRead, filePointer2);
|
||||||
readStartFile2 = 0;
|
readStartFile2 = 0;
|
||||||
} else if (positionStartDisplayFile2 > -NB_DATA_PER_LINE*4) {
|
} else if (positionStartDisplayFile2 > -NB_DATA_PER_LINE*4) {
|
||||||
fseek(filePointer2 , 0 , SEEK_SET );
|
fseek(filePointer2 , fileProp[1].fileBasicOffset , SEEK_SET );
|
||||||
// Special case of the partial display ...
|
// Special case of the partial display ...
|
||||||
readFile2 = fread(data2.data_8 - positionStartDisplayFile2, sizeof(uint8_t), NB_DATA_PER_LINE*4 + positionStartDisplayFile2, filePointer2);
|
readFile2 = fread(data2.data_8 - positionStartDisplayFile2, sizeof(uint8_t), NB_DATA_PER_LINE*4 + positionStartDisplayFile2, filePointer2);
|
||||||
readStartFile2 = NB_DATA_PER_LINE*4 - readFile2;
|
readStartFile2 = NB_DATA_PER_LINE*4 - readFile2;
|
||||||
@ -604,6 +679,8 @@ void compareFile(FILE *filePointer1, FILE *filePointer2 ,int32_t curentFilePosit
|
|||||||
} else {
|
} else {
|
||||||
printf(COLOR_BOLD_MAGENTA" | "COLOR_BOLD_YELLOW"| "COLOR_NORMAL " |\n");
|
printf(COLOR_BOLD_MAGENTA" | "COLOR_BOLD_YELLOW"| "COLOR_NORMAL " |\n");
|
||||||
}
|
}
|
||||||
|
// update file positions :
|
||||||
|
offsetDisplaySlot += nbElementToRead;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -622,7 +699,11 @@ void * threadDisplay (void * p_data)
|
|||||||
if (getParamModification()) {
|
if (getParamModification()) {
|
||||||
uint32_t curentFilePosition = getOfsetFile();
|
uint32_t curentFilePosition = getOfsetFile();
|
||||||
uint32_t curentFilePadding = getPaddingOffsetFile();
|
uint32_t curentFilePadding = getPaddingOffsetFile();
|
||||||
compareFile(filePointer[0],filePointer[1], curentFilePosition, curentFilePadding);
|
compareFile(fileProp[0].pointer,fileProp[1].pointer, curentFilePosition, curentFilePadding);
|
||||||
|
if (true==getHelpDisplay()) {
|
||||||
|
showConfiguration();
|
||||||
|
usage();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
}
|
}
|
||||||
|
11
display.h
11
display.h
@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file display.h
|
* @file display.h
|
||||||
* @brief Editeur De N'ours :
|
* @brief main display system of the hexViewer (Header)
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 05/02/2011
|
* @date 05/02/2011
|
||||||
* @par Project
|
* @par Project
|
||||||
* Edn tool : hexViewer
|
* hexViewer
|
||||||
*
|
*
|
||||||
* @par Copyright
|
* @par Copyright
|
||||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||||
@ -13,12 +13,7 @@
|
|||||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* ANY WARRANTY.
|
* ANY WARRANTY.
|
||||||
*
|
*
|
||||||
* Licence summary :
|
* Licence : GNU Lesser General Public License (LGPL) v3.0
|
||||||
* You can modify and redistribute the sources code and binaries.
|
|
||||||
* You can send me the bug-fix
|
|
||||||
* You can not earn money with this Software (if the source extract from Edn
|
|
||||||
* represent less than 50% of original Sources)
|
|
||||||
* Term of the licence in in the file licence.txt.
|
|
||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
78
dump_test.sh
Executable file
78
dump_test.sh
Executable file
@ -0,0 +1,78 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
DUMP_DIR_EXP=.
|
||||||
|
DUMP_DIR_MATLAB=..
|
||||||
|
|
||||||
|
MATLAB_PREFIX=m__
|
||||||
|
TANGO_PREFIX=exp
|
||||||
|
|
||||||
|
DUMP_FILES=(
|
||||||
|
'WTX_')
|
||||||
|
|
||||||
|
#echo "Dump directory: $DUMP_DIR"
|
||||||
|
#echo "Dump files: ${DUMP_FILES[@]}"
|
||||||
|
|
||||||
|
COLOR_RESET=$(tput sgr0)
|
||||||
|
COLOR_FILENAME=$(tput bold)$(tput setaf 3)
|
||||||
|
COLOR_BIT_EXACT=$(tput bold)$(tput setaf 4)
|
||||||
|
COLOR_DIFFERENT=$(tput bold)$(tput setaf 1)
|
||||||
|
COLOR_ERROR=$(tput bold)$(tput setaf 5)
|
||||||
|
|
||||||
|
for i in "${DUMP_FILES[@]}" ; do
|
||||||
|
for (( FileID=0; FileID<=1000; FileID++ )) ; do
|
||||||
|
VALUE="010"
|
||||||
|
if [ $FileID -lt 10 ] ; then
|
||||||
|
VALUE="00$FileID"
|
||||||
|
elif [ $FileID -lt 100 ] ; then
|
||||||
|
VALUE="0$FileID"
|
||||||
|
else
|
||||||
|
VALUE="$FileID"
|
||||||
|
fi
|
||||||
|
|
||||||
|
MATLAB_DUMP="$DUMP_DIR_MATLAB/$MATLAB_PREFIX$i$VALUE""_*"
|
||||||
|
TANGO_DUMP="$DUMP_DIR_EXP/$TANGO_PREFIX$i$VALUE""_*"
|
||||||
|
|
||||||
|
# TODO : afficher quend un des deux fichier existe
|
||||||
|
|
||||||
|
if [ ! -e "$MATLAB_DUMP" ] ; then
|
||||||
|
finanameLS=`ls $MATLAB_DUMP 2> /dev/null`
|
||||||
|
if [ ! -e "$finanameLS" ] ; then
|
||||||
|
#echo -e -n "$COLOR_ERROR [ ??? ]
"
|
||||||
|
#echo -e -n "\t\t\t\t\t$MATLAB_DUMP$COLOR_RESET\n"
|
||||||
|
#echo -e -n "\t\t\t\t\t\t\t\t\t\t\t$COLOR_FILENAME$TANGO_DUMP$COLOR_RESET\n"
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
MATLAB_DUMP=$finanameLS
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "$TANGO_DUMP" ] ; then
|
||||||
|
finanameLS=`ls $TANGO_DUMP 2> /dev/null`
|
||||||
|
if [ ! -e "$finanameLS" ] ; then
|
||||||
|
#echo -e -n "$COLOR_ERROR [ ??? ]
"
|
||||||
|
#echo -e -n "\t\t\t\t\t$COLOR_FILENAME$MATLAB_DUMP$COLOR_RESET
"
|
||||||
|
#echo -e -n "\t\t\t\t\t\t\t\t\t\t\t$COLOR_ERROR$TANGO_DUMP$COLOR_RESET\n"
|
||||||
|
continue
|
||||||
|
else
|
||||||
|
TANGO_DUMP=$finanameLS
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
hexViewer -d $MATLAB_DUMP $TANGO_DUMP > .tmpResultHexViewer.txt
|
||||||
|
VALUE_ERROR=$?
|
||||||
|
RESULT=`cat .tmpResultHexViewer.txt`
|
||||||
|
if [ $VALUE_ERROR -eq '0' ] ; then
|
||||||
|
echo -e -n "$COLOR_ERROR [ OK ] $COLOR_RESET
"
|
||||||
|
echo -e -n "\t\t\t\t\t$COLOR_FILENAME$MATLAB_DUMP$COLOR_RESET
"
|
||||||
|
echo -e -n "\t\t\t\t\t\t\t\t\t\t\t$COLOR_FILENAME$TANGO_DUMP$COLOR_RESET
"
|
||||||
|
echo -e -n "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$RESULT\n"
|
||||||
|
else
|
||||||
|
echo -e -n "$COLOR_DIFFERENT [ERROR] $COLOR_RESET
"
|
||||||
|
echo -e -n "\t\toctet=$VALUE_ERROR
"
|
||||||
|
echo -e -n "\t\t\t\t\t$COLOR_FILENAME$MATLAB_DUMP$COLOR_RESET
"
|
||||||
|
echo -e -n "\t\t\t\t\t\t\t\t\t\t\t$COLOR_FILENAME$TANGO_DUMP$COLOR_RESET
"
|
||||||
|
echo -e -n "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$RESULT\n"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file generalDefine.h
|
* @file generalDefine.h
|
||||||
* @brief Editeur De N'ours :
|
* @brief generic basic defines
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 05/02/2011
|
* @date 05/02/2011
|
||||||
* @par Project
|
* @par Project
|
||||||
* Edn tool : hexViewer
|
* hexViewer
|
||||||
*
|
*
|
||||||
* @par Copyright
|
* @par Copyright
|
||||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||||
@ -13,12 +13,7 @@
|
|||||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* ANY WARRANTY.
|
* ANY WARRANTY.
|
||||||
*
|
*
|
||||||
* Licence summary :
|
* Licence : GNU Lesser General Public License (LGPL) v3.0
|
||||||
* You can modify and redistribute the sources code and binaries.
|
|
||||||
* You can send me the bug-fix
|
|
||||||
* You can not earn money with this Software (if the source extract from Edn
|
|
||||||
* represent less than 50% of original Sources)
|
|
||||||
* Term of the licence in in the file licence.txt.
|
|
||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
@ -39,7 +34,7 @@ typedef signed short int int16_t;
|
|||||||
typedef unsigned long int uint32_t;
|
typedef unsigned long int uint32_t;
|
||||||
//typedef signed long int int32_t;
|
//typedef signed long int int32_t;
|
||||||
typedef unsigned long long int uint64_t;
|
typedef unsigned long long int uint64_t;
|
||||||
typedef signed long long int int64_t;
|
//typedef signed long long int int64_t;
|
||||||
//typedef unsigned long long long int uint128_t;
|
//typedef unsigned long long long int uint128_t;
|
||||||
//typedef signed long long long int int128_t;
|
//typedef signed long long long int int128_t;
|
||||||
|
|
||||||
@ -90,6 +85,7 @@ typedef signed long long int int64_t;
|
|||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
SHOW_TYPE_UNKNOW,
|
||||||
SHOW_TYPE_HEX,
|
SHOW_TYPE_HEX,
|
||||||
SHOW_TYPE_DECIMAL_SIGNED,
|
SHOW_TYPE_DECIMAL_SIGNED,
|
||||||
SHOW_TYPE_DECIMAL_UNSIGNED
|
SHOW_TYPE_DECIMAL_UNSIGNED
|
||||||
@ -97,12 +93,26 @@ typedef enum {
|
|||||||
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
SHOW_TYPE_SIZE_UNKNOW,
|
||||||
SHOW_TYPE_SIZE_8,
|
SHOW_TYPE_SIZE_8,
|
||||||
SHOW_TYPE_SIZE_16,
|
SHOW_TYPE_SIZE_16,
|
||||||
SHOW_TYPE_SIZE_32,
|
SHOW_TYPE_SIZE_32,
|
||||||
SHOW_TYPE_SIZE_64,
|
SHOW_TYPE_SIZE_64,
|
||||||
SHOW_TYPE_SIZE_128
|
SHOW_TYPE_SIZE_128,
|
||||||
|
SHOW_TYPE_SIZE_FLOAT,
|
||||||
|
SHOW_TYPE_SIZE_DOUBLE
|
||||||
} showTypeSize_te;
|
} showTypeSize_te;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
bool availlable;
|
||||||
|
FILE *pointer;
|
||||||
|
uint32_t size;
|
||||||
|
char name[2096];
|
||||||
|
int32_t fileBasicOffset;
|
||||||
|
showType_te type;
|
||||||
|
showTypeSize_te typeSize;
|
||||||
|
int32_t slotSize;
|
||||||
|
int32_t delta;
|
||||||
|
} fileProperties_ts;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
165
licence.txt
Normal file
165
licence.txt
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
550
main.c
550
main.c
@ -1,26 +1,19 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file main.c
|
* @file main.c
|
||||||
* @brief Editeur De N'ours :
|
* @brief Main function (sources)
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 05/02/2011
|
* @date 05/02/2011
|
||||||
* @par Project
|
* @par Project
|
||||||
* Edn tool : hexViewer
|
* hexViewer
|
||||||
*
|
*
|
||||||
* @version $Id$
|
|
||||||
*
|
|
||||||
* @par Copyright
|
* @par Copyright
|
||||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||||
*
|
*
|
||||||
* This is free software; you can redistribute it and/or modify it under the
|
|
||||||
* terms of the GNU General Public License as published by the Free Software
|
|
||||||
* Foundation; either version 3 of the License, or (at your option) any later
|
|
||||||
* version.
|
|
||||||
*
|
|
||||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY.
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
*
|
||||||
* for more details.
|
* Licence : GNU Lesser General Public License (LGPL) v3.0
|
||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
@ -29,82 +22,34 @@
|
|||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
|
|
||||||
|
fileProperties_ts fileProp[2];
|
||||||
|
|
||||||
bool filePresent[2] = {false, false};
|
|
||||||
FILE *filePointer[2] = {NULL, NULL};
|
|
||||||
uint32_t filesize[2] = {0, 0};
|
|
||||||
char fileName[2][2096] = {"",""};
|
|
||||||
|
|
||||||
void usage(void)
|
|
||||||
{
|
|
||||||
printf("usage : hexViwer [file_1] [file_2]\n");
|
|
||||||
printf("\t[file_1] : Show the first file only\n");
|
|
||||||
printf("\t[file_2] : if it was precise : Show the comparaison with the first file\n");
|
|
||||||
printf("\t\n");
|
|
||||||
printf("\tInside Usage : \n");
|
|
||||||
printf("\t\t[a] Go to the start of the files\n");
|
|
||||||
printf("\t\t[z] Go to the end of the files (the first push is the File 1, the second push is the file 2) \n");
|
|
||||||
printf("\t\t[q] Quit the curent program\n");
|
|
||||||
printf("\t\t[s] Change the view of the propram of the size of interpretation (8 bits, 16 bits, 32 bits)\n");
|
|
||||||
printf("\t\t[t] Change the interpretation of Data (hexedecimal, Signed Decimal, Unigned Decimal)\n");
|
|
||||||
printf("\t\t[f] Find the first Error when comparing the two files\n");
|
|
||||||
printf("\t\t[UP] Go up 5 line in the view\n");
|
|
||||||
printf("\t\t[DOWN] Go down 5 line in the view\n");
|
|
||||||
printf("\t\t[LEFT] Go up 50 line in the view (one screen)\n");
|
|
||||||
printf("\t\t[RIGHT] Go down 50 line in the view (one screen)\n");
|
|
||||||
printf("\t\tAdd padding : \n");
|
|
||||||
printf("\t\t\t[o] Add 1 Byte padding at the left file\n");
|
|
||||||
printf("\t\t\t[O] Add 16 Bytes padding at the left file\n");
|
|
||||||
printf("\t\t\t[p] Add 1 Byte padding at the right file\n");
|
|
||||||
printf("\t\t\t[P] Add 16 Bytes padding at the right file\n");
|
|
||||||
printf("\t\t\t[m] reset padding\n");
|
|
||||||
printf("\t\n");
|
|
||||||
/*
|
|
||||||
printf("\tTODO : \n");
|
|
||||||
printf("\t\t- The print of 128 bytes\n");
|
|
||||||
printf("\t\t- The print in Octal\n");
|
|
||||||
printf("\t\t- The print in Binary\n");
|
|
||||||
printf("\t\t- The Modification of the file\n");
|
|
||||||
printf("\t\t- The Saving of the file\n");
|
|
||||||
printf("\t\t- The information that one of the files has been update\n");
|
|
||||||
printf("\t\t- To reload the two files ==> [U]\n");
|
|
||||||
printf("\t\t- The windows scroling with the mouse\n");
|
|
||||||
printf("\t\t- The selection with the mouse\n");
|
|
||||||
printf("\t\t- The display on char view\n");
|
|
||||||
printf("\t\t- The scroling Bar on the right\n");
|
|
||||||
printf("\t\t- Add to the croling bar the differences in the two files\n");
|
|
||||||
printf("\t\t- The research of a sequency in the two files ==> [R]\n");
|
|
||||||
printf("\t\t- The jump to an offset directly ==> [J] \n");
|
|
||||||
*/
|
|
||||||
/*printf("\t\t- \n");*/
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int32_t findFirstDiff(void)
|
int32_t findFirstDiff(void)
|
||||||
{
|
{
|
||||||
uint8_t data1, data2;
|
uint8_t data1, data2;
|
||||||
int32_t offset = 0;
|
int32_t offset = 0;
|
||||||
if( NULL == filePointer[0]
|
if( NULL == fileProp[0].pointer
|
||||||
|| NULL == filePointer[1] ) {
|
|| NULL == fileProp[1].pointer ) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(NULL != filePointer[0]) {
|
int32_t paddingFile = getPaddingOffsetFile();
|
||||||
fseek ( filePointer[0] , 0 , SEEK_SET );
|
int32_t pad1 = 0;
|
||||||
|
int32_t pad2 = 0;
|
||||||
|
if (paddingFile>0) {
|
||||||
|
pad1 = paddingFile;
|
||||||
|
pad2 = 0;
|
||||||
|
} else {
|
||||||
|
pad1 = 0;
|
||||||
|
pad2 = -1*paddingFile;
|
||||||
}
|
}
|
||||||
if(NULL != filePointer[1]) {
|
if(NULL != fileProp[0].pointer) {
|
||||||
fseek ( filePointer[1] , 0 , SEEK_SET );
|
fseek ( fileProp[0].pointer , pad1+fileProp[0].fileBasicOffset , SEEK_SET );
|
||||||
}
|
}
|
||||||
while ( fread(&data1, sizeof(uint8_t), 1, filePointer[0]) == 1
|
if(NULL != fileProp[1].pointer) {
|
||||||
&& fread(&data2, sizeof(uint8_t), 1, filePointer[1]) == 1)
|
fseek ( fileProp[1].pointer , pad2+fileProp[1].fileBasicOffset , SEEK_SET );
|
||||||
|
}
|
||||||
|
while ( fread(&data1, sizeof(uint8_t), 1, fileProp[0].pointer) == 1
|
||||||
|
&& fread(&data2, sizeof(uint8_t), 1, fileProp[1].pointer) == 1)
|
||||||
{
|
{
|
||||||
offset ++;
|
offset ++;
|
||||||
if (data1 != data2) {
|
if (data1 != data2) {
|
||||||
@ -114,52 +59,229 @@ int32_t findFirstDiff(void)
|
|||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AutoSetPadding(void)
|
||||||
|
{
|
||||||
|
displayPaddingOffset(0);
|
||||||
|
if( NULL == fileProp[0].pointer
|
||||||
|
|| NULL == fileProp[1].pointer ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(NULL != fileProp[0].pointer) {
|
||||||
|
fseek ( fileProp[0].pointer , fileProp[0].fileBasicOffset , SEEK_SET );
|
||||||
|
}
|
||||||
|
int32_t offset1 = 0;
|
||||||
|
char data;
|
||||||
|
while(fread(&data, sizeof(uint8_t), 1, fileProp[0].pointer) == 1) {
|
||||||
|
if (data != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
offset1 ++;
|
||||||
|
}
|
||||||
|
if(NULL != fileProp[1].pointer) {
|
||||||
|
fseek ( fileProp[1].pointer , fileProp[1].fileBasicOffset , SEEK_SET );
|
||||||
|
}
|
||||||
|
int32_t offset2 = 0;
|
||||||
|
while(fread(&data, sizeof(uint8_t), 1, fileProp[1].pointer) == 1)
|
||||||
|
{
|
||||||
|
if (data != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
offset2 ++;
|
||||||
|
}
|
||||||
|
if (offset1 == offset2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (0 == offset1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (0 == offset2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
displayPaddingOffset(offset1 - offset2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void UpdateFilesSize(void)
|
void UpdateFilesSize(void)
|
||||||
{
|
{
|
||||||
// get size file 1
|
// get size for 2 files
|
||||||
if ( NULL != filePointer[0]) {
|
int32_t iii=0;
|
||||||
fseek ( filePointer[0] , 0 , SEEK_END );
|
for (iii=0; iii<2; iii++) {
|
||||||
filesize[0] = ftell (filePointer[0]);
|
if ( NULL != fileProp[iii].pointer) {
|
||||||
fseek ( filePointer[0] , 0 , SEEK_SET );
|
fseek ( fileProp[iii].pointer , 0 , SEEK_END );
|
||||||
}
|
fileProp[iii].size = ftell (fileProp[iii].pointer) - fileProp[iii].fileBasicOffset;
|
||||||
// get size file 2
|
fseek ( fileProp[iii].pointer , 0 , SEEK_SET );
|
||||||
if ( NULL != filePointer[1]) {
|
}
|
||||||
fseek ( filePointer[1] , 0 , SEEK_END );
|
|
||||||
filesize[1] = ftell (filePointer[1]);
|
|
||||||
fseek ( filePointer[1] , 0 , SEEK_SET );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenFiles(void) {
|
|
||||||
filePointer[0] = NULL;
|
void ResetProperties(void)
|
||||||
filePointer[1] = NULL;
|
{
|
||||||
filesize[0] = 0;
|
int32_t iii=0;
|
||||||
filesize[1] = 0;
|
for (iii=0; iii<2; iii++) {
|
||||||
if (true == filePresent[0]) {
|
fileProp[iii].availlable = false;
|
||||||
// Open file 1
|
fileProp[iii].pointer = NULL;
|
||||||
filePointer[0] = fopen(fileName[0], "rb");
|
fileProp[iii].size = 0;
|
||||||
if ( NULL == filePointer[0]) {
|
strcpy(fileProp[iii].name, "No-File");
|
||||||
//printf("Can not Open [File_1] = %s\n", fileName[0]);
|
fileProp[iii].fileBasicOffset = 0;
|
||||||
|
fileProp[iii].type = SHOW_TYPE_UNKNOW;
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_UNKNOW;
|
||||||
|
fileProp[iii].slotSize = 0;
|
||||||
|
fileProp[iii].delta = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OpenFiles(void)
|
||||||
|
{
|
||||||
|
int32_t iii=0;
|
||||||
|
for (iii=0; iii<2; iii++) {
|
||||||
|
if (true == fileProp[iii].availlable) {
|
||||||
|
// Open file 1
|
||||||
|
fileProp[iii].pointer = fopen(fileProp[iii].name, "rb");
|
||||||
|
if ( NULL == fileProp[iii].pointer) {
|
||||||
|
//printf("Can not Open [File_1] = %s\n", fileName[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fileProp[iii].pointer==NULL) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// check if file has specifi header :
|
||||||
|
char dataheader[128];
|
||||||
|
if(16 == fread(&dataheader, sizeof(uint8_t), 16, fileProp[iii].pointer)) {
|
||||||
|
// parse header
|
||||||
|
if( dataheader[0]=='#'
|
||||||
|
&& dataheader[1]=='M'
|
||||||
|
&& dataheader[2]=='E'
|
||||||
|
&& dataheader[3]=='T') {
|
||||||
|
|
||||||
|
// ==> "#MET %c %s %04d "
|
||||||
|
// type unused ...
|
||||||
|
if( dataheader[5] == 'I'
|
||||||
|
|| dataheader[5] == 'F'
|
||||||
|
|| dataheader[5] == 'D') {
|
||||||
|
fileProp[iii].type = SHOW_TYPE_DECIMAL_SIGNED;
|
||||||
|
} else if (dataheader[5] == 'U') {
|
||||||
|
fileProp[iii].type = SHOW_TYPE_DECIMAL_UNSIGNED;
|
||||||
|
} else if (dataheader[5] == 'U') {
|
||||||
|
fileProp[iii].type = SHOW_TYPE_HEX;
|
||||||
|
} else {
|
||||||
|
printf("Error while parsing the header ... \n");
|
||||||
|
fileProp[iii].type = SHOW_TYPE_UNKNOW;
|
||||||
|
}
|
||||||
|
if (strncmp(&dataheader[6], "08", 2)==0) {
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_8;
|
||||||
|
} else if (strncmp(&dataheader[6], "16", 2)==0) {
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_16;
|
||||||
|
} else if (strncmp(&dataheader[6], "32", 2)==0) {
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_32;
|
||||||
|
} else if (strncmp(&dataheader[6], "64", 2)==0) {
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_64;
|
||||||
|
} else if (strncmp(&dataheader[6], "28", 2)==0) {
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_128;
|
||||||
|
} else if (strncmp(&dataheader[6], "LO", 2)==0) {
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_FLOAT;
|
||||||
|
} else if (strncmp(&dataheader[6], "OU", 2)==0) {
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_DOUBLE;
|
||||||
|
} else {
|
||||||
|
printf("Error while parsing the header ... \n");
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_UNKNOW;
|
||||||
|
}
|
||||||
|
char tmpVal[5];
|
||||||
|
tmpVal[0] = dataheader[8];
|
||||||
|
tmpVal[1] = dataheader[9];
|
||||||
|
tmpVal[2] = dataheader[10];
|
||||||
|
tmpVal[3] = dataheader[11];
|
||||||
|
tmpVal[4] = '\0';
|
||||||
|
sscanf(tmpVal, "%04d", &fileProp[iii].slotSize);
|
||||||
|
|
||||||
|
sscanf(&dataheader[12], "%04d", &fileProp[iii].delta);
|
||||||
|
//printf("slot size [%d]=%d\n", iii, fileProp[iii].slotSize);
|
||||||
|
// ofset of the header :
|
||||||
|
fileProp[iii].fileBasicOffset = 16;
|
||||||
|
}
|
||||||
|
} // else : no header present ==> raw file
|
||||||
|
fseek ( fileProp[iii].pointer , fileProp[iii].fileBasicOffset , SEEK_SET );
|
||||||
|
}
|
||||||
|
// check internal properties :
|
||||||
|
if (fileProp[0].fileBasicOffset!=0 && fileProp[1].fileBasicOffset!=0) {
|
||||||
|
if (fileProp[0].typeSize == fileProp[1].typeSize) {
|
||||||
|
setTypeSize(fileProp[0].typeSize);
|
||||||
|
} else {
|
||||||
|
printf("Error The 2 files has not the same header typeSize properties header ... \n");
|
||||||
|
}
|
||||||
|
if (fileProp[0].type == fileProp[1].type) {
|
||||||
|
setType(fileProp[0].type);
|
||||||
|
} else {
|
||||||
|
printf("Error The 2 files has not the same header type properties header ... \n");
|
||||||
|
}
|
||||||
|
if (fileProp[0].slotSize == fileProp[1].slotSize) {
|
||||||
|
setSlotSize(fileProp[0].slotSize);
|
||||||
|
if (fileProp[0].slotSize>0) {
|
||||||
|
setSlotDisplayMode(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
printf("Error The 2 files has not the same header slotSize properties header ... \n");
|
||||||
|
}
|
||||||
|
} else if (fileProp[0].fileBasicOffset!=0) {
|
||||||
|
setTypeSize(fileProp[0].typeSize);
|
||||||
|
setType(fileProp[0].type);
|
||||||
|
setSlotSize(fileProp[0].slotSize);
|
||||||
|
if (fileProp[0].slotSize>0) {
|
||||||
|
setSlotDisplayMode(true);
|
||||||
|
}
|
||||||
|
} else if (fileProp[1].fileBasicOffset!=0) {
|
||||||
|
setTypeSize(fileProp[1].typeSize);
|
||||||
|
setType(fileProp[1].type);
|
||||||
|
setSlotSize(fileProp[1].slotSize);
|
||||||
|
if (fileProp[1].slotSize>0) {
|
||||||
|
setSlotDisplayMode(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (true == filePresent[1]) {
|
int32_t sizeElement=1;
|
||||||
// open File 2
|
showTypeSize_te tmpType = getTypeSize();
|
||||||
filePointer[1] = fopen(fileName[1], "rb");
|
switch(tmpType)
|
||||||
if ( NULL == filePointer[1]) {
|
{
|
||||||
//printf("Can not Open [File_2] = %s\n", fileName[1]);
|
default:
|
||||||
}
|
case SHOW_TYPE_SIZE_8:
|
||||||
|
sizeElement = 1;
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_16:
|
||||||
|
sizeElement = 2;
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_FLOAT:
|
||||||
|
case SHOW_TYPE_SIZE_32:
|
||||||
|
sizeElement = 4;
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_DOUBLE:
|
||||||
|
case SHOW_TYPE_SIZE_64:
|
||||||
|
sizeElement = 8;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
int32_t tmpDela = (fileProp[1].delta - fileProp[0].delta) * sizeElement;
|
||||||
|
displayPaddingOffset(tmpDela);
|
||||||
|
|
||||||
|
|
||||||
UpdateFilesSize();
|
UpdateFilesSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CloseFiles(void) {
|
void CloseFiles(void)
|
||||||
if (NULL != filePointer[0]) {
|
{
|
||||||
fclose(filePointer[0]);
|
int32_t iii=0;
|
||||||
filePointer[0] = NULL;
|
for (iii=0; iii<2; iii++) {
|
||||||
} if (NULL != filePointer[1]) {
|
if (NULL != fileProp[iii].pointer) {
|
||||||
fclose(filePointer[1]);
|
fclose(fileProp[iii].pointer);
|
||||||
filePointer[1] = NULL;
|
}
|
||||||
|
fileProp[iii].pointer = NULL;
|
||||||
|
fileProp[iii].fileBasicOffset = 0;
|
||||||
|
fileProp[iii].type = SHOW_TYPE_UNKNOW;
|
||||||
|
fileProp[iii].typeSize = SHOW_TYPE_SIZE_UNKNOW;
|
||||||
|
fileProp[iii].slotSize = 0;
|
||||||
|
fileProp[iii].delta = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,32 +289,79 @@ void CloseFiles(void) {
|
|||||||
int main (int argc, char**argv)
|
int main (int argc, char**argv)
|
||||||
{
|
{
|
||||||
int32_t first_Error = 0;
|
int32_t first_Error = 0;
|
||||||
filePointer[0] = NULL;
|
ResetProperties();
|
||||||
filePointer[1] = NULL;
|
|
||||||
strcpy(fileName[0], "No-File");
|
|
||||||
strcpy(fileName[1], "No-File");
|
|
||||||
|
|
||||||
UpdateNumberOfRawAndColomn();
|
UpdateNumberOfRawAndColomn();
|
||||||
|
|
||||||
// check error
|
// check error
|
||||||
if (3 < argc || argc < 2) {
|
if (argc < 2) {
|
||||||
printf("You set more than 3 argument at the commande line\n");
|
printf("You set more than 3 argument at the commande line\n");
|
||||||
usage();
|
usage();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
bool directCheckFiles = false;
|
||||||
|
int basicIDParsing = 1;
|
||||||
|
if (0==strcmp("-d",argv[1])) {
|
||||||
|
basicIDParsing++;
|
||||||
|
directCheckFiles = true;
|
||||||
|
}
|
||||||
// one file
|
// one file
|
||||||
if (2 <= argc) {
|
if (basicIDParsing+1 <= argc) {
|
||||||
strcpy(fileName[0], argv[1]);
|
strcpy(fileProp[0].name, argv[basicIDParsing]);
|
||||||
filePresent[0] = true;
|
fileProp[0].availlable = true;
|
||||||
}
|
}
|
||||||
// a second file
|
// a second file
|
||||||
if (3 <= argc) {
|
if (basicIDParsing+2 <= argc) {
|
||||||
strcpy(fileName[1], argv[2]);
|
strcpy(fileProp[1].name, argv[basicIDParsing+1]);
|
||||||
filePresent[1] = true;
|
fileProp[1].availlable = true;
|
||||||
}
|
}
|
||||||
// open the files
|
// open the files
|
||||||
OpenFiles();
|
OpenFiles();
|
||||||
|
|
||||||
|
// user requested to have the direct error ID of the file...
|
||||||
|
if (directCheckFiles==true) {
|
||||||
|
|
||||||
|
float dividor = 1;
|
||||||
|
int32_t maxSlot = (fileProp[0].slotSize>fileProp[1].slotSize)?fileProp[0].slotSize:fileProp[1].slotSize;
|
||||||
|
if (0!=maxSlot) {
|
||||||
|
dividor = maxSlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t idError = findFirstDiff();
|
||||||
|
int minSizeFile = ((fileProp[0].size<fileProp[1].size)?fileProp[0].size:fileProp[1].size) - abs(getPaddingOffsetFile());
|
||||||
|
if (minSizeFile<=idError) {
|
||||||
|
printf(" --- slot=%3d nb frame=%d", (int32_t)dividor, (int32_t)(idError/dividor));
|
||||||
|
CloseFiles();
|
||||||
|
// 0 : no error
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
int32_t sizeElement = 1;
|
||||||
|
showTypeSize_te tmpType = getTypeSize();
|
||||||
|
switch(tmpType)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case SHOW_TYPE_SIZE_8:
|
||||||
|
sizeElement = 1;
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_16:
|
||||||
|
sizeElement = 2;
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_FLOAT:
|
||||||
|
case SHOW_TYPE_SIZE_32:
|
||||||
|
sizeElement = 4;
|
||||||
|
break;
|
||||||
|
case SHOW_TYPE_SIZE_DOUBLE:
|
||||||
|
case SHOW_TYPE_SIZE_64:
|
||||||
|
sizeElement = 8;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
int32_t elementIDError = idError/sizeElement;
|
||||||
|
float frameRatio = (float)elementIDError/dividor;
|
||||||
|
int32_t idFrame = frameRatio;
|
||||||
|
int32_t idFrameElement = (frameRatio-idFrame)*dividor;
|
||||||
|
printf("%9d / frame=%9.2f ==> frame=%5d element=%5d slot=%3d", elementIDError, frameRatio, idFrame, idFrameElement, (int32_t)dividor);
|
||||||
|
CloseFiles();
|
||||||
|
return idError;
|
||||||
|
}
|
||||||
|
}
|
||||||
// rendre la lecture des données non canonique
|
// rendre la lecture des données non canonique
|
||||||
system("stty -icanon");
|
system("stty -icanon");
|
||||||
// supression de l'écho des caractères
|
// supression de l'écho des caractères
|
||||||
@ -215,43 +384,6 @@ int main (int argc, char**argv)
|
|||||||
{
|
{
|
||||||
int32_t inputValue;
|
int32_t inputValue;
|
||||||
inputValue = getc(stdin);
|
inputValue = getc(stdin);
|
||||||
if (inputValue == 0x1b) {
|
|
||||||
// mose event :
|
|
||||||
int32_t val2 = getc(stdin);
|
|
||||||
int32_t val3 = getc(stdin);
|
|
||||||
int32_t val4 = getc(stdin);
|
|
||||||
int32_t val5 = getc(stdin);
|
|
||||||
int32_t val6 = getc(stdin);
|
|
||||||
int32_t bt=0;
|
|
||||||
switch (val4) {
|
|
||||||
case 97:
|
|
||||||
bt = 4;
|
|
||||||
break;
|
|
||||||
case 96:
|
|
||||||
bt = 5;
|
|
||||||
break;
|
|
||||||
case 32:
|
|
||||||
bt = 1;
|
|
||||||
break;
|
|
||||||
case 33:
|
|
||||||
bt = 3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//printf("\n mouse event : %d, %d, %d, %d=%d x=%d y=%d\n", inputValue, val2, val3, val4, bt, val5-33, val6-33);
|
|
||||||
(void)val2;
|
|
||||||
(void)val3;
|
|
||||||
(void)val4;
|
|
||||||
(void)val5;
|
|
||||||
(void)val6;
|
|
||||||
if (bt == 4) {
|
|
||||||
upDownOfsetFile(5);
|
|
||||||
} else if (bt == 5) {
|
|
||||||
upDownOfsetFile(-5);
|
|
||||||
}
|
|
||||||
inputValue = 0;
|
|
||||||
} else {
|
|
||||||
//printf("\n get data : 0x%08x ..... : \n", (unsigned int)inputValue);
|
|
||||||
}
|
|
||||||
switch(inputValue)
|
switch(inputValue)
|
||||||
{
|
{
|
||||||
case 'q':
|
case 'q':
|
||||||
@ -262,26 +394,61 @@ int main (int argc, char**argv)
|
|||||||
case '\e':
|
case '\e':
|
||||||
inputValue = getc (stdin);
|
inputValue = getc (stdin);
|
||||||
//printf("\n get data : 0x%08x ..... : \n", (unsigned int)inputValue);
|
//printf("\n get data : 0x%08x ..... : \n", (unsigned int)inputValue);
|
||||||
if (inputValue == 0x5B)
|
// [ == 0x5B
|
||||||
|
if (inputValue == '[')
|
||||||
{
|
{
|
||||||
inputValue = getc (stdin);
|
inputValue = getc (stdin);
|
||||||
//printf("\n get data : 0x%08x ..... : \n", (unsigned int)inputValue);
|
char charValue = inputValue;
|
||||||
if ( inputValue == 0x41
|
// printf("\n get data : 0x%08x ..... : \\e[%c\n", (unsigned int)inputValue, charValue);
|
||||||
|| inputValue == 0x42
|
if ( charValue == 'A' //0x41 ==> UP
|
||||||
|| inputValue == 0x43
|
|| charValue == 'B' //0x42 ==> DOWN
|
||||||
|| inputValue == 0x44)
|
|| charValue == 'C' //0x43 ==> RIGHT
|
||||||
|
|| charValue == 'D' //0x44 ==> LEFT
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (inputValue == 0x41) {
|
//printf("\n get data :\\e[%c ==> MoveKey \n", charValue);
|
||||||
|
if (charValue == 'A') {
|
||||||
upDownOfsetFile(-5);
|
upDownOfsetFile(-5);
|
||||||
} else if ( inputValue == 0x42) {
|
} else if ( charValue == 'B') {
|
||||||
upDownOfsetFile(5);
|
upDownOfsetFile(5);
|
||||||
} else if ( inputValue == 0x43) {
|
} else if ( charValue == 'C') {
|
||||||
upDownOfsetFile((GetNumberOfRaw()-NB_HEARDER_RAW));
|
upDownOfsetFile((GetNumberOfRaw()-NB_HEARDER_RAW));
|
||||||
} else if ( inputValue == 0x44) {
|
} else if ( charValue == 'D') {
|
||||||
upDownOfsetFile(-(GetNumberOfRaw()-NB_HEARDER_RAW));
|
upDownOfsetFile(-(GetNumberOfRaw()-NB_HEARDER_RAW));
|
||||||
}
|
}
|
||||||
|
} else if (charValue == 'M' ) { //0x4d ==> mouse
|
||||||
|
//printf("\n get data :\\e[%c ==> Mouse \n", charValue);
|
||||||
|
int32_t button = getc(stdin);
|
||||||
|
int32_t xPos = getc(stdin);
|
||||||
|
xPos -= 0x20;
|
||||||
|
int32_t yPos = getc(stdin);
|
||||||
|
yPos -= 0x20;
|
||||||
|
|
||||||
|
int32_t bt=0;
|
||||||
|
switch (button) {
|
||||||
|
case 97:
|
||||||
|
bt = 4;
|
||||||
|
break;
|
||||||
|
case 96:
|
||||||
|
bt = 5;
|
||||||
|
break;
|
||||||
|
case 32:
|
||||||
|
bt = 1;
|
||||||
|
break;
|
||||||
|
case 33:
|
||||||
|
bt = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//printf(" bt=%#x=%d \n", button, bt);
|
||||||
|
//printf(" x=%d y=%d\n", xPos, yPos);
|
||||||
|
if (bt == 4) {
|
||||||
|
upDownOfsetFile(5);
|
||||||
|
} else if (bt == 5) {
|
||||||
|
upDownOfsetFile(-5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
// change the type of interpretation the file
|
// change the type of interpretation the file
|
||||||
case 't':
|
case 't':
|
||||||
@ -314,10 +481,10 @@ int main (int argc, char**argv)
|
|||||||
static bool whichElement = false;
|
static bool whichElement = false;
|
||||||
if (whichElement == false) {
|
if (whichElement == false) {
|
||||||
whichElement = true;
|
whichElement = true;
|
||||||
setOfsetFile((filesize[0]/16)*16 - 256);
|
setOfsetFile((fileProp[0].size/16)*16 - 256);
|
||||||
} else {
|
} else {
|
||||||
whichElement = false;
|
whichElement = false;
|
||||||
setOfsetFile((filesize[1]/16)*16 - 256);
|
setOfsetFile((fileProp[1].size/16)*16 - 256);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -330,6 +497,30 @@ int main (int argc, char**argv)
|
|||||||
OpenFiles();
|
OpenFiles();
|
||||||
needRedraw();
|
needRedraw();
|
||||||
break;
|
break;
|
||||||
|
// Display Slot mode :
|
||||||
|
case 'j':
|
||||||
|
case 'J':
|
||||||
|
setSlotDisplayMode((getSlotDisplayMode()==true)?false:true);
|
||||||
|
needRedraw();
|
||||||
|
break;
|
||||||
|
case 'U':
|
||||||
|
setSlotSize(getSlotSize()-9);
|
||||||
|
case 'u':
|
||||||
|
setSlotSize(getSlotSize()-1);
|
||||||
|
needRedraw();
|
||||||
|
break;
|
||||||
|
case 'I':
|
||||||
|
setSlotSize(getSlotSize()+9);
|
||||||
|
case 'i':
|
||||||
|
setSlotSize(getSlotSize()+1);
|
||||||
|
needRedraw();
|
||||||
|
break;
|
||||||
|
case 'k':
|
||||||
|
case 'K':
|
||||||
|
setSlotSize(0);
|
||||||
|
setSlotDisplayMode(false);
|
||||||
|
needRedraw();
|
||||||
|
break;
|
||||||
// Add padding offset between left an right file
|
// Add padding offset between left an right file
|
||||||
case 'o':
|
case 'o':
|
||||||
displayPaddingOffset(-1);
|
displayPaddingOffset(-1);
|
||||||
@ -348,6 +539,15 @@ int main (int argc, char**argv)
|
|||||||
case 'M':
|
case 'M':
|
||||||
displayPaddingOffsetClear();
|
displayPaddingOffsetClear();
|
||||||
break;
|
break;
|
||||||
|
case 'c':
|
||||||
|
case 'C':
|
||||||
|
AutoSetPadding();
|
||||||
|
break;
|
||||||
|
case 'h':
|
||||||
|
case 'H':
|
||||||
|
setHelpDisplay((getHelpDisplay()==true)?false:true);
|
||||||
|
needRedraw();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
114
parameter.c
114
parameter.c
@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file parameter.c
|
* @file parameter.c
|
||||||
* @brief Editeur De N'ours :
|
* @brief Parameters area (Sources)
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 05/02/2011
|
* @date 05/02/2011
|
||||||
* @par Project
|
* @par Project
|
||||||
* Edn tool : hexViewer
|
* hexViewer
|
||||||
*
|
*
|
||||||
* @par Copyright
|
* @par Copyright
|
||||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||||
@ -13,12 +13,7 @@
|
|||||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* ANY WARRANTY.
|
* ANY WARRANTY.
|
||||||
*
|
*
|
||||||
* Licence summary :
|
* Licence : GNU Lesser General Public License (LGPL) v3.0
|
||||||
* You can modify and redistribute the sources code and binaries.
|
|
||||||
* You can send me the bug-fix
|
|
||||||
* You can not earn money with this Software (if the source extract from Edn
|
|
||||||
* represent less than 50% of original Sources)
|
|
||||||
* Term of the licence in in the file licence.txt.
|
|
||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
@ -37,7 +32,7 @@ static showType_te curentType = SHOW_TYPE_HEX;
|
|||||||
static showTypeSize_te curentTypeSize = SHOW_TYPE_SIZE_8;
|
static showTypeSize_te curentTypeSize = SHOW_TYPE_SIZE_8;
|
||||||
|
|
||||||
|
|
||||||
extern uint32_t filesize[2];
|
extern fileProperties_ts fileProp[2];
|
||||||
|
|
||||||
void CleanDisplay(void)
|
void CleanDisplay(void)
|
||||||
{
|
{
|
||||||
@ -63,8 +58,8 @@ void setOfsetFile(int32_t offset)
|
|||||||
if (0 > offset) {
|
if (0 > offset) {
|
||||||
offset = 0;
|
offset = 0;
|
||||||
}
|
}
|
||||||
if( offset > (int32_t)filesize[0]
|
if( offset > (int32_t)fileProp[0].size
|
||||||
&& offset > (int32_t)filesize[1]) {
|
&& offset > (int32_t)fileProp[1].size) {
|
||||||
// nothing to do
|
// nothing to do
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -148,6 +143,12 @@ showType_te getType(void)
|
|||||||
return curentType;
|
return curentType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setType(showType_te newType)
|
||||||
|
{
|
||||||
|
curentType = newType;
|
||||||
|
parmamModifier = true;
|
||||||
|
}
|
||||||
|
|
||||||
void nextTypeSize(void)
|
void nextTypeSize(void)
|
||||||
{
|
{
|
||||||
switch(curentTypeSize)
|
switch(curentTypeSize)
|
||||||
@ -179,6 +180,11 @@ showTypeSize_te getTypeSize(void)
|
|||||||
{
|
{
|
||||||
return curentTypeSize;
|
return curentTypeSize;
|
||||||
}
|
}
|
||||||
|
void setTypeSize(showTypeSize_te newType)
|
||||||
|
{
|
||||||
|
curentTypeSize = newType;
|
||||||
|
parmamModifier = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t nbRaw = 20;
|
int32_t nbRaw = 20;
|
||||||
@ -203,3 +209,89 @@ int32_t GetNumberOfColomn(void)
|
|||||||
return nbColomn;
|
return nbColomn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int32_t slotSize = -1;
|
||||||
|
bool slotEnable = false;
|
||||||
|
int32_t getSlotSize(void)
|
||||||
|
{
|
||||||
|
if (true == slotEnable) {
|
||||||
|
return slotSize;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
void setSlotSize(int32_t newSize)
|
||||||
|
{
|
||||||
|
if (newSize<0) {
|
||||||
|
newSize = 0;
|
||||||
|
}
|
||||||
|
slotSize = newSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setSlotDisplayMode(bool enable)
|
||||||
|
{
|
||||||
|
slotEnable = enable;
|
||||||
|
}
|
||||||
|
bool getSlotDisplayMode(void)
|
||||||
|
{
|
||||||
|
return slotEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool displayHelp = false;
|
||||||
|
void setHelpDisplay(bool enable)
|
||||||
|
{
|
||||||
|
displayHelp = enable;
|
||||||
|
}
|
||||||
|
bool getHelpDisplay(void)
|
||||||
|
{
|
||||||
|
return displayHelp;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cleanLine(void)
|
||||||
|
{
|
||||||
|
printf(" | | \r");
|
||||||
|
}
|
||||||
|
void endLine(void)
|
||||||
|
{
|
||||||
|
printf(" |-----------------------------------------------------------------------------------------------------------------------------------| \n");
|
||||||
|
}
|
||||||
|
void usage(void)
|
||||||
|
{
|
||||||
|
cleanLine(); printf(" | usage : hexViwer [option] [file_1] [file_2]\n");
|
||||||
|
cleanLine(); printf("\t[option] : options:\n");
|
||||||
|
cleanLine(); printf("\t\t[-d] : direct check of the error ...\n");
|
||||||
|
cleanLine(); printf("\t[file_1] : Show the first file only\n");
|
||||||
|
cleanLine(); printf("\t[file_2] : if it was precise : Show the comparaison with the first file\n");
|
||||||
|
cleanLine(); printf("\t\n");
|
||||||
|
cleanLine(); printf("\tInside Usage : \n");
|
||||||
|
cleanLine(); printf("\t\t[h] diplay/Hide Help\n");
|
||||||
|
cleanLine(); printf("\t\t[a] Go to the start of the files\n");
|
||||||
|
cleanLine(); printf("\t\t[z] Go to the end of the files (the first push is the File 1, the second push is the file 2) \n");
|
||||||
|
cleanLine(); printf("\t\t[q] Quit the curent program\n");
|
||||||
|
cleanLine(); printf("\t\t[s] Change the view of the propram of the size of interpretation (8/16/32/64 bits)\n");
|
||||||
|
cleanLine(); printf("\t\t[t] Change the interpretation of Data (hexedecimal, Signed Decimal, Unigned Decimal)\n");
|
||||||
|
cleanLine(); printf("\t\t[f] Find the first Error when comparing the two files\n");
|
||||||
|
cleanLine(); printf("\t\t[c] Calibrate the delta between the 2 file (fist element !=0)\n");
|
||||||
|
cleanLine(); printf("\t\t[UP] Go up (5 lines)\n");
|
||||||
|
cleanLine(); printf("\t\t[DOWN] Go down (5 lines)\n");
|
||||||
|
cleanLine(); printf("\t\t[LEFT] Go up (one screen)\n");
|
||||||
|
cleanLine(); printf("\t\t[RIGHT] Go down (one screen)\n");
|
||||||
|
cleanLine(); printf("\t\tAdd padding : \n");
|
||||||
|
cleanLine(); printf("\t\t\t[o] Add 1 Byte padding at the left file\n");
|
||||||
|
cleanLine(); printf("\t\t\t[O] Add 16 Bytes padding at the left file\n");
|
||||||
|
cleanLine(); printf("\t\t\t[p] Add 1 Byte padding at the right file\n");
|
||||||
|
cleanLine(); printf("\t\t\t[P] Add 16 Bytes padding at the right file\n");
|
||||||
|
cleanLine(); printf("\t\t\t[m] reset padding\n");
|
||||||
|
cleanLine(); printf("\t\tdiplay slot element\n");
|
||||||
|
cleanLine(); printf("\t\t\t[j] enable/disabe slot display\n");
|
||||||
|
cleanLine(); printf("\t\t\t[u] Decrement slot size -1 \n");
|
||||||
|
cleanLine(); printf("\t\t\t[U] Decrement slot size -10 \n");
|
||||||
|
cleanLine(); printf("\t\t\t[i] Increment slot size +1 \n");
|
||||||
|
cleanLine(); printf("\t\t\t[I] Increment slot size +10\n");
|
||||||
|
cleanLine(); printf("\t\t\t[k] Reset slot display\n");
|
||||||
|
cleanLine(); printf("\t\n");
|
||||||
|
cleanLine(); printf("\tCopyright: 2010 Edouard DUPIN, all right reserved\n");
|
||||||
|
cleanLine(); printf("\tLicense: GNU Lesser General Public License (LGPL) v3.0\n");
|
||||||
|
endLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
32
parameter.h
32
parameter.h
@ -1,26 +1,19 @@
|
|||||||
/**
|
/**
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* @file parameter.h
|
* @file parameter.h
|
||||||
* @brief Editeur De N'ours :
|
* @brief Parameters area (header)
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @date 05/02/2011
|
* @date 05/02/2011
|
||||||
* @par Project
|
* @par Project
|
||||||
* Edn tool : hexViewer
|
* hexViewer
|
||||||
*
|
*
|
||||||
* @version $Id$
|
|
||||||
*
|
|
||||||
* @par Copyright
|
* @par Copyright
|
||||||
* Copyright 2010 Edouard DUPIN, all right reserved
|
* Copyright 2010 Edouard DUPIN, all right reserved
|
||||||
*
|
*
|
||||||
* This is free software; you can redistribute it and/or modify it under the
|
|
||||||
* terms of the GNU General Public License as published by the Free Software
|
|
||||||
* Foundation; either version 3 of the License, or (at your option) any later
|
|
||||||
* version.
|
|
||||||
*
|
|
||||||
* This software is distributed in the hope that it will be useful, but WITHOUT
|
* This software is distributed in the hope that it will be useful, but WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY.
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
*
|
||||||
* for more details.
|
* Licence : GNU Lesser General Public License (LGPL) v3.0
|
||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
@ -38,9 +31,11 @@ bool getParamModification();
|
|||||||
void needRedraw(void);
|
void needRedraw(void);
|
||||||
void nextType(void);
|
void nextType(void);
|
||||||
showType_te getType(void);
|
showType_te getType(void);
|
||||||
|
void setType(showType_te newType);
|
||||||
|
|
||||||
void nextTypeSize(void);
|
void nextTypeSize(void);
|
||||||
showTypeSize_te getTypeSize(void);
|
showTypeSize_te getTypeSize(void);
|
||||||
|
void setTypeSize(showTypeSize_te newType);
|
||||||
|
|
||||||
void displayPaddingOffset(int32_t size);
|
void displayPaddingOffset(int32_t size);
|
||||||
void displayPaddingOffsetClear(void);
|
void displayPaddingOffsetClear(void);
|
||||||
@ -55,5 +50,18 @@ int32_t GetNumberOfColomn(void);
|
|||||||
|
|
||||||
void CleanDisplay(void);
|
void CleanDisplay(void);
|
||||||
|
|
||||||
|
// if 0 ==> disable ...
|
||||||
|
int32_t getSlotSize(void);
|
||||||
|
void setSlotSize(int32_t newSize);
|
||||||
|
void setSlotDisplayMode(bool enable);
|
||||||
|
bool getSlotDisplayMode(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void setHelpDisplay(bool enable);
|
||||||
|
bool getHelpDisplay(void);
|
||||||
|
|
||||||
|
void usage(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user