diff options
-rw-r--r-- | engine.html | 18 | ||||
-rw-r--r-- | src/ini_read.c | 254 | ||||
-rw-r--r-- | src/inirw_internal.h | 34 | ||||
-rw-r--r-- | src/lightconfini.h | 72 | ||||
-rw-r--r-- | src/main.c | 45 | ||||
-rw-r--r-- | tests/bom.ini | 2 | ||||
-rw-r--r-- | tests/test.ini | 3 |
7 files changed, 291 insertions, 137 deletions
diff --git a/engine.html b/engine.html new file mode 100644 index 0000000..095071f --- /dev/null +++ b/engine.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> + +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Welcome file</title> + <link rel="stylesheet" href="https://stackedit.io/style.css" /> +</head> + +<body class="stackedit"> + <div class="stackedit__html"><h2 id="engine-is-using-a-finite-state-machine">Engine is using a Finite State Machine</h2> +<p>(markdown graph)</p> +<div class="mermaid"><svg xmlns="http://www.w3.org/2000/svg" id="mermaid-svg-sKSVEjl1fpiwRQcW" width="100%" style="max-width: 2354.3999786376953px;" viewBox="0 0 2354.3999786376953 1346.191520690918"><g transform="translate(-1.5, -12)"><g class="output"><g class="clusters"></g><g class="edgePaths"><g class="edgePath" style="opacity: 1;"><path class="path" d="M49.95486872662998,732.2040901184082L145.09166717529297,33.35832977294922L258.9583282470703,33.35832977294922L374.7583236694336,33.35832977294922L475.7083206176758,33.35832977294922L591.7416534423828,33.35832977294922L722.8583221435547,33.35832977294922L851.5499877929688,33.35832977294922L977.816650390625,33.35832977294922L1136.5833129882812,33.35832977294922L1293.2666473388672,33.35832977294922L1449.9499816894531,33.35832977294922L1608.7166442871094,33.35832977294922L1734.9833068847656,33.35832977294922L1859.6416397094727,33.35832977294922L1952.5999755859375,33.35832977294922L2070.8989491778384,559.5916061401367" marker-end="url(#arrowhead8087)" style="fill:none"></path><defs><marker id="arrowhead8087" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M50.108858291236785,732.2040901184082L145.09166717529297,66.71665954589844L258.9583282470703,66.71665954589844L374.7583236694336,66.71665954589844L475.7083206176758,66.71665954589844L591.7416534423828,66.71665954589844L722.8583221435547,66.71665954589844L851.5499877929688,66.71665954589844L977.816650390625,66.71665954589844L1136.5833129882812,66.71665954589844L1293.2666473388672,66.71665954589844L1449.9499816894531,66.71665954589844L1608.7166442871094,66.71665954589844L1734.9833068847656,66.71665954589844L1853.2702949051672,500.3749465942383" marker-end="url(#arrowhead8088)" style="fill:none"></path><defs><marker id="arrowhead8088" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M50.54206759179309,732.2040901184082L145.09166717529297,145.93331909179688L206.13333129882812,145.93331909179688" marker-end="url(#arrowhead8089)" style="fill:none"></path><defs><marker id="arrowhead8089" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M35.525889482747885,778.9207496643066L20,811.1596361796061L20,819.219357808431L46.775001525878906,827.2790794372559L73.55000305175781,819.219357808431L73.55000305175781,811.1596361796061L58.02411356900993,778.9207496643066" marker-end="url(#arrowhead8090)" style="fill:none"></path><defs><marker id="arrowhead8090" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M51.23811443699182,778.9207496643066L145.09166717529297,1270.1165313720703L258.9583282470703,1270.1165313720703L374.7583236694336,1270.1165313720703L475.7083206176758,1270.1165313720703L591.7416534423828,1270.1165313720703L722.8583221435547,1270.1165313720703L851.5499877929688,1270.1165313720703L977.816650390625,1270.1165313720703L1136.5833129882812,1270.1165313720703L1286.0011733958306,789.741584777832" marker-end="url(#arrowhead8091)" style="fill:none"></path><defs><marker id="arrowhead8091" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M50.96638855326821,778.9207496643066L145.09166717529297,1303.4748611450195L258.9583282470703,1303.4748611450195L374.7583236694336,1303.4748611450195L463.36076198828715,1135.862377166748" marker-end="url(#arrowhead8092)" style="fill:none"></path><defs><marker id="arrowhead8092" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M50.725850618737674,778.9207496643066L145.09166717529297,1336.8331909179688L258.9583282470703,1336.8331909179688L374.7583236694336,1336.8331909179688L475.7083206176758,1336.8331909179688L591.7416534423828,1336.8331909179688L722.8583221435547,1336.8331909179688L851.5499877929688,1336.8331909179688L977.816650390625,1336.8331909179688L1136.5833129882812,1336.8331909179688L1293.2666473388672,1336.8331909179688L1449.9499816894531,1336.8331909179688L1608.7166442871094,1336.8331909179688L1734.9833068847656,1336.8331909179688L1859.6416397094727,1336.8331909179688L1952.5999755859375,1336.8331909179688L2076.1499786376953,1336.8331909179688L2215.8416442871094,1336.8331909179688L2307.59642828546,839.7790794372559" marker-end="url(#arrowhead8093)" style="fill:none"></path><defs><marker id="arrowhead8093" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1840.9596418482954,547.0916061401367L1815.1749725341797,579.3304926554363L1815.1749725341797,587.390214284261L1859.6416397094727,595.4499359130859L1904.1083068847656,587.390214284261L1904.1083068847656,579.3304926554363L1878.32363757065,547.0916061401367" marker-end="url(#arrowhead8094)" style="fill:none"></path><defs><marker id="arrowhead8094" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1904.1083068847656,523.7332763671875L1952.5999755859375,523.7332763671875L2050.1249771118164,570.4763331856635" marker-end="url(#arrowhead8095)" style="fill:none"></path><defs><marker id="arrowhead8095" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M311.7833251953125,125.01392163006174L374.7583236694336,100.07498931884766L475.7083206176758,100.07498931884766L591.7416534423828,100.07498931884766L722.8583221435547,100.07498931884766L851.5499877929688,100.07498931884766L977.816650390625,100.07498931884766L1136.5833129882812,100.07498931884766L1293.2666473388672,100.07498931884766L1449.9499816894531,100.07498931884766L1608.7166442871094,100.07498931884766L1734.9833068847656,100.07498931884766L1859.6416397094727,100.07498931884766L1952.5999755859375,100.07498931884766L2070.173438054908,559.5916061401367" marker-end="url(#arrowhead8096)" style="fill:none"></path><defs><marker id="arrowhead8096" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M311.7833251953125,140.23113871221537L374.7583236694336,133.43331909179688L475.7083206176758,133.43331909179688L591.7416534423828,133.43331909179688L722.8583221435547,133.43331909179688L851.5499877929688,133.43331909179688L977.816650390625,133.43331909179688L1136.5833129882812,133.43331909179688L1293.2666473388672,133.43331909179688L1449.9499816894531,133.43331909179688L1608.7166442871094,133.43331909179688L1734.9833068847656,133.43331909179688L1852.181197060715,500.3749465942383" marker-end="url(#arrowhead8097)" style="fill:none"></path><defs><marker id="arrowhead8097" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M311.7833251953125,155.448355794369L374.7583236694336,166.7916488647461L475.7083206176758,166.7916488647461L591.7416534423828,166.7916488647461L722.8583221435547,166.7916488647461L851.5499877929688,166.7916488647461L977.816650390625,166.7916488647461L1136.5833129882812,166.7916488647461L1287.1627243416015,743.0249252319336" marker-end="url(#arrowhead8098)" style="fill:none"></path><defs><marker id="arrowhead8098" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M308.8487955579838,169.2916488647461L374.7583236694336,200.1499786376953L473.1237721402298,1089.1457176208496" marker-end="url(#arrowhead8099)" style="fill:none"></path><defs><marker id="arrowhead8099" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M289.8449375612142,169.2916488647461L374.7583236694336,233.50830841064453L475.7083206176758,233.50830841064453L591.7416534423828,233.50830841064453L722.8583221435547,233.50830841064453L851.5499877929688,233.50830841064453L977.816650390625,233.50830841064453L1136.5833129882812,233.50830841064453L1293.2666473388672,233.50830841064453L1449.9499816894531,233.50830841064453L1608.7166442871094,233.50830841064453L1734.9833068847656,233.50830841064453L1859.6416397094727,233.50830841064453L1952.5999755859375,233.50830841064453L2076.1499786376953,233.50830841064453L2215.8416442871094,233.50830841064453L2308.058749183281,793.0624198913574" marker-end="url(#arrowhead8100)" style="fill:none"></path><defs><marker id="arrowhead8100" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1328.6999816894531,745.8359926510122L1449.9499816894531,675.5249252319336L1567.4916458129883,675.5249252319336" marker-end="url(#arrowhead8101)" style="fill:none"></path><defs><marker id="arrowhead8101" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1287.0638224796073,789.741584777832L1257.8333129882812,899.8165740966797L1257.8333129882812,927.3353214263916L1293.2666473388672,954.8540687561035L1328.6999816894531,927.3353214263916L1328.6999816894531,899.8165740966797L1299.469472198127,789.741584777832" marker-end="url(#arrowhead8102)" style="fill:none"></path><defs><marker id="arrowhead8102" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1316.4817535210075,789.741584777832L1449.9499816894531,924.0332336425781L1608.7166442871094,924.0332336425781L1734.9833068847656,924.0332336425781L1859.6416397094727,924.0332336425781L1952.5999755859375,924.0332336425781L2076.1499786376953,924.0332336425781L2215.8416442871094,924.0332336425781L2291.056111627638,839.7790794372559" marker-end="url(#arrowhead8103)" style="fill:none"></path><defs><marker id="arrowhead8103" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1649.9416427612305,664.633712415364L1734.9833068847656,642.1665954589844L1859.6416397094727,642.1665954589844L1952.5999755859375,642.1665954589844L2050.1249771118164,595.4235386405084" marker-end="url(#arrowhead8104)" style="fill:none"></path><defs><marker id="arrowhead8104" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1591.3965845154949,698.8832550048828L1567.4916458129883,731.1221415201823L1567.4916458129883,739.1818631490072L1608.7166442871094,747.241584777832L1649.9416427612305,739.1818631490072L1649.9416427612305,731.1221415201823L1626.036704058724,698.8832550048828" marker-end="url(#arrowhead8105)" style="fill:none"></path><defs><marker id="arrowhead8105" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1649.9416427612305,675.5249252319336L1734.9833068847656,675.5249252319336L1840.4586973747455,547.0916061401367" marker-end="url(#arrowhead8106)" style="fill:none"></path><defs><marker id="arrowhead8106" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1648.4567560400744,698.8832550048828L1734.9833068847656,749.741584777832L1859.6416397094727,749.741584777832L1952.5999755859375,749.741584777832L2076.1499786376953,749.741584777832L2215.8416442871094,749.741584777832L2278.2552661372024,793.0624198913574" marker-end="url(#arrowhead8107)" style="fill:none"></path><defs><marker id="arrowhead8107" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M479.01105191210013,1089.1457176208496L591.7416534423828,291.86663818359375L722.8583221435547,291.86663818359375L851.5499877929688,291.86663818359375L956.7665750472805,408.620792388916" marker-end="url(#arrowhead8108)" style="fill:none"></path><defs><marker id="arrowhead8108" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M467.9322752799974,1135.862377166748L449.2416534423828,1192.0068168640137L449.2416534423828,1206.04292678833L475.7083206176758,1220.0790367126465L502.17498779296875,1206.04292678833L502.17498779296875,1192.0068168640137L483.4843659553542,1135.862377166748" marker-end="url(#arrowhead8109)" style="fill:none"></path><defs><marker id="arrowhead8109" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M502.17498779296875,1116.8787263019472L591.7416534423828,1131.6832122802734L679.5416564941406,1131.6832122802734" marker-end="url(#arrowhead8110)" style="fill:none"></path><defs><marker id="arrowhead8110" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M497.5212319855742,1135.862377166748L591.7416534423828,1236.758201599121L722.8583221435547,1236.758201599121L851.5499877929688,1236.758201599121L977.816650390625,1236.758201599121L1136.5833129882812,1236.758201599121L1293.2666473388672,1236.758201599121L1449.9499816894531,1236.758201599121L1608.7166442871094,1236.758201599121L1734.9833068847656,1236.758201599121L1859.6416397094727,1236.758201599121L1952.5999755859375,1236.758201599121L2076.1499786376953,1236.758201599121L2215.8416442871094,1236.758201599121L2306.5698447436225,839.7790794372559" marker-end="url(#arrowhead8111)" style="fill:none"></path><defs><marker id="arrowhead8111" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M747.5476018226684,1108.3248825073242L851.5499877929688,1009.9290580749512L972.713477674417,455.33745193481445" marker-end="url(#arrowhead8112)" style="fill:none"></path><defs><marker id="arrowhead8112" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M704.6594800350254,1155.0415420532227L679.5416564941406,1187.2804285685222L679.5416564941406,1195.340150197347L722.8583221435547,1203.3998718261719L766.1749877929688,1195.340150197347L766.1749877929688,1187.2804285685222L741.057164252084,1155.0415420532227" marker-end="url(#arrowhead8113)" style="fill:none"></path><defs><marker id="arrowhead8113" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M766.1749877929688,1143.7528616525392L851.5499877929688,1167.5415420532227L977.816650390625,1167.5415420532227L1136.5833129882812,1167.5415420532227L1293.2666473388672,1167.5415420532227L1449.9499816894531,1167.5415420532227L1608.7166442871094,1167.5415420532227L1734.9833068847656,1167.5415420532227L1859.6416397094727,1167.5415420532227L1952.5999755859375,1167.5415420532227L2076.1499786376953,1167.5415420532227L2215.8416442871094,1167.5415420532227L2305.5174697895773,839.7790794372559" marker-end="url(#arrowhead8114)" style="fill:none"></path><defs><marker id="arrowhead8114" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1000.2772419373832,408.620792388916L1136.5833129882812,266.86663818359375L1293.2666473388672,266.86663818359375L1449.9499816894531,266.86663818359375L1608.7166442871094,266.86663818359375L1734.9833068847656,266.86663818359375L1859.6416397094727,266.86663818359375L1952.5999755859375,266.86663818359375L2067.0197217229447,559.5916061401367" marker-end="url(#arrowhead8115)" style="fill:none"></path><defs><marker id="arrowhead8115" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1005.9639531020624,408.620792388916L1136.5833129882812,300.22496795654297L1293.2666473388672,300.22496795654297L1449.9499816894531,300.22496795654297L1608.7166442871094,300.22496795654297L1734.9833068847656,300.22496795654297L1846.6138893418406,500.3749465942383" marker-end="url(#arrowhead8116)" style="fill:none"></path><defs><marker id="arrowhead8116" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1021.5416488647461,429.46146820234554L1136.5833129882812,422.83745193481445L1244.7166442871094,422.83745193481445" marker-end="url(#arrowhead8117)" style="fill:none"></path><defs><marker id="arrowhead8117" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M975.4402058667241,455.33745193481445L934.0916519165039,861.7568524678547L934.0916519165039,963.361702601115L977.816650390625,1064.966552734375L1021.5416488647461,963.361702601115L1021.5416488647461,861.7568524678547L980.1930949145259,455.33745193481445" marker-end="url(#arrowhead8118)" style="fill:none"></path><defs><marker id="arrowhead8118" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M984.053744933518,455.33745193481445L1136.5833129882812,1026.570728302002L1264.6749801635742,1026.570728302002" marker-end="url(#arrowhead8119)" style="fill:none"></path><defs><marker id="arrowhead8119" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M983.0979127958059,455.33745193481445L1136.5833129882812,1134.1832122802734L1293.2666473388672,1134.1832122802734L1449.9499816894531,1134.1832122802734L1608.7166442871094,1134.1832122802734L1734.9833068847656,1134.1832122802734L1859.6416397094727,1134.1832122802734L1952.5999755859375,1134.1832122802734L2076.1499786376953,1134.1832122802734L2215.8416442871094,1134.1832122802734L2304.84656690384,839.7790794372559" marker-end="url(#arrowhead8120)" style="fill:none"></path><defs><marker id="arrowhead8120" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1321.8583145141602,1013.9468735308682L1449.9499816894531,957.3915634155273L1608.7166442871094,957.3915634155273L1734.9833068847656,957.3915634155273L1859.6416397094727,957.3915634155273L1952.5999755859375,957.3915634155273L2068.4427113288193,606.3082656860352" marker-end="url(#arrowhead8121)" style="fill:none"></path><defs><marker id="arrowhead8121" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1321.8583145141602,1020.0341212036661L1449.9499816894531,990.7498931884766L1608.7166442871094,990.7498931884766L1734.9833068847656,990.7498931884766L1853.4067214170902,547.0916061401367" marker-end="url(#arrowhead8122)" style="fill:none"></path><defs><marker id="arrowhead8122" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1281.6089993328799,1049.9290580749512L1264.6749801635742,1083.8596076965332L1264.6749801635742,1092.3422451019287L1293.2666473388672,1100.8248825073242L1321.8583145141602,1092.3422451019287L1321.8583145141602,1083.8596076965332L1304.9242953448545,1049.9290580749512" marker-end="url(#arrowhead8123)" style="fill:none"></path><defs><marker id="arrowhead8123" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1321.8583145141602,1030.5335971321108L1449.9499816894531,1048.2873878479004L1592.5454590425452,842.3165740966797" marker-end="url(#arrowhead8124)" style="fill:none"></path><defs><marker id="arrowhead8124" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1321.8583145141602,1036.620844804909L1449.9499816894531,1081.6457176208496L1608.7166442871094,1081.6457176208496L1734.9833068847656,1081.6457176208496L1859.6416397094727,1081.6457176208496L1952.5999755859375,1081.6457176208496L2076.1499786376953,1081.6457176208496L2215.8416442871094,1081.6457176208496L2303.4477307017873,839.7790794372559" marker-end="url(#arrowhead8125)" style="fill:none"></path><defs><marker id="arrowhead8125" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1589.1999740600586,413.74861420291495L1449.9499816894531,557.0916061401367L1320.5273381930886,446.1957817077637" marker-end="url(#arrowhead8126)" style="fill:none"></path><defs><marker id="arrowhead8126" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1654.1583099365234,806.0533159858286L1734.9833068847656,783.0999145507812L1859.6416397094727,783.0999145507812L1952.5999755859375,783.0999145507812L2061.731182620955,606.3082656860352" marker-end="url(#arrowhead8127)" style="fill:none"></path><defs><marker id="arrowhead8127" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1654.1583099365234,818.9582443237305L1734.9833068847656,818.9582443237305L1849.7786173939137,547.0916061401367" marker-end="url(#arrowhead8128)" style="fill:none"></path><defs><marker id="arrowhead8128" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1589.625015559369,842.3165740966797L1563.2749786376953,874.5554606119791L1563.2749786376953,882.6151822408041L1608.7166442871094,890.6749038696289L1654.1583099365234,882.6151822408041L1654.1583099365234,874.5554606119791L1627.8082730148496,842.3165740966797" marker-end="url(#arrowhead8129)" style="fill:none"></path><defs><marker id="arrowhead8129" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1654.1583099365234,837.8657787216162L1734.9833068847656,871.4957389831543L1859.6416397094727,871.4957389831543L1952.5999755859375,871.4957389831543L2076.1499786376953,871.4957389831543L2215.8416442871094,871.4957389831543L2275.9166412353516,837.0547620543956" marker-end="url(#arrowhead8130)" style="fill:none"></path><defs><marker id="arrowhead8130" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1341.4888126695485,399.47912216186523L1449.9499816894531,346.9416275024414L1600.859878381534,795.5999145507812" marker-end="url(#arrowhead8131)" style="fill:none"></path><defs><marker id="arrowhead8131" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1341.816650390625,413.7959763359082L1449.9499816894531,393.65828704833984L1589.1999740600586,393.65828704833984" marker-end="url(#arrowhead8132)" style="fill:none"></path><defs><marker id="arrowhead8132" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1341.816650390625,431.8789275337207L1449.9499816894531,452.01661682128906L1608.7166442871094,452.01661682128906L1734.9833068847656,452.01661682128906L1859.6416397094727,452.01661682128906L1952.5999755859375,452.01661682128906L2076.1499786376953,452.01661682128906L2215.8416442871094,452.01661682128906L2305.750430115239,793.0624198913574" marker-end="url(#arrowhead8133)" style="fill:none"></path><defs><marker id="arrowhead8133" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M1282.1203084005456,446.1957817077637L1244.7166442871094,524.5791079203289L1244.7166442871094,544.17493947347L1293.2666473388672,563.7707710266113L1341.816650390625,544.17493947347L1341.816650390625,524.5791079203289L1304.4129862771888,446.1957817077637" marker-end="url(#arrowhead8134)" style="fill:none"></path><defs><marker id="arrowhead8134" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M2295.395978775507,793.0624198913574L2215.8416442871094,680.5249252319336L2102.174980163574,601.1284667087868" marker-end="url(#arrowhead8135)" style="fill:none"></path><defs><marker id="arrowhead8135" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M2069.86622670281,606.3082656860352L2050.1249771118164,679.6915918986002L2050.1249771118164,698.0374234517416L2076.1499786376953,716.3832550048828L2102.174980163574,698.0374234517416L2102.174980163574,679.6915918986002L2082.4337305725808,606.3082656860352" marker-end="url(#arrowhead8136)" style="fill:none"></path><defs><marker id="arrowhead8136" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g><g class="edgePath" style="opacity: 1;"><path class="path" d="M2102.174980163574,568.3445445249162L2215.8416442871094,504.5541114807129L2304.713064977024,793.0624198913574" marker-end="url(#arrowhead8137)" style="fill:none"></path><defs><marker id="arrowhead8137" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowheadPath" style="stroke-width: 1px; stroke-dasharray: 1px, 0px;"></path></marker></defs></g></g><g class="edgeLabels"><g class="edgeLabel" style="opacity: 1;" transform="translate(977.816650390625,33.35832977294922)"><g transform="translate(-16.425003051757812,-13.358329772949219)" class="label"><foreignObject width="32.850006103515625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\n,\r</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(851.5499877929688,66.71665954589844)"><g transform="translate(-50.633331298828125,-13.358329772949219)" class="label"><foreignObject width="101.26666259765625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">comment_sign</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(145.09166717529297,145.93331909179688)"><g transform="translate(-36.041664123535156,-13.358329772949219)" class="label"><foreignObject width="72.08332824707031" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_space</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(46.775001525878906,827.2790794372559)"><g transform="translate(-37.275001525878906,-13.358329772949219)" class="label"><foreignObject width="74.55000305175781" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">utf8_BOM</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(591.7416534423828,1270.1165313720703)"><g transform="translate(-53.05833435058594,-13.358329772949219)" class="label"><foreignObject width="106.11666870117188" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">square_bracket</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(258.9583282470703,1303.4748611450195)"><g transform="translate(-37.974998474121094,-13.358329772949219)" class="label"><foreignObject width="75.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">alpha_num</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1136.5833129882812,1336.8331909179688)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1859.6416397094727,595.4499359130859)"><g transform="translate(-49.025001525878906,-13.358329772949219)" class="label"><foreignObject width="98.05000305175781" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_character</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1952.5999755859375,523.7332763671875)"><g transform="translate(-18.474998474121094,-13.358329772949219)" class="label"><foreignObject width="36.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\n, \r</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1136.5833129882812,100.07498931884766)"><g transform="translate(-18.474998474121094,-13.358329772949219)" class="label"><foreignObject width="36.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\n, \r</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(977.816650390625,133.43331909179688)"><g transform="translate(-50.633331298828125,-13.358329772949219)" class="label"><foreignObject width="101.26666259765625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">comment_sign</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(722.8583221435547,166.7916488647461)"><g transform="translate(-53.05833435058594,-13.358329772949219)" class="label"><foreignObject width="106.11666870117188" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">square_bracket</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(374.7583236694336,200.1499786376953)"><g transform="translate(-37.974998474121094,-13.358329772949219)" class="label"><foreignObject width="75.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">alpha_num</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1293.2666473388672,233.50830841064453)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1449.9499816894531,675.5249252319336)"><g transform="translate(-53.05833435058594,-13.358329772949219)" class="label"><foreignObject width="106.11666870117188" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">square_bracket</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1293.2666473388672,954.8540687561035)"><g transform="translate(-37.974998474121094,-13.358329772949219)" class="label"><foreignObject width="75.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">alpha_num</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1859.6416397094727,924.0332336425781)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1859.6416397094727,642.1665954589844)"><g transform="translate(-18.474998474121094,-13.358329772949219)" class="label"><foreignObject width="36.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\n, \r</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1608.7166442871094,747.241584777832)"><g transform="translate(-36.041664123535156,-13.358329772949219)" class="label"><foreignObject width="72.08332824707031" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_space</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1734.9833068847656,675.5249252319336)"><g transform="translate(-50.633331298828125,-13.358329772949219)" class="label"><foreignObject width="101.26666259765625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">comment_sign</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1952.5999755859375,749.741584777832)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(722.8583221435547,291.86663818359375)"><g transform="translate(-36.71666717529297,-13.358329772949219)" class="label"><foreignObject width="73.43333435058594" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">equal_sign</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(475.7083206176758,1220.0790367126465)"><g transform="translate(-37.974998474121094,-13.358329772949219)" class="label"><foreignObject width="75.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">alpha_num</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(591.7416534423828,1131.6832122802734)"><g transform="translate(-36.041664123535156,-13.358329772949219)" class="label"><foreignObject width="72.08332824707031" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_space</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1449.9499816894531,1236.758201599121)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(851.5499877929688,1009.9290580749512)"><g transform="translate(-36.71666717529297,-13.358329772949219)" class="label"><foreignObject width="73.43333435058594" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">equal_sign</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(722.8583221435547,1203.3998718261719)"><g transform="translate(-36.041664123535156,-13.358329772949219)" class="label"><foreignObject width="72.08332824707031" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_space</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1608.7166442871094,1167.5415420532227)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1608.7166442871094,266.86663818359375)"><g transform="translate(-18.474998474121094,-13.358329772949219)" class="label"><foreignObject width="36.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\n, \r</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1449.9499816894531,300.22496795654297)"><g transform="translate(-50.633331298828125,-13.358329772949219)" class="label"><foreignObject width="101.26666259765625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">comment_sign</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1136.5833129882812,422.83745193481445)"><g transform="translate(-83.13333129882812,-13.358329772949219)" class="label"><foreignObject width="166.26666259765625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">double_quotation_mark</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(977.816650390625,1064.966552734375)"><g transform="translate(-36.041664123535156,-13.358329772949219)" class="label"><foreignObject width="72.08332824707031" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_space</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1136.5833129882812,1026.570728302002)"><g transform="translate(-37.974998474121094,-13.358329772949219)" class="label"><foreignObject width="75.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">alpha_num</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1734.9833068847656,1134.1832122802734)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1734.9833068847656,957.3915634155273)"><g transform="translate(-18.474998474121094,-13.358329772949219)" class="label"><foreignObject width="36.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\n, \r</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1608.7166442871094,990.7498931884766)"><g transform="translate(-50.633331298828125,-13.358329772949219)" class="label"><foreignObject width="101.26666259765625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">comment_sign</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1293.2666473388672,1100.8248825073242)"><g transform="translate(-37.974998474121094,-13.358329772949219)" class="label"><foreignObject width="75.94999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">alpha_num</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1449.9499816894531,1048.2873878479004)"><g transform="translate(-36.041664123535156,-13.358329772949219)" class="label"><foreignObject width="72.08332824707031" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_space</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1859.6416397094727,1081.6457176208496)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1449.9499816894531,557.0916061401367)"><g transform="translate(-63.32499694824219,-13.358329772949219)" class="label"><foreignObject width="126.64999389648438" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">prev==quoted_val</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1859.6416397094727,783.0999145507812)"><g transform="translate(-16.65833282470703,-13.358329772949219)" class="label"><foreignObject width="33.31666564941406" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\n \r</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1734.9833068847656,818.9582443237305)"><g transform="translate(-50.633331298828125,-13.358329772949219)" class="label"><foreignObject width="101.26666259765625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">comment_sign</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1608.7166442871094,890.6749038696289)"><g transform="translate(-36.041664123535156,-13.358329772949219)" class="label"><foreignObject width="72.08332824707031" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_space</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1952.5999755859375,871.4957389831543)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1449.9499816894531,346.9416275024414)"><g transform="translate(-83.13333129882812,-13.358329772949219)" class="label"><foreignObject width="166.26666259765625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">double_quotation_mark</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1449.9499816894531,393.65828704833984)"><g transform="translate(-33.60832977294922,-13.358329772949219)" class="label"><foreignObject width="67.21665954589844" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">backslash</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1859.6416397094727,452.01661682128906)"><g transform="translate(-26.800003051757812,-13.358329772949219)" class="label"><foreignObject width="53.600006103515625" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\r \n \0</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(1293.2666473388672,563.7707710266113)"><g transform="translate(-35.07499694824219,-13.358329772949219)" class="label"><foreignObject width="70.14999389648438" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(2215.8416442871094,680.5249252319336)"><g transform="translate(-35.07499694824219,-13.358329772949219)" class="label"><foreignObject width="70.14999389648438" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">any_other</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(2076.1499786376953,716.3832550048828)"><g transform="translate(-79.61666870117188,-13.358329772949219)" class="label"><foreignObject width="159.23333740234375" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">\n \r \0 prev==ERROR</span></div></foreignObject></g></g><g class="edgeLabel" style="opacity: 1;" transform="translate(2215.8416442871094,504.5541114807129)"><g transform="translate(-18.933334350585938,-13.358329772949219)" class="label"><foreignObject width="37.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;"><span class="edgeLabel">other</span></div></foreignObject></g></g></g><g class="nodes"><g class="node" style="opacity: 1;" id="A" transform="translate(46.775001525878906,755.5624198913574)"><rect rx="0" ry="0" x="-26.775001525878906" y="-23.35832977294922" width="53.55000305175781" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-16.775001525878906,-13.358329772949219)"><foreignObject width="33.55000305175781" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Start</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="ST" transform="translate(2076.1499786376953,582.9499359130859)"><rect rx="0" ry="0" x="-26.025001525878906" y="-23.35832977294922" width="52.05000305175781" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-16.025001525878906,-13.358329772949219)"><foreignObject width="32.05000305175781" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Stop</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="C" transform="translate(1859.6416397094727,523.7332763671875)"><rect rx="0" ry="0" x="-44.46666717529297" y="-23.35832977294922" width="88.93333435058594" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-34.46666717529297,-13.358329772949219)"><foreignObject width="68.93333435058594" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">Comment</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="SP" transform="translate(258.9583282470703,145.93331909179688)"><rect rx="0" ry="0" x="-52.82499694824219" y="-23.35832977294922" width="105.64999389648438" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-42.82499694824219,-13.358329772949219)"><foreignObject width="85.64999389648438" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">begin_space</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="S" transform="translate(1293.2666473388672,766.3832550048828)"><rect rx="0" ry="0" x="-35.43333435058594" y="-23.35832977294922" width="70.86666870117188" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-25.433334350585938,-13.358329772949219)"><foreignObject width="50.866668701171875" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">section</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="P" transform="translate(475.7083206176758,1112.5040473937988)"><rect rx="0" ry="0" x="-26.46666717529297" y="-23.35832977294922" width="52.93333435058594" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-16.46666717529297,-13.358329772949219)"><foreignObject width="32.93333435058594" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">label</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="E" transform="translate(2311.9083099365234,816.4207496643066)"><rect rx="0" ry="0" x="-35.991668701171875" y="-23.35832977294922" width="71.98333740234375" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-25.991668701171875,-13.358329772949219)"><foreignObject width="51.98333740234375" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">ERROR</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="SE" transform="translate(1608.7166442871094,675.5249252319336)"><rect rx="0" ry="0" x="-41.224998474121094" y="-23.35832977294922" width="82.44999694824219" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-31.224998474121094,-13.358329772949219)"><foreignObject width="62.44999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">sect_end</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="VP" transform="translate(977.816650390625,431.97912216186523)"><rect rx="0" ry="0" x="-43.724998474121094" y="-23.35832977294922" width="87.44999694824219" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-33.724998474121094,-13.358329772949219)"><foreignObject width="67.44999694824219" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">value_pre</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="P2" transform="translate(722.8583221435547,1131.6832122802734)"><rect rx="0" ry="0" x="-43.31666564941406" y="-23.35832977294922" width="86.63333129882812" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-33.31666564941406,-13.358329772949219)"><foreignObject width="66.63333129882812" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">label_end</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="DQ" transform="translate(1293.2666473388672,422.83745193481445)"><rect rx="0" ry="0" x="-48.55000305175781" y="-23.35832977294922" width="97.10000610351562" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-38.55000305175781,-13.358329772949219)"><foreignObject width="77.10000610351562" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">quoted_val</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="VC" transform="translate(1293.2666473388672,1026.570728302002)"><rect rx="0" ry="0" x="-28.59166717529297" y="-23.35832977294922" width="57.18333435058594" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-18.59166717529297,-13.358329772949219)"><foreignObject width="37.18333435058594" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">value</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="VV" transform="translate(1608.7166442871094,818.9582443237305)"><rect rx="0" ry="0" x="-45.44166564941406" y="-23.35832977294922" width="90.88333129882812" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-35.44166564941406,-13.358329772949219)"><foreignObject width="70.88333129882812" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">value_end</div></foreignObject></g></g></g><g class="node" style="opacity: 1;" id="BS" transform="translate(1608.7166442871094,393.65828704833984)"><rect rx="0" ry="0" x="-19.51667022705078" y="-23.35832977294922" width="39.03334045410156" height="46.71665954589844"></rect><g class="label" transform="translate(0,0)"><g transform="translate(-9.516670227050781,-13.358329772949219)"><foreignObject width="19.033340454101562" height="26.716659545898438"><div xmlns="http://www.w3.org/1999/xhtml" style="display: inline-block; white-space: nowrap;">BS</div></foreignObject></g></g></g></g></g></g></svg></div> +</div> +</body> + +</html> diff --git a/src/ini_read.c b/src/ini_read.c index bbfb68e..9ac834c 100644 --- a/src/ini_read.c +++ b/src/ini_read.c @@ -9,8 +9,13 @@ #define ini_read_c #include "inirw_internal.h" +#include "lightconfini.h" +/* +extern void (mylciniReadOutFunct)(int line, int linelen, char *section, int sectionlen, char *param, int paramlen, char *value, int valuelen, char *comment, int commentlen, char *error, int errorlen ); +*/ + size_t strNullLen(const char *str){ if(str == NULL){ @@ -20,7 +25,7 @@ size_t strNullLen(const char *str){ } } -char *strResize(char *ptr, size_t oldsize, size_t newsize){ +char *lciniStrResize(char *ptr, size_t oldsize, size_t newsize){ char *tmp; if(newsize <= 0){ /* deleting */ @@ -29,25 +34,18 @@ char *strResize(char *ptr, size_t oldsize, size_t newsize){ } else if(newsize != oldsize){ /* If any changes needed */ tmp = (char *) malloc(newsize*sizeof(char)); - memset(tmp, 0, newsize); + memset(tmp, 0, newsize*sizeof(char)); if(tmp == NULL){ /* String is not changed at malloc error */ return ptr; } else if(ptr == NULL) { return tmp; - /*} else if(newsize > oldsize) { //FEL - strncpy(tmp, ptr, oldsize); // old < new - //snprintf(tmp, newsize, "%s", ptr); - free(ptr); - return tmp; - */ - } else /*if(newsize < oldsize)*/ { + + } else { strncpy(tmp, ptr, newsize); /* c89 */ /*snprintf(tmp, newsize, "%s", ptr);*/ /* c99 */ free(ptr); return tmp; - } /*else { //Ide sosem jutunk - return ptr; - }*/ + } } else { return ptr; } @@ -92,10 +90,6 @@ int eescape(int c){ return 't'; } else if(c == '\v'){ /* Vertical tab */ return 'v'; - /*} else if(c == '\''){ //Apostrophe debug - // return '\''; - //} else if(c == '"'){ //Double quotation mark debug - // return '\"'; */ /*} else if(c < 0x20){ //debug return '~';*/ } else { /* Original is OK */ @@ -139,7 +133,7 @@ int checkspace(int c){ /* Only for ASCII characters */ -size_t getFileMaxLineLen(FILE *tfd){ +size_t lciniFileMaxLineLen(FILE *tfd){ size_t c=0; size_t i=0, max=0; @@ -164,7 +158,7 @@ size_t getFileMaxLineLen(FILE *tfd){ } } -struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t len){ +struct lcini_data *iniFSM(struct lcini_data *data, const char *in, int32_t len){ int32_t i,j, vallen=len; enum ini_states pstate=Start, state=Start; @@ -175,30 +169,30 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t } else { for(i=0, j=0; i<len; i++, j++){ - /*cc = in[i]; */ /*debug*/ + /*cc = in[i];*/ /*debug*/ switch (state) { case Start: - if(data->nodeState == lci_MULTILINE){ /* Bypass to the DQM collection */ + if(data->nodeState == lcini_MULTILINE){ /* Bypass to the DQM collection */ state = DqmW; j = data->valueLen-2; /* (x-1) => \0; (x-2) => j--; */ - data->value = strResize(data->value, data->valueLen, data->valueLen+len+1); /* strResize(ptr, oldsize, newsize */ + data->value = lciniStrResize(data->value, data->valueLen, data->valueLen+len+1); /* lciniStrResize(ptr, oldsize, newsize */ vallen = data->valueLen+len+1; - data->nodeState = lci_CONTINUE; + data->nodeState = lcini_CONTINUE; i--; /* first char is collected also */ pstate = Start; break; } else if(in[i] == '\n' || in[i] == '\r' /*|| in[i] == '\0'*/){ /* Line End */ state = Stop; i--; - }else if(in[i] == 0xEF || in[i] == 0xBB || in[i] == 0xBF || in[i] == 0xFF || in[i] == 0x00 ){ /* UTF8, UTF16, UTF32 BOM */ + }else if((unsigned char)in[i] == 0xEF || (unsigned char)in[i] == 0xBB || (unsigned char)in[i] == 0xBF || (unsigned char)in[i] == 0xFF || (unsigned char)in[i] == 0x00 ){ /* UTF8, UTF16, UTF32 BOM */ state = Start; } else if(checkspace(in[i])){ /* ISSPACE, but not line end */ state = BgnSp; } else if(in[i] == ';' || in[i] == '#' ){ /* Comment sign first */ j = -1; state = CommEndW; - data->comment = strResize(data->comment, data->commentLen, len); + data->comment = lciniStrResize(data->comment, data->commentLen, len); memset(data->comment, 0, len); data->commentStartPos = i; data->sectionStartPos = -1; /* Comment only line */ @@ -206,13 +200,13 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t } else if(in[i] == '['){ /* Section start */ j = -1; state = SectEndW; - data->section = strResize(data->section, data->sectionLen, len); + data->section = lciniStrResize(data->section, data->sectionLen, len); memset(data->section, 0, len); data->sectionStartPos = i; /* Brackets [] are counted! */ } else if(isascalnum(in[i]) ){ /* Parameter is starting */ j = -1; state = EqW1; - data->param = strResize(data->param, data->paramLen, len); + data->param = lciniStrResize(data->param, data->paramLen, len); memset(data->param, 0, len); data->paramStartPos = i; i--; @@ -220,8 +214,8 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t state = Error; i--; } - data->nodeState = lci_EMPTY; - data->valueDraw = lci_EMPTYVAL; + data->nodeState = lcini_EMPTY; + data->valueDraw = lcini_EMPTYVAL; pstate = Start; break; @@ -233,7 +227,7 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t } else if (in[i] == ';' || in[i] == '#'){ /* Comment is coming */ j = -1; state = CommEndW; - data->comment = strResize(data->comment, data->commentLen, len); + data->comment = lciniStrResize(data->comment, data->commentLen, len); memset(data->comment, 0, len); data->commentStartPos = i; data->sectionStartPos = -1; /* No Section started in this line */ @@ -241,13 +235,13 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t } else if(in[i] == '['){ /* Section is starting */ j = -1; state = SectEndW; - data->section = strResize(data->section, data->sectionLen, len); + data->section = lciniStrResize(data->section, data->sectionLen, len); memset(data->section, 0, len); data->sectionStartPos = i; } else if (isascalnum(in[i])){ /* Parameter will be */ j = -1; state = EqW1; - data->param = strResize(data->param, data->paramLen, len); + data->param = lciniStrResize(data->param, data->paramLen, len); memset(data->param, 0, len); data->paramStartPos = i; i--; @@ -264,7 +258,7 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t case CommEndW: /* Till comment to the line end */ if(in[i] == '\n' || in[i] == '\r'){ state = Stop; - data->nodeState = lci_READY; + data->nodeState = lcini_READY; data->comment[j] = '\0'; data->commentLen = j+1; i--; @@ -300,18 +294,18 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t case SectEndD: /* Section collected, then: SP(), line_end, or comment */ if(in[i] == '\n' || in[i] == '\r'){ state = Stop; - data->nodeState = lci_READY; + data->nodeState = lcini_READY; i--; }else if(checkspace(in[i])){ state = SectEndD; /* remain here */ } else if (in[i] == ';' || in[i] == '#'){ j = -1; state = CommEndW; - data->comment = strResize(data->comment, data->commentLen, len); + data->comment = lciniStrResize(data->comment, data->commentLen, len); memset(data->comment, 0, len); data->commentStartPos = i; data->commentSign = in[i]; - data->nodeState = lci_CONTINUE; + data->nodeState = lcini_CONTINUE; } else { state = Error; /* wrong character in line */ i--; @@ -356,37 +350,37 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t case ValPSP: /* After EQ_sign, (SPACE, or value can arrive) */ if(in[i] == '\n' || in[i] == '\r' /*|| in[i] == '\0'*/ ){ /* Empty value */ state = Stop; - data->nodeState = lci_READY; - data->valueDraw = lci_SIMPLEVAL; + data->nodeState = lcini_READY; + data->valueDraw = lcini_SIMPLEVAL; i--; } else if(in[i] == ';' || in[i] == '#'){ /* Comment */ j = -1; state = CommEndW; - data->comment = strResize(data->comment, data->commentLen, len); + data->comment = lciniStrResize(data->comment, data->commentLen, len); memset(data->comment, 0, len); data->commentStartPos = i; - data->nodeState = lci_CONTINUE; - data->valueDraw = lci_SIMPLEVAL; + data->nodeState = lcini_CONTINUE; + data->valueDraw = lcini_SIMPLEVAL; data->commentSign = in[i]; } else if( pstate != Bslsh && in[i] == '\"' ){ /* DQM arrived => DQM collector */ j = -1; state = DqmW; - data->value = strResize(data->value, data->valueLen, len); + data->value = lciniStrResize(data->value, data->valueLen, len); memset(data->value, 0, len); data->valueStartPos = i; - data->nodeState = lci_CONTINUE; - data->valueDraw = lci_DQUOTEDVAL; + data->nodeState = lcini_CONTINUE; + data->valueDraw = lcini_DQUOTEDVAL; } else if(checkspace(in[i])){ /* Another SP(), remain here */ state = ValPSP; } else if(isascalnum(in[i]) || in[i]=='-') { /* Normal_Value collector */ j = -1; state = ValW; - data->value = strResize(data->value, data->valueLen, len); + data->value = lciniStrResize(data->value, data->valueLen, len); memset(data->value, 0, len); data->valueStartPos = i; - data->nodeState = lci_CONTINUE; - data->valueDraw = lci_SIMPLEVAL; + data->nodeState = lcini_CONTINUE; + data->valueDraw = lcini_SIMPLEVAL; i--; } else { state = Error; @@ -399,21 +393,21 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t case ValW: /* Normal_Value collector */ if(in[i] == '\n' || in[i] == '\r'){ /* end -> new_line */ state = Stop; - data->nodeState = lci_READY; + data->nodeState = lcini_READY; data->value[j] = '\0'; data->valueLen = j + 1; i--; } else if(in[i] == ';' || in[i] == '#'){ /* comment */ - data->nodeState = lci_CONTINUE; + data->nodeState = lcini_CONTINUE; data->value[j] = '\0'; data->valueLen = j+1; state = CommEndW; j = -1; - data->comment = strResize(data->comment, data->commentLen, len); + data->comment = lciniStrResize(data->comment, data->commentLen, len); memset(data->comment, 0, len); data->commentStartPos = i; data->commentSign = in[i]; - data->nodeState = lci_CONTINUE; + data->nodeState = lcini_CONTINUE; /* } else if( in[i] == '\\' ){ // Backslash support // j--; //A '\' nem számít bele! // state = Bslsh; */ @@ -422,7 +416,7 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t } else if(checkspace(in[i])){ /* SPACE arrived -> line_end */ data->value[j] = '\0'; data->valueLen = j+1; - data->nodeState = lci_READY; + data->nodeState = lcini_READY; state = ValFSP; i--; } else { @@ -467,11 +461,11 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t } else if( in[i] == ';' || in[i] == '#'){ j = -1; state = CommEndW; - data->comment = strResize(data->comment, data->commentLen, len); + data->comment = lciniStrResize(data->comment, data->commentLen, len); memset(data->comment, 0, len); data->commentStartPos = i; data->commentSign = in[i]; - data->nodeState = lci_CONTINUE; + data->nodeState = lcini_CONTINUE; } else if(checkspace(in[i])){ state = ValFSP; /* SP() -> ermain here */ } else { @@ -486,7 +480,7 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t if( in[i] == '\"'){ /* Second DQM => Sring_end */ data->value[j] = '\0'; data->valueLen = j+1; - data->nodeState = lci_READY; + data->nodeState = lcini_READY; state = ValFSP; } else if ( in[i] == '\\'){ /* Backslash */ j--; @@ -494,16 +488,16 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t } else if(len > 1 && in[i] == '\n' && in[i-1] == '\\'){ /* UNIX style line endings*/ data->value[j] = '\0'; /* '\\n' => '\n\0' */ data->valueLen = j+1; - data->nodeState = lci_MULTILINE; - data->valueDraw = lci_MULTILINEVAL; + data->nodeState = lcini_MULTILINE; + data->valueDraw = lcini_MULTILINEVAL; state = Stop; i--; } else if(len > 2 && in[i] == '\n' && in[i-1] == '\r' && in[i-2] == '\\'){ /* WINDOWS style */ data->value[j] = '\n'; data->value[j+1] = '\0'; data->valueLen = j+2; - data->nodeState = lci_MULTILINE; - data->valueDraw = lci_MULTILINEVAL; + data->nodeState = lcini_MULTILINE; + data->valueDraw = lcini_MULTILINEVAL; state = Stop; i--; } else if( pstate != Bslsh && (in[i] == '\r' || in[i] == '\n' || in[i] == '\0')){ /* Too early Line_end */ @@ -517,7 +511,7 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t case Error: - data->errorMsg = strResize(data->errorMsg, data->errorMsgLen, 256); /* Returns zero-filled string */ + data->errorMsg = lciniStrResize(data->errorMsg, data->errorMsgLen, 256); /* Returns zero-filled string */ if(pstate == SectEndW || pstate == SectEndD){ data->errorMsgLen = sprintf(data->errorMsg, "Illegal character or EMPTY SECTION! (line: %d, pos: %d)", data->lineNum, i+1) +1; @@ -534,7 +528,7 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t i--; state = Stop; - data->nodeState = lci_ERROR; + data->nodeState = lcini_ERROR; pstate = Error; break; @@ -546,14 +540,14 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t if(strNullLen(data->value) == 0){data->valueLen = 0;} if(strNullLen(data->comment) == 0){data->commentLen = 0;} if(strNullLen(data->errorMsg) == 0){data->errorMsgLen = 0;} - data->section = strResize(data->section, len, data->sectionLen); - data->param = strResize(data->param, len, data->paramLen); - data->value = strResize(data->value, vallen, data->valueLen); - data->comment = strResize(data->comment, len, data->commentLen); - data->errorMsg = strResize(data->errorMsg, 256, data->errorMsgLen); + data->section = lciniStrResize(data->section, len, data->sectionLen); + data->param = lciniStrResize(data->param, len, data->paramLen); + data->value = lciniStrResize(data->value, vallen, data->valueLen); + data->comment = lciniStrResize(data->comment, len, data->commentLen); + data->errorMsg = lciniStrResize(data->errorMsg, 256, data->errorMsgLen); if(data->sectionStartPos < 0 && data->param==NULL && data->value==NULL && data->comment==NULL && data->errorMsg==NULL){ - data->nodeState = lci_EMPTY; - data->valueDraw = lci_EMPTYVAL; + data->nodeState = lcini_EMPTY; + data->valueDraw = lcini_EMPTYVAL; } return data; } else { /* Everything else -> ERROR */ @@ -574,26 +568,30 @@ struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t -lci_data *createNode( lci_data *head, int64_t lineLen ){ /* Creates one Node */ - lci_data *curr; +lcini_data *lciniCreateNode( lcini_data *head, int64_t lineLen ){ /* Creates one Node */ + lcini_data *curr; - curr = (lci_data *) calloc(1, sizeof(lci_data)); - curr->nodeState = lci_EMPTY; + curr = (lcini_data *) calloc(1, sizeof(lcini_data)); + curr->nodeState = lcini_EMPTY; curr->lineNum = 0; curr->lineLen = lineLen; - curr->section = (char *) calloc(lineLen, sizeof(char)); - curr->param = (char *) calloc(lineLen, sizeof(char)); - curr->value = (char *) calloc(lineLen, sizeof(char)); - curr->comment = (char *) calloc(lineLen, sizeof(char)); - curr->errorMsg = (char *) calloc(lineLen, sizeof(char)); + if(lineLen > 0){ + curr->section = (char *) calloc(lineLen, sizeof(char)); + curr->param = (char *) calloc(lineLen, sizeof(char)); + curr->value = (char *) calloc(lineLen, sizeof(char)); + curr->comment = (char *) calloc(lineLen, sizeof(char)); + curr->errorMsg = (char *) calloc(lineLen, sizeof(char)); + } else { + lineLen = 0; + } curr->sectionLen = lineLen; curr->sectionStartPos = -1; curr->paramLen = lineLen; curr->paramStartPos = -1; curr->valueLen = lineLen; curr->valueStartPos = -1; - curr->valueDraw = lci_EMPTYVAL; + curr->valueDraw = lcini_EMPTYVAL; curr->commentLen = lineLen; curr->commentStartPos = -1; curr->commentSign = '\0'; @@ -606,8 +604,8 @@ lci_data *createNode( lci_data *head, int64_t lineLen ){ /* Creates one Node */ return curr; } -lci_data *destroyNodes( lci_data *head){ /* Destroys Nodes from HEAD to the end */ - lci_data *tmp, *node=head; +lcini_data *lciniDestroyNodes( lcini_data *head){ /* Destroys Nodes from HEAD to the end */ + lcini_data *tmp, *node=head; while(node != NULL){ free(node->section); free(node->param); @@ -623,26 +621,26 @@ lci_data *destroyNodes( lci_data *head){ /* Destroys Nodes from HEAD to the end -struct lci_data *iniReadOut(const char *filename){ +struct lcini_data *lciniReadOut(const char *filename){ /* Reads the entire file to a linked-list */ int c=0; - unsigned char *buff; + char *buff; FILE *fp=NULL; int64_t linemax, line=0, pos=0; /*char cc;*/ - struct lci_data *prev=NULL, *curr=NULL, *list = NULL; + struct lcini_data *prev=NULL, *curr=NULL, *list = NULL; fp = fopen(filename, "rb"); if(!fp ){ /* fp == NULL */ - list = createNode(NULL, 256); - list->errorMsg = strResize(list->errorMsg, list->errorMsgLen, 256); + list = lciniCreateNode(NULL, 256); + list->errorMsg = lciniStrResize(list->errorMsg, list->errorMsgLen, 256); list->errorMsgLen = sprintf(list->errorMsg, "File opening error. Errno: %d (%s)", errno, strerror(errno) ); - list->nodeState = lci_ERROR; + list->nodeState = lcini_ERROR; } else { - linemax = getFileMaxLineLen(fp) +1; - buff = (unsigned char *) malloc(linemax*sizeof(char)); - memset(buff, 0, linemax); + linemax = lciniFileMaxLineLen(fp) +1; + buff = (char *) malloc(linemax*sizeof(char)); + memset(buff, 0, linemax*sizeof(char)); while( c != EOF){ c = fgetc(fp); @@ -652,14 +650,14 @@ struct lci_data *iniReadOut(const char *filename){ line++; buff[pos] = '\n'; - if(curr == NULL || curr->nodeState != lci_MULTILINE ){ - curr = createNode(NULL, linemax); + if(curr == NULL || curr->nodeState != lcini_MULTILINE ){ + curr = lciniCreateNode(NULL, linemax); } if(list == NULL){ /* First node */ list = curr; } if(prev && curr && prev != curr && prev->section ){ /* Copy SECTION string from previous node to current */ - curr->section = strResize(curr->section, curr->sectionLen, prev->sectionLen); + curr->section = lciniStrResize(curr->section, curr->sectionLen, prev->sectionLen); memcpy(curr->section, prev->section, prev->sectionLen); curr->sectionLen = prev->sectionLen; } @@ -668,29 +666,28 @@ struct lci_data *iniReadOut(const char *filename){ curr->lineLen = pos + 1; curr = iniFSM(curr, buff, linemax); } - if(curr->nodeState == lci_EMPTY){ /* Dropping empty lines */ + if(curr->nodeState == lcini_EMPTY){ /* Dropping empty lines */ if(list == curr || prev == curr ){ /* File contains empty lines */ list = NULL; prev = NULL; } - curr = destroyNodes(curr); + curr = lciniDestroyNodes(curr); } - if(!prev){ /* Prew is null */ prev = curr; } else { /* Register current for next step */ prev->next = curr; - if(prev->next && curr->nodeState != lci_MULTILINE){ /* Step only, when current is not multiline */ + if(prev->next && curr->nodeState != lcini_MULTILINE){ /* Step only, when current is not multiline */ prev = prev->next; } } - if(curr && curr->nodeState == lci_ERROR){ /* Stop on first ERROR */ + if(curr && curr->nodeState == lcini_ERROR){ /* Stop on first ERROR */ /* return list; */ } pos = 0; - memset(buff, 0, linemax); + memset(buff, 0, linemax*sizeof(char)); } else { buff[pos] = c; pos++; @@ -707,4 +704,67 @@ struct lci_data *iniReadOut(const char *filename){ +int lciniReadOutOwn(const char *filename){ /* Reads the entire file to a linked-list */ + + int c=0; + char *buff=NULL; + FILE *fp=NULL; + int64_t linemax, line=0, pos=0; + struct lcini_data curr; + /* char cc;*/ + + curr.section = NULL; + curr.param = NULL; + curr.value = NULL; + curr.comment = NULL; + curr.errorMsg = NULL; + buff = (char *) malloc(256*sizeof(char)); + memset(buff, 0, 256*sizeof(char)); + fp = fopen(filename, "rb"); + + if(!fp && mylciniReadOutFunct != NULL){ /* fp == NULL */ + + sprintf(buff, "File opening error. Errno: %d (%s)", errno, strerror(errno) ); + mylciniReadOutFunct(0,0, NULL,0, NULL,0, NULL,0, NULL,0, buff, 256); + + } else { + linemax = lciniFileMaxLineLen(fp) +1; + buff = lciniStrResize(buff, 256, linemax); + + while( c != EOF){ + c = fgetc(fp); + /*cc = c;*/ /* debug */ + + if( c == '\n' || c == EOF){ + line++; + buff[pos] = '\n'; + + + if(1){ /* Call the Finite-State-Machine processor */ + curr.lineNum = line; + curr.lineLen = pos + 1; + iniFSM(&curr, buff, linemax); + } + if(curr.nodeState != lcini_EMPTY && mylciniReadOutFunct != NULL ){ /* Dropping empty lines */ + /* mylciniReadOutFunct(line, pos+1, curr.section, curr.sectionLen, curr.param, curr.paramLen, curr.value, curr.valueLen, curr.comment, curr.commentLen, curr.errorMsg, curr.errorMsgLen);*/ + (*mylciniReadOutFunct)(line, pos+1, curr.section, curr.sectionLen, curr.param, curr.paramLen, curr.value, curr.valueLen, curr.comment, curr.commentLen, curr.errorMsg, curr.errorMsgLen); + } + + pos = 0; + memset(buff, 0, linemax*sizeof(char)); + } else { + buff[pos] = c; + pos++; + } + } + } + + if(fp){ + fclose(fp); + } + free(buff); + return line; +} + + diff --git a/src/inirw_internal.h b/src/inirw_internal.h index a75a70b..c569fd7 100644 --- a/src/inirw_internal.h +++ b/src/inirw_internal.h @@ -1,13 +1,13 @@ #ifndef INI_READ_H_INCLUDED #define INI_READ_H_INCLUDED -/* #include "deftypes.h" */ #include <stdint.h> /* int64_t*/ +#include "lightconfini.h" +/* +typedef struct lcini_data { -typedef struct lci_data { - - enum nodeState {lci_EMPTY, lci_READY, lci_CONTINUE, lci_MULTILINE, lci_ERROR } nodeState; + enum nodeState {lcini_EMPTY, lcini_READY, lcini_CONTINUE, lcini_MULTILINE, lcini_ERROR } nodeState; int32_t lineNum; int32_t lineLen; @@ -20,7 +20,7 @@ typedef struct lci_data { char *value; int32_t valueLen; int32_t valueStartPos; - enum valueDraw {lci_EMPTYVAL, lci_SIMPLEVAL, lci_MULTILINEVAL, lci_DQUOTEDVAL} valueDraw; + enum valueDraw {lcini_EMPTYVAL, lcini_SIMPLEVAL, lcini_MULTILINEVAL, lcini_DQUOTEDVAL} valueDraw; char *comment; int32_t commentLen; int32_t commentStartPos; @@ -28,23 +28,22 @@ typedef struct lci_data { char *errorMsg; int32_t errorMsgLen; - struct lci_data *next; -} lci_data; - - + struct lcini_data *next; +} lcini_data; +*/ -struct lci_data *iniReadOut(const char *filename); -/* int64_t getFileMaxLineLen(FILE *tfd); */ +/* +struct lcini_data *iniReadOut(const char *filename); char *strResize(char *ptr, size_t oldsize, size_t newsize); -lci_data *destroyNodes( lci_data *head); -lci_data *createNode( lci_data *head, int64_t lineLen ); +lcini_data *destroyNodes( lcini_data *head); +lcini_data *createNode( lcini_data *head, int64_t lineLen ); size_t getFileMaxLineLen(FILE *tfd); - +*/ #if defined(ini_read_c) || defined(ini_write_c) enum ini_states {Start, BgnSp, CommEndW, SectEndW, SectEndD, EqW1, EqW2, ValPSP, ValW, ValFSP, DqmW, Bslsh, Error, Stop }; size_t strNullLen(const char *str); -struct lci_data *iniFSM(struct lci_data *data, const unsigned char *in, int32_t len); +struct lcini_data *iniFSM(struct lcini_data *data, const char *in, int32_t len); int eescape(int c); int isascalnum(int c); /* Check if input is ASCII Alpha-numeric */ int checkspace(int c); /* Only for ASCII characters */ @@ -60,9 +59,8 @@ int unescape(int c); #endif /* ini_read_c, ini_write_c*/ - +/* char *lciGETtoStr( const char *section, const char *param, char *dest, size_t dstlen ); -/*int lciGETtoStrlen(const char *section, const char *param, ...); */ int8_t lciGETtoInt8( const char *filename, const char *section, const char *param); int16_t lciGETtoInt16(const char *filename, const char *section, const char *param); int32_t lciGETtoInt32(const char *filename, const char *section, const char *param); @@ -71,7 +69,7 @@ int64_t lciGETtoInt64(const char *filename, const char *section, const char * double lciGETtoDlb(const char *filename, const char *section, const char *param); float lciGETtoFlt(const char *filename, const char *section, const char *param); long int lciGETtoLng(const char *filename, const char *section, const char *param); - +*/ diff --git a/src/lightconfini.h b/src/lightconfini.h new file mode 100644 index 0000000..ee5a7c3 --- /dev/null +++ b/src/lightconfini.h @@ -0,0 +1,72 @@ +#ifndef LIGHTCONFINI_H_INCLUDED +#define LIGHTCONFINI_H_INCLUDED +#include <stdint.h> /* int64_t*/ + +typedef struct lcini_data { + enum nodeState {lcini_EMPTY, lcini_READY, lcini_CONTINUE, lcini_MULTILINE, lcini_ERROR } nodeState; + int32_t lineNum; + int32_t lineLen; + + char *section; + int32_t sectionLen; + int32_t sectionStartPos; + char *param; + int32_t paramLen; + int32_t paramStartPos; + char *value; + int32_t valueLen; + int32_t valueStartPos; + enum valueDraw {lcini_EMPTYVAL, lcini_SIMPLEVAL, lcini_MULTILINEVAL, lcini_DQUOTEDVAL} valueDraw; + char *comment; + int32_t commentLen; + int32_t commentStartPos; + char commentSign; + char *errorMsg; + int32_t errorMsgLen; + + struct lcini_data *next; +} lcini_data; + + +typedef struct lcini_retdata{ + char *value; + int32_t vallen; + char *error; + int32_t errorlen; +} lcini_retdata; + +/* Ha maga függvény van átpakolva, nevestül, testestül */ +/* extern void (mylciniReadOutFunct)(int line, int linelen, char *section, int sectionlen, char *param, int paramlen, char *value, int valuelen, char *comment, int commentlen, char *error, int errorlen ) ; */ +/* Ha csak egy fggvényre mutató ptr */ +typedef void (*lcinimyReadFunc)(int line, int linelen, char *section, int sectionlen, char *param, int paramlen, char *value, int valuelen, char *comment, int commentlen, char *error, int errorlen ) ; +extern lcinimyReadFunc mylciniReadOutFunct; + + +struct lcini_data *lciniReadOut(const char *filename); +int lciniReadOutOwn(const char *filename); + +char *lciniGet(const char *filename, const char *section, const char *parameter, int32_t bufflen); +lcini_retdata *lciniGet2(const char *filename, const char *section, const char *parameter); + + + + + +char *lciGETtoStr( const char *section, const char *param, char *dest, size_t dstlen ); +/*int lciGETtoStrlen(const char *section, const char *param, ...); */ +int8_t lciGETtoInt8( const char *filename, const char *section, const char *param); +int16_t lciGETtoInt16(const char *filename, const char *section, const char *param); +int32_t lciGETtoInt32(const char *filename, const char *section, const char *param); +int64_t lciGETtoInt64(const char *filename, const char *section, const char *param); + +double lciGETtoDlb(const char *filename, const char *section, const char *param); +float lciGETtoFlt(const char *filename, const char *section, const char *param); +long int lciGETtoLng(const char *filename, const char *section, const char *param); + +char *lciniStrResize(char *ptr, size_t oldsize, size_t newsize); +lcini_data *lciniDestroyNodes( lcini_data *head); +lcini_data *lciniCreateNode( lcini_data *head, int64_t lineLen ); +size_t lciniFileMaxLineLen(FILE *tfd); + +#endif /* LIGHTCONFINI_H_INCLUDED */ + @@ -4,17 +4,28 @@ #include <ctype.h> #include <stdbool.h> -#include "inirw_internal.h" +/* #include "inirw_internal.h" */ +#include "lightconfini.h" #define main_c - + +int lens=16, lenp=16, lenv=16, lenc=24, elen=55; + + +void myfunct(int line, int linelen, char *section, int sectionlen, char *param, int paramlen, char *value, int valuelen, char *comment, int commentlen, char *error, int errorlen ){ + + printf("LN: %d,\tLL: %d,\tSC: %*s,%2d P: %*s,%2d V: %*s,%2d C: %*s,%2d ER: %*s \n", line, linelen, lens, section,sectionlen, + lenp, param, paramlen, lenv, value, valuelen, lenc, comment, commentlen, elen, error); +} +/*lcinimyReadFunc mylciniReadOutFunct=myfunct;*/ +lcinimyReadFunc mylciniReadOutFunct=NULL; + int main(int argc, char* argv[]){ - + int len; char filename[4096] = "tests/test.ini", *buff1, *buff2, *buff3, *buff4, *buff5; - lci_data *ini=NULL, *tmp=NULL; - int len=0, elen=54, lens=0, lenp=0, lenv=0, lenc=0; + lcini_data *ini=NULL, *tmp=NULL; FILE *fp; if(argc > 1){ @@ -22,18 +33,11 @@ int main(int argc, char* argv[]){ /* snprintf(filename, 4096, "%s", argv[1]); */ sprintf(filename, "%s", argv[1]); } - - fp = fopen(filename, "rb"); - len = getFileMaxLineLen(fp)+1; + len = lciniFileMaxLineLen(fp)+1; if(fp != NULL) { fclose(fp);} /* len = 24000; */ /*Debug*/ - lens=16; - lenp=16; - lenv=16; - lenc=44; - buff1 = calloc((len+100), sizeof(char)); buff2 = calloc((len+100), sizeof(char)); @@ -44,13 +48,9 @@ int main(int argc, char* argv[]){ printf("\nLineMax: %d\n\n",len); - ini = iniReadOut(filename); - - + ini = lciniReadOut(filename); tmp = ini; while(tmp != NULL){ - - /* snprintf(buff1, len+3, "'%s' %3ld",tmp->section, tmp->sectionLen); snprintf(buff2, len+3, "'%s' %3ld",tmp->param, tmp->paramLen); snprintf(buff3, len+3, "'%s' %3ld",tmp->value, tmp->valueLen); @@ -69,14 +69,19 @@ int main(int argc, char* argv[]){ tmp=tmp->next; } - free(buff1); free(buff2); free(buff3); free(buff4); free(buff5); + lciniDestroyNodes( ini); + + + + + + lciniReadOutOwn(filename); - destroyNodes( ini); return 0; diff --git a/tests/bom.ini b/tests/bom.ini index f527b00..291abd8 100644 --- a/tests/bom.ini +++ b/tests/bom.ini @@ -1,5 +1,5 @@ [bom_section] ;OK bom_name=bom_value ;OK -key“ = value“ ;ERROR +key“ = value“ ;ER key="value" ;OK 10= 10
\ No newline at end of file diff --git a/tests/test.ini b/tests/test.ini index a69444f..fcac46c 100644 --- a/tests/test.ini +++ b/tests/test.ini @@ -84,4 +84,5 @@ server_ = server.example.com ;OK _server_= server.example.com ;ERROR ip = 127.0.0.1 ;OK ip = "127.0.0.1" ;OK - +1024 = xxxxx ;OK +1024 = 2048 ;OK (but only syntactically :) |