Add and Fixed.

This commit is contained in:
Saturneic 2018-08-07 12:55:59 +08:00
parent d8cac27242
commit 3ce69ae8e5
8 changed files with 159 additions and 184 deletions

View File

@ -154,7 +154,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "test.c" filePath = "test.c"
timestampString = "555307651.589517" timestampString = "555310052.789754"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "64" startingLineNumber = "64"
@ -175,7 +175,7 @@
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "60" startingLineNumber = "60"
endingLineNumber = "60" endingLineNumber = "60"
landmarkName = "printTNode" landmarkName = "getValueByStringForTree"
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
@ -525,11 +525,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "test.c" filePath = "test.c"
timestampString = "555307651.590879" timestampString = "555310052.790392"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "89" startingLineNumber = "88"
endingLineNumber = "89" endingLineNumber = "88"
landmarkName = "main" landmarkName = "main"
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
@ -541,11 +541,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "test.c" filePath = "test.c"
timestampString = "555307651.5910259" timestampString = "555310052.790665"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "91" startingLineNumber = "90"
endingLineNumber = "91" endingLineNumber = "90"
landmarkName = "main" landmarkName = "main"
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
@ -557,7 +557,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "list/list_expand.c" filePath = "list/list_expand.c"
timestampString = "555307651.591181" timestampString = "555309906.510792"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "83" startingLineNumber = "83"
@ -573,11 +573,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "test.c" filePath = "test.c"
timestampString = "555307651.591266" timestampString = "555310052.790953"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "93" startingLineNumber = "92"
endingLineNumber = "93" endingLineNumber = "92"
landmarkName = "main" landmarkName = "main"
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
@ -589,7 +589,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.591457" timestampString = "555310052.791223"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "102" startingLineNumber = "102"
@ -605,7 +605,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.592109" timestampString = "555310052.791289"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "137" startingLineNumber = "137"
@ -621,7 +621,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.592618" timestampString = "555310052.791344"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "124" startingLineNumber = "124"
@ -630,22 +630,6 @@
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "test.c"
timestampString = "555307651.593114"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "97"
endingLineNumber = "97"
landmarkName = "main"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy <BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent <BreakpointContent
@ -653,13 +637,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "test.c" filePath = "test.c"
timestampString = "555307651.593201" timestampString = "555310052.7917579"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "105" startingLineNumber = "100"
endingLineNumber = "105" endingLineNumber = "100">
landmarkName = "main"
landmarkType = "9">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy <BreakpointProxy
@ -669,7 +651,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.593284" timestampString = "555310052.792031"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "189" startingLineNumber = "189"
@ -685,7 +667,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.593739" timestampString = "555310052.792091"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "118" startingLineNumber = "118"
@ -701,7 +683,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.594172" timestampString = "555310052.792145"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "203" startingLineNumber = "203"
@ -733,11 +715,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.594716" timestampString = "555310052.792217"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "238" startingLineNumber = "241"
endingLineNumber = "238" endingLineNumber = "241"
landmarkName = "dataFileReadOut" landmarkName = "dataFileReadOut"
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
@ -749,7 +731,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.595166" timestampString = "555310052.792271"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "231" startingLineNumber = "231"
@ -765,7 +747,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.595765" timestampString = "555310052.792323"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "186" startingLineNumber = "186"
@ -781,7 +763,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.596207" timestampString = "555310052.7923729"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "38" startingLineNumber = "38"
@ -797,7 +779,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.596637" timestampString = "555310052.792423"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "120" startingLineNumber = "120"
@ -813,7 +795,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.597056" timestampString = "555310052.792475"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "194" startingLineNumber = "194"
@ -829,7 +811,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.597474" timestampString = "555310052.792524"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "217" startingLineNumber = "217"
@ -861,7 +843,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.597941" timestampString = "555310052.792592"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "224" startingLineNumber = "224"
@ -877,7 +859,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.598327" timestampString = "555310052.792645"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "17" startingLineNumber = "17"
@ -893,7 +875,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.598729" timestampString = "555310052.792713"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "7" startingLineNumber = "7"
@ -909,7 +891,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.599126" timestampString = "555310052.7927589"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "43" startingLineNumber = "43"
@ -925,7 +907,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.599665" timestampString = "555310052.792803"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "170" startingLineNumber = "170"
@ -941,7 +923,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.6000921" timestampString = "555310052.7928669"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "221" startingLineNumber = "221"
@ -957,7 +939,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.600467" timestampString = "555310052.792913"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "223" startingLineNumber = "223"
@ -973,7 +955,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.600853" timestampString = "555310052.792958"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "151" startingLineNumber = "151"
@ -989,7 +971,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.601244" timestampString = "555310052.7930011"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "153" startingLineNumber = "153"
@ -1005,7 +987,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.601626" timestampString = "555310052.793045"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "226" startingLineNumber = "226"
@ -1021,7 +1003,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "list/list_expand.c" filePath = "list/list_expand.c"
timestampString = "555307651.602327" timestampString = "555309906.512913"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "103" startingLineNumber = "103"
@ -1037,13 +1019,11 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "test.c" filePath = "test.c"
timestampString = "555307651.6025029" timestampString = "555310052.793105"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "104" startingLineNumber = "99"
endingLineNumber = "104" endingLineNumber = "99">
landmarkName = "main"
landmarkType = "9">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy <BreakpointProxy
@ -1053,31 +1033,31 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.602582" timestampString = "555310052.793486"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "263" startingLineNumber = "266"
endingLineNumber = "263" endingLineNumber = "266"
landmarkName = "unknown"
landmarkType = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "communicate/communicate.c"
timestampString = "555310052.793792"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "270"
endingLineNumber = "270"
landmarkName = "releaseDFile" landmarkName = "releaseDFile"
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "test.c"
timestampString = "555307651.602928"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "98"
endingLineNumber = "98"
landmarkName = "main"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy <BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent <BreakpointContent
@ -1085,7 +1065,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "communicate/communicate.c" filePath = "communicate/communicate.c"
timestampString = "555307651.602989" timestampString = "555310052.7938451"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "267" startingLineNumber = "267"
@ -1094,22 +1074,6 @@
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "communicate/communicate.c"
timestampString = "555307651.603296"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "264"
endingLineNumber = "264"
landmarkName = "releaseDFile"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy <BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent <BreakpointContent
@ -1117,7 +1081,7 @@
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
filePath = "list/list.c" filePath = "list/list.c"
timestampString = "555307651.603591" timestampString = "555310052.793896"
startingColumnNumber = "9223372036854775807" startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807"
startingLineNumber = "508" startingLineNumber = "508"
@ -1126,21 +1090,5 @@
landmarkType = "9"> landmarkType = "9">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "test.c"
timestampString = "555307651.603639"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "100"
endingLineNumber = "100"
landmarkName = "main"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>

