Browse Source

version 1.13

tags/v1.13
Vladimir Smagin 2 years ago
parent
commit
388d455b35
100 changed files with 2765 additions and 511 deletions
  1. +3
    -0
      .hgignore
  2. +0
    -0
     
  3. +0
    -0
     
  4. +0
    -0
     
  5. +0
    -0
     
  6. BIN
     
  7. +0
    -0
     
  8. +3
    -0
      avtokanal.lpi
  9. +0
    -0
     
  10. +19
    -158
      avtokanal.lps
  11. +0
    -0
     
  12. +0
    -0
     
  13. +16
    -168
      backup/avtokanal.lps.bak
  14. +41
    -13
      backup/unit1.lfm.bak
  15. +37
    -20
      backup/unit1.pas.bak
  16. +0
    -0
     
  17. BIN
     
  18. BIN
     
  19. +69
    -0
      distrib/NsProcess/Example/nsProcessTest.nsi
  20. +28
    -0
      distrib/NsProcess/Include/nsProcess.nsh
  21. BIN
     
  22. BIN
     
  23. +67
    -0
      distrib/NsProcess/Readme.txt
  24. +825
    -0
      distrib/NsProcess/Source/ConvFunc.h
  25. +83
    -0
      distrib/NsProcess/Source/api.h
  26. +416
    -0
      distrib/NsProcess/Source/nsProcess.c
  27. +23
    -0
      distrib/NsProcess/Source/nsProcess.sln
  28. +372
    -0
      distrib/NsProcess/Source/nsProcess.vcproj
  29. +214
    -0
      distrib/NsProcess/Source/nsis_tchar.h
  30. +290
    -0
      distrib/NsProcess/Source/pluginapi.c
  31. +101
    -0
      distrib/NsProcess/Source/pluginapi.h
  32. +0
    -0
     
  33. +0
    -0
     
  34. BIN
     
  35. +0
    -0
     
  36. +4
    -4
      distrib/ark_tomsk.nsi
  37. BIN
     
  38. BIN
     
  39. BIN
     
  40. +13
    -0
      distrib/build.bat
  41. +50
    -0
      distrib/build.log
  42. +2
    -0
      distrib/build_run.bat
  43. +0
    -0
     
  44. +0
    -0
     
  45. +0
    -0
     
  46. +1
    -1
      distrib/version
  47. +1
    -1
      distrib/version.w32
  48. +0
    -0
     
  49. BIN
     
  50. +0
    -0
     
  51. +0
    -0
     
  52. +0
    -0
     
  53. +36
    -95
      laucher/ark_laucher.lps
  54. +0
    -0
     
  55. +0
    -0
     
  56. +0
    -0
     
  57. +0
    -0
     
  58. +0
    -0
     
  59. +33
    -33
      laucher/backup/ark_laucher.lps.bak
  60. +5
    -5
      laucher/backup/unit1.lfm.bak
  61. +1
    -1
      laucher/backup/unit1.pas.bak
  62. +0
    -0
     
  63. +0
    -0
     
  64. +2
    -2
      laucher/lib/i386-win32/ark_laucher.compiled
  65. BIN
     
  66. BIN
     
  67. +0
    -0
     
  68. +0
    -0
     
  69. BIN
     
  70. +0
    -0
     
  71. BIN
     
  72. +0
    -0
     
  73. BIN
     
  74. +0
    -0
     
  75. BIN
     
  76. +0
    -0
     
  77. BIN
     
  78. +0
    -0
     
  79. BIN
     
  80. +0
    -0
     
  81. BIN
     
  82. +0
    -0
     
  83. BIN
     
  84. +3
    -3
      laucher/lib/i386-win32/unit1.lfm
  85. BIN
     
  86. BIN
     
  87. +0
    -0
     
  88. +0
    -0
     
  89. +0
    -0
     
  90. +0
    -0
     
  91. +0
    -0
     
  92. +0
    -0
     
  93. +0
    -0
     
  94. +3
    -3
      laucher/unit1.lfm
  95. +2
    -2
      laucher/unit1.pas
  96. +0
    -0
     
  97. +2
    -2
      lib/i386-win32/avtokanal.compiled
  98. BIN
     
  99. BIN
     
  100. +0
    -0
     

+ 3
- 0
.hgignore View File

@@ -0,0 +1,3 @@
syntax: glob
distrib
lib

+ 0
- 0
View File


+ 0
- 0
View File


+ 0
- 0
View File


+ 0
- 0
View File


BIN
View File


+ 0
- 0
View File


+ 3
- 0
avtokanal.lpi View File

@@ -113,6 +113,9 @@
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">


+ 0
- 0
View File


+ 19
- 158
avtokanal.lps View File

@@ -8,7 +8,9 @@
<Unit0>
<Filename Value="avtokanal.lpr"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="1"/>
<EditorIndex Value="0"/>
<WindowIndex Value="1"/>
<TopLine Value="1"/>
<CursorPos X="8" Y="22"/>
<UsageCount Value="86"/>
<Loaded Value="True"/>
@@ -21,8 +23,10 @@
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<IsVisibleTab Value="True"/>
<TopLine Value="319"/>
<CursorPos X="18" Y="340"/>
<EditorIndex Value="1"/>
<WindowIndex Value="1"/>
<TopLine Value="261"/>
<CursorPos X="69" Y="275"/>
<UsageCount Value="86"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@@ -30,7 +34,6 @@
<Unit2>
<Filename Value="blcksock.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="3731"/>
<CursorPos Y="3756"/>
<UsageCount Value="36"/>
@@ -38,7 +41,6 @@
<Unit3>
<Filename Value="synsock.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="27"/>
<CursorPos X="6" Y="62"/>
<UsageCount Value="37"/>
@@ -46,7 +48,6 @@
<Unit4>
<Filename Value="httpsend.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="336"/>
<CursorPos Y="351"/>
<UsageCount Value="37"/>
@@ -54,7 +55,6 @@
<Unit5>
<Filename Value="synacode.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="434"/>
<CursorPos Y="475"/>
<UsageCount Value="37"/>
@@ -62,16 +62,11 @@
<Unit6>
<Filename Value="synafpc.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<WindowIndex Value="-1"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="37"/>
</Unit6>
<Unit7>
<Filename Value="synaip.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="165"/>
<CursorPos Y="189"/>
<UsageCount Value="37"/>
@@ -79,7 +74,6 @@
<Unit8>
<Filename Value="synautil.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="1060"/>
<CursorPos Y="1077"/>
<UsageCount Value="37"/>
@@ -87,10 +81,6 @@
<Unit9>
<Filename Value="synaser.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<WindowIndex Value="-1"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="37"/>
</Unit9>
<Unit10>
@@ -129,127 +119,106 @@
</Unit15>
<Unit16>
<Filename Value="C:\lazarus\fpc\2.6.4\source\packages\fcl-process\src\process.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="4"/>
<CursorPos X="48" Y="24"/>
<UsageCount Value="31"/>
</Unit16>
<Unit17>
<Filename Value="C:\lazarus\components\lazutils\utf8process.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="35"/>
<CursorPos X="58" Y="57"/>
<UsageCount Value="30"/>
</Unit17>
<Unit18>
<Filename Value="C:\lazarus\synapse\source\lib\sswin32.inc"/>
<EditorIndex Value="-1"/>
<WindowIndex Value="-1"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="18"/>
</Unit18>
<Unit19>
<Filename Value="C:\lazarus\lcl\include\messagedialogs.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="174"/>
<CursorPos Y="201"/>
<UsageCount Value="11"/>
</Unit19>
<Unit20>
<Filename Value="C:\lazarus\components\lazutils\lazlogger.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="741"/>
<CursorPos Y="784"/>
<UsageCount Value="11"/>
</Unit20>
<Unit21>
<Filename Value="C:\lazarus\lcl\include\lclintf.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="152"/>
<CursorPos Y="178"/>
<UsageCount Value="11"/>
</Unit21>
<Unit22>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32lclintf.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="141"/>
<CursorPos Y="167"/>
<UsageCount Value="11"/>
</Unit22>
<Unit23>
<Filename Value="C:\lazarus\lcl\themes.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="539"/>
<CursorPos Y="565"/>
<UsageCount Value="11"/>
</Unit23>
<Unit24>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32object.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="134"/>
<CursorPos Y="167"/>
<UsageCount Value="11"/>
</Unit24>
<Unit25>
<Filename Value="C:\lazarus\lcl\include\application.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="1116"/>
<CursorPos Y="1147"/>
<UsageCount Value="11"/>
</Unit25>
<Unit26>
<Filename Value="C:\lazarus\lcl\lclproc.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="2914"/>
<CursorPos Y="2940"/>
<UsageCount Value="11"/>
</Unit26>
<Unit27>
<Filename Value="C:\lazarus\components\lazutils\lazutf8.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="3278"/>
<CursorPos Y="3293"/>
<UsageCount Value="11"/>
</Unit27>
<Unit28>
<Filename Value="C:\lazarus\lcl\buttons.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="490"/>
<CursorPos Y="549"/>
<UsageCount Value="11"/>
</Unit28>
<Unit29>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32wsdialogs.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="155"/>
<CursorPos Y="173"/>
<UsageCount Value="11"/>
</Unit29>
<Unit30>
<Filename Value="C:\lazarus\lcl\include\screen.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="246"/>
<CursorPos Y="274"/>
<UsageCount Value="11"/>
</Unit30>
<Unit31>
<Filename Value="C:\lazarus\lcl\include\wincontrol.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="7233"/>
<CursorPos Y="7259"/>
<UsageCount Value="11"/>
</Unit31>
<Unit32>
<Filename Value="C:\lazarus\lcl\include\winapi.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="775"/>
<CursorPos Y="801"/>
<UsageCount Value="11"/>
</Unit32>
<Unit33>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="2920"/>
<CursorPos Y="2946"/>
<UsageCount Value="11"/>
@@ -258,201 +227,93 @@
<Filename Value="C:\lazarus\lcl\grids.pas"/>
<UnitName Value="Grids"/>
<EditorIndex Value="2"/>
<TopLine Value="2343"/>
<CursorPos Y="2370"/>
<WindowIndex Value="1"/>
<TopLine Value="2316"/>
<CursorPos X="1" Y="2370"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit34>
<Unit35>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32proc.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="1087"/>
<CursorPos Y="1121"/>
<UsageCount Value="9"/>
</Unit35>
<Unit36>
<Filename Value="C:\lazarus\lcl\lresources.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="1473"/>
<CursorPos Y="1502"/>
<UsageCount Value="9"/>
</Unit36>
<Unit37>
<Filename Value="C:\lazarus\lcl\include\icon.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="674"/>
<CursorPos Y="700"/>
<UsageCount Value="9"/>
</Unit37>
<Unit38>
<Filename Value="C:\lazarus\lcl\include\rasterimage.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="147"/>
<CursorPos Y="188"/>
<UsageCount Value="9"/>
</Unit38>
<Unit39>
<Filename Value="C:\lazarus\lcl\include\sharedrasterimage.inc"/>
<EditorIndex Value="-1"/>
<CursorPos Y="49"/>
<UsageCount Value="9"/>
</Unit39>
<Unit40>
<Filename Value="C:\lazarus\lcl\intfgraphics.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="3411"/>
<CursorPos Y="3437"/>
<UsageCount Value="9"/>
</Unit40>
<Unit41>
<Filename Value="C:\lazarus\lcl\include\graphic.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="30"/>
<CursorPos Y="56"/>
<UsageCount Value="9"/>
</Unit41>
<Unit42>
<Filename Value="C:\lazarus\lcl\graphtype.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="1738"/>
<CursorPos Y="1778"/>
<UsageCount Value="9"/>
</Unit42>
<Unit43>
<Filename Value="C:\lazarus\lcl\graphics.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="2262"/>
<CursorPos Y="2305"/>
<UsageCount Value="9"/>
</Unit43>
<Unit44>
<Filename Value="C:\lazarus\lcl\include\intfbaselcl.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="298"/>
<CursorPos Y="323"/>
<UsageCount Value="9"/>
</Unit44>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<General>
<ActiveWindowIndexAtStart Value="0"/>
</General>
<JumpHistory Count="4" HistoryIndex="3">
<Position1>
<Filename Value="unit1.pas"/>
<Caret Line="68" Column="5" TopLine="26"/>
<Caret Line="3" Column="29" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="unit1.pas"/>
<Caret Line="160" Column="22" TopLine="141"/>
<Caret Line="272" Column="69" TopLine="258"/>
</Position2>
<Position3>
<Filename Value="unit1.pas"/>
<Caret Line="141" Column="25" TopLine="130"/>
<Caret Line="273" Column="69" TopLine="259"/>
</Position3>
<Position4>
<Filename Value="unit1.pas"/>
<Caret Line="135" Column="23" TopLine="110"/>
<Caret Line="274" Column="69" TopLine="260"/>
</Position4>
<Position5>
<Filename Value="unit1.pas"/>
<Caret Line="115" Column="48" TopLine="76"/>
</Position5>
<Position6>
<Filename Value="unit1.pas"/>
<Caret Line="68" Column="52" TopLine="67"/>
</Position6>
<Position7>
<Filename Value="unit1.pas"/>
<Caret Line="283" Column="9" TopLine="258"/>
</Position7>
<Position8>
<Filename Value="unit1.pas"/>
<Caret Line="68" Column="15" TopLine="44"/>
</Position8>
<Position9>
<Filename Value="unit1.pas"/>
<Caret Line="280" Column="70" TopLine="254"/>
</Position9>
<Position10>
<Filename Value="unit1.pas"/>
<Caret Line="283" Column="58" TopLine="258"/>
</Position10>
<Position11>
<Filename Value="unit1.pas"/>
<Caret Line="149" Column="35" TopLine="133"/>
</Position11>
<Position12>
<Filename Value="unit1.pas"/>
<Caret Line="68" Column="59" TopLine="62"/>
</Position12>
<Position13>
<Filename Value="unit1.pas"/>
<Caret Line="285" Column="5" TopLine="284"/>
</Position13>
<Position14>
<Filename Value="unit1.pas"/>
<Caret Line="284" Column="5" TopLine="283"/>
</Position14>
<Position15>
<Filename Value="unit1.pas"/>
<Caret Line="280" Column="22" TopLine="254"/>
</Position15>
<Position16>
<Filename Value="unit1.pas"/>
<Caret Line="354" Column="29" TopLine="15"/>
</Position16>
<Position17>
<Filename Value="unit1.pas"/>
<Caret Line="131" Column="14" TopLine="90"/>
</Position17>
<Position18>
<Filename Value="avtokanal.lpr"/>
<Caret Line="21"/>
</Position18>
<Position19>
<Filename Value="unit1.pas"/>
<Caret Line="143" Column="19" TopLine="132"/>
</Position19>
<Position20>
<Filename Value="unit1.pas"/>
<Caret Line="289" Column="88" TopLine="131"/>
</Position20>
<Position21>
<Filename Value="unit1.pas"/>
<Caret Line="315" TopLine="202"/>
</Position21>
<Position22>
<Filename Value="unit1.pas"/>
<Caret Line="316" Column="32" TopLine="202"/>
</Position22>
<Position23>
<Filename Value="unit1.pas"/>
<Caret Line="318" Column="20" TopLine="202"/>
</Position23>
<Position24>
<Filename Value="unit1.pas"/>
<Caret Line="373" Column="51" TopLine="298"/>
</Position24>
<Position25>
<Filename Value="unit1.pas"/>
<Caret Line="38" Column="19" TopLine="13"/>
</Position25>
<Position26>
<Filename Value="unit1.pas"/>
<Caret Line="56" Column="29" TopLine="13"/>
</Position26>
<Position27>
<Filename Value="unit1.pas"/>
<Caret Line="131" Column="34" TopLine="104"/>
</Position27>
<Position28>
<Filename Value="unit1.pas"/>
<Caret Line="328" Column="18" TopLine="216"/>
</Position28>
<Position29>
<Filename Value="unit1.pas"/>
<Caret Line="228" Column="60" TopLine="214"/>
</Position29>
<Position30>
<Filename Value="unit1.pas"/>
</Position30>
</JumpHistory>
</ProjectSession>
<EditorMacros Count="0"/>
</CONFIG>