View File

@ -1,11 +1,12 @@
#include "communicate.h" #include "communicate.h"
STD_BLOCKS *initStandardDBlocks(SID *p_sid, unsigned long long data_size){ STD_BLOCKS *initStandardDBlocks(SID *p_sid, unsigned int type, unsigned long long data_size){
STD_BLOCKS *p_stdb = (STD_BLOCKS *)malloc(sizeof(STD_BLOCKS)); STD_BLOCKS *p_stdb = (STD_BLOCKS *)malloc(sizeof(STD_BLOCKS));
p_stdb->sid = s_idToASCIIString(p_sid); p_stdb->sid = s_idToASCIIString(p_sid);
p_stdb->if_data = 0; p_stdb->if_data = 0;
unsigned int blocks_num = (unsigned int)(data_size/sizeof(char)); unsigned int blocks_num = (unsigned int)(data_size/sizeof(char));
p_stdb->blocks_num = blocks_num; p_stdb->blocks_num = blocks_num;
p_stdb->type = type;
p_stdb->buff = (char *)malloc(sizeof(char) * blocks_num); p_stdb->buff = (char *)malloc(sizeof(char) * blocks_num);
return p_stdb; return p_stdb;
} }
@ -34,13 +35,13 @@ STD_DATA *initStandardData(unsigned int type){
p_std->pd_ctnlst = initList(); p_std->pd_ctnlst = initList();
p_std->lock = 0; p_std->lock = 0;
p_std->type = type; p_std->type = type;
p_std->s_id = getS_id(STANDARD_DATA, 2); p_std->s_id = getS_id(STANDARD_DATA, 1);
return p_std; return p_std;
} }
int standardDataAddBlock(STD_DATA *p_std, SID *p_sid ,void *data, unsigned long long data_size){ int standardDataAddBlock(STD_DATA *p_std, SID *p_sid ,unsigned int type, void *data, unsigned long long data_size){
if (p_std->lock) return -1; if (p_std->lock) return -1;
STD_BLOCKS *p_stdb = initStandardDBlocks(p_sid, data_size); STD_BLOCKS *p_stdb = initStandardDBlocks(p_sid, type,data_size);
dataForStandardDBlock(p_stdb, data); dataForStandardDBlock(p_stdb, data);
insertInTail(p_std->pd_blocklst, nodeWithPointer(p_stdb)); insertInTail(p_std->pd_blocklst, nodeWithPointer(p_stdb));
return 0; return 0;
@ -150,6 +151,7 @@ List *_doStandardDBlockWrite(unsigned int type, void *value, List *er_list){
unsigned long sid_len = strlen(p_stdb->sid)+1, blocks_num = p_stdb->blocks_num; unsigned long sid_len = strlen(p_stdb->sid)+1, blocks_num = p_stdb->blocks_num;
fwrite(&sid_len, sizeof(unsigned long), 1, fp); fwrite(&sid_len, sizeof(unsigned long), 1, fp);
fwrite(p_stdb->sid, sizeof(char), sid_len, fp); fwrite(p_stdb->sid, sizeof(char), sid_len, fp);
fwrite(&p_stdb->type, sizeof(unsigned int), 1, fp);
fwrite(&blocks_num, sizeof(unsigned long), 1, fp); fwrite(&blocks_num, sizeof(unsigned long), 1, fp);
fwrite(p_stdb->buff, sizeof(char), p_stdb->blocks_num, fp); fwrite(p_stdb->buff, sizeof(char), p_stdb->blocks_num, fp);
return p_rtnlst; return p_rtnlst;
@ -164,7 +166,7 @@ STD_DATA *listToSTD(List *p_list){
else if (p_node->type == DOUBLE) data_size = sizeof(double); else if (p_node->type == DOUBLE) data_size = sizeof(double);
else if (p_node->type == STRING) data_size = strlen((char *)p_node->value) + 1; else if (p_node->type == STRING) data_size = strlen((char *)p_node->value) + 1;
else data_size = sizeof(void *); else data_size = sizeof(void *);
standardDataAddBlock(p_std, p_node->s_id, p_node->value, data_size); standardDataAddBlock(p_std, p_node->s_id, p_node->type, p_node->value, data_size);
p_node = p_node->next; p_node = p_node->next;
} }
return p_std; return p_std;
@ -220,7 +222,9 @@ int dataFileReadOut(D_FILE *p_dfile){
char *content = (char *)malloc(sizeof(char) * blk_len); char *content = (char *)malloc(sizeof(char) * blk_len);
fread(content, sizeof(char), blk_len, p_dfile->fp); fread(content, sizeof(char), blk_len, p_dfile->fp);
SID *s_id = asciiStringToS_id(string_sid); SID *s_id = asciiStringToS_id(string_sid);
standardDataAddBlock(p_std, s_id, content, blk_len); unsigned int type = VOID;
fread(&type, sizeof(unsigned int), 1, p_dfile->fp);
standardDataAddBlock(p_std, s_id, type, content, blk_len);
freeS_id(s_id); freeS_id(s_id);
free(string_sid); free(string_sid);
free(content); free(content);
@ -230,6 +234,9 @@ int dataFileReadOut(D_FILE *p_dfile){
else break; else break;
} }
} }
else{
}
} }
showError(pushError(DATA_FILE, STANDARD, initInfo("dataFileReadOut()", "Datafile not complete."))); showError(pushError(DATA_FILE, STANDARD, initInfo("dataFileReadOut()", "Datafile not complete.")));
return -1; return -1;
@ -264,3 +271,25 @@ int releaseDFile(D_FILE *p_dfile){
free(p_dfile); free(p_dfile);
return 0; return 0;
} }
List *standardDataToList(STD_DATA *p_std){
List *p_list = initList();
List *er_list = initList();
insertInTail(er_list, nodeWithPointer(er_list));
listThrough(p_std->pd_blocklst, _doStandardDataToList, er_list);
return p_list;
}
List *_doStandardDataToList(unsigned int type, void *value, List *er_list){
List *rtn_list = initList();
insertInTail(rtn_list, nodeWithInt(0));
List *p_list = getByPointerForNode(findByIndexForNode(er_list, 0));
STD_BLOCKS *p_stdb = value;
Node *p_node = initNode();
p_node->s_id = asciiStringToS_id(p_stdb->sid);
p_node->type = p_stdb->type;
p_node->value = malloc(sizeof(p_stdb->blocks_num));
memcpy(p_node->value, p_stdb->buff, sizeof(p_stdb->blocks_num));
insertInTail(p_list, p_node);
return rtn_list;
}