+ 0
- 0
View File


+ 0
- 0
View File


+ 16
- 168
backup/avtokanal.lps.bak View File

@@ -8,7 +8,9 @@
<Unit0>
<Filename Value="avtokanal.lpr"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="1"/>
<EditorIndex Value="0"/>
<WindowIndex Value="1"/>
<TopLine Value="1"/>
<CursorPos X="8" Y="22"/>
<UsageCount Value="86"/>
<Loaded Value="True"/>
@@ -21,9 +23,10 @@
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<IsVisibleTab Value="True"/>
<TopLine Value="308"/>
<CursorPos X="6" Y="337"/>
<FoldState Value=" T3kK091162224G"/>
<EditorIndex Value="1"/>
<WindowIndex Value="1"/>
<TopLine Value="258"/>
<CursorPos X="69" Y="272"/>
<UsageCount Value="86"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@@ -31,7 +34,6 @@
<Unit2>
<Filename Value="blcksock.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="3731"/>
<CursorPos Y="3756"/>
<UsageCount Value="36"/>
@@ -39,7 +41,6 @@
<Unit3>
<Filename Value="synsock.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="27"/>
<CursorPos X="6" Y="62"/>
<UsageCount Value="37"/>
@@ -47,7 +48,6 @@
<Unit4>
<Filename Value="httpsend.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="336"/>
<CursorPos Y="351"/>
<UsageCount Value="37"/>
@@ -55,7 +55,6 @@
<Unit5>
<Filename Value="synacode.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="434"/>
<CursorPos Y="475"/>
<UsageCount Value="37"/>
@@ -63,16 +62,11 @@
<Unit6>
<Filename Value="synafpc.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<WindowIndex Value="-1"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="37"/>
</Unit6>
<Unit7>
<Filename Value="synaip.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="165"/>
<CursorPos Y="189"/>
<UsageCount Value="37"/>
@@ -80,7 +74,6 @@
<Unit8>
<Filename Value="synautil.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="1060"/>
<CursorPos Y="1077"/>
<UsageCount Value="37"/>
@@ -88,10 +81,6 @@
<Unit9>
<Filename Value="synaser.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<WindowIndex Value="-1"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="37"/>
</Unit9>
<Unit10>
@@ -130,127 +119,106 @@
</Unit15>
<Unit16>
<Filename Value="C:\lazarus\fpc\2.6.4\source\packages\fcl-process\src\process.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="4"/>
<CursorPos X="48" Y="24"/>
<UsageCount Value="31"/>
</Unit16>
<Unit17>
<Filename Value="C:\lazarus\components\lazutils\utf8process.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="35"/>
<CursorPos X="58" Y="57"/>
<UsageCount Value="30"/>
</Unit17>
<Unit18>
<Filename Value="C:\lazarus\synapse\source\lib\sswin32.inc"/>
<EditorIndex Value="-1"/>
<WindowIndex Value="-1"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="18"/>
</Unit18>
<Unit19>
<Filename Value="C:\lazarus\lcl\include\messagedialogs.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="174"/>
<CursorPos Y="201"/>
<UsageCount Value="11"/>
</Unit19>
<Unit20>
<Filename Value="C:\lazarus\components\lazutils\lazlogger.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="741"/>
<CursorPos Y="784"/>
<UsageCount Value="11"/>
</Unit20>
<Unit21>
<Filename Value="C:\lazarus\lcl\include\lclintf.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="152"/>
<CursorPos Y="178"/>
<UsageCount Value="11"/>
</Unit21>
<Unit22>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32lclintf.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="141"/>
<CursorPos Y="167"/>
<UsageCount Value="11"/>
</Unit22>
<Unit23>
<Filename Value="C:\lazarus\lcl\themes.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="539"/>
<CursorPos Y="565"/>
<UsageCount Value="11"/>
</Unit23>
<Unit24>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32object.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="134"/>
<CursorPos Y="167"/>
<UsageCount Value="11"/>
</Unit24>
<Unit25>
<Filename Value="C:\lazarus\lcl\include\application.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="1116"/>
<CursorPos Y="1147"/>
<UsageCount Value="11"/>
</Unit25>
<Unit26>
<Filename Value="C:\lazarus\lcl\lclproc.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="2914"/>
<CursorPos Y="2940"/>
<UsageCount Value="11"/>
</Unit26>
<Unit27>
<Filename Value="C:\lazarus\components\lazutils\lazutf8.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="3278"/>
<CursorPos Y="3293"/>
<UsageCount Value="11"/>
</Unit27>
<Unit28>
<Filename Value="C:\lazarus\lcl\buttons.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="490"/>
<CursorPos Y="549"/>
<UsageCount Value="11"/>
</Unit28>
<Unit29>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32wsdialogs.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="155"/>
<CursorPos Y="173"/>
<UsageCount Value="11"/>
</Unit29>
<Unit30>
<Filename Value="C:\lazarus\lcl\include\screen.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="246"/>
<CursorPos Y="274"/>
<UsageCount Value="11"/>
</Unit30>
<Unit31>
<Filename Value="C:\lazarus\lcl\include\wincontrol.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="7233"/>
<CursorPos Y="7259"/>
<UsageCount Value="11"/>
</Unit31>
<Unit32>
<Filename Value="C:\lazarus\lcl\include\winapi.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="775"/>
<CursorPos Y="801"/>
<UsageCount Value="11"/>
</Unit32>
<Unit33>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32winapi.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="2920"/>
<CursorPos Y="2946"/>
<UsageCount Value="11"/>
@@ -259,201 +227,81 @@
<Filename Value="C:\lazarus\lcl\grids.pas"/>
<UnitName Value="Grids"/>
<EditorIndex Value="2"/>
<TopLine Value="2343"/>
<CursorPos Y="2370"/>
<WindowIndex Value="1"/>
<TopLine Value="2316"/>
<CursorPos X="1" Y="2370"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
</Unit34>
<Unit35>
<Filename Value="C:\lazarus\lcl\interfaces\win32\win32proc.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="1087"/>
<CursorPos Y="1121"/>
<UsageCount Value="9"/>
</Unit35>
<Unit36>
<Filename Value="C:\lazarus\lcl\lresources.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="1473"/>
<CursorPos Y="1502"/>
<UsageCount Value="9"/>
</Unit36>
<Unit37>
<Filename Value="C:\lazarus\lcl\include\icon.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="674"/>
<CursorPos Y="700"/>
<UsageCount Value="9"/>
</Unit37>
<Unit38>
<Filename Value="C:\lazarus\lcl\include\rasterimage.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="147"/>
<CursorPos Y="188"/>
<UsageCount Value="9"/>
</Unit38>
<Unit39>
<Filename Value="C:\lazarus\lcl\include\sharedrasterimage.inc"/>
<EditorIndex Value="-1"/>
<CursorPos Y="49"/>
<UsageCount Value="9"/>
</Unit39>
<Unit40>
<Filename Value="C:\lazarus\lcl\intfgraphics.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="3411"/>
<CursorPos Y="3437"/>
<UsageCount Value="9"/>
</Unit40>
<Unit41>
<Filename Value="C:\lazarus\lcl\include\graphic.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="30"/>
<CursorPos Y="56"/>
<UsageCount Value="9"/>
</Unit41>
<Unit42>
<Filename Value="C:\lazarus\lcl\graphtype.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="1738"/>
<CursorPos Y="1778"/>
<UsageCount Value="9"/>
</Unit42>
<Unit43>
<Filename Value="C:\lazarus\lcl\graphics.pp"/>
<EditorIndex Value="-1"/>
<TopLine Value="2262"/>
<CursorPos Y="2305"/>
<UsageCount Value="9"/>
</Unit43>
<Unit44>
<Filename Value="C:\lazarus\lcl\include\intfbaselcl.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="298"/>
<CursorPos Y="323"/>
<UsageCount Value="9"/>
</Unit44>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<General>
<ActiveWindowIndexAtStart Value="0"/>
</General>
<JumpHistory Count="1" HistoryIndex="0">
<Position1>
<Filename Value="unit1.pas"/>
<Caret Line="68" Column="5" TopLine="26"/>
<Caret Line="3" Column="29" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="unit1.pas"/>
<Caret Line="160" Column="22" TopLine="141"/>
</Position2>
<Position3>
<Filename Value="unit1.pas"/>
<Caret Line="141" Column="25" TopLine="130"/>
</Position3>
<Position4>
<Filename Value="unit1.pas"/>
<Caret Line="135" Column="23" TopLine="110"/>
</Position4>
<Position5>
<Filename Value="unit1.pas"/>
<Caret Line="115" Column="48" TopLine="76"/>
</Position5>
<Position6>
<Filename Value="unit1.pas"/>
<Caret Line="68" Column="52" TopLine="67"/>
</Position6>
<Position7>
<Filename Value="unit1.pas"/>
<Caret Line="283" Column="9" TopLine="258"/>
</Position7>
<Position8>
<Filename Value="unit1.pas"/>
<Caret Line="68" Column="15" TopLine="44"/>
</Position8>
<Position9>
<Filename Value="unit1.pas"/>
<Caret Line="280" Column="70" TopLine="254"/>
</Position9>
<Position10>
<Filename Value="unit1.pas"/>
<Caret Line="283" Column="58" TopLine="258"/>
</Position10>
<Position11>
<Filename Value="unit1.pas"/>
<Caret Line="149" Column="35" TopLine="133"/>
</Position11>
<Position12>
<Filename Value="unit1.pas"/>
<Caret Line="68" Column="59" TopLine="62"/>
</Position12>
<Position13>
<Filename Value="unit1.pas"/>
<Caret Line="285" Column="5" TopLine="284"/>
</Position13>
<Position14>
<Filename Value="unit1.pas"/>
<Caret Line="284" Column="5" TopLine="283"/>
</Position14>
<Position15>
<Filename Value="unit1.pas"/>
<Caret Line="280" Column="22" TopLine="254"/>
</Position15>
<Position16>
<Filename Value="unit1.pas"/>
<Caret Line="354" Column="29" TopLine="15"/>
</Position16>
<Position17>
<Filename Value="unit1.pas"/>
<Caret Line="131" Column="14" TopLine="90"/>
</Position17>
<Position18>
<Filename Value="avtokanal.lpr"/>
<Caret Line="21"/>
</Position18>
<Position19>
<Filename Value="unit1.pas"/>
<Caret Line="143" Column="19" TopLine="132"/>
</Position19>
<Position20>
<Filename Value="unit1.pas"/>
<Caret Line="289" Column="88" TopLine="131"/>
</Position20>
<Position21>
<Filename Value="unit1.pas"/>
<Caret Line="315" TopLine="202"/>
</Position21>
<Position22>
<Filename Value="unit1.pas"/>
<Caret Line="316" Column="32" TopLine="202"/>
</Position22>
<Position23>
<Filename Value="unit1.pas"/>
<Caret Line="318" Column="20" TopLine="202"/>
</Position23>
<Position24>
<Filename Value="unit1.pas"/>
<Caret Line="373" Column="51" TopLine="298"/>
</Position24>
<Position25>
<Filename Value="unit1.pas"/>
<Caret Line="38" Column="19" TopLine="13"/>
</Position25>
<Position26>
<Filename Value="unit1.pas"/>
<Caret Line="56" Column="29" TopLine="13"/>
</Position26>
<Position27>
<Filename Value="unit1.pas"/>
<Caret Line="131" Column="34" TopLine="104"/>
</Position27>
<Position28>
<Filename Value="unit1.pas"/>
<Caret Line="328" Column="18" TopLine="216"/>
</Position28>
<Position29>
<Filename Value="unit1.pas"/>
<Caret Line="228" Column="60" TopLine="214"/>
</Position29>
<Position30>
<Filename Value="unit1.pas"/>
</Position30>
</JumpHistory>
</ProjectSession>
<EditorMacros Count="0"/>
</CONFIG>

+ 41
- 13
backup/unit1.lfm.bak View File

@@ -1,36 +1,34 @@
object Form1: TForm1
Left = 407
Left = 497
Height = 414
Top = 248
Width = 345
Top = 61
Width = 343
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'Журнал АРК Томск'
ClientHeight = 414
ClientWidth = 345
ClientWidth = 343
OnShow = FormShow
OnWindowStateChange = FormWindowStateChange
Position = poScreenCenter
LCLVersion = '1.4.2.0'
LCLVersion = '1.2.4.0'
object DateEdit1: TDateEdit
Left = 200
Height = 23
Top = 32
Width = 136
Width = 113
CalendarDisplaySettings = [dsShowHeadings, dsShowDayNames]
OKCaption = 'OK'
CancelCaption = 'Cancel'
DefaultToday = True
DateOrder = doNone
ButtonHint = 'Выбрать дату'
ButtonWidth = 23
CharCase = ecNormal
DirectInput = False
NumGlyphs = 1
Flat = True
MaxLength = 0
OnChange = DateEdit1Change
TabOrder = 0
Text = '02.03.2015'
end
object btnSave: TButton
Left = 200
@@ -54,7 +52,7 @@ object Form1: TForm1
Height = 30
Top = 352
Width = 150
Caption = '(С) Владимир Смагин, 2015'#13#10'http://blindage.org'
Caption = '(С) Владимир Смагин, 2016'#13#10'http://blindage.org'
Enabled = False
ParentColor = False
end
@@ -117,7 +115,7 @@ object Form1: TForm1
object chkAutoPlay: TCheckBox
Left = 200
Height = 19
Top = 152
Top = 184
Width = 136
AutoSize = False
Caption = 'Автопроигрывание'
@@ -184,7 +182,7 @@ object Form1: TForm1
object chkAlwaysOnTop: TCheckBox
Left = 200
Height = 19
Top = 176
Top = 208
Width = 136
AutoSize = False
Caption = 'Поверх всех окон'
@@ -197,7 +195,7 @@ object Form1: TForm1
Left = 0
Height = 23
Top = 391
Width = 345
Width = 343
Panels = <
item
Width = 250
@@ -371,6 +369,36 @@ object Form1: TForm1
UseXORFeatures = True
OnDblClick = StringGrid1DblClick
end
object intervalEdit: TEdit
Left = 289
Height = 23
Top = 150
Width = 28
ReadOnly = True
TabOrder = 7
Text = '10'
end
object Label6: TLabel
Left = 200
Height = 15
Top = 154
Width = 82
Caption = 'Интервал (сек)'
ParentColor = False
end
object UpDown1: TUpDown
Left = 317
Height = 23
Top = 150
Width = 17
Associate = intervalEdit
Min = 10
Max = 60
Position = 10
TabOrder = 8
Wrap = False
OnChangingEx = UpDown1ChangingEx
end
object SaveDialog1: TSaveDialog
DefaultExt = '.mp3'
Filter = 'mp3|*.mp3'