View File

@ -7,55 +7,19 @@
typedef struct message{ typedef struct message{
SID *p_sid; SID *p_sid;
char titile[16]; char titile[16];
unsigned long size;
char content[0]; char content[0];
}MSG; }MSG;
typedef struct file_head{
char head_test[18];
unsigned long long data_num;
}F_HEAD;
typedef struct data_file{
FILE *fp;
F_HEAD *pf_head;
List *pf_stdlst;
}D_FILE;
typedef struct standard_data_blocks{
unsigned int type;
char *sid;
_Bool if_data;
unsigned int blocks_num;
char *buff;
}STD_BLOCKS;
typedef struct standard_data_connection{
char *f_sid;
char *s_sid;
}STD_CTN;
typedef struct standard_data_head{
unsigned long long data_blk_num;
unsigned long long data_ctn_num;
}STD_HEAD;
typedef struct standard_data{
SID *s_id;
unsigned int type;
_Bool lock;
List *pd_blocklst;
List *pd_ctnlst;
}STD_DATA;
D_FILE *initDataFileForWrite(char *route); D_FILE *initDataFileForWrite(char *route);
D_FILE *initDataFileForRead(char *route); D_FILE *initDataFileForRead(char *route);
STD_BLOCKS *initStandardDBlocks(SID *p_sid, unsigned long long data_size); STD_BLOCKS *initStandardDBlocks(SID *p_sid, unsigned int type, unsigned long long data_size);
STD_CTN *initStandardDConnection(SID *f_sid, SID *s_sid); STD_CTN *initStandardDConnection(SID *f_sid, SID *s_sid);
STD_DATA *initStandardData(unsigned int type); STD_DATA *initStandardData(unsigned int type);
int dataForStandardDBlock(STD_BLOCKS *p_stdb,void *data); int dataForStandardDBlock(STD_BLOCKS *p_stdb,void *data);
int dataFileAddStandardData(D_FILE *p_dfile, STD_DATA *p_std); int dataFileAddStandardData(D_FILE *p_dfile, STD_DATA *p_std);
int standardDataAddBlock(STD_DATA *p_std, SID *p_sid ,void *data, unsigned long long data_size); int standardDataAddBlock(STD_DATA *p_std, SID *p_sid ,unsigned int type, void *data, unsigned long long data_size);
int standardDataAddConnection(STD_DATA *p_std, SID *f_sid, SID *s_sid); int standardDataAddConnection(STD_DATA *p_std, SID *f_sid, SID *s_sid);
int dataFileWriteIn(D_FILE *p_dfile); int dataFileWriteIn(D_FILE *p_dfile);
int dataFileReadOut(D_FILE *p_dfile); int dataFileReadOut(D_FILE *p_dfile);
@ -71,7 +35,9 @@ List *_doStandardDConnectionWrite(unsigned int type, void *value, List *er_list)
List *_doStandardDBlockWrite(unsigned int type, void *value, List *er_list); List *_doStandardDBlockWrite(unsigned int type, void *value, List *er_list);
STD_DATA *listToSTD(List *); STD_DATA *listToSTD(List *);
STD_DATA *stackToSTD(Stack *); List *standardDataToList(STD_DATA *);
STD_DATA *treeToSTD(Tree *); List *_doStandardDataToList(unsigned int type, void *value, List *er_list);
//STD_DATA *stackToSTD(Stack *);
//STD_DATA *treeToSTD(Tree *);
#endif /* communicate_h */ #endif /* communicate_h */

View File

@ -93,7 +93,7 @@ Node *initNode(void) {
return NULL; return NULL;
} }
Node *prec_node = NULL; Node *prec_node = NULL;
p_node->s_id = getS_id(LIST_NODE, 2); p_node->s_id = getS_id(LIST_NODE, 1);
p_node->if_sid = 1; p_node->if_sid = 1;
p_node->if_malloc = 0; p_node->if_malloc = 0;
p_node->next = NULL; p_node->next = NULL;

View File

@ -18,7 +18,7 @@ SNode *initSNode(void) {
showError(pushError(STACK_NODE, STANDARD, initInfo("initSNode()", "Error in getting the memory of snode."))); showError(pushError(STACK_NODE, STANDARD, initInfo("initSNode()", "Error in getting the memory of snode.")));
return NULL; return NULL;
} }
p_snode->s_id = getS_id(STACK_NODE, 2); p_snode->s_id = getS_id(STACK_NODE, 1);
p_snode->if_malloc = 0; p_snode->if_malloc = 0;
p_snode->next = NULL; p_snode->next = NULL;
p_snode->value = NULL; p_snode->value = NULL;

7
test.c
View File

@ -83,9 +83,8 @@ int stack(void) {
int main(int argc, char **argv) { int main(int argc, char **argv) {
init_rand(); init_rand();
for (int j = 0; j < 65535; j++) {
List *t_list = initList(); List *t_list = initList();
for (int i = 0; i < 12; i++) { for (int i = 0; i < 100; i++) {
insertInHead(t_list, nodeWithInt(i)); insertInHead(t_list, nodeWithInt(i));
} }
STD_DATA *p_std = listToSTD(t_list); STD_DATA *p_std = listToSTD(t_list);
@ -97,9 +96,5 @@ int main(int argc, char **argv) {
dataFileReadOut(p_dfiler); dataFileReadOut(p_dfiler);
releaseDFile(p_dfiler); releaseDFile(p_dfiler);
releaseList(t_list); releaseList(t_list);
printf("%d\n",j);
usleep(2000);
}
return 0; return 0;
} }

View File

@ -40,7 +40,7 @@ TNode *initTNode(void) {
showError(pushError(TREE_NODE, STANDARD, initInfo("initTNode()", "Error in getting the memory of tnode."))); showError(pushError(TREE_NODE, STANDARD, initInfo("initTNode()", "Error in getting the memory of tnode.")));
return NULL; return NULL;
} }
p_tnode->s_id = getS_id(TREE_NODE, 2); p_tnode->s_id = getS_id(TREE_NODE, 1);
p_tnode->if_sid = 1; p_tnode->if_sid = 1;
p_tnode->child_num = 0; p_tnode->child_num = 0;
p_tnode->father = NULL; p_tnode->father = NULL;

View File

@ -6,6 +6,7 @@
#include <time.h> #include <time.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <inttypes.h>
#define VOID 0 #define VOID 0
#define INT 1 #define INT 1
@ -129,5 +130,41 @@ typedef struct tree
TNode *root; TNode *root;
}Tree; }Tree;
typedef struct file_head{
char head_test[18];
unsigned long long data_num;
}F_HEAD;
typedef struct data_file{
FILE *fp;
F_HEAD *pf_head;
List *pf_stdlst;
}D_FILE;
typedef struct standard_data_blocks{
unsigned int type;
char *sid;
_Bool if_data;
unsigned int blocks_num;
char *buff;
}STD_BLOCKS;
typedef struct standard_data_connection{
char *f_sid;
char *s_sid;
}STD_CTN;
typedef struct standard_data_head{
unsigned long long data_blk_num;
unsigned long long data_ctn_num;
}STD_HEAD;
typedef struct standard_data{
SID *s_id;
unsigned int type;
_Bool lock;
List *pd_blocklst;
List *pd_ctnlst;
}STD_DATA;
#endif /* type_h */ #endif /* type_h */