+ 37
- 20
backup/unit1.pas.bak View File

@@ -38,12 +38,14 @@ type
chkAutoRefresh: TCheckBox;
chkAutoPlay: TCheckBox;
DateEdit1: TDateEdit;
intervalEdit: TEdit;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
SaveDialog1: TSaveDialog;
btnRefresh: TSpeedButton;
btnToday: TSpeedButton;
@@ -51,6 +53,7 @@ type
StringGrid1: TStringGrid;
Timer1: TTimer;
TrayIcon1: TTrayIcon;
UpDown1: TUpDown;
procedure btnSaveClick(Sender: TObject);
procedure chkAlwaysOnTopChange(Sender: TObject);
procedure chkAutoRefreshChange(Sender: TObject);
@@ -64,6 +67,8 @@ type
procedure TrayIcon1DblClick(Sender: TObject);
procedure UpdateMessages(date: string);
procedure DownloadMessage(fIdx: integer; fName: string);
procedure UpDown1ChangingEx(Sender: TObject; var AllowChange: Boolean;
NewValue: SmallInt; Direction: TUpDownDirection);
private
{ private declarations }
public
@@ -90,7 +95,7 @@ var
url: string;
csv: TStringList;
begin
url := 'http://radio70.ru/archive.php?date='; //2015-02-27
url := 'http://tomsk.cb-radio.ru/archive.php?date='; //2015-02-27
csv := TStringList.Create;
with THTTPSend.Create do
begin
@@ -128,8 +133,9 @@ begin
begin
btnSave.Enabled := False;
end;
if chkAutoRefresh.Checked then DateEdit1.text:=FormatDateTime('DD.MM.YYYY',Now);
if (DateToStr(DateEdit1.Date) = DateToStr(Now) ) then
if chkAutoRefresh.Checked then
DateEdit1.Text := FormatDateTime('DD.MM.YYYY', Now);
if (DateToStr(DateEdit1.Date) = DateToStr(Now)) then
begin
btnRefresh.Enabled := True;
chkAutoRefresh.Enabled := True;
@@ -163,7 +169,7 @@ var
url, path: string;
memstream: TMemoryStream;
begin
url := 'http://radio70.ru/archive/';
url := 'http://tomsk.cb-radio.ru/archive/';
path := get_value(fIdx, 3);
with THTTPSend.Create do
begin
@@ -179,12 +185,20 @@ begin
end;
end;
procedure TForm1.UpDown1ChangingEx(Sender: TObject; var AllowChange: Boolean;
NewValue: SmallInt; Direction: TUpDownDirection);
begin
Timer1.Interval:=NewValue * 1000;
ShowMessage(IntToStr(NewValue));
end;
procedure TPlayThread.DownloadMessage();
var
url, path: string;
memstream: TMemoryStream;
begin
url := 'http://radio70.ru/archive/';
url := 'http://tomsk.cb-radio.ru/archive/';
path := get_value(fIdx, 3);
with THTTPSend.Create do
begin
@@ -273,7 +287,7 @@ begin
//Synchronize(@DownloadMessage);
PlayerPath := SysToUTF8(ExtractFileDir(Application.ExeName) + '\mpg123.exe');
//PlayerParams := SysToUTF8(' -q "' + tmp + '"');
PlayerParams:= '-q http://radio70.ru/archive/'+get_value(fIdx, 3);
PlayerParams := '-q http://tomsk.cb-radio.ru/archive/' + get_value(fIdx, 3);
Player := TProcessUTF8.Create(nil);
Form1.StatusBar1.Panels.Items[0].Text := 'Играет запись от ' + fTimeStamp;
Form1.StatusBar1.Panels.Items[1].Text := 'В очереди ' + IntToStr(PlayQueue);
@@ -323,21 +337,24 @@ begin
end;
procedure TForm1.FormShow(Sender: TObject);
var v:TStringList;
var
v: TStringList;
begin
try
v:=TStringList.Create;
DateEdit1.Date := now();
UpdateMessages(FormatDateTime('YYYY-MM-DD', DateEdit1.Date));
v.LoadFromFile('version');
Label3.Caption:='Версия '+ v.Text;
v.Free;
DeleteFileUTF8(ExtractFileDir(Application.ExeName)+'\ark_laucher.exe');
if FileExists(ExtractFileDir(Application.ExeName)+'\ark_laucher.new') then
RenameFileUTF8(ExtractFileDir(Application.ExeName)+'\ark_laucher.new',
ExtractFileDir(Application.ExeName)+'\ark_laucher.exe');
v := TStringList.Create;
DateEdit1.Date := now();
UpdateMessages(FormatDateTime('YYYY-MM-DD', DateEdit1.Date));
v.LoadFromFile('version');
Label3.Caption := 'Версия ' + v.Text;
v.Free;
if FileExists(ExtractFileDir(Application.ExeName) + '\ark_laucher.new') then
begin
DeleteFileUTF8(ExtractFileDir(Application.ExeName) + '\ark_laucher.exe');
RenameFileUTF8(ExtractFileDir(Application.ExeName) + '\ark_laucher.new',
ExtractFileDir(Application.ExeName) + '\ark_laucher.exe');
end;
except
//
end;
end;
@@ -387,8 +404,8 @@ begin
if ((chkAutoRefresh.Checked) and (chkAutoRefresh.Enabled)) then
begin
Timer1.Enabled := False;
UpdateMessages(FormatDateTime( 'YYYY-MM-DD', Now ));
DateEdit1.Date:=Now;
UpdateMessages(FormatDateTime('YYYY-MM-DD', Now));
DateEdit1.Date := Now;
raznica := count_current - count_prev;
if ((count_current > count_prev) and (chkAutoPlay.Checked) and
(chkAutoPlay.Enabled)) then


+ 0
- 0
View File


BIN
View File


BIN
View File


+ 69
- 0
distrib/NsProcess/Example/nsProcessTest.nsi View File

@@ -0,0 +1,69 @@
Name "nsProcessTest"
OutFile "nsProcessTest.exe"
!include "nsProcess.nsh"
!include "Sections.nsh"
Var RADIOBUTTON
Page components
Page instfiles
Section "Find process" FindProcess
${nsProcess::FindProcess} "Calc.exe" $R0
MessageBox MB_OK "nsProcess::FindProcess$\n$\n\
Errorlevel: [$R0]"
${nsProcess::Unload}
SectionEnd
Section /o "Kill process" KillProcess
loop:
${nsProcess::FindProcess} "NoTePad.exe" $R0
StrCmp $R0 0 0 +2
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION 'Close "notepad" before continue' IDOK loop IDCANCEL end
${nsProcess::KillProcess} "NoTePad.exe" $R0
MessageBox MB_OK "nsProcess::KillProcess$\n$\n\
Errorlevel: [$R0]"
Exec "notepad.exe"
Exec "notepad.exe"
Exec "notepad.exe"
Sleep 1000
BringToFront
MessageBox MB_OK "Press OK and 3 notepad's windows will be closed (TERMINATED)"
${nsProcess::KillProcess} "NoTePad.exe" $R0
MessageBox MB_OK "nsProcess::KillProcess$\n$\n\
Errorlevel: [$R0]"
Exec "notepad.exe"
Exec "notepad.exe"
Exec "notepad.exe"
Sleep 1000
BringToFront
MessageBox MB_OK "Press OK and 3 notepad's windows will be CLOSED"
${nsProcess::CloseProcess} "NoTePad.exe" $R0
MessageBox MB_OK "nsProcess::CloseProcess$\n$\n\
Errorlevel: [$R0]"
end:
${nsProcess::Unload}
SectionEnd
Function .onInit
StrCpy $RADIOBUTTON ${FindProcess}
FunctionEnd
Function .onSelChange
!insertmacro StartRadioButtons $RADIOBUTTON
!insertmacro RadioButton ${FindProcess}
!insertmacro RadioButton ${KillProcess}
!insertmacro EndRadioButtons
FunctionEnd

+ 28
- 0
distrib/NsProcess/Include/nsProcess.nsh View File

@@ -0,0 +1,28 @@
!define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess`
!macro nsProcess::FindProcess _FILE _ERR
nsProcess::_FindProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::KillProcess `!insertmacro nsProcess::KillProcess`
!macro nsProcess::KillProcess _FILE _ERR
nsProcess::_KillProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::CloseProcess `!insertmacro nsProcess::CloseProcess`
!macro nsProcess::CloseProcess _FILE _ERR
nsProcess::_CloseProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::Unload `!insertmacro nsProcess::Unload`
!macro nsProcess::Unload
nsProcess::_Unload
!macroend

BIN
View File


BIN
View File


+ 67
- 0
distrib/NsProcess/Readme.txt View File

@@ -0,0 +1,67 @@
*****************************************************************
*** nsProcess NSIS plugin v1.6 ***
*****************************************************************
2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
Source function FIND_PROC_BY_NAME based
upon the Ravi Kochhar (kochhar@physiology.wisc.edu) code
Thanks iceman_k (FindProcDLL plugin) and
DITMan (KillProcDLL plugin) for direct me
NSIS UNICODE compatible version (1.6) by brainsucker
(sorry, installer missing, i'm too lazy :)
Features:
- Find a process by name
- Kill all processes with specified name (not only one)
- Close all processes with specified name (first tries to close all process windows,
waits for 3 seconds for process to exit, terminates if still alive)
- The process name is case-insensitive
- Win95/98/ME/NT/2000/XP/Win7 support
- Small plugin size (4 Kb)
- NSIS UNICODE support (just rename nsProcessW.dll into nsProcess.dll)
**** Find process ****
${nsProcess::FindProcess} "[file.exe]" $var
"[file.exe]" - Process name (e.g. "notepad.exe")
$var 0 Success
603 Process was not currently running
604 Unable to identify system type
605 Unsupported OS
606 Unable to load NTDLL.DLL
607 Unable to get procedure address from NTDLL.DLL
608 NtQuerySystemInformation failed
609 Unable to load KERNEL32.DLL
610 Unable to get procedure address from KERNEL32.DLL
611 CreateToolhelp32Snapshot failed
**** Kill/Close process ****
${nsProcess::KillProcess} "[file.exe]" $var
${nsProcess::CloseProcess} "[file.exe]" $var
"[file.exe]" - Process name (e.g. "notepad.exe")
$var 0 Success
601 No permission to terminate process
602 Not all processes terminated successfully
603 Process was not currently running
604 Unable to identify system type
605 Unsupported OS
606 Unable to load NTDLL.DLL
607 Unable to get procedure address from NTDLL.DLL
608 NtQuerySystemInformation failed
609 Unable to load KERNEL32.DLL
610 Unable to get procedure address from KERNEL32.DLL
611 CreateToolhelp32Snapshot failed
**** Comment from brainsucker ****
I'm actually not using macros in my code, plugin calls are easy:
nsProcess:_CloseProcess "notepad.exe"
Pop $R0
**** Unload plugin ****
${nsProcess::Unload}

+ 825
- 0
distrib/NsProcess/Source/ConvFunc.h View File

@@ -0,0 +1,825 @@
/*****************************************************************
* Conversion functions header v1.9 *
* *
* 2006 Shengalts Aleksander aka Instructor (Shengalts@mail.ru) *
* *
* *
*Functions (ALLCONVFUNC): *
* xatoi, xatoiW, xitoa, xitoaW, xatoui, xatouiW, *
* xuitoa, xuitoaW, xatoi64, xatoi64W, xi64toa, xi64toaW, *
* hex2dec, hex2decW, dec2hex, dec2hexW *
* *
*Special functions (ALLCONVFUNCS): *
* str2hex, hex2str *
* *
*****************************************************************/
#ifndef _CONVFUNC_
#define _CONVFUNC_
int xatoi(char *str);
int xatoiW(wchar_t *wstr);
char* xitoa(int number, char *str, int width);
wchar_t* xitoaW(int number, wchar_t *wstr, int width);
unsigned int xatoui(char *str);
unsigned int xatouiW(wchar_t *wstr);
char* xuitoa(unsigned int number, char *str, int width);
wchar_t* xuitoaW(unsigned int number, wchar_t *wstr, int width);
__int64 xatoi64(char *str);
__int64 xatoi64W(wchar_t *wstr);
char* xi64toa(__int64 number, char *str, int width);
wchar_t* xi64toaW(__int64 number, wchar_t *wstr, int width);
int hex2dec(char *hex);
int hex2decW(wchar_t *whex);
void dec2hex(unsigned int dec, char *hex, BOOL lowercase, unsigned int width);
void dec2hexW(unsigned int dec, wchar_t *whex, BOOL lowercase, unsigned int width);
void str2hex(unsigned char *str, char *hex, BOOL lowercase, unsigned int bytes);
void hex2str(char *hex, char *str);
#endif
/********************************************************************
*
* xatoi
*
*Converts string to int.
*
*[in] char *str -string number
*
*Returns: integer
*
*Examples:
* xatoi("45") == 45;
* xatoi(" -0045:value") == -45;
********************************************************************/
#if defined xatoi || defined ALLCONVFUNC
#define xatoi_INCLUDED
#undef xatoi
int xatoi(char *str)
{
int nNumber=0;
BOOL bMinus=FALSE;
while (*str == ' ')
++str;
if (*str == '+')
++str;
else if (*str == '-')
{
bMinus=TRUE;
++str;
}
for (; *str != '\0' && *str >= '0' && *str <= '9'; ++str)
nNumber=(nNumber * 10) + (*str - '0');
if (bMinus == TRUE)
nNumber=0 - nNumber;
return nNumber;
}
#endif
/********************************************************************
*
* xatoiW
*
*Converts unicode string to int.
*
*[in] wchar_t *wstr -string number
*
*Returns: integer
*
*Examples:
* xatoiW(L"45") == 45;
* xatoiW(L" -0045:value") == -45;
********************************************************************/
#if defined xatoiW || defined ALLCONVFUNC
#define xatoiW_INCLUDED
#undef xatoiW
int xatoiW(wchar_t *wstr)
{
int nNumber=0;
BOOL bMinus=FALSE;
while (*wstr == ' ')
++wstr;
if (*wstr == '+')
++wstr;
else if (*wstr == '-')
{
bMinus=TRUE;
++wstr;
}
for (; *wstr != '\0' && *wstr >= '0' && *wstr <= '9'; ++wstr)
nNumber=(nNumber * 10) + (*wstr - '0');
if (bMinus == TRUE)
nNumber=0 - nNumber;
return nNumber;
}
#endif
/********************************************************************
*
* xitoa [API: wsprintf(szResult, "%d", 45)]
*
*Converts int to string.
*
*[in] int number -integer
*[out] char *str -string number
*[in] int width -minimum number of characters to the output
*
*Returns: a pointer to string
*
*Examples:
* xitoa(45, szResult, 0); //szResult == "45"
* xitoa(-45, szResult, 0); //szResult == "-45"
* xitoa(45, szResult, 4); //szResult == "0045"
********************************************************************/
#if defined xitoa || defined ALLCONVFUNC
#define xitoa_INCLUDED
#undef xitoa
char* xitoa(int number, char *str, int width)
{
char tmp[128];
int a=0;
int b=0;
*tmp = 0;
if (number == 0)
{
str[0]='0';
--width;
b=1;
}
else if (number < 0)
{
str[0]='-';
number=0 - number;
--width;
b=1;
}
for (tmp[a]='\0'; number != 0; ++a)
{
tmp[a]=(number % 10) + '0';
number=number / 10;
}
if (a < width)
do
{
tmp[a]='0';
} while (++a<width);
for (--a; a >= 0; --a, ++b) str[b]=tmp[a];
str[b]='\0';
return str;
}
#endif
/********************************************************************
*
* xitoaW [API: wsprintfW(wszResult, L"%d", 45)]
*
*Converts int to unicode string.
*
*[in] int number -integer
*[out] wchar_t *wstr -unicode string number
*[in] int width -minimum number of characters to the output
*
*Returns: a pointer to unicode string
*
*Examples:
* xitoaW(45, wszResult, 0); //wszResult == L"45"
* xitoaW(-45, wszResult, 0); //wszResult == L"-45"
* xitoaW(45, wszResult, 4); //wszResult == L"0045"
********************************************************************/
#if defined xitoaW || defined ALLCONVFUNC
#define xitoaW_INCLUDED
#undef xitoaW
wchar_t* xitoaW(int number, wchar_t *wstr, int width)
{
wchar_t wtmp[128]=L"";
int a=0;
int b=0;
if (number == 0)
{
wstr[0]='0';
--width;
b=1;
}
else if (number < 0)
{
wstr[0]='-';
number=0 - number;
--width;
b=1;
}
for (wtmp[a]='\0'; number != 0; ++a)
{
wtmp[a]=(number % 10) + '0';
number=number / 10;
}
for (; width > a; ++a) wtmp[a]='0';
for (--a; a >= 0; --a, ++b) wstr[b]=wtmp[a];
wstr[b]='\0';
return wstr;
}
#endif
/********************************************************************
*
* xatoui
*
*Converts string to unsigned int.
*
*[in] char *str -string number
*
*Returns: unsigned integer
*
*Examples:
* xatoui("45") == 45;
* xatoui(" -0045:value") == 0;
********************************************************************/
#if defined xatoui || defined ALLCONVFUNC
#define xatoui_INCLUDED
#undef xatoui
unsigned int xatoui(char *str)
{
unsigned int nNumber=0;
while (*str == ' ')
++str;
if (*str == '+')
++str;
else if (*str == '-')
return 0;
for (; *str != '\0' && *str >= '0' && *str <= '9'; ++str)
nNumber=(nNumber * 10) + (*str - '0');
return nNumber;
}
#endif
/********************************************************************
*
* xatouiW
*
*Converts unicode string to unsigned int.
*
*[in] wchar_t *wstr -unicode string number
*
*Returns: unsigned integer
*
*Examples:
* xatouiW(L"45") == 45;
* xatouiW(L" -0045:value") == 0;
********************************************************************/
#if defined xatouiW || defined ALLCONVFUNC
#define xatouiW_INCLUDED
#undef xatouiW
unsigned int xatouiW(wchar_t *wstr)
{
unsigned int nNumber=0;
while (*wstr == ' ')
++wstr;
if (*wstr == '+')
++wstr;
else if (*wstr == '-')
return 0;
for (; *wstr != '\0' && *wstr >= '0' && *wstr <= '9'; ++wstr)
nNumber=(nNumber * 10) + (*wstr - '0');
return nNumber;
}
#endif
/********************************************************************
*
* xuitoa
*
*Converts unsigned int to string.
*
*[in] unsigned int number -unsigned integer
*[out] char *str -string number
*[in] int width -minimum number of characters to the output
*
*Returns: a pointer to string
*
*Examples:
* xuitoa(45, szResult, 0); //szResult == "45"
* xuitoa(45, szResult, 4); //szResult == "0045"
********************************************************************/
#if defined xuitoa || defined ALLCONVFUNC
#define xuitoa_INCLUDED
#undef xuitoa
char* xuitoa(unsigned int number, char *str, int width)
{
char tmp[128]="";
int a=0;
int b=0;
if (number == 0)
{
str[0]='0';
--width;
b=1;
}
for (tmp[a]='\0'; number != 0; ++a)
{
tmp[a]=(number % 10) + '0';
number=number / 10;
}
for (; width > a; ++a) tmp[a]='0';
for (--a; a >= 0; --a, ++b) str[b]=tmp[a];
str[b]='\0';
return str;
}
#endif
/********************************************************************
*
* xuitoaW
*
*Converts unsigned int to unicode string.
*
*[in] unsigned int number -unsigned integer
*[out] wchar_t *wstr -unicode string number
*[in] int width -minimum number of characters to the output
*
*Returns: a pointer to unicode string
*
*Examples:
* xuitoaW(45, wszResult, 0); //wszResult == L"45"
* xuitoaW(45, wszResult, 4); //wszResult == L"0045"
********************************************************************/
#if defined xuitoaW || defined ALLCONVFUNC
#define xuitoaW_INCLUDED
#undef xuitoaW
wchar_t* xuitoaW(unsigned int number, wchar_t *wstr, int width)
{
wchar_t wtmp[128]=L"";
int a=0;
int b=0;
if (number == 0)
{
wstr[0]='0';
--width;
b=1;
}
for (wtmp[a]='\0'; number != 0; ++a)
{
wtmp[a]=(number % 10) + '0';
number=number / 10;
}
for (; width > a; ++a) wtmp[a]='0';
for (--a; a >= 0; --a, ++b) wstr[b]=wtmp[a];
wstr[b]='\0';
return wstr;
}
#endif
/********************************************************************
*
* xatoi64
*
*Converts string to int64.
*
*[in] char *str -string number
*
*Returns: 64-bit integer
*
*Examples:
* xatoi64("45") == 45;
* xatoi64(" -0045:value") == -45;
********************************************************************/
#if defined xatoi64 || defined ALLCONVFUNC
#define xatoi64_INCLUDED
#undef xatoi64
__int64 xatoi64(char *str)
{
__int64 nNumber=0;
BOOL bMinus=FALSE;
while (*str == ' ')
++str;
if (*str == '+')
++str;
else if (*str == '-')
{
bMinus=TRUE;
++str;
}
for (; *str != '\0' && *str >= '0' && *str <= '9'; ++str)
nNumber=(nNumber * 10) + (*str - '0');
if (bMinus == TRUE)
nNumber=0 - nNumber;
return nNumber;
}
#endif
/********************************************************************
*
* xatoi64W
*
*Converts unicode string to int64.
*
*[in] wchar_t *wstr -unicode string number
*
*Returns: 64-bit integer
*
*Examples:
* xatoi64W(L"45") == 45;
* xatoi64W(L" -0045:value") == -45;
********************************************************************/
#if defined xatoi64W || defined ALLCONVFUNC
#define xatoi64W_INCLUDED
#undef xatoi64W
__int64 xatoi64W(wchar_t *wstr)
{
__int64 nNumber=0;
BOOL bMinus=FALSE;
while (*wstr == ' ')
++wstr;
if (*wstr == '+')
++wstr;
else if (*wstr == '-')
{
bMinus=TRUE;
++wstr;
}
for (; *wstr != '\0' && *wstr >= '0' && *wstr <= '9'; ++wstr)
nNumber=(nNumber * 10) + (*wstr - '0');
if (bMinus == TRUE)
nNumber=0 - nNumber;
return nNumber;
}
#endif
/********************************************************************
*
* xitoa64
*
*Converts int64 to string.
*
*[in] __int64 number -64-bit integer
*[out] char *str -string number
*[in] int width -minimum number of characters to the output
*
*Returns: a pointer to string
*
*Examples:
* xi64toa(45, szResult, 0); //szResult == "45"
* xi64toa(-45, szResult, 0); //szResult == "-45"
* xi64toa(45, szResult, 4); //szResult == "0045"
********************************************************************/
#if defined xi64toa || defined ALLCONVFUNC
#define xi64toa_INCLUDED
#undef xi64toa
char* xi64toa(__int64 number, char *str, int width)
{
char tmp[128]="";
int a=0;
int b=0;
if (number == 0)
{
str[0]='0';
--width;
b=1;
}
else if (number < 0)
{
str[0]='-';
number=0 - number;
--width;
b=1;
}
for (tmp[a]='\0'; number != 0; ++a)
{
tmp[a]=(char)((number % 10) + '0');
number=number / 10;
}
for (; width > a; ++a) tmp[a]='0';
for (--a; a >= 0; --a, ++b) str[b]=tmp[a];
str[b]='\0';
return str;
}
#endif
/********************************************************************
*
* xitoa64W
*
*Converts int64 to unicode string.
*
*[in] __int64 number -64-bit integer
*[out] wchar_t *wstr -unicode string number
*[in] int width -minimum number of characters to the output
*
*Returns: a pointer to unicode string
*
*Examples:
* xi64toaW(45, wszResult, 0); //wszResult == L"45"
* xi64toaW(-45, wszResult, 0); //wszResult == L"-45"
* xi64toaW(45, wszResult, 4); //wszResult == L"0045"
********************************************************************/
#if defined xi64toaW || defined ALLCONVFUNC
#define xi64toaW_INCLUDED
#undef xi64toaW
wchar_t* xi64toaW(__int64 number, wchar_t *wstr, int width)
{
wchar_t wtmp[128]=L"";
int a=0;
int b=0;
if (number == 0)
{
wstr[0]='0';
--width;
b=1;
}
else if (number < 0)
{
wstr[0]='-';
number=0 - number;
--width;
b=1;
}
for (wtmp[a]='\0'; number != 0; ++a)
{
wtmp[a]=(char)((number % 10) + '0');
number=number / 10;
}
for (; width > a; ++a) wtmp[a]='0';
for (--a; a >= 0; --a, ++b) wstr[b]=wtmp[a];
wstr[b]='\0';
return wstr;
}
#endif
/********************************************************************
*
* hex2dec
*
*Converts hex value to decimal.
*
*[in] char *hex -hex value
*
*Returns: integer
* -1 wrong hex value
*
*Examples:
* hex2dec("A1F") == 2591;
********************************************************************/
#if defined hex2dec || defined ALLCONVFUNC
#define hex2dec_INCLUDED
#undef hex2dec
int hex2dec(char *hex)
{
int a;
int b=0;
while (1)
{
a=*hex++;
if (a >= '0' && a <= '9') a-='0';
else if (a >= 'a' && a <= 'f') a-='a'-10;
else if (a >= 'A' && a <= 'F') a-='A'-10;
else return -1;
if (*hex) b=(b + a) * 16;
else return (b + a);
}
}
#endif
/********************************************************************
*
* hex2decW
*
*Converts unicode hex value to decimal.
*
*[in] wchar_t *whex -unicode hex value
*
*Returns: integer
* -1 wrong hex value
*
*Examples:
* hex2decW(L"A1F") == 2591;
********************************************************************/
#if defined hex2decW || defined ALLCONVFUNC
#define hex2decW_INCLUDED
#undef hex2decW
int hex2decW(wchar_t *whex)
{
int a;
int b=0